#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 /*<<< orphan*/ adders_io(int, int, int *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int main() {
  int inA, inB, ioC, temp_ioC;
  int sum;
  int refOut[5] = {60, 90, 120, 150, 180};
  int pass;
  int i;
  inA = 10;
  inB = 20;
  ioC = 30;
  for (i = 0; i < 5; i++) {
    temp_ioC = ioC;
    adders_io(inA, inB, &ioC);
    fprintf(stdout, "  %d+%d+%d=%d \n", inA, inB, temp_ioC, ioC);
    if (ioC == refOut[i])
      pass = 1;
    else
      pass = 0;
    inA = inA + 10;
    inB = inB + 10;
    ioC = temp_ioC + 10;
  }
  if (pass) {
    fprintf(stdout, "----------Pass!------------\n");
    return 0;
  } else {
    fprintf(stderr, "----------Fail!------------\n");
    return 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x20(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
movl   $0x1e,-0x10(%rbp)
movl   $0x0,-0x38(%rbp)
cmpl   $0x5,-0x38(%rbp)
jge    11fb <main+0xdb>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
lea    -0x10(%rbp),%rdx
call   1030 <adders_io@plt>
mov    0x2e48(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x10(%rbp),%r9d
lea    0xe6d(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%eax
movslq -0x38(%rbp),%rcx
cmp    -0x30(%rbp,%rcx,4),%eax
jne    11cb <main+0xab>
movl   $0x1,-0x34(%rbp)
jmp    11d2 <main+0xb2>
movl   $0x0,-0x34(%rbp)
mov    -0x8(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x10(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    116a <main+0x4a>
cmpl   $0x0,-0x34(%rbp)
je     1228 <main+0x108>
mov    0x2dcc(%rip),%rax
mov    (%rax),%edi
lea    0xe0f(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1246 <main+0x126>
mov    0x2db1(%rip),%rax
mov    (%rax),%edi
lea    0xe09(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x1e,0xc(%rsp)
lea    0xc(%rsp),%r14
mov    $0xa,%edi
mov    $0x14,%esi
mov    %r14,%rdx
call   1030 <adders_io@plt>
mov    0x2e89(%rip),%r15
mov    (%r15),%edi
mov    0xc(%rsp),%r9d
lea    0xea2(%rip),%rbx
mov    %rbx,%rsi
mov    $0xa,%edx
mov    $0x14,%ecx
mov    $0x1e,%r8d
xor    %eax,%eax
call   1040 <fprintf@plt>
movl   $0x28,0xc(%rsp)
mov    $0x14,%edi
mov    $0x1e,%esi
mov    %r14,%rdx
call   1030 <adders_io@plt>
mov    (%r15),%edi
mov    0xc(%rsp),%r9d
mov    %rbx,%rsi
mov    $0x14,%edx
mov    $0x1e,%ecx
mov    $0x28,%r8d
xor    %eax,%eax
call   1040 <fprintf@plt>
movl   $0x32,0xc(%rsp)
mov    $0x1e,%edi
mov    $0x28,%esi
mov    %r14,%rdx
call   1030 <adders_io@plt>
mov    (%r15),%edi
mov    0xc(%rsp),%r9d
mov    %rbx,%rsi
mov    $0x1e,%edx
mov    $0x28,%ecx
mov    $0x32,%r8d
xor    %eax,%eax
call   1040 <fprintf@plt>
movl   $0x3c,0xc(%rsp)
mov    $0x28,%edi
mov    $0x32,%esi
mov    %r14,%rdx
call   1030 <adders_io@plt>
mov    (%r15),%edi
mov    0xc(%rsp),%r9d
mov    %rbx,%rsi
mov    $0x28,%edx
mov    $0x32,%ecx
mov    $0x3c,%r8d
xor    %eax,%eax
call   1040 <fprintf@plt>
movl   $0x46,0xc(%rsp)
mov    $0x32,%edi
mov    $0x3c,%esi
mov    %r14,%rdx
call   1030 <adders_io@plt>
mov    (%r15),%edi
mov    0xc(%rsp),%r9d
mov    %rbx,%rsi
mov    $0x32,%edx
mov    $0x3c,%ecx
mov    $0x46,%r8d
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0xc(%rsp),%eax
movl   $0x50,0xc(%rsp)
xor    %ebx,%ebx
cmp    $0xb4,%eax
setne  %bl
lea    0xd8b(%rip),%rax
lea    0xda1(%rip),%rsi
cmove  %rax,%rsi
cmovne 0x2d48(%rip),%r15
mov    (%r15),%edi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.refOut = [5 x i32] [i32 60, i32 90, i32 120, i32 150, i32 180]
@stdout = global i32 0
@.str = [16 x i8] c" %d+%d+%d=%d \0A\00"
@.str.1 = [29 x i8] c"----------Pass!------------\0A\00"
@stderr = global i32 0
@.str.2 = [29 x i8] c"----------Fail!------------\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [5 x i32]
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
%10 = bitcast [5 x i32]* %7 to i8*
store i32 10, i32* %2
store i32 20, i32* %3
store i32 30, i32* %4
store i32 0, i32* %9
br label %11
11: ; preds = %40, %0
%12 = load i32, i32* %9
%13 = icmp slt i32 %12, 5
br i1 %13, label %14, label %43
14: ; preds = %11
%15 = load i32, i32* %4
store i32 %15, i32* %5
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = call i32 @adders_io(i32 %16, i32 %17, i32* %4)
%19 = load i32, i32* @stdout
%20 = load i32, i32* %2
%21 = load i32, i32* %3
%22 = load i32, i32* %5
%23 = load i32, i32* %4
%24 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %20, i32 %21, i32 %22, i32 %23)
%25 = load i32, i32* %4
%26 = load i32, i32* %9
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [5 x i32], [5 x i32]* %7, i64 0, i64 %27
%29 = load i32, i32* %28
%30 = icmp eq i32 %25, %29
br i1 %30, label %31, label %32
31: ; preds = %14
store i32 1, i32* %8
br label %33
32: ; preds = %14
store i32 0, i32* %8
br label %33
33: ; preds = %32, %31
%34 = load i32, i32* %2
%35 = add nsw i32 %34, 10
store i32 %35, i32* %2
%36 = load i32, i32* %3
%37 = add nsw i32 %36, 10
store i32 %37, i32* %3
%38 = load i32, i32* %5
%39 = add nsw i32 %38, 10
store i32 %39, i32* %4
br label %40
40: ; preds = %33
%41 = load i32, i32* %9
%42 = add nsw i32 %41, 1
store i32 %42, i32* %9
br label %11
43: ; preds = %11
%44 = load i32, i32* %8
%45 = icmp ne i32 %44, 0
br i1 %45, label %46, label %49
46: ; preds = %43
%47 = load i32, i32* @stdout
%48 = call i32 (i32, i8*, ...) @fprintf(i32 %47, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %52
49: ; preds = %43
%50 = load i32, i32* @stderr
%51 = call i32 (i32, i8*, ...) @fprintf(i32 %50, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %1
br label %52
52: ; preds = %49, %46
%53 = load i32, i32* %1
ret i32 %53
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [16 x i8] c" %d+%d+%d=%d \0A\00"
@.str.1 = [29 x i8] c"----------Pass!------------\0A\00"
@stderr = global i32 0
@.str.2 = [29 x i8] c"----------Fail!------------\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 30, i32* %1
%3 = call i32 @adders_io(i32 10, i32 20, i32* %1)
%4 = load i32, i32* @stdout
%5 = load i32, i32* %1
%6 = call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 10, i32 20, i32 30, i32 %5)
store i32 40, i32* %1
%7 = call i32 @adders_io(i32 20, i32 30, i32* %1)
%8 = load i32, i32* @stdout
%9 = load i32, i32* %1
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 20, i32 30, i32 40, i32 %9)
store i32 50, i32* %1
%11 = call i32 @adders_io(i32 30, i32 40, i32* %1)
%12 = load i32, i32* @stdout
%13 = load i32, i32* %1
%14 = call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 30, i32 40, i32 50, i32 %13)
store i32 60, i32* %1
%15 = call i32 @adders_io(i32 40, i32 50, i32* %1)
%16 = load i32, i32* @stdout
%17 = load i32, i32* %1
%18 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 40, i32 50, i32 60, i32 %17)
store i32 70, i32* %1
%19 = call i32 @adders_io(i32 50, i32 60, i32* %1)
%20 = load i32, i32* @stdout
%21 = load i32, i32* %1
%22 = call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 50, i32 60, i32 70, i32 %21)
%23 = load i32, i32* %1
store i32 80, i32* %1
%24 = icmp eq i32 %23, 180
%25 = select i1 %24, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0)
%26 = xor i1 %24, true
%27 = zext i1 %26 to i32
%28 = load i32, i32* @stdout
%29 = load i32, i32* @stderr
%30 = select i1 %24, i32 %28, i32 %29
%31 = call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* %25)
ret i32 %27
}