xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
scalar_t__ UINT64_MAX;
int /*<<< orphan*/ __VERIFIER_assert(int);
int main() {
  uint64_t value = UINT64_MAX;
  ++value;
  __VERIFIER_assert(value == 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
xor    %edi,%edi
cmpq   $0xffffffffffffffff,(%rax)
sete   %dil
call   1030 <__VERIFIER_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@UINT64_MAX = global i64 0
define i32 @main() {
%1 = alloca i64
%2 = load i64, i64* @UINT64_MAX
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = add nsw i64 %3, 1
store i64 %4, i64* %1
%5 = load i64, i64* %1
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @__VERIFIER_assert(i32 %7)
ret i32 0
}

LLVM IR (-O2):
@UINT64_MAX = global i64 0
define i32 @main() {
%1 = load i64, i64* @UINT64_MAX
%2 = icmp eq i64 %1, -1
%3 = zext i1 %2 to i32
%4 = tail call i32 @__VERIFIER_assert(i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void handler(int signo) { usleep(10); }


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xa,%edi
call   1030 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
mov    $0xa,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @usleep(i32 10)
ret void
}

LLVM IR (-O2):
define void @handler(i32 %0) {
%2 = tail call i32 @usleep(i32 10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ key_t;

/* Variables and functions */
void *shmat(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
int shmget(int /*<<< orphan*/, size_t, int);
void *try_get_shm(key_t key, size_t size, int flag) {
  int id;
  void *ptr;
  id = shmget(key, size, flag);
  if (id < 0)
    return 0;
  ptr = shmat(id, NULL, 0);
  if (ptr == (void *)-1)
    return 0;
  else
    return ptr;
}


x86 assembly (clang, -O0):
<try_get_shm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <shmget@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    115b <try_get_shm+0x3b>
movq   $0x0,-0x8(%rbp)
jmp    1193 <try_get_shm+0x73>
mov    -0x20(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <shmat@plt>
mov    %rax,-0x28(%rbp)
mov    $0xffffffffffffffff,%rax
cmp    %rax,-0x28(%rbp)
jne    118b <try_get_shm+0x6b>
movq   $0x0,-0x8(%rbp)
jmp    1193 <try_get_shm+0x73>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<try_get_shm>:
push   %rbx
call   1040 <shmget@plt>
test   %eax,%eax
js     1141 <try_get_shm+0x21>
xor    %ebx,%ebx
mov    %eax,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <shmat@plt>
cmp    $0xffffffffffffffff,%rax
cmove  %rbx,%rax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @try_get_shm(i32 %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
store i32 %0, i32* %5
store i64 %1, i64* %6
store i32 %2, i32* %7
%10 = load i32, i32* %5
%11 = load i64, i64* %6
%12 = load i32, i32* %7
%13 = call i32 @shmget(i32 %10, i64 %11, i32 %12)
store i32 %13, i32* %8
%14 = load i32, i32* %8
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %3
store i8* null, i8** %4
br label %25
17: ; preds = %3
%18 = load i32, i32* %8
%19 = call i8* @shmat(i32 %18, i32* null, i32 0)
store i8* %19, i8** %9
%20 = load i8*, i8** %9
%21 = icmp eq i8* %20, inttoptr (i64 -1 to i8*)
br i1 %21, label %22, label %23
22: ; preds = %17
store i8* null, i8** %4
br label %25
23: ; preds = %17
%24 = load i8*, i8** %9
store i8* %24, i8** %4
br label %25
25: ; preds = %23, %22, %16
%26 = load i8*, i8** %4
ret i8* %26
}

LLVM IR (-O2):
define i8* @try_get_shm(i32 %0, i64 %1, i32 %2) {
%4 = tail call i32 @shmget(i32 %0, i64 %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i8* @shmat(i32 %4, i32* null, i32 0)
%8 = icmp eq i8* %7, inttoptr (i64 -1 to i8*)
%9 = select i1 %8, i8* null, i8* %7
br label %10
10: ; preds = %6, %3
%11 = phi i8* [ null, %3 ], [ %9, %6 ]
ret i8* %11
}
/* Variables and functions */
int atoi(char *);
scalar_t__ strcmp(char *, char *);
int enumeratePlacement(char string[]) {
  if (strcmp(string, "DNF") == 0)
    return -1;
  else if (strcmp(string, "OTL") == 0)
    return 0;
  else
    return atoi(string);
}


x86 assembly (clang, -O0):
<enumeratePlacement>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1152 <enumeratePlacement+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    1184 <enumeratePlacement+0x64>
mov    -0x10(%rbp),%rdi
lea    0xea7(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1178 <enumeratePlacement+0x58>
movl   $0x0,-0x4(%rbp)
jmp    1184 <enumeratePlacement+0x64>
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enumeratePlacement>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1152 <enumeratePlacement+0x32>
lea    0xec8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1159 <enumeratePlacement+0x39>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <atoi@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"DNF\00"
@.str.1 = [4 x i8] c"OTL\00"
define i32 @enumeratePlacement(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %16
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 0, i32* %2
br label %16
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = call i32 @atoi(i8* %14)
store i32 %15, i32* %2
br label %16
16: ; preds = %13, %12, %7
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@.str = [4 x i8] c"DNF\00"
@.str.1 = [4 x i8] c"OTL\00"
define i32 @enumeratePlacement(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @atoi(i8* %0)
br label %9
9: ; preds = %4, %1, %7
%10 = phi i32 [ %8, %7 ], [ -1, %1 ], [ 0, %4 ]
ret i32 %10
}
unsigned int getIp4MaskFromCidr(int cidr) { return 4294967295 << (32 - cidr); }


x86 assembly (clang, -O0):
<getIp4MaskFromCidr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x20,%eax
sub    -0x4(%rbp),%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0xffffffff,%eax
shl    %cl,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getIp4MaskFromCidr>:
lea    0x20(%rdi),%ecx
neg    %ecx
mov    $0xffffffff,%eax
shl    %cl,%rax
ret

LLVM IR (-O0):
define i32 @getIp4MaskFromCidr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 32, %3
%5 = zext i32 %4 to i64
%6 = shl i64 4294967295, %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @getIp4MaskFromCidr(i32 %0) {
%2 = sub nsw i32 32, %0
%3 = zext i32 %2 to i64
%4 = shl i64 4294967295, %3
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ *stderr;
int start(char *name, int atnum, char **atname, char **atval, char *buf,
          int sze, void *data) {
  FILE *fp = NULL;
  if (data != NULL)
    fp = (FILE *)data;
  else
    fp = stderr;
  fprintf(fp, "<%s>", name);
  return 0;
}


x86 assembly (clang, -O0):
<start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
movq   $0x0,-0x38(%rbp)
cmpq   $0x0,0x10(%rbp)
je     1153 <start+0x43>
mov    0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
jmp    1161 <start+0x51>
mov    0x2e86(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe90(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start>:
push   %rax
mov    %rdi,%rdx
mov    0x10(%rsp),%rdi
test   %rdi,%rdi
jne    1128 <start+0x18>
mov    0x2ebb(%rip),%rax
mov    (%rax),%rdi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32* null
@.str = [5 x i8] c"<%s>\00"
define i32 @start(i8* %0, i32 %1, i8** %2, i8** %3, i8* %4, i32 %5, i8* %6) {
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8**
%11 = alloca i8**
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i8*
%15 = alloca i32*
store i8* %0, i8** %8
store i32 %1, i32* %9
store i8** %2, i8*** %10
store i8** %3, i8*** %11
store i8* %4, i8** %12
store i32 %5, i32* %13
store i8* %6, i8** %14
store i32* null, i32** %15
%16 = load i8*, i8** %14
%17 = icmp ne i8* %16, null
br i1 %17, label %18, label %21
18: ; preds = %7
%19 = load i8*, i8** %14
%20 = bitcast i8* %19 to i32*
store i32* %20, i32** %15
br label %23
21: ; preds = %7
%22 = load i32*, i32** @stderr
store i32* %22, i32** %15
br label %23
23: ; preds = %21, %18
%24 = load i32*, i32** %15
%25 = load i8*, i8** %8
%26 = call i32 @fprintf(i32* %24, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %25)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32* null
@.str = [5 x i8] c"<%s>\00"
define i32 @start(i8* %0, i32 %1, i8** nocapture readnone %2, i8** nocapture readnone %3, i8* nocapture readnone %4, i32 %5, i8* %6) {
%8 = icmp eq i8* %6, null
%9 = bitcast i8* %6 to i32*
%10 = load i32*, i32** @stderr
%11 = select i1 %8, i32* %10, i32* %9
%12 = tail call i32 @fprintf(i32* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Variables and functions */
int func();
int main(int argc, char **argv) { return func() == 1 ? 0 : 1; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <func@plt>
mov    %eax,%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <func@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @func()
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 0, i32 1
ret i32 %9
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @func()
%4 = icmp ne i32 %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ra_mclear(int);
void co__cclear(void) {
  ra_mclear(0);
  ra_mclear(1);
  ra_mclear(2);
}


x86 assembly (clang, -O0):
<co__cclear>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <ra_mclear@plt>
mov    $0x1,%edi
call   1030 <ra_mclear@plt>
mov    $0x2,%edi
call   1030 <ra_mclear@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<co__cclear>:
push   %rax
xor    %edi,%edi
call   1030 <ra_mclear@plt>
mov    $0x1,%edi
call   1030 <ra_mclear@plt>
mov    $0x2,%edi
pop    %rax
jmp    1030 <ra_mclear@plt>

LLVM IR (-O0):
define void @co__cclear() {
%1 = call i32 @ra_mclear(i32 0)
%2 = call i32 @ra_mclear(i32 1)
%3 = call i32 @ra_mclear(i32 2)
ret void
}

LLVM IR (-O2):
define void @co__cclear() {
%1 = tail call i32 @ra_mclear(i32 0)
%2 = tail call i32 @ra_mclear(i32 1)
%3 = tail call i32 @ra_mclear(i32 2)
ret void
}
/* Variables and functions */
int getCoor(int, int);
int getMaxH();
int getMaxW();
int getCenter() { return getCoor((getMaxH() / 2), (getMaxW() / 2)); }


x86 assembly (clang, -O0):
<getCenter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <getMaxH@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getMaxW@plt>
mov    -0x4(%rbp),%edi
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
call   1030 <getCoor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCenter>:
push   %rbx
xor    %eax,%eax
call   1050 <getMaxH@plt>
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
xor    %eax,%eax
call   1040 <getMaxW@plt>
mov    %eax,%esi
shr    $0x1f,%esi
add    %eax,%esi
sar    %esi
mov    %ebx,%edi
pop    %rbx
jmp    1030 <getCoor@plt>

LLVM IR (-O0):
define i32 @getCenter() {
%1 = call i32 (...) @getMaxH()
%2 = sdiv i32 %1, 2
%3 = call i32 (...) @getMaxW()
%4 = sdiv i32 %3, 2
%5 = call i32 @getCoor(i32 %2, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @getCenter() {
%1 = tail call i32 (...) @getMaxH()
%2 = sdiv i32 %1, 2
%3 = tail call i32 (...) @getMaxW()
%4 = sdiv i32 %3, 2
%5 = tail call i32 @getCoor(i32 %2, i32 %4)
ret i32 %5
}
int isLeapYear(int year) {
  if (year % 4 == 0) {
    if (year % 100 == 0) {
      if (year % 400 == 0) {
        return 1;
      } else {
        return 0;
      }
    }
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isLeapYear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1167 <isLeapYear+0x67>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    115b <isLeapYear+0x5b>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <isLeapYear+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    116e <isLeapYear+0x6e>
movl   $0x0,-0x4(%rbp)
jmp    116e <isLeapYear+0x6e>
movl   $0x1,-0x4(%rbp)
jmp    116e <isLeapYear+0x6e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLeapYear>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <isLeapYear+0x9>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x1,%eax
cmp    $0x28f5c28,%edx
ja     1108 <isLeapYear+0x8>
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @isLeapYear(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = srem i32 %4, 4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %18
7: ; preds = %1
%8 = load i32, i32* %3
%9 = srem i32 %8, 100
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i32, i32* %3
%13 = srem i32 %12, 400
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 1, i32* %2
br label %19
16: ; preds = %11
store i32 0, i32* %2
br label %19
17: ; preds = %7
store i32 1, i32* %2
br label %19
18: ; preds = %1
store i32 0, i32* %2
br label %19
19: ; preds = %18, %17, %16, %15
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @isLeapYear(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %1, %4, %7
%12 = phi i32 [ %10, %7 ], [ 1, %4 ], [ 0, %1 ]
ret i32 %12
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int compose_flipped(uint16_t width, uint16_t height, int i, int j) {
  return (height - 1 - j) * width + i;
}


x86 assembly (clang, -O0):
<compose_flipped>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
sub    -0x10(%rbp),%eax
imul   -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compose_flipped>:
not    %ecx
lea    (%rcx,%rsi,1),%eax
imul   %edi,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @compose_flipped(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = sub nsw i32 %9, 1
%11 = load i32, i32* %8
%12 = sub nsw i32 %10, %11
%13 = load i32, i32* %5
%14 = mul nsw i32 %12, %13
%15 = load i32, i32* %7
%16 = add nsw i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @compose_flipped(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = xor i32 %3, -1
%6 = add i32 %5, %1
%7 = mul nsw i32 %6, %0
%8 = add nsw i32 %7, %2
ret i32 %8
}
/* Variables and functions */
float averageFloats(float *, int);
int /*<<< orphan*/ printf(char *, float);
int main(int argc, const char *argv[]) {
  float gradeBook[] = {60.2, 94.5, 81.1};
  float average = averageFloats(gradeBook, 3);
  printf("Average = %.2f\n", average);
  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    0xec3(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xec1(%rip),%eax
mov    %eax,-0x14(%rbp)
lea    -0x1c(%rbp),%rdi
mov    $0x3,%esi
call   1030 <averageFloats@plt>
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xede(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xecb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x3,%esi
call   1030 <averageFloats@plt>
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.gradeBook = [3 x float] [float 0x404E1999A0000000, float 9.450000e+01, float 0x4054466660000000]
@.str = [16 x i8] c"Average = %.2f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [3 x float]
%7 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [3 x float]* %6 to i8*
%9 = getelementptr inbounds [3 x float], [3 x float]* %6, i64 0, i64 0
%10 = call float @averageFloats(float* %9, i32 3)
store float %10, float* %7
%11 = load float, float* %7
%12 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), float %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.gradeBook = [3 x float] [float 0x404E1999A0000000, float 9.450000e+01, float 0x4054466660000000]
@.str = [16 x i8] c"Average = %.2f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [3 x float]
%4 = bitcast [3 x float]* %3 to i8*
%5 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 0
%6 = call float @averageFloats(float* %5, i32 3)
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), float %6)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ c2_addr_write(int);
int /*<<< orphan*/ check_status();
int fpdat_read();
int /*<<< orphan*/ fpdat_write(int);
uint8_t fp_reg_read(uint8_t addr) {
  c2_addr_write(0xb4);
  fpdat_write(0x09);
  check_status();
  fpdat_write(addr);
  fpdat_write(1);
  return fpdat_read();
}


x86 assembly (clang, -O0):
<fp_reg_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xb4,%edi
call   1040 <c2_addr_write@plt>
mov    $0x9,%edi
call   1060 <fpdat_write@plt>
mov    $0x0,%al
call   1030 <check_status@plt>
mov    -0x4(%rbp),%edi
call   1060 <fpdat_write@plt>
mov    $0x1,%edi
call   1060 <fpdat_write@plt>
mov    $0x0,%al
call   1050 <fpdat_read@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fp_reg_read>:
push   %rbx
mov    %edi,%ebx
mov    $0xb4,%edi
call   1040 <c2_addr_write@plt>
mov    $0x9,%edi
call   1060 <fpdat_write@plt>
xor    %eax,%eax
call   1030 <check_status@plt>
mov    %ebx,%edi
call   1060 <fpdat_write@plt>
mov    $0x1,%edi
call   1060 <fpdat_write@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <fpdat_read@plt>

LLVM IR (-O0):
define i32 @fp_reg_read(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @c2_addr_write(i32 180)
%4 = call i32 @fpdat_write(i32 9)
%5 = call i32 (...) @check_status()
%6 = load i32, i32* %2
%7 = call i32 @fpdat_write(i32 %6)
%8 = call i32 @fpdat_write(i32 1)
%9 = call i32 (...) @fpdat_read()
ret i32 %9
}

LLVM IR (-O2):
define i32 @fp_reg_read(i32 %0) {
%2 = tail call i32 @c2_addr_write(i32 180)
%3 = tail call i32 @fpdat_write(i32 9)
%4 = tail call i32 (...) @check_status()
%5 = tail call i32 @fpdat_write(i32 %0)
%6 = tail call i32 @fpdat_write(i32 1)
%7 = tail call i32 (...) @fpdat_read()
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int size = 1;
  int rank = 0;
  if (rank == 0)
    printf("%i\n", size);
  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)
movl   $0x1,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    114d <main+0x3d>
mov    -0x14(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %10, %2
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ fputc(char, int /*<<< orphan*/);
scalar_t__ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int puts(const char *s) {
  if (fputs(s, stdout) == EOF || fputc('\n', stdout) == EOF)
    return EOF;
  return 0;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%rax
je     1171 <puts+0x51>
mov    0x2e83(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    0x2e80(%rip),%rcx
cmp    (%rcx),%rax
jne    1183 <puts+0x63>
mov    0x2e70(%rip),%rax
mov    (%rax),%rax
mov    %eax,-0x4(%rbp)
jmp    118a <puts+0x6a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %r14
push   %rbx
push   %rax
mov    0x2ead(%rip),%rbx
mov    (%rbx),%esi
call   1030 <fputs@plt>
mov    0x2eaf(%rip),%r14
cmp    (%r14),%rax
je     1151 <puts+0x31>
mov    (%rbx),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
xor    %ecx,%ecx
cmp    (%r14),%rax
jne    1153 <puts+0x33>
mov    %eax,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdout = global i32 0
@EOF = global i64 0
define i32 @puts(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i32, i32* @stdout
%6 = call i64 @fputs(i8* %4, i32 %5)
%7 = load i64, i64* @EOF
%8 = icmp eq i64 %6, %7
br i1 %8, label %14, label %9
9: ; preds = %1
%10 = load i32, i32* @stdout
%11 = call i64 @fputc(i8 signext 10, i32 %10)
%12 = load i64, i64* @EOF
%13 = icmp eq i64 %11, %12
br i1 %13, label %14, label %17
14: ; preds = %9, %1
%15 = load i64, i64* @EOF
%16 = trunc i64 %15 to i32
store i32 %16, i32* %2
br label %18
17: ; preds = %9
store i32 0, i32* %2
br label %18
18: ; preds = %17, %14
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@stdout = global i32 0
@EOF = global i64 0
define i32 @puts(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i64 @fputs(i8* %0, i32 %2)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = load i32, i32* @stdout
%8 = tail call i64 @fputc(i8 signext 10, i32 %7)
%9 = load i64, i64* @EOF
%10 = icmp eq i64 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %6, %1
%12 = phi i64 [ %8, %6 ], [ %3, %1 ]
%13 = trunc i64 %12 to i32
br label %14
14: ; preds = %6, %11
%15 = phi i32 [ %13, %11 ], [ 0, %6 ]
ret i32 %15
}
void __writew(unsigned short val, void *addr) {
  *(volatile unsigned short *)addr = val;
}


x86 assembly (clang, -O0):
<__writew>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x2(%rbp),%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__writew>:
mov    %di,(%rsi)
ret

LLVM IR (-O0):
define void @__writew(i16 zeroext %0, i8* %1) {
%3 = alloca i16
%4 = alloca i8*
store i16 %0, i16* %3
store i8* %1, i8** %4
%5 = load i16, i16* %3
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i16*
store volatile i16 %5, i16* %7
ret void
}

LLVM IR (-O2):
define void @__writew(i16 zeroext %0, i8* %1) {
%3 = bitcast i8* %1 to i16*
store volatile i16 %0, i16* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputsn(int, char *, int);
char *print_to_base(int, char *, int, int *);
int print_hex(int fd, int n) {
  int count;
  char buffer[20] = {0};
  char *str;
  str = print_to_base(n, buffer, 16, &count);
  fputsn(fd, str, count);
  return count;
}


x86 assembly (clang, -O0):
<print_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x10,%edx
lea    -0xc(%rbp),%rcx
call   1050 <print_to_base@plt>
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <fputsn@plt>
mov    -0xc(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hex>:
push   %rbx
sub    $0x30,%rsp
mov    %esi,%eax
mov    %edi,%ebx
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x20(%rsp)
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rcx
mov    %eax,%edi
mov    $0x10,%edx
call   1040 <print_to_base@plt>
mov    0xc(%rsp),%edx
mov    %ebx,%edi
mov    %rax,%rsi
call   1030 <fputsn@plt>
mov    0xc(%rsp),%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @print_hex(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [20 x i8]
%7 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = bitcast [20 x i8]* %6 to i8*
%9 = load i32, i32* %4
%10 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%11 = call i8* @print_to_base(i32 %9, i8* %10, i32 16, i32* %5)
store i8* %11, i8** %7
%12 = load i32, i32* %3
%13 = load i8*, i8** %7
%14 = load i32, i32* %5
%15 = call i32 @fputsn(i32 %12, i8* %13, i32 %14)
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
define i32 @print_hex(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca [20 x i8]
%5 = bitcast i32* %3 to i8*
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%7 = call i8* @print_to_base(i32 %1, i8* %6, i32 16, i32* %3)
%8 = load i32, i32* %3
%9 = call i32 @fputsn(i32 %0, i8* %7, i32 %8)
%10 = load i32, i32* %3
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  assert((1 || 2) == 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @assert(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
ret i32 0
}
void ARGBToYJRow_NEON() {}


x86 assembly (clang, -O0):
<ARGBToYJRow_NEON>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ARGBToYJRow_NEON>:
ret

LLVM IR (-O0):
define void @ARGBToYJRow_NEON() {
ret void
}

LLVM IR (-O2):
define void @ARGBToYJRow_NEON() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int fread_char_values(FILE *fp, unsigned char *cbuf, int num_of_bytes) {
  size_t bytes_read;
  bytes_read = fread(cbuf, sizeof(unsigned char), num_of_bytes, fp);
  return ((int)bytes_read);
}


x86 assembly (clang, -O0):
<fread_char_values>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fread_char_values>:
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x1,%esi
jmp    1030 <fread@plt>

LLVM IR (-O0):
define i32 @fread_char_values(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i64
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = load i32*, i32** %4
%11 = call i64 @fread(i8* %8, i32 1, i32 %9, i32* %10)
store i64 %11, i64* %7
%12 = load i64, i64* %7
%13 = trunc i64 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @fread_char_values(i32* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i64 @fread(i8* %1, i32 1, i32 %2, i32* %0)
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
float fOpIntersectionRound(float, float, float);
float fOpDifferenceRound(float a, float b, float r) {
  return fOpIntersectionRound(a, -b, r);
}


x86 assembly (clang, -O0):
<fOpDifferenceRound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <fOpIntersectionRound@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fOpDifferenceRound>:
xorps  0xee9(%rip),%xmm1
jmp    1030 <fOpIntersectionRound@plt>

LLVM IR (-O0):
define float @fOpDifferenceRound(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fneg float %8
%10 = load float, float* %6
%11 = call float @fOpIntersectionRound(float %7, float %9, float %10)
ret float %11
}

LLVM IR (-O2):
define float @fOpDifferenceRound(float %0, float %1, float %2) {
%4 = fneg float %1
%5 = tail call float @fOpIntersectionRound(float %0, float %4, float %2)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
void printArray(long *a, long left, long right) {
  long i;
  for (i = left; i <= right; i = i + 1) {
    printf("%d\n", a[i]);
  }
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jg     1163 <printArray+0x53>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <printArray+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    %rdx,%rsi
jg     1155 <printArray+0x45>
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
add    $0x1,%r14
lea    0xecf(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r12,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1140 <printArray+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @printArray(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64* %0, i64** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64, i64* %5
store i64 %8, i64* %7
br label %9
9: ; preds = %19, %3
%10 = load i64, i64* %7
%11 = load i64, i64* %6
%12 = icmp sle i64 %10, %11
br i1 %12, label %13, label %22
13: ; preds = %9
%14 = load i64*, i64** %4
%15 = load i64, i64* %7
%16 = getelementptr inbounds i64, i64* %14, i64 %15
%17 = load i64, i64* %16
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %17)
br label %19
19: ; preds = %13
%20 = load i64, i64* %7
%21 = add nsw i64 %20, 1
store i64 %21, i64* %7
br label %9
22: ; preds = %9
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @printArray(i64* nocapture %0, i64 %1, i64 %2) {
%4 = icmp sgt i64 %1, %2
br i1 %4, label %12, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %10, %5 ], [ %1, %3 ]
%7 = getelementptr inbounds i64, i64* %0, i64 %6
%8 = load i64, i64* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %8)
%10 = add i64 %6, 1
%11 = icmp eq i64 %6, %2
br i1 %11, label %12, label %5
12: ; preds = %5, %3
ret void
}
void up_end_monitor(const char *name) {}


x86 assembly (clang, -O0):
<up_end_monitor>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<up_end_monitor>:
ret

LLVM IR (-O0):
define void @up_end_monitor(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @up_end_monitor(i8* nocapture %0) {
ret void
}
void f10(void) {}


x86 assembly (clang, -O0):
<f10>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f10>:
ret

LLVM IR (-O0):
define void @f10() {
ret void
}

LLVM IR (-O2):
define void @f10() {
ret void
}
int tegra_emc_disable_eack(void) { return 0; }


x86 assembly (clang, -O0):
<tegra_emc_disable_eack>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tegra_emc_disable_eack>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @tegra_emc_disable_eack() {
ret i32 0
}

LLVM IR (-O2):
define i32 @tegra_emc_disable_eack() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _Exit(int);
int /*<<< orphan*/ link_failure();
void t_Exit(void) {
  _Exit(1);
  link_failure();
}


x86 assembly (clang, -O0):
<t_Exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <_Exit@plt>

x86 assembly (clang, -O2):
<t_Exit>:
push   %rax
mov    $0x1,%edi
call   1030 <_Exit@plt>

LLVM IR (-O0):
define void @t_Exit() {
%1 = call i32 @_Exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @t_Exit() {
%1 = tail call i32 @_Exit(i32 1)
unreachable
}
/* Type definitions */
struct string_tree {
  int dummy;
};
struct string_entries {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ string_entries_RB_REMOVE(struct string_entries *,
                                            struct string_tree *);
void string_tree_rm(struct string_entries *root, struct string_tree *st) {
  string_entries_RB_REMOVE(root, st);
}


x86 assembly (clang, -O0):
<string_tree_rm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <string_entries_RB_REMOVE@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_tree_rm>:
jmp    1030 <string_entries_RB_REMOVE@plt>

LLVM IR (-O0):
%struct.string_entries = type { i32 }
%struct.string_tree = type { i32 }
define void @string_tree_rm(%struct.string_entries* %0, %struct.string_tree* %1) {
%3 = alloca %struct.string_entries*
%4 = alloca %struct.string_tree*
store %struct.string_entries* %0, %struct.string_entries** %3
store %struct.string_tree* %1, %struct.string_tree** %4
%5 = load %struct.string_entries*, %struct.string_entries** %3
%6 = load %struct.string_tree*, %struct.string_tree** %4
%7 = call i32 @string_entries_RB_REMOVE(%struct.string_entries* %5, %struct.string_tree* %6)
ret void
}

LLVM IR (-O2):
%struct.string_entries = type { i32 }
%struct.string_tree = type { i32 }
define void @string_tree_rm(%struct.string_entries* %0, %struct.string_tree* %1) {
%3 = tail call i32 @string_entries_RB_REMOVE(%struct.string_entries* %0, %struct.string_tree* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int os_perf_callchain_start(int /*<<< orphan*/, int);
int perf_callchain_start(pid_t pid, int lwpid) {
  return (os_perf_callchain_start(pid, lwpid));
}


x86 assembly (clang, -O0):
<perf_callchain_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <os_perf_callchain_start@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perf_callchain_start>:
jmp    1030 <os_perf_callchain_start@plt>

LLVM IR (-O0):
define i32 @perf_callchain_start(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @os_perf_callchain_start(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @perf_callchain_start(i32 %0, i32 %1) {
%3 = tail call i32 @os_perf_callchain_start(i32 %0, i32 %1)
ret i32 %3
}
unsigned long b_config(unsigned long function, unsigned long var) {
  unsigned long tlong;
  asm volatile("call *0x00100040" : "=a"(tlong) : "c"(function), "a"(var));
  return tlong;
}


x86 assembly (clang, -O0):
<b_config>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
call   *0x100040
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_config>:
mov    %rsi,%rax
mov    %rdi,%rcx
call   *0x100040
ret

LLVM IR (-O0):
define i64 @b_config(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i64 asm sideeffect "call *0x00100040", "={ax},{cx},{ax},~{dirflag},~{fpsr},~{flags}"(i64 %6, i64 %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
ret i64 %9
}

LLVM IR (-O2):
define i64 @b_config(i64 %0, i64 %1) {
%3 = tail call i64 asm sideeffect "call *0x00100040", "={ax},{cx},{ax},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1)
ret i64 %3
}
void handler(int sig) {
  printf("\n %s: \n", __func__);
  printf("[%s] Got signal %d\n", currTime("%T"), sig);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
lea    0xecf(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <currTime@plt>
mov    %eax,%esi
mov    -0x4(%rbp),%edx
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
lea    0xed7(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <currTime@plt>
lea    0xec3(%rip),%rdi
mov    %eax,%esi
mov    %ebx,%edx
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\0A %s: \0A\00"
@__func__.handler = [8 x i8] c"handler\00"
@.str.1 = [20 x i8] c"[%s] Got signal %d\0A\00"
@.str.2 = [3 x i8] c"%T\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.handler, i64 0, i64 0))
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @currTime to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\0A %s: \0A\00"
@__func__.handler = [8 x i8] c"handler\00"
@.str.1 = [20 x i8] c"[%s] Got signal %d\0A\00"
@.str.2 = [3 x i8] c"%T\00"
define void @handler(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.handler, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @currTime to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %3, i32 %0)
ret void
}
/* Variables and functions */
size_t sb_pad(size_t n, size_t align) { return (n + align - 1) & ~(align - 1); }


x86 assembly (clang, -O0):
<sb_pad>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
xor    $0xffffffffffffffff,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sb_pad>:
lea    (%rdi,%rsi,1),%rax
add    $0xffffffffffffffff,%rax
neg    %rsi
and    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @sb_pad(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = add i64 %5, %6
%8 = sub i64 %7, 1
%9 = load i64, i64* %4
%10 = sub i64 %9, 1
%11 = xor i64 %10, -1
%12 = and i64 %8, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @sb_pad(i64 %0, i64 %1) {
%3 = add i64 %0, -1
%4 = add i64 %3, %1
%5 = sub i64 0, %1
%6 = and i64 %4, %5
ret i64 %6
}
/* Variables and functions */
int foo(int);
int bar(int i) { return foo(i - 1); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
add    $0xffffffff,%edi
jmp    1030 <foo@plt>

LLVM IR (-O0):
define i32 @bar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
%5 = call i32 @foo(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = tail call i32 @foo(i32 %2)
ret i32 %3
}
void syslog(int priority, const char *format, ...) {}


x86 assembly (clang, -O0):
<syslog>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<syslog>:
ret

LLVM IR (-O0):
define void @syslog(i32 %0, i8* %1, ...) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @syslog(i32 %0, i8* nocapture %1, ...) {
ret void
}
/* Type definitions */
struct single_row_lut {
  int dummy;
};

/* Variables and functions */
int EINVAL;
int interpolate_rbatt_temp(struct single_row_lut *rbatt_temp_lut,
                           int batt_temp) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<interpolate_rbatt_temp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpolate_rbatt_temp>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.single_row_lut = type { i32 }
@EINVAL = global i32 0
define i32 @interpolate_rbatt_temp(%struct.single_row_lut* %0, i32 %1) {
%3 = alloca %struct.single_row_lut*
%4 = alloca i32
store %struct.single_row_lut* %0, %struct.single_row_lut** %3
store i32 %1, i32* %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
%struct.single_row_lut = type { i32 }
@EINVAL = global i32 0
define i32 @interpolate_rbatt_temp(%struct.single_row_lut* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t _plat__LocalityGet() { return 0; }


x86 assembly (clang, -O0):
<_plat__LocalityGet>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_plat__LocalityGet>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @_plat__LocalityGet() {
ret i32 0
}

LLVM IR (-O2):
define i32 @_plat__LocalityGet() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sched_yield();
__attribute__((__always___)) void yield() { sched_yield(); }


x86 assembly (clang, -O0):
<yield>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <sched_yield@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<yield>:
xor    %eax,%eax
jmp    1030 <sched_yield@plt>

LLVM IR (-O0):
define void @yield() {
%1 = call i32 (...) @sched_yield()
ret void
}

LLVM IR (-O2):
define void @yield() {
%1 = tail call i32 (...) @sched_yield()
ret void
}
void foo513(int p) {}


x86 assembly (clang, -O0):
<foo513>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo513>:
ret

LLVM IR (-O0):
define void @foo513(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @foo513(i32 %0) {
ret void
}
int mrtd_get_mrz_weight(int i) {
  switch (i) {
  case (0):
    return 7;
  case (1):
    return 3;
  case (2):
    return 1;
  }
}


x86 assembly (clang, -O0):
<mrtd_get_mrz_weight>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     113c <mrtd_get_mrz_weight+0x3c>
jmp    111a <mrtd_get_mrz_weight+0x1a>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
je     1148 <mrtd_get_mrz_weight+0x48>
jmp    112b <mrtd_get_mrz_weight+0x2b>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     1154 <mrtd_get_mrz_weight+0x54>
jmp    115b <mrtd_get_mrz_weight+0x5b>
movl   $0x7,-0x4(%rbp)
jmp    115b <mrtd_get_mrz_weight+0x5b>
movl   $0x3,-0x4(%rbp)
jmp    115b <mrtd_get_mrz_weight+0x5b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mrtd_get_mrz_weight>:
xor    %eax,%eax
cmp    $0x1,%edi
setne  %al
lea    0x3(,%rax,4),%ecx
cmp    $0x2,%edi
mov    $0x1,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @mrtd_get_mrz_weight(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
]
5: ; preds = %1
store i32 7, i32* %2
br label %8
6: ; preds = %1
store i32 3, i32* %2
br label %8
7: ; preds = %1
store i32 1, i32* %2
br label %8
8: ; preds = %5, %6, %7, %1
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @mrtd_get_mrz_weight(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i32 3, i32 7
%4 = icmp eq i32 %0, 2
%5 = select i1 %4, i32 1, i32 %3
ret i32 %5
}