#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 */
long Original1(int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, long);
int main() {
  long res;
  int i;
  for (i = 0; i < 10; i++) {
    res = Original1(3, 4);
  }
  if ((unsigned int)res != (unsigned int)9207) {
    printf("***ERROR res %ld is unexpected\n", res);
    exit(-1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    1171 <main+0x41>
mov    $0x3,%edi
mov    $0x4,%esi
call   1040 <Original1@plt>
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1146 <main+0x16>
mov    -0x10(%rbp),%rax
cmp    $0x23f7,%eax
je     119a <main+0x6a>
mov    -0x10(%rbp),%rsi
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0x4,%esi
call   1040 <Original1@plt>
mov    $0x3,%edi
mov    $0x4,%esi
call   1040 <Original1@plt>
mov    $0x3,%edi
mov    $0x4,%esi
call   1040 <Original1@plt>
mov    $0x3,%edi
mov    $0x4,%esi
call   1040 <Original1@plt>
mov    $0x3,%edi
mov    $0x4,%esi
call   1040 <Original1@plt>
mov    $0x3,%edi
mov    $0x4,%esi
call   1040 <Original1@plt>
mov    $0x3,%edi
mov    $0x4,%esi
call   1040 <Original1@plt>
mov    $0x3,%edi
mov    $0x4,%esi
call   1040 <Original1@plt>
mov    $0x3,%edi
mov    $0x4,%esi
call   1040 <Original1@plt>
mov    $0x3,%edi
mov    $0x4,%esi
call   1040 <Original1@plt>
cmp    $0x23f7,%eax
jne    11d2 <main+0xa2>
xor    %eax,%eax
pop    %rcx
ret
lea    0xe27(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"***ERROR res %ld is unexpected\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %9, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = call i64 @Original1(i32 3, i32 4)
store i64 %8, i64* %2
br label %9
9: ; preds = %7
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i64, i64* %2
%14 = trunc i64 %13 to i32
%15 = icmp ne i32 %14, 9207
br i1 %15, label %16, label %20
16: ; preds = %12
%17 = load i64, i64* %2
%18 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i64 %17)
%19 = call i32 @exit(i32 -1)
unreachable
20: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"***ERROR res %ld is unexpected\0A\00"
define i32 @main() {
%1 = tail call i64 @Original1(i32 3, i32 4)
%2 = tail call i64 @Original1(i32 3, i32 4)
%3 = tail call i64 @Original1(i32 3, i32 4)
%4 = tail call i64 @Original1(i32 3, i32 4)
%5 = tail call i64 @Original1(i32 3, i32 4)
%6 = tail call i64 @Original1(i32 3, i32 4)
%7 = tail call i64 @Original1(i32 3, i32 4)
%8 = tail call i64 @Original1(i32 3, i32 4)
%9 = tail call i64 @Original1(i32 3, i32 4)
%10 = tail call i64 @Original1(i32 3, i32 4)
%11 = trunc i64 %10 to i32
%12 = icmp eq i32 %11, 9207
br i1 %12, label %16, label %13
13: ; preds = %0
%14 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i64 %10)
%15 = tail call i32 @exit(i32 -1)
unreachable
16: ; preds = %0
ret i32 0
}