xunge/DecIR huggingface dataset:
unsigned char IsJAMValid(int H, int M, int S) {
  if ((H > 0) && (H < 24) && (M > 0) && (M < 60) && (S > 0) && (S < 60)) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<IsJAMValid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1152 <IsJAMValid+0x52>
cmpl   $0x18,-0x8(%rbp)
jge    1152 <IsJAMValid+0x52>
cmpl   $0x0,-0xc(%rbp)
jle    1152 <IsJAMValid+0x52>
cmpl   $0x3c,-0xc(%rbp)
jge    1152 <IsJAMValid+0x52>
cmpl   $0x0,-0x10(%rbp)
jle    1152 <IsJAMValid+0x52>
cmpl   $0x3c,-0x10(%rbp)
jge    1152 <IsJAMValid+0x52>
movb   $0x1,-0x1(%rbp)
jmp    1156 <IsJAMValid+0x56>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsJAMValid>:
add    $0xffffffff,%edi
cmp    $0x17,%edi
setb   %al
add    $0xffffffff,%esi
cmp    $0x3b,%esi
setb   %cl
and    %al,%cl
add    $0xffffffff,%edx
cmp    $0x3b,%edx
setb   %al
and    %cl,%al
ret

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

LLVM IR (-O2):
define zeroext i8 @IsJAMValid(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %0, -1
%5 = icmp ult i32 %4, 23
%6 = add i32 %1, -1
%7 = icmp ult i32 %6, 59
%8 = and i1 %5, %7
%9 = add i32 %2, -1
%10 = icmp ult i32 %9, 59
%11 = and i1 %10, %8
%12 = zext i1 %11 to i8
ret i8 %12
}
/* Variables and functions */
long __NR_exit;
__attribute__((noreturn, unused)) void sys_exit(int status) {
  ({
    long _ret;
    register long _num asm("rax") = (__NR_exit);
    register long _arg1 asm("rdi") = (long)(status & 255);
    asm volatile("syscall\n"
                 : "=a"(_ret)
                 : "r"(_arg1), "0"(_num)
                 : "rcx", "r8", "r9", "r10", "r11", "memory", "cc");
    _ret;
  });
  while (1)
    ;
}


x86 assembly (clang, -O0):
<sys_exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eda(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rax
syscall
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1139 <sys_exit+0x39>

x86 assembly (clang, -O2):
<sys_exit>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%rax
movzbl %dil,%edi
syscall
jmp    1110 <sys_exit+0x10>

LLVM IR (-O0):
@__NR_exit = global i64 0
define void @sys_exit(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i32 %0, i32* %2
%7 = load i64, i64* @__NR_exit
store i64 %7, i64* %4
%8 = load i32, i32* %2
%9 = and i32 %8, 255
%10 = sext i32 %9 to i64
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = load i64, i64* %4
%13 = call i64 asm sideeffect "syscall\0A", "={ax},{rdi},{rax},~{rcx},~{r8},~{r9},~{r10},~{r11},~{memory},~{cc},~{dirflag},~{fpsr},~{flags}"(i64 %11, i64 %12)
store i64 %13, i64* %3
%14 = load i64, i64* %3
store i64 %14, i64* %6
%15 = load i64, i64* %6
br label %16
16: ; preds = %1, %16
br label %16
}

LLVM IR (-O2):
@__NR_exit = global i64 0
define void @sys_exit(i32 %0) {
%2 = load i64, i64* @__NR_exit
%3 = and i32 %0, 255
%4 = zext i32 %3 to i64
%5 = tail call i64 asm sideeffect "syscall\0A", "={ax},{rdi},{rax},~{rcx},~{r8},~{r9},~{r10},~{r11},~{memory},~{cc},~{dirflag},~{fpsr},~{flags}"(i64 %4, i64 %2)
br label %6
6: ; preds = %1, %6
br label %6
}
/* Type definitions */
struct group_list_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ early_complete(struct group_list_t *, int /*<<< orphan*/,
                                  int);
void handle_fileinfo_freespace(struct group_list_t *group) {
  early_complete(group, 0, 1);
}


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

x86 assembly (clang, -O2):
<handle_fileinfo_freespace>:
xor    %esi,%esi
mov    $0x1,%edx
jmp    1030 <early_complete@plt>

LLVM IR (-O0):
%struct.group_list_t = type { i32 }
define void @handle_fileinfo_freespace(%struct.group_list_t* %0) {
%2 = alloca %struct.group_list_t*
store %struct.group_list_t* %0, %struct.group_list_t** %2
%3 = load %struct.group_list_t*, %struct.group_list_t** %2
%4 = call i32 @early_complete(%struct.group_list_t* %3, i32 0, i32 1)
ret void
}

LLVM IR (-O2):
%struct.group_list_t = type { i32 }
define void @handle_fileinfo_freespace(%struct.group_list_t* %0) {
%2 = tail call i32 @early_complete(%struct.group_list_t* %0, i32 0, i32 1)
ret void
}
/* Variables and functions */
int close(int);
int ccnl_close_socket(int s) { return close(s); }


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

x86 assembly (clang, -O2):
<ccnl_close_socket>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @ccnl_close_socket(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long subwindow;
};
typedef TYPE_1__ XKeyEvent;

/* Variables and functions */
void set_XKeyEvent_subwindow(void *_p, unsigned long _v) {
  ((XKeyEvent *)_p)->subwindow = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XKeyEvent_subwindow>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XKeyEvent_subwindow(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XKeyEvent_subwindow(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int (*free_private)();
};
typedef TYPE_1__ XExtData;

/* Variables and functions */
void set_XExtData_free_private(void *_p, void *_v) {
  ((XExtData *)_p)->free_private = (int (*)())_v;
}


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

x86 assembly (clang, -O2):
<set_XExtData_free_private>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 (...)* }
define void @set_XExtData_free_private(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32 (...)*
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.TYPE_2__*
%9 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %8, i32 0, i32 0
store i32 (...)* %6, i32 (...)** %9
ret void
}

LLVM IR (-O2):
define void @set_XExtData_free_private(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_access_boolean();
int /*<<< orphan*/ test_access_null();
int /*<<< orphan*/ test_access_number();
int /*<<< orphan*/ test_access_string();
void test_access() {
  test_access_null();
  test_access_boolean();
  test_access_number();
  test_access_string();
}


x86 assembly (clang, -O0):
<test_access>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <test_access_null@plt>
mov    $0x0,%al
call   1030 <test_access_boolean@plt>
mov    $0x0,%al
call   1050 <test_access_number@plt>
mov    $0x0,%al
call   1040 <test_access_string@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_access>:
push   %rax
xor    %eax,%eax
call   1060 <test_access_null@plt>
xor    %eax,%eax
call   1030 <test_access_boolean@plt>
xor    %eax,%eax
call   1050 <test_access_number@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <test_access_string@plt>

LLVM IR (-O0):
define void @test_access() {
%1 = call i32 (...) @test_access_null()
%2 = call i32 (...) @test_access_boolean()
%3 = call i32 (...) @test_access_number()
%4 = call i32 (...) @test_access_string()
ret void
}

LLVM IR (-O2):
define void @test_access() {
%1 = tail call i32 (...) @test_access_null()
%2 = tail call i32 (...) @test_access_boolean()
%3 = tail call i32 (...) @test_access_number()
%4 = tail call i32 (...) @test_access_string()
ret void
}
/* Type definitions */
typedef char ulong;

/* Variables and functions */
ulong calcScore(char *s, int index) {
  ulong retVal = 0;
  while (*s != 0) {
    retVal += *s - 'A' + 1;
    s++;
  }
  return index * retVal;
}


x86 assembly (clang, -O0):
<calcScore>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movb   $0x0,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1146 <calcScore+0x46>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
sub    $0x41,%ecx
add    $0x1,%ecx
movsbl -0xd(%rbp),%eax
add    %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <calcScore+0xf>
mov    -0xc(%rbp),%eax
movsbl -0xd(%rbp),%ecx
imul   %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcScore>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <calcScore+0x2c>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movzbl %cl,%ecx
add    %ecx,%eax
add    $0xc0,%eax
movsbl %al,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <calcScore+0x10>
imul   %esi,%eax
ret
xor    %eax,%eax
imul   %esi,%eax
ret

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

LLVM IR (-O2):
define signext i8 @calcScore(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %15, %5 ], [ %3, %2 ]
%7 = phi i32 [ %14, %5 ], [ 0, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = zext i8 %6 to i32
%10 = add nsw i32 %7, 192
%11 = add nsw i32 %10, %9
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = shl i32 %11, 24
%14 = ashr exact i32 %13, 24
%15 = load i8, i8* %12
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %5
17: ; preds = %5, %2
%18 = phi i32 [ 0, %2 ], [ %14, %5 ]
%19 = mul nsw i32 %18, %1
%20 = trunc i32 %19 to i8
ret i8 %20
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  int n = 0;
  int i;
  for (i = 1; i < 101; i++) {
    n += i;
  }
  printf("Total da soma %d", n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x65,-0xc(%rbp)
jge    114e <main+0x3e>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [17 x i8] c"Total da soma %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 5050)
ret i32 0
}
/* Variables and functions */
unsigned int random();
int random_u32(unsigned int *r) {
  *r = random();
  return 0;
}


x86 assembly (clang, -O0):
<random_u32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_u32>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <random@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @random_u32(i32* nocapture writeonly %0) {
%2 = tail call i32 (...) @random()
store i32 %2, i32* %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memory_remove(void *, int);
void my_free(void *ptr) {
  memory_remove(ptr, 1);
  ptr = NULL;
}


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

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

LLVM IR (-O0):
define void @my_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @memory_remove(i8* %3, i32 1)
store i8* null, i8** %2
ret void
}

LLVM IR (-O2):
define void @my_free(i8* %0) {
%2 = tail call i32 @memory_remove(i8* %0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ program_parts();
int yyselect();
program() {
  switch (yyselect()) {
  case 1: {
    printf("Find");
    program_parts();
  } break;
  case 2: {
    printf("Find");
    program_parts();
    program();
  } break;
  }
}


x86 assembly (clang, -O0):
<program>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <yyselect@plt>
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
sub    $0x1,%eax
je     1173 <program+0x33>
jmp    1162 <program+0x22>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
je     118b <program+0x4b>
jmp    11a3 <program+0x63>
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1060 <program_parts@plt>
jmp    11a3 <program+0x63>
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1060 <program_parts@plt>
call   1050 <program@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<program>:
push   %rbx
lea    0xec8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <yyselect@plt>
cmp    $0x2,%eax
jne    115d <program+0x2d>
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <program_parts@plt>
jmp    1140 <program+0x10>
cmp    $0x1,%eax
jne    1175 <program+0x45>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <program_parts@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"Find\00"
define i32 @program() {
%1 = alloca i32
%2 = call i32 (...) @yyselect()
switch i32 %2, label %10 [
i32 1, label %3
i32 2, label %6
]
3: ; preds = %0
%4 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @program_parts()
br label %10
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @program_parts()
%9 = call i32 @program()
br label %10
10: ; preds = %0, %6, %3
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [5 x i8] c"Find\00"
define i32 @program() {
br label %1
1: ; preds = %6, %0
%2 = tail call i32 (...) @yyselect()
switch i32 %2, label %9 [
i32 1, label %3
i32 2, label %6
]
3: ; preds = %1
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (...) @program_parts()
br label %9
6: ; preds = %1
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (...) @program_parts()
br label %1
9: ; preds = %1, %3
ret i32 undef
}
/* Variables and functions */
char toupper(char);
void util_str_toupper(char *str) {
  int i;
  for (i = 0; str[i] != '\0'; i++)
    str[i] = toupper(str[i]);
}


x86 assembly (clang, -O0):
<util_str_toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1164 <util_str_toupper+0x54>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <util_str_toupper+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_str_toupper>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <util_str_toupper+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <util_str_toupper+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @util_str_toupper(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = phi i8 [ %11, %4 ], [ %2, %1 ]
%7 = phi i8* [ %10, %4 ], [ %0, %1 ]
%8 = tail call signext i8 @toupper(i8 signext %6)
store i8 %8, i8* %7
%9 = add nuw i64 %5, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}
int slash_count(char *txt) {
  int i = 0, n = 0;
  while (txt[i])
    if (txt[i++] == '/')
      n++;
  return (n);
}


x86 assembly (clang, -O0):
<slash_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1155 <slash_count+0x55>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jne    1150 <slash_count+0x50>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <slash_count+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<slash_count>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <slash_count+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    $0x2f,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <slash_count+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @slash_count(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %13, %4 ], [ %2, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = add nuw nsw i64 %5, 1
%9 = icmp eq i8 %6, 47
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %7, %10
%12 = getelementptr inbounds i8, i8* %0, i64 %8
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %16
}
/* Variables and functions */
int atoi(char *);
int ee_get_num_out(char *eqn, int *error) {
  if (eqn[0] != '[') {
    *(error) = 11;
    return (-1);
  }
  return (atoi(eqn + 1));
}


x86 assembly (clang, -O0):
<ee_get_num_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5b,%eax
je     1146 <ee_get_num_out+0x36>
mov    -0x18(%rbp),%rax
movl   $0xb,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1156 <ee_get_num_out+0x46>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1030 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ee_get_num_out>:
cmpb   $0x5b,(%rdi)
jne    111e <ee_get_num_out+0xe>
add    $0x1,%rdi
jmp    1030 <atoi@plt>
movl   $0xb,(%rsi)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @ee_get_num_out(i8* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %4
store i32* %1, i32** %5
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 91
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32*, i32** %5
store i32 11, i32* %12
store i32 -1, i32* %3
br label %17
13: ; preds = %2
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = call i32 @atoi(i8* %15)
store i32 %16, i32* %3
br label %17
17: ; preds = %13, %11
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @ee_get_num_out(i8* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 91
br i1 %4, label %6, label %5
5: ; preds = %2
store i32 11, i32* %1
br label %9
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = tail call i32 @atoi(i8* %7)
br label %9
9: ; preds = %6, %5
%10 = phi i32 [ -1, %5 ], [ %8, %6 ]
ret i32 %10
}
void pthread_kill() {}


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

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

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

LLVM IR (-O2):
define void @pthread_kill() {
ret void
}
long int longint_id(long int x) { return x; }


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

x86 assembly (clang, -O2):
<longint_id>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @longint_id(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
ret i64 %3
}

LLVM IR (-O2):
define i64 @longint_id(i64 returned %0) {
ret i64 %0
}
unsigned char checkSum(char *string) {
  int i = 0;
  unsigned char sum = 0;
  while (string[i] != 0) {
    sum += string[i++];
  }
  return -sum;
}


x86 assembly (clang, -O0):
<checkSum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movb   $0x0,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114c <checkSum+0x4c>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%ecx
movzbl -0xd(%rbp),%eax
add    %ecx,%eax
mov    %al,-0xd(%rbp)
jmp    1113 <checkSum+0x13>
movzbl -0xd(%rbp),%ecx
xor    %eax,%eax
sub    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkSum>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1125 <checkSum+0x25>
add    $0x1,%rdi
nopl   0x0(%rax)
movzbl %cl,%edx
add    %eax,%edx
movzbl %dl,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <checkSum+0x10>
mov    %edx,%eax
neg    %al
ret

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

LLVM IR (-O2):
define zeroext i8 @checkSum(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = phi i8 [ %13, %4 ], [ %2, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = zext i8 %6 to i32
%9 = add nuw nsw i64 %5, 1
%10 = add nuw nsw i32 %7, %8
%11 = and i32 %10, 255
%12 = getelementptr inbounds i8, i8* %0, i64 %9
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4
%16 = trunc i32 %10 to i8
br label %17
17: ; preds = %15, %1
%18 = phi i8 [ 0, %1 ], [ %16, %15 ]
%19 = sub i8 0, %18
ret i8 %19
}
/* Variables and functions */
int /*<<< orphan*/ eof_get_configdir(char *, size_t);
int /*<<< orphan*/ memset(char *, char, size_t);
int /*<<< orphan*/ strncat(char *, char *, size_t);
void eof_get_pidfile(char buf[], size_t len) {
  memset(buf, '\0', len);
  eof_get_configdir(buf, len);
  strncat(buf,
          "/"
          "pid",
          len - 1);
}


x86 assembly (clang, -O0):
<eof_get_pidfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <eof_get_configdir@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
sub    $0x1,%rdx
lea    0xe91(%rip),%rsi
call   1040 <strncat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eof_get_pidfile>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <eof_get_configdir@plt>
add    $0xffffffffffffffff,%rbx
lea    0xea6(%rip),%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strncat@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"/pid\00"
define void @eof_get_pidfile(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @memset(i8* %5, i8 signext 0, i64 %6)
%8 = load i8*, i8** %3
%9 = load i64, i64* %4
%10 = call i32 @eof_get_configdir(i8* %8, i64 %9)
%11 = load i8*, i8** %3
%12 = load i64, i64* %4
%13 = sub i64 %12, 1
%14 = call i32 @strncat(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %13)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"/pid\00"
define void @eof_get_pidfile(i8* %0, i64 %1) {
%3 = tail call i32 @memset(i8* %0, i8 signext 0, i64 %1)
%4 = tail call i32 @eof_get_configdir(i8* %0, i64 %1)
%5 = add i64 %1, -1
%6 = tail call i32 @strncat(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %5)
ret void
}
int main() {
  int DIM_X = 1000;
  int DIM_Y = 1000;
  int vectorMD[DIM_X][DIM_Y];
  for (int x = 0; x < DIM_X; x++)
    for (int y = 0; y < DIM_Y; y++)
      vectorMD[x][y] = x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3e8,-0x8(%rbp)
movl   $0x3e8,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
mov    %rax,-0x40(%rbp)
mov    %rsp,%rdx
mov    %rdx,-0x18(%rbp)
mov    %rcx,%rdx
imul   %rax,%rdx
lea    0xf(,%rdx,4),%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x38(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x20(%rbp)
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11c0 <main+0xc0>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11ad <main+0xad>
mov    -0x38(%rbp),%rax
mov    -0x40(%rbp),%rsi
mov    -0x2c(%rbp),%edx
movslq -0x2c(%rbp),%rcx
imul   %rsi,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0x30(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1172 <main+0x72>
jmp    11b2 <main+0xb2>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    115f <main+0x5f>
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
store i32 1000, i32* %2
store i32 1000, i32* %3
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = load i32, i32* %3
%12 = zext i32 %11 to i64
%13 = call i8* @llvm.stacksave()
store i8* %13, i8** %4
%14 = mul nuw i64 %10, %12
%15 = alloca i32, i64 %14
store i64 %10, i64* %5
store i64 %12, i64* %6
store i32 0, i32* %7
br label %16
16: ; preds = %38, %0
%17 = load i32, i32* %7
%18 = load i32, i32* %2
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %41
20: ; preds = %16
store i32 0, i32* %8
br label %21
21: ; preds = %34, %20
%22 = load i32, i32* %8
%23 = load i32, i32* %3
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %37
25: ; preds = %21
%26 = load i32, i32* %7
%27 = load i32, i32* %7
%28 = sext i32 %27 to i64
%29 = mul nsw i64 %28, %12
%30 = getelementptr inbounds i32, i32* %15, i64 %29
%31 = load i32, i32* %8
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i32, i32* %30, i64 %32
store i32 %26, i32* %33
br label %34
34: ; preds = %25
%35 = load i32, i32* %8
%36 = add nsw i32 %35, 1
store i32 %36, i32* %8
br label %21
37: ; preds = %21
br label %38
38: ; preds = %37
%39 = load i32, i32* %7
%40 = add nsw i32 %39, 1
store i32 %40, i32* %7
br label %16
41: ; preds = %16
%42 = load i8*, i8** %4
%43 = load i32, i32* %1
ret i32 %43
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "%s\n%s\n", "usage: rm [-f | -i] [-dIPRrvWx] file ...",
                "       unlink file");
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xecc(%rip),%rdx
lea    0xeee(%rip),%rcx
call   1030 <fprintf@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xecf(%rip),%rdx
lea    0xef1(%rip),%rcx
call   1030 <fprintf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [7 x i8] c"%s\0A%s\0A\00"
@.str.1 = [41 x i8] c"usage: rm [-f | -i] [-dIPRrvWx] file ...\00"
@.str.2 = [19 x i8] c" unlink file\00"
@EX_USAGE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"%s\0A%s\0A\00"
@.str.1 = [41 x i8] c"usage: rm [-f | -i] [-dIPRrvWx] file ...\00"
@.str.2 = [19 x i8] c" unlink file\00"
@EX_USAGE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int g(double);
int f(double x) {
  int tmp;
  {
    tmp = g(x);
    return (tmp);
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <g@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
jmp    1030 <g@plt>

LLVM IR (-O0):
define i32 @f(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = load double, double* %2
%5 = call i32 @g(double %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @f(double %0) {
%2 = tail call i32 @g(double %0)
ret i32 %2
}
char *stpcpy(char *dst, const char *src) {
  while (*src) {
    *dst++ = *src++;
  }
  return dst;
}


x86 assembly (clang, -O0):
<stpcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1140 <stpcpy+0x40>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <stpcpy+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stpcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1121 <stpcpy+0x21>
add    $0x1,%rsi
nopl   (%rax)
mov    %cl,(%rax)
add    $0x1,%rax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <stpcpy+0x10>
ret

LLVM IR (-O0):
define i8* @stpcpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %9, %2
%6 = load i8*, i8** %4
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %4
%12 = load i8, i8* %10
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %3
store i8 %12, i8* %13
br label %5
15: ; preds = %5
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @stpcpy(i8* writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %6, i8* %8
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ cp850_to_latin1(unsigned int);
int latin1_downcase(int /*<<< orphan*/);
unsigned hpfs_char_to_lower_linux(unsigned c) {
  return latin1_downcase(cp850_to_latin1(c));
}


x86 assembly (clang, -O0):
<hpfs_char_to_lower_linux>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <cp850_to_latin1@plt>
mov    %eax,%edi
call   1040 <latin1_downcase@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hpfs_char_to_lower_linux>:
push   %rax
call   1030 <cp850_to_latin1@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <latin1_downcase@plt>

LLVM IR (-O0):
define i32 @hpfs_char_to_lower_linux(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @cp850_to_latin1(i32 %3)
%5 = call i32 @latin1_downcase(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @hpfs_char_to_lower_linux(i32 %0) {
%2 = tail call i32 @cp850_to_latin1(i32 %0)
%3 = tail call i32 @latin1_downcase(i32 %2)
ret i32 %3
}
int test_imm_DCuint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0xDC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_DCuint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0xdc,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_DCuint64_highword_mem>:
testb  $0xdc,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_DCuint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 220
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_DCuint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 944892805120
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int start_gr(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @start_gr() {
ret i32 1
}

LLVM IR (-O2):
define i32 @start_gr() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ pause();
int /*<<< orphan*/ printf(char *);
void *thr_fn(void *arg) {
  printf("thread started...\n");
  pause();
  return (0);
}


x86 assembly (clang, -O0):
<thr_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <pause@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thr_fn>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <pause@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"thread started...\0A\00"
define i8* @thr_fn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @pause()
ret i8* null
}

LLVM IR (-O2):
@str = [18 x i8] c"thread started...\00"
define noalias i8* @thr_fn(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @pause()
ret i8* null
}
int f_ge_cr1(float a1) { return (((100) >= (a1))); }


x86 assembly (clang, -O0):
<f_ge_cr1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_ge_cr1>:
movss  0xef8(%rip),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setae  %al
ret

LLVM IR (-O0):
define i32 @f_ge_cr1(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp oge float 1.000000e+02, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @f_ge_cr1(float %0) {
%2 = fcmp ole float %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
uint32_t zi_read32(const unsigned char *z) {
  return (unsigned)z[0] << 24 | z[1] << 16 | z[2] << 8 | z[3];
}


x86 assembly (clang, -O0):
<zi_read32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zi_read32>:
mov    (%rdi),%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @zi_read32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 24
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = or i32 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 3
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = or i32 %19, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @zi_read32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
size_t strlen(char *);
char *strncat(char *, char const *, size_t);
char *okcash_strncat(char *dest, size_t dest_size, char const *src,
                     size_t count) {
  return strlen(dest) + count + 1 <= dest_size ? strncat(dest, src, count)
                                               : NULL;
}


x86 assembly (clang, -O0):
<okcash_strncat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    -0x20(%rbp),%rax
add    $0x1,%rax
cmp    -0x10(%rbp),%rax
ja     116d <okcash_strncat+0x4d>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <strncat@plt>
mov    %rax,-0x28(%rbp)
jmp    1178 <okcash_strncat+0x58>
xor    %eax,%eax
mov    %rax,-0x28(%rbp)
jmp    1178 <okcash_strncat+0x58>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<okcash_strncat>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
call   1030 <strlen@plt>
add    %r14,%rax
add    $0x1,%rax
cmp    %r12,%rax
jbe    1149 <okcash_strncat+0x29>
xor    %ebx,%ebx
jmp    1157 <okcash_strncat+0x37>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <strncat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @okcash_strncat(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = call i64 @strlen(i8* %9)
%11 = load i64, i64* %8
%12 = add i64 %10, %11
%13 = add i64 %12, 1
%14 = load i64, i64* %6
%15 = icmp ule i64 %13, %14
br i1 %15, label %16, label %21
16: ; preds = %4
%17 = load i8*, i8** %5
%18 = load i8*, i8** %7
%19 = load i64, i64* %8
%20 = call i8* @strncat(i8* %17, i8* %18, i64 %19)
br label %22
21: ; preds = %4
br label %22
22: ; preds = %21, %16
%23 = phi i8* [ %20, %16 ], [ null, %21 ]
ret i8* %23
}

LLVM IR (-O2):
define i8* @okcash_strncat(i8* %0, i64 %1, i8* nocapture %2, i64 %3) {
%5 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%6 = add i64 %3, 1
%7 = add i64 %6, %5
%8 = icmp ugt i64 %7, %1
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = tail call i8* @strncat(i8* dereferenceable(1) %0, i8* %2, i64 %3)
br label %11
11: ; preds = %4, %9
%12 = phi i8* [ %0, %9 ], [ null, %4 ]
ret i8* %12
}