2021-12-30 00:14:23 +00:00
|
|
|
/*
|
2022-06-02 18:51:06 +00:00
|
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
2021-12-30 00:14:23 +00:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This source code is licensed under the BSD-style license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* compile with clang.par nested.c -o nested -O0 -g -Wall */
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
int bar(int);
|
|
|
|
int baz(int, int);
|
|
|
|
|
|
|
|
int foo(int a, int b) {
|
|
|
|
int x = a * a + b * b;
|
|
|
|
return bar(x);
|
|
|
|
}
|
|
|
|
|
|
|
|
int bar(int x) {
|
|
|
|
int y = x * (1 + x);
|
|
|
|
return baz(x, y);
|
|
|
|
}
|
|
|
|
|
|
|
|
int baz(int a, int b) {
|
|
|
|
return (a + b) * (a - b);
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, char* argv[]) {
|
|
|
|
printf("%d\n", foo(3, 4));
|
|
|
|
return 0;
|
|
|
|
}
|