#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int find_sum(int, int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int a = find_sum(10, 3, 5);
  printf(" 10, 3,5 is %d, expected 23\n", a);
  printf(" 11, 3, 5 is %d, expected 33\n", find_sum(11, 3, 5));
  printf(" 11, 3, 5 is %d, expected 33\n", find_sum(12, 3, 5));
  printf(" 11, 3, 5 is %d, expected 45\n", find_sum(13, 3, 5));
  printf("1000, 3, 5 is %d\n", find_sum(1000, 3, 5));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xa,%edi
mov    $0x3,%esi
mov    $0x5,%edx
call   1040 <find_sum@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    $0xb,%edi
mov    $0x3,%esi
mov    $0x5,%edx
call   1040 <find_sum@plt>
mov    %eax,%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
mov    $0xc,%edi
mov    $0x3,%esi
mov    $0x5,%edx
call   1040 <find_sum@plt>
mov    %eax,%esi
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
mov    $0xd,%edi
mov    $0x3,%esi
mov    $0x5,%edx
call   1040 <find_sum@plt>
mov    %eax,%esi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3e8,%edi
mov    $0x3,%esi
mov    $0x5,%edx
call   1040 <find_sum@plt>
mov    %eax,%esi
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
mov    $0x3,%esi
mov    $0x5,%edx
call   1040 <find_sum@plt>
lea    0xec4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xb,%edi
mov    $0x3,%esi
mov    $0x5,%edx
call   1040 <find_sum@plt>
lea    0xebf(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xc,%edi
mov    $0x3,%esi
mov    $0x5,%edx
call   1040 <find_sum@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xd,%edi
mov    $0x3,%esi
mov    $0x5,%edx
call   1040 <find_sum@plt>
lea    0xe9a(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x3e8,%edi
mov    $0x3,%esi
mov    $0x5,%edx
call   1040 <find_sum@plt>
lea    0xe96(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c" 10, 3,5 is %d, expected 23\0A\00"
@.str.1 = [30 x i8] c" 11, 3, 5 is %d, expected 33\0A\00"
@.str.2 = [30 x i8] c" 11, 3, 5 is %d, expected 45\0A\00"
@.str.3 = [18 x i8] c"1000, 3, 5 is %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @find_sum(i32 10, i32 3, i32 5)
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32 @find_sum(i32 11, i32 3, i32 5)
%11 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = call i32 @find_sum(i32 12, i32 3, i32 5)
%13 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = call i32 @find_sum(i32 13, i32 3, i32 5)
%15 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %14)
%16 = call i32 @find_sum(i32 1000, i32 3, i32 5)
%17 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c" 10, 3,5 is %d, expected 23\0A\00"
@.str.1 = [30 x i8] c" 11, 3, 5 is %d, expected 33\0A\00"
@.str.2 = [30 x i8] c" 11, 3, 5 is %d, expected 45\0A\00"
@.str.3 = [18 x i8] c"1000, 3, 5 is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @find_sum(i32 10, i32 3, i32 5)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @find_sum(i32 11, i32 3, i32 5)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = tail call i32 @find_sum(i32 12, i32 3, i32 5)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = tail call i32 @find_sum(i32 13, i32 3, i32 5)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = tail call i32 @find_sum(i32 1000, i32 3, i32 5)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %11)
ret i32 0
}