xunge/DecIR huggingface dataset:
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
int /*<<< orphan*/ *strstr(int /*<<< orphan*/, char *);
int filter(const struct dirent *d) {
  if (NULL == d) {
    return 0;
  }
  if (strstr(d->d_name, ".c") != NULL) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<filter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1134 <filter+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1163 <filter+0x53>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
je     115c <filter+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1163 <filter+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filter>:
test   %rdi,%rdi
je     1134 <filter+0x24>
push   %rax
mov    (%rdi),%edi
lea    0xee1(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
%struct.dirent = type { i32 }
@.str = [3 x i8] c".c\00"
define i32 @filter(%struct.dirent* %0) {
%2 = icmp eq %struct.dirent* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%5 = load i32, i32* %4
%6 = tail call i32* @strstr(i32 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = icmp ne i32* %6, null
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %10
}
int f_65535x(void) { return 65535; }


x86 assembly (clang, -O0):
<f_65535x>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_65535x>:
mov    $0xffff,%eax
ret

LLVM IR (-O0):
define i32 @f_65535x() {
ret i32 65535
}

LLVM IR (-O2):
define i32 @f_65535x() {
ret i32 65535
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void predict_4x4_v(uint8_t *src, int i_stride) {
  uint32_t top = *((uint32_t *)&src[-i_stride]);
  int i;
  for (i = 0; i < 4; i++) {
    uint32_t *p = (uint32_t *)src;
    *p = top;
    src += i_stride;
  }
}


x86 assembly (clang, -O0):
<predict_4x4_v>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1162 <predict_4x4_v+0x62>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1124 <predict_4x4_v+0x24>
pop    %rbp
ret

x86 assembly (clang, -O2):
<predict_4x4_v>:
movslq %esi,%rax
neg    %esi
movslq %esi,%rcx
mov    (%rdi,%rcx,4),%ecx
mov    %ecx,(%rdi)
lea    (%rdi,%rax,4),%rdx
mov    %ecx,(%rdi,%rax,4)
lea    (%rdx,%rax,4),%rsi
mov    %ecx,(%rdx,%rax,4)
mov    %ecx,(%rsi,%rax,4)
ret

LLVM IR (-O0):
define void @predict_4x4_v(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
%8 = load i32*, i32** %3
%9 = load i32, i32* %4
%10 = sub nsw i32 0, %9
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %8, i64 %11
%13 = load i32, i32* %12
store i32 %13, i32* %5
store i32 0, i32* %6
br label %14
14: ; preds = %25, %2
%15 = load i32, i32* %6
%16 = icmp slt i32 %15, 4
br i1 %16, label %17, label %28
17: ; preds = %14
%18 = load i32*, i32** %3
store i32* %18, i32** %7
%19 = load i32, i32* %5
%20 = load i32*, i32** %7
store i32 %19, i32* %20
%21 = load i32, i32* %4
%22 = load i32*, i32** %3
%23 = sext i32 %21 to i64
%24 = getelementptr inbounds i32, i32* %22, i64 %23
store i32* %24, i32** %3
br label %25
25: ; preds = %17
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 1
store i32 %27, i32* %6
br label %14
28: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @predict_4x4_v(i32* nocapture %0, i32 %1) {
%3 = sub nsw i32 0, %1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %1 to i64
store i32 %6, i32* %0
%8 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 %6, i32* %8
%9 = getelementptr inbounds i32, i32* %8, i64 %7
store i32 %6, i32* %9
%10 = getelementptr inbounds i32, i32* %9, i64 %7
store i32 %6, i32* %10
ret void
}
void serial_put_hex_nothing(unsigned int data, unsigned bitlen) { return; }


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

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

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

LLVM IR (-O2):
define void @serial_put_hex_nothing(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ suicidef(char *, char const *);
void suicide(const char *message) {
  if (message == NULL)
    suicidef(NULL, NULL);
  else
    suicidef("%s", message);
}


x86 assembly (clang, -O0):
<suicide>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1138 <suicide+0x28>
xor    %eax,%eax
mov    %eax,%esi
mov    %rsi,%rdi
call   1030 <suicidef@plt>
jmp    1148 <suicide+0x38>
mov    -0x8(%rbp),%rsi
lea    0xebd(%rip),%rdi
call   1030 <suicidef@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<suicide>:
test   %rdi,%rdi
je     1124 <suicide+0x14>
mov    %rdi,%rsi
lea    0xee1(%rip),%rdi
jmp    1030 <suicidef@plt>
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <suicidef@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @suicide(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @suicidef(i8* null, i8* null)
br label %7
5: ; preds = %1
%6 = tail call i32 @suicidef(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %3
ret void
}
void rop3_33_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D ^ T;
  stk1 = S | stk2;
  stk1 = ~stk1;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_33_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_33_0_1>:
mov    (%rdi),%al
mov    %edx,%ecx
or     %sil,%cl
not    %sil
and    %dl,%sil
and    %al,%sil
xor    %dl,%al
or     %al,%cl
not    %cl
or     %cl,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_33_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = xor i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = and i32 %27, %29
%31 = load i8, i8* %7
%32 = zext i8 %31 to i32
%33 = load i8, i8* %6
%34 = zext i8 %33 to i32
%35 = xor i32 %34, -1
%36 = and i32 %32, %35
%37 = or i32 %30, %36
%38 = load i8, i8* %6
%39 = zext i8 %38 to i32
%40 = load i8, i8* %5
%41 = zext i8 %40 to i32
%42 = xor i32 %41, -1
%43 = and i32 %39, %42
%44 = load i8*, i8** %4
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
%47 = and i32 %43, %46
%48 = or i32 %37, %47
%49 = trunc i32 %48 to i8
%50 = load i8*, i8** %4
store i8 %49, i8* %50
ret void
}

LLVM IR (-O2):
define void @rop3_33_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %2
%6 = or i8 %2, %1
%7 = or i8 %6, %5
%8 = xor i8 %7, -1
%9 = xor i8 %1, -1
%10 = and i8 %9, %2
%11 = and i8 %10, %4
%12 = or i8 %11, %8
store i8 %12, i8* %0
ret void
}
const char *nts_to_str(int nts) {
  switch (nts) {
  case 1:
    return "ssdp:alive";
  case 2:
    return "ssdp:byebye";
  case 3:
    return "ssdp:update";
  }
  return "unknown";
}


x86 assembly (clang, -O0):
<nts_to_str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     113d <nts_to_str+0x3d>
jmp    111b <nts_to_str+0x1b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     114d <nts_to_str+0x4d>
jmp    112c <nts_to_str+0x2c>
mov    -0x10(%rbp),%eax
sub    $0x3,%eax
je     115d <nts_to_str+0x5d>
jmp    116d <nts_to_str+0x6d>
lea    0xebc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <nts_to_str+0x78>
lea    0xeb7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <nts_to_str+0x78>
lea    0xeb3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <nts_to_str+0x78>
lea    0xeaf(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nts_to_str>:
add    $0xffffffff,%edi
cmp    $0x2,%edi
ja     111a <nts_to_str+0x1a>
movslq %edi,%rax
lea    0xf1a(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xf02(%rip),%rax
ret

LLVM IR (-O0):
@.str = [11 x i8] c"ssdp:alive\00"
@.str.1 = [12 x i8] c"ssdp:byebye\00"
@.str.2 = [12 x i8] c"ssdp:update\00"
@.str.3 = [8 x i8] c"unknown\00"
define i8* @nts_to_str(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 1, label %5
i32 2, label %6
i32 3, label %7
]
5: ; preds = %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
6: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [11 x i8] c"ssdp:alive\00"
@.str.1 = [12 x i8] c"ssdp:byebye\00"
@.str.2 = [12 x i8] c"ssdp:update\00"
@.str.3 = [8 x i8] c"unknown\00"
@reltable.nts_to_str = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.nts_to_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.nts_to_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.nts_to_str to i64)) to i32)]
define i8* @nts_to_str(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 3
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = shl i64 %5, 2
%7 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.nts_to_str to i8*), i64 %6)
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %7, %4 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), %1 ]
ret i8* %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int file_exists(char *pathname) {
  FILE *f;
  f = fopen(pathname, "r");
  if (f == NULL) {
    return 0;
  } else {
    fclose(f);
  }
  return 1;
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1157 <file_exists+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1167 <file_exists+0x47>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <file_exists+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @file_exists(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, long, char);
void numbwrite(FILE *fily, long a, char b) { fprintf(fily, "%ld%c", a, b); }


x86 assembly (clang, -O0):
<numbwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xecc(%rip),%rsi
movsbl -0x11(%rbp),%ecx
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numbwrite>:
mov    %edx,%ecx
mov    %rsi,%rdx
lea    0xee4(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%ld%c\00"
define void @numbwrite(i32* %0, i64 %1, i8 signext %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i8
store i32* %0, i32** %4
store i64 %1, i64* %5
store i8 %2, i8* %6
%7 = load i32*, i32** %4
%8 = load i64, i64* %5
%9 = load i8, i8* %6
%10 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %8, i8 signext %9)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%ld%c\00"
define void @numbwrite(i32* nocapture %0, i64 %1, i8 signext %2) {
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %1, i8 signext %2)
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int time_diff(struct timeval *second, struct timeval *first) {
  return (second->tv_sec - first->tv_sec) * 1000 +
         (second->tv_usec - first->tv_usec) / 1000;
}


x86 assembly (clang, -O0):
<time_diff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
imul   $0x3e8,%eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    -0x10(%rbp),%rcx
sub    0x4(%rcx),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_diff>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
sub    (%rsi),%eax
imul   $0x3e8,%eax,%edx
sub    0x4(%rsi),%ecx
movslq %ecx,%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @time_diff(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load %struct.timeval*, %struct.timeval** %3
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load %struct.timeval*, %struct.timeval** %4
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
%12 = mul nsw i32 %11, 1000
%13 = load %struct.timeval*, %struct.timeval** %3
%14 = getelementptr inbounds %struct.timeval, %struct.timeval* %13, i32 0, i32 1
%15 = load i32, i32* %14
%16 = load %struct.timeval*, %struct.timeval** %4
%17 = getelementptr inbounds %struct.timeval, %struct.timeval* %16, i32 0, i32 1
%18 = load i32, i32* %17
%19 = sub nsw i32 %15, %18
%20 = sdiv i32 %19, 1000
%21 = add nsw i32 %12, %20
ret i32 %21
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @time_diff(%struct.timeval* nocapture %0, %struct.timeval* nocapture %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
%8 = mul nsw i32 %7, 1000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%10 = load i32, i32* %9
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%12 = load i32, i32* %11
%13 = sub nsw i32 %10, %12
%14 = sdiv i32 %13, 1000
%15 = add nsw i32 %14, %8
ret i32 %15
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int i;
  i = __VERIFIER_nondet_int();
  while (i < 10) {
    if (i != 3) {
      i = i + 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    114b <main+0x3b>
cmpl   $0x3,-0x8(%rbp)
je     1146 <main+0x36>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x9,%eax
jg     1130 <main+0x20>
nopl   (%rax)
lea    0x1(%rax),%ecx
cmp    $0x3,%eax
cmove  %eax,%ecx
mov    %ecx,%eax
cmp    $0xa,%ecx
jl     1120 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %3, i32* %2
br label %4
4: ; preds = %13, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 3
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %13
13: ; preds = %10, %7
br label %4
14: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp slt i32 %1, 10
br i1 %2, label %3, label %9
3: ; preds = %0, %3
%4 = phi i32 [ %7, %3 ], [ %1, %0 ]
%5 = icmp eq i32 %4, 3
%6 = add nsw i32 %4, 1
%7 = select i1 %5, i32 3, i32 %6
%8 = icmp slt i32 %7, 10
br i1 %8, label %3, label %9
9: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int getch();
scalar_t__ isalpha(int);
scalar_t__ islower(int);
int /*<<< orphan*/ ungetch(int);
int parse_var(int cstart) {
  int c;
  if (islower(cstart)) {
    c = getch();
    ungetch(c);
    if (isalpha(c) == 0) {
      return '5';
    }
  }
  return '4';
}


x86 assembly (clang, -O0):
<parse_var>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     1192 <parse_var+0x52>
mov    $0x0,%al
call   1060 <getch@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <ungetch@plt>
mov    -0xc(%rbp),%edi
call   1050 <isalpha@plt>
cmp    $0x0,%rax
jne    118d <parse_var+0x4d>
movl   $0x35,-0x4(%rbp)
jmp    1199 <parse_var+0x59>
jmp    1192 <parse_var+0x52>
movl   $0x34,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_var>:
push   %rbx
call   1030 <islower@plt>
test   %rax,%rax
je     1167 <parse_var+0x27>
xor    %eax,%eax
call   1060 <getch@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <ungetch@plt>
mov    %ebx,%edi
call   1050 <isalpha@plt>
test   %rax,%rax
je     116e <parse_var+0x2e>
mov    $0x34,%eax
pop    %rbx
ret
mov    $0x35,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @parse_var(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i64 @islower(i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %1
%9 = call i32 (...) @getch()
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = call i32 @ungetch(i32 %10)
%12 = load i32, i32* %4
%13 = call i64 @isalpha(i32 %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %8
store i32 53, i32* %2
br label %18
16: ; preds = %8
br label %17
17: ; preds = %16, %1
store i32 52, i32* %2
br label %18
18: ; preds = %17, %15
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @parse_var(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i32 (...) @getch()
%6 = tail call i32 @ungetch(i32 %5)
%7 = tail call i64 @isalpha(i32 %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %4, %1
br label %10
10: ; preds = %4, %9
%11 = phi i32 [ 52, %9 ], [ 53, %4 ]
ret i32 %11
}
/* Variables and functions */
scalar_t__ floorl(long double);
int cbuiltin_entierl(long double x) { return (int)floorl(x); }


x86 assembly (clang, -O0):
<cbuiltin_entierl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <floorl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbuiltin_entierl>:
jmp    1030 <floorl@plt>

LLVM IR (-O0):
define i32 @cbuiltin_entierl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @floorl(x86_fp80 %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @cbuiltin_entierl(x86_fp80 %0) {
%2 = tail call i64 @floorl(x86_fp80 %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
double eval_cgt(double x, double y) { return x > y; }


x86 assembly (clang, -O0):
<eval_cgt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_cgt>:
cmpltsd %xmm0,%xmm1
movsd  0xef3(%rip),%xmm0
andpd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @eval_cgt(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @eval_cgt(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = uitofp i1 %3 to double
ret double %4
}
void snd_fight(void) {}


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

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

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

LLVM IR (-O2):
define void @snd_fight() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ main_screen();
int main(void) {
  main_screen();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @main_screen()
ret i32 0
}
/* Variables and functions */
double rand_gamma(int, int);
double rand_invgamma(int alpha, double beta) {
  return 1.0 / rand_gamma(alpha, 1 / beta);
}


x86 assembly (clang, -O0):
<rand_invgamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
movsd  0xed5(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%esi
call   1030 <rand_gamma@plt>
movaps %xmm0,%xmm1
movsd  0xebc(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_invgamma>:
push   %rax
movsd  0xee7(%rip),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%esi
call   1030 <rand_gamma@plt>
movsd  0xed2(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @rand_invgamma(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%5 = load i32, i32* %3
%6 = load double, double* %4
%7 = fdiv double 1.000000e+00, %6
%8 = fptosi double %7 to i32
%9 = call double @rand_gamma(i32 %5, i32 %8)
%10 = fdiv double 1.000000e+00, %9
ret double %10
}

LLVM IR (-O2):
define double @rand_invgamma(i32 %0, double %1) {
%3 = fdiv double 1.000000e+00, %1
%4 = fptosi double %3 to i32
%5 = tail call double @rand_gamma(i32 %0, i32 %4)
%6 = fdiv double 1.000000e+00, %5
ret double %6
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int quaddobl_scale_solutions(int dim, int basis, double *cff) {
  int fail;
  fail = _ada_use_c2phc4c(596, &dim, &basis, cff, 0);
  return fail;
}


x86 assembly (clang, -O0):
<quaddobl_scale_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x254,%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quaddobl_scale_solutions>:
push   %rax
mov    %rdx,%rcx
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    $0x254,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @quaddobl_scale_solutions(i32 %0, i32 %1, double* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store double* %2, double** %6
%8 = load double*, double** %6
%9 = call i32 @_ada_use_c2phc4c(i32 596, i32* %4, i32* %5, double* %8, i32 0)
store i32 %9, i32* %7
%10 = load i32, i32* %7
ret i32 %10
}

LLVM IR (-O2):
define i32 @quaddobl_scale_solutions(i32 %0, i32 %1, double* %2) {
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 @_ada_use_c2phc4c(i32 596, i32* %4, i32* %5, double* %2, i32 0)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void print_usage_quit(const char *name) {
  fprintf(stderr, "Usage: %s [-v] [-f init] [-n boardsize] [-g generations]\n",
          name);
  exit(-1);
}


x86 assembly (clang, -O0):
<print_usage_quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_usage_quit>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [58 x i8] c"Usage: %s [-v] [-f init] [-n boardsize] [-g generations]\0A\00"
define void @print_usage_quit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [58 x i8] c"Usage: %s [-v] [-f init] [-n boardsize] [-g generations]\0A\00"
define void @print_usage_quit(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 -1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ atomic_sub_uint64_t(int /*<<< orphan*/ *, int);
uint64_t atomic_dec_uint64_t(uint64_t *var) {
  return atomic_sub_uint64_t(var, 1);
}


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

x86 assembly (clang, -O2):
<atomic_dec_uint64_t>:
mov    $0x1,%esi
jmp    1030 <atomic_sub_uint64_t@plt>

LLVM IR (-O0):
define i32 @atomic_dec_uint64_t(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @atomic_sub_uint64_t(i32* %3, i32 1)
ret i32 %4
}

LLVM IR (-O2):
define i32 @atomic_dec_uint64_t(i32* %0) {
%2 = tail call i32 @atomic_sub_uint64_t(i32* %0, i32 1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void abort(void) {
  printf("ABORT\n\r");
  while (1)
    ;
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
jmp    1120 <abort+0x10>

x86 assembly (clang, -O2):
<abort>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
nopl   (%rax)
jmp    1120 <abort+0x10>

LLVM IR (-O0):
@.str = [8 x i8] c"ABORT\0A\0D\00"
define void @abort() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
@.str = [8 x i8] c"ABORT\0A\0D\00"
define void @abort() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
void llvm_dummy() {}


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

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

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

LLVM IR (-O2):
define void @llvm_dummy() {
ret void
}
int mySqrt3(int x) {
  if (x == 0)
    return 0;
  int i;
  for (i = 1; i < x / 2; ++i)
    if (i > x / i)
      break;
  return i - 1;
}


x86 assembly (clang, -O0):
<mySqrt3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <mySqrt3+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    117d <mySqrt3+0x7d>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    1174 <mySqrt3+0x74>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jle    1161 <mySqrt3+0x61>
jmp    1174 <mySqrt3+0x74>
jmp    1166 <mySqrt3+0x66>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <mySqrt3+0x24>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mySqrt3>:
test   %edi,%edi
je     1138 <mySqrt3+0x38>
mov    $0x1,%ecx
cmp    $0x4,%edi
jl     1132 <mySqrt3+0x32>
mov    %edi,%esi
shr    %esi
mov    $0x1,%ecx
nopw   0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %ecx
cmp    %eax,%ecx
jg     1132 <mySqrt3+0x32>
add    $0x1,%ecx
cmp    %ecx,%esi
jne    1120 <mySqrt3+0x20>
mov    %esi,%ecx
add    $0xffffffff,%ecx
mov    %ecx,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @mySqrt3(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %28
8: ; preds = %1
store i32 1, i32* %4
br label %9
9: ; preds = %22, %8
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = sdiv i32 %11, 2
%13 = icmp slt i32 %10, %12
br i1 %13, label %14, label %25
14: ; preds = %9
%15 = load i32, i32* %4
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = sdiv i32 %16, %17
%19 = icmp sgt i32 %15, %18
br i1 %19, label %20, label %21
20: ; preds = %14
br label %25
21: ; preds = %14
br label %22
22: ; preds = %21
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
store i32 %24, i32* %4
br label %9
25: ; preds = %20, %9
%26 = load i32, i32* %4
%27 = sub nsw i32 %26, 1
store i32 %27, i32* %2
br label %28
28: ; preds = %25, %7
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @mySqrt3(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %17, label %3
3: ; preds = %1
%4 = icmp sgt i32 %0, 3
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = lshr i32 %0, 1
br label %7
7: ; preds = %5, %11
%8 = phi i32 [ %12, %11 ], [ 1, %5 ]
%9 = sdiv i32 %0, %8
%10 = icmp sgt i32 %8, %9
br i1 %10, label %14, label %11
11: ; preds = %7
%12 = add nuw nsw i32 %8, 1
%13 = icmp eq i32 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %11, %7, %3
%15 = phi i32 [ 1, %3 ], [ %8, %7 ], [ %6, %11 ]
%16 = add nsw i32 %15, -1
br label %17
17: ; preds = %1, %14
%18 = phi i32 [ %16, %14 ], [ 0, %1 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
submenu_configuracion(void) {
  puts("\t\t\t\t\tCONFIGURACION\n");
  puts("1. Precio");
  puts("2. Viaje");
  printf("3. Volver al menu principal\n\nOpcion: ");
}


x86 assembly (clang, -O0):
<submenu_configuracion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
lea    0xed4(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<submenu_configuracion>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
lea    0xedb(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"\09\09\09\09\09CONFIGURACION\0A\00"
@.str.1 = [10 x i8] c"1. Precio\00"
@.str.2 = [9 x i8] c"2. Viaje\00"
@.str.3 = [38 x i8] c"3. Volver al menu principal\0A\0AOpcion: \00"
define i32 @submenu_configuracion() {
%1 = alloca i32
%2 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@.str = [20 x i8] c"\09\09\09\09\09CONFIGURACION\0A\00"
@.str.1 = [10 x i8] c"1. Precio\00"
@.str.2 = [9 x i8] c"2. Viaje\00"
@.str.3 = [38 x i8] c"3. Volver al menu principal\0A\0AOpcion: \00"
define i32 @submenu_configuracion() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: HXF2IHFS <hxf_img> <ihfs_img> [ihfs_size]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [50 x i8] c"Usage: HXF2IHFS <hxf_img> <ihfs_img> [ihfs_size]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [50 x i8] c"Usage: HXF2IHFS <hxf_img> <ihfs_img> [ihfs_size]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
int /*<<< orphan*/ access(unsigned char const *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
scalar_t__ unlink(unsigned char const *);
int filedel(const unsigned char *fname) {
  if (!access(fname, F_OK)) {
    if (unlink(fname)) {
      perror("unlink");
      return 0x80001102;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<filedel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
call   1040 <access@plt>
cmp    $0x0,%eax
jne    1187 <filedel+0x57>
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
cmp    $0x0,%rax
je     1182 <filedel+0x52>
lea    0xe8f(%rip),%rdi
call   1050 <perror@plt>
movl   $0x80001102,-0x4(%rbp)
jmp    118e <filedel+0x5e>
jmp    1187 <filedel+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filedel>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
call   1040 <access@plt>
xor    %ebp,%ebp
test   %eax,%eax
jne    1157 <filedel+0x27>
mov    %rbx,%rdi
call   1030 <unlink@plt>
test   %rax,%rax
jne    1160 <filedel+0x30>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe99(%rip),%rdi
call   1050 <perror@plt>
mov    $0x80001102,%ebp
jmp    1157 <filedel+0x27>

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

LLVM IR (-O2):
@F_OK = global i32 0
@.str = [7 x i8] c"unlink\00"
define i32 @filedel(i8* nocapture %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i32 @access(i8* %0, i32 %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = tail call i64 @unlink(i8* %0)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %1, %5, %8
%11 = phi i32 [ -2147479294, %8 ], [ 0, %5 ], [ 0, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ alloca(int);
void alloca_reset() { alloca(-1); }


x86 assembly (clang, -O0):
<alloca_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
call   1030 <alloca@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloca_reset>:
mov    $0xffffffff,%edi
jmp    1030 <alloca@plt>

LLVM IR (-O0):
define void @alloca_reset() {
%1 = call i32 @alloca(i32 -1)
ret void
}

LLVM IR (-O2):
define void @alloca_reset() {
%1 = tail call i32 @alloca(i32 -1)
ret void
}
void flipEndianLE(unsigned char *x, int length) { return; }


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

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

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

LLVM IR (-O2):
define void @flipEndianLE(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int GLUT_DOWN;
int glutGetModifiers();
int /*<<< orphan*/ hidCodeFromMouseEvent(int, int, int);
int /*<<< orphan*/ hidKeyEvent(int /*<<< orphan*/);
int /*<<< orphan*/ hidMouseMoveEvent(int, int, int);
void mainMouseEvent(int button, int state, int x, int y) {
  int m = glutGetModifiers();
  hidMouseMoveEvent(x, y, m);
  hidKeyEvent(hidCodeFromMouseEvent(button, m, (state == GLUT_DOWN)));
}


x86 assembly (clang, -O0):
<mainMouseEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    $0x0,%al
call   1060 <glutGetModifiers@plt>
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <hidMouseMoveEvent@plt>
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x8(%rbp),%eax
mov    0x2e6c(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edx
call   1050 <hidCodeFromMouseEvent@plt>
mov    %eax,%edi
call   1030 <hidKeyEvent@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mainMouseEvent>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %ecx,%r12d
mov    %edx,%ebp
mov    %esi,%r14d
mov    %edi,%r15d
xor    %eax,%eax
call   1060 <glutGetModifiers@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    %r12d,%esi
mov    %eax,%edx
call   1040 <hidMouseMoveEvent@plt>
mov    0x2e79(%rip),%rax
xor    %edx,%edx
cmp    %r14d,(%rax)
sete   %dl
mov    %r15d,%edi
mov    %ebx,%esi
call   1050 <hidCodeFromMouseEvent@plt>
mov    %eax,%edi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <hidKeyEvent@plt>

LLVM IR (-O0):
@GLUT_DOWN = global i32 0
define void @mainMouseEvent(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = call i32 (...) @glutGetModifiers()
store i32 %10, i32* %9
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = load i32, i32* %9
%14 = call i32 @hidMouseMoveEvent(i32 %11, i32 %12, i32 %13)
%15 = load i32, i32* %5
%16 = load i32, i32* %9
%17 = load i32, i32* %6
%18 = load i32, i32* @GLUT_DOWN
%19 = icmp eq i32 %17, %18
%20 = zext i1 %19 to i32
%21 = call i32 @hidCodeFromMouseEvent(i32 %15, i32 %16, i32 %20)
%22 = call i32 @hidKeyEvent(i32 %21)
ret void
}

LLVM IR (-O2):
@GLUT_DOWN = global i32 0
define void @mainMouseEvent(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 (...) @glutGetModifiers()
%6 = tail call i32 @hidMouseMoveEvent(i32 %2, i32 %3, i32 %5)
%7 = load i32, i32* @GLUT_DOWN
%8 = icmp eq i32 %7, %1
%9 = zext i1 %8 to i32
%10 = tail call i32 @hidCodeFromMouseEvent(i32 %0, i32 %5, i32 %9)
%11 = tail call i32 @hidKeyEvent(i32 %10)
ret void
}
void cloud_update(struct demo *d, struct cloud *c) {
  (void)d;
  (void)c;
}


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

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

LLVM IR (-O0):
%struct.demo = type opaque
%struct.cloud = type opaque
define void @cloud_update(%struct.demo* %0, %struct.cloud* %1) {
%3 = alloca %struct.demo*
%4 = alloca %struct.cloud*
store %struct.demo* %0, %struct.demo** %3
store %struct.cloud* %1, %struct.cloud** %4
%5 = load %struct.demo*, %struct.demo** %3
%6 = load %struct.cloud*, %struct.cloud** %4
ret void
}

LLVM IR (-O2):
%struct.demo = type opaque
%struct.cloud = type opaque
define void @cloud_update(%struct.demo* nocapture %0, %struct.cloud* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: nca [1]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"Usage: nca [1]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"Usage: nca [1]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ automatic();
int mainMenu();
int main() {
  while (mainMenu() != 3)
    ;
  automatic();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <mainMenu@plt>
cmp    $0x3,%eax
je     1144 <main+0x24>
jmp    112f <main+0xf>
mov    $0x0,%al
call   1040 <automatic@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <mainMenu@plt>
cmp    $0x3,%eax
jne    1130 <main+0x10>
xor    %eax,%eax
call   1040 <automatic@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %5, %0
%3 = call i32 (...) @mainMenu()
%4 = icmp ne i32 %3, 3
br i1 %4, label %5, label %6
5: ; preds = %2
br label %2
6: ; preds = %2
%7 = call i32 (...) @automatic()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @mainMenu()
%3 = icmp eq i32 %2, 3
br i1 %3, label %4, label %1
4: ; preds = %1
%5 = tail call i32 (...) @automatic()
ret i32 0
}