int main() {
  printf("1. %d\n", (printf("Call function %s\n", "square"), square(4)));
  printf("2. %d\n", (printf("Call function %s\n", "f"), f(10)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec1(%rip),%rdi
lea    0xecc(%rip),%rsi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x4,%edi
mov    $0x0,%al
call   1040 <square@plt>
mov    %eax,%esi
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe90(%rip),%rdi
lea    0xea9(%rip),%rsi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0xa,%edi
mov    $0x0,%al
call   1030 <f@plt>
mov    %eax,%esi
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xecf(%rip),%rbx
lea    0xeda(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x4,%edi
xor    %eax,%eax
call   1040 <square@plt>
lea    0xea4(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xebb(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
xor    %eax,%eax
call   1030 <f@plt>
lea    0xe97(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"1. %d\0A\00"
@.str.1 = [18 x i8] c"Call function %s\0A\00"
@.str.2 = [7 x i8] c"square\00"
@.str.3 = [7 x i8] c"2. %d\0A\00"
@.str.4 = [2 x i8] c"f\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 (i32, ...) bitcast (i32 (...)* @square to i32 (i32, ...)*)(i32 4)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%6 = call i32 (i32, ...) bitcast (i32 (...)* @f to i32 (i32, ...)*)(i32 10)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"1. %d\0A\00"
@.str.1 = [18 x i8] c"Call function %s\0A\00"
@.str.2 = [7 x i8] c"square\00"
@.str.3 = [7 x i8] c"2. %d\0A\00"
@.str.4 = [2 x i8] c"f\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @square to i32 (i32, ...)*)(i32 4)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @f to i32 (i32, ...)*)(i32 10)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %5)
ret i32 0
}