xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ adc16(int /*<<< orphan*/);
int /*<<< orphan*/ readmemw65816(int /*<<< orphan*/);
int /*<<< orphan*/ sindirecty();
void adcsIndirecty16(void) { adc16(readmemw65816(sindirecty())); }


x86 assembly (clang, -O0):
<adcsIndirecty16>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <sindirecty@plt>
mov    %eax,%edi
call   1030 <readmemw65816@plt>
mov    %eax,%edi
call   1050 <adc16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<adcsIndirecty16>:
push   %rax
xor    %eax,%eax
call   1040 <sindirecty@plt>
mov    %eax,%edi
call   1030 <readmemw65816@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <adc16@plt>

LLVM IR (-O0):
define void @adcsIndirecty16() {
%1 = call i32 (...) @sindirecty()
%2 = call i32 @readmemw65816(i32 %1)
%3 = call i32 @adc16(i32 %2)
ret void
}

LLVM IR (-O2):
define void @adcsIndirecty16() {
%1 = tail call i32 (...) @sindirecty()
%2 = tail call i32 @readmemw65816(i32 %1)
%3 = tail call i32 @adc16(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err_sys(char *);
int ioctl(int, int, void *);
int Ioctl(int fd, int request, void *arg) {
  int n;
  if ((n = ioctl(fd, request, arg)) == -1)
    err_sys("ioctl error");
  return (n);
}


x86 assembly (clang, -O0):
<Ioctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1040 <ioctl@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
jne    1159 <Ioctl+0x39>
lea    0xeac(%rip),%rdi
call   1030 <err_sys@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ioctl>:
push   %rbx
call   1040 <ioctl@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    1139 <Ioctl+0x19>
lea    0xecc(%rip),%rdi
call   1030 <err_sys@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"ioctl error\00"
define i32 @Ioctl(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @ioctl(i32 %0, i32 %1, i8* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @err_sys(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i32 %4
}
long kernel__Char__object_id(char self) {
  long var;
  long var1;
  var1 = (long)self;
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


x86 assembly (clang, -O0):
<kernel__Char__object_id>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbq -0x1(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel__Char__object_id>:
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @kernel__Char__object_id(i8 signext %0) {
%2 = alloca i8
%3 = alloca i64
%4 = alloca i64
store i8 %0, i8* %2
%5 = load i8, i8* %2
%6 = sext i8 %5 to i64
store i64 %6, i64* %4
%7 = load i64, i64* %4
store i64 %7, i64* %3
br label %8
8: ; preds = %1
%9 = load i64, i64* %3
ret i64 %9
}

LLVM IR (-O2):
define i64 @kernel__Char__object_id(i8 signext %0) {
%2 = sext i8 %0 to i64
ret i64 %2
}
/* Variables and functions */
long internal__syscall3(long, long, long, long);
long __syscall3(long n, long a1, long a2, long a3) {
  return internal__syscall3(n, a1, a2, a3);
}


x86 assembly (clang, -O0):
<__syscall3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <internal__syscall3@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__syscall3>:
jmp    1030 <internal__syscall3@plt>

LLVM IR (-O0):
define i64 @__syscall3(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load i64, i64* %8
%13 = call i64 @internal__syscall3(i64 %9, i64 %10, i64 %11, i64 %12)
ret i64 %13
}

LLVM IR (-O2):
define i64 @__syscall3(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = tail call i64 @internal__syscall3(i64 %0, i64 %1, i64 %2, i64 %3)
ret i64 %5
}
/* Variables and functions */
int grabbed_callback(int);
int use_grabbed_callback(int n) { return grabbed_callback(n); }


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

x86 assembly (clang, -O2):
<use_grabbed_callback>:
jmp    1030 <grabbed_callback@plt>

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

LLVM IR (-O2):
define i32 @use_grabbed_callback(i32 %0) {
%2 = tail call i32 @grabbed_callback(i32 %0)
ret i32 %2
}
int countbn(char c) {
  int bn = 0;
  switch (c) {
  case ' ':
    bn += 1;
    break;
  case '\n':
    bn += 1;
    break;
  case '\t':
    bn += 4;
    break;
  default:;
  }
  return bn;
}


x86 assembly (clang, -O0):
<countbn>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x9,%eax
je     1164 <countbn+0x64>
jmp    1126 <countbn+0x26>
mov    -0xc(%rbp),%eax
sub    $0xa,%eax
je     1156 <countbn+0x56>
jmp    1137 <countbn+0x37>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
jne    1172 <countbn+0x72>
jmp    1148 <countbn+0x48>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1177 <countbn+0x77>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1177 <countbn+0x77>
mov    -0x8(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x8(%rbp)
jmp    1177 <countbn+0x77>
jmp    1177 <countbn+0x77>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countbn>:
cmp    $0x9,%edi
je     1117 <countbn+0x17>
cmp    $0xa,%edi
je     1111 <countbn+0x11>
xor    %eax,%eax
cmp    $0x20,%edi
jne    111c <countbn+0x1c>
mov    $0x1,%eax
ret
mov    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @countbn(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %15 [
i32 32, label %6
i32 10, label %9
i32 9, label %12
]
6: ; preds = %1
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
store i32 %8, i32* %3
br label %16
9: ; preds = %1
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %16
12: ; preds = %1
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 4
store i32 %14, i32* %3
br label %16
15: ; preds = %1
br label %16
16: ; preds = %15, %12, %9, %6
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @countbn(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %6 [
i32 32, label %3
i32 10, label %4
i32 9, label %5
]
3: ; preds = %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %5, %4, %3
%7 = phi i32 [ 0, %1 ], [ 4, %5 ], [ 1, %4 ], [ 1, %3 ]
ret i32 %7
}
void work(int n) {
  volatile int i = 0;
  while (i++ < n)
    ;
}


x86 assembly (clang, -O0):
<work>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cmp    -0x4(%rbp),%eax
jge    1127 <work+0x27>
jmp    110e <work+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<work>:
movl   $0x0,-0x4(%rsp)
nopl   0x0(%rax,%rax,1)
mov    -0x4(%rsp),%eax
lea    0x1(%rax),%ecx
mov    %ecx,-0x4(%rsp)
cmp    %edi,%eax
jl     1110 <work+0x10>
ret

LLVM IR (-O0):
define void @work(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store volatile i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load volatile i32, i32* %3
%6 = add nsw i32 %5, 1
store volatile i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = icmp slt i32 %5, %7
br i1 %8, label %9, label %10
9: ; preds = %4
br label %4
10: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @work(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store volatile i32 0, i32* %2
br label %4
4: ; preds = %4, %1
%5 = load volatile i32, i32* %2
%6 = add nsw i32 %5, 1
store volatile i32 %6, i32* %2
%7 = icmp slt i32 %5, %0
br i1 %7, label %4, label %8
8: ; preds = %4
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool ubitmap_bit_is_set(const void *b, size_t num) {
  return ((uint8_t *)b)[(num) / 8] & (0x80 >> ((num) % 8));
}


x86 assembly (clang, -O0):
<ubitmap_bit_is_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    $0x3,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
and    $0x7,%rcx
mov    $0x80,%edx
sar    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ubitmap_bit_is_set>:
mov    %rsi,%rcx
mov    %rsi,%rdx
and    $0x7,%cl
mov    $0x80,%eax
shr    %cl,%eax
shr    $0x3,%rdx
and    (%rdi,%rdx,4),%eax
ret

LLVM IR (-O0):
define i32 @ubitmap_bit_is_set(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 = bitcast i8* %5 to i32*
%7 = load i64, i64* %4
%8 = udiv i64 %7, 8
%9 = getelementptr inbounds i32, i32* %6, i64 %8
%10 = load i32, i32* %9
%11 = load i64, i64* %4
%12 = urem i64 %11, 8
%13 = trunc i64 %12 to i32
%14 = ashr i32 128, %13
%15 = and i32 %10, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @ubitmap_bit_is_set(i8* nocapture %0, i64 %1) {
%3 = bitcast i8* %0 to i32*
%4 = lshr i64 %1, 3
%5 = getelementptr inbounds i32, i32* %3, i64 %4
%6 = load i32, i32* %5
%7 = trunc i64 %1 to i32
%8 = and i32 %7, 7
%9 = lshr i32 128, %8
%10 = and i32 %6, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ umfpack_zi_free_symbolic(void **);
void umf4zfsym(void **Symbolic) { umfpack_zi_free_symbolic(Symbolic); }


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

x86 assembly (clang, -O2):
<umf4zfsym>:
jmp    1030 <umfpack_zi_free_symbolic@plt>

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

LLVM IR (-O2):
define void @umf4zfsym(i8** %0) {
%2 = tail call i32 @umfpack_zi_free_symbolic(i8** %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char const *);
void info(const char *message, ...) { syslog(LOG_INFO, message); }


x86 assembly (clang, -O0):
<info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <syslog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<info>:
mov    %rdi,%rsi
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syslog@plt>

LLVM IR (-O0):
@LOG_INFO = global i32 0
define void @info(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @LOG_INFO
%4 = load i8*, i8** %2
%5 = call i32 @syslog(i32 %3, i8* %4)
ret void
}

LLVM IR (-O2):
@LOG_INFO = global i32 0
define void @info(i8* %0, ...) {
%2 = load i32, i32* @LOG_INFO
%3 = tail call i32 @syslog(i32 %2, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, unsigned long long const,
                          char const *, char const *, int);
void print_test_case_executor(const char *name, size_t idx, int reset_mocks) {
  const unsigned long long int idx_llu = idx;
  printf("  if (1 == cutest_test_name_argument_given(\"%s\")) {\n"
         "    memset(&cutest_mock, 0, sizeof(cutest_mock));\n"
         "    cutest_execute_test(&junit_report[%llu], cutest_%s, \"%s\", %d, "
         "argv[0]);\n"
         "  }\n",
         name, idx_llu, name, name, reset_mocks);
}


x86 assembly (clang, -O0):
<print_test_case_executor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0x8(%rbp),%r8
mov    -0x14(%rbp),%r9d
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_test_case_executor>:
mov    %edx,%r9d
mov    %rsi,%rdx
mov    %rdi,%rcx
lea    0xee0(%rip),%rdi
mov    %rcx,%rsi
mov    %rcx,%r8
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [183 x i8] c" if (1 == cutest_test_name_argument_given(\22%s\22)) {\0A memset(&cutest_mock, 0, sizeof(cutest_mock));\0A cutest_execute_test(&junit_report[%llu], cutest_%s, \22%s\22, %d, argv[0]);\0A }\0A\00"
define void @print_test_case_executor(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
%7 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%8 = load i64, i64* %5
store i64 %8, i64* %7
%9 = load i8*, i8** %4
%10 = load i64, i64* %7
%11 = load i8*, i8** %4
%12 = load i8*, i8** %4
%13 = load i32, i32* %6
%14 = call i32 @printf(i8* getelementptr inbounds ([183 x i8], [183 x i8]* @.str, i64 0, i64 0), i8* %9, i64 %10, i8* %11, i8* %12, i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [183 x i8] c" if (1 == cutest_test_name_argument_given(\22%s\22)) {\0A memset(&cutest_mock, 0, sizeof(cutest_mock));\0A cutest_execute_test(&junit_report[%llu], cutest_%s, \22%s\22, %d, argv[0]);\0A }\0A\00"
define void @print_test_case_executor(i8* %0, i64 %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([183 x i8], [183 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %1, i8* %0, i8* %0, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_mullo_pi16(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 __attribute__((no, unused)) test(__m64 s1, __m64 s2) {
  return _mm_mullo_pi16(s1, s2);
}


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

x86 assembly (clang, -O2):
<test>:
jmp    1030 <_mm_mullo_pi16@plt>

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

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_mullo_pi16(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int newnntpreply(int /*<<< orphan*/);
int nntpreply(void) { return newnntpreply(0); }


x86 assembly (clang, -O0):
<nntpreply>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <newnntpreply@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nntpreply>:
xor    %edi,%edi
jmp    1030 <newnntpreply@plt>

LLVM IR (-O0):
define i32 @nntpreply() {
%1 = call i32 @newnntpreply(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @nntpreply() {
%1 = tail call i32 @newnntpreply(i32 0)
ret i32 %1
}
/* Variables and functions */
int strncmp(char const *, char const *, int);
int sqliteStrCompare(const void *pKey1, int n1, const void *pKey2, int n2) {
  if (n1 != n2)
    return 1;
  return strncmp((const char *)pKey1, (const char *)pKey2, n1);
}


x86 assembly (clang, -O0):
<sqliteStrCompare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     113e <sqliteStrCompare+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1151 <sqliteStrCompare+0x41>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strncmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqliteStrCompare>:
cmp    %ecx,%esi
jne    1120 <sqliteStrCompare+0x10>
mov    %esi,%eax
mov    %rdx,%rsi
mov    %eax,%edx
jmp    1030 <strncmp@plt>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @sqliteStrCompare(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = icmp eq i32 %1, %3
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @strncmp(i8* %0, i8* %2, i32 %1)
br label %8
8: ; preds = %4, %6
%9 = phi i32 [ %7, %6 ], [ 1, %4 ]
ret i32 %9
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int /*<<< orphan*/ fts_name;
};
typedef TYPE_1__ FTSENT;

/* Variables and functions */
int strcoll(int /*<<< orphan*/, int /*<<< orphan*/);
int ftscompare(const FTSENT *const *e1, const FTSENT *const *e2) {
  return (strcoll((*e1)->fts_name, (*e2)->fts_name));
}


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

x86 assembly (clang, -O2):
<ftscompare>:
mov    (%rdi),%rax
mov    (%rax),%edi
mov    (%rsi),%rax
mov    (%rax),%esi
jmp    1030 <strcoll@plt>

LLVM IR (-O0):
%struct.TYPE_4__ = type { i32 }
define i32 @ftscompare(%struct.TYPE_4__** %0, %struct.TYPE_4__** %1) {
%3 = alloca %struct.TYPE_4__**
%4 = alloca %struct.TYPE_4__**
store %struct.TYPE_4__** %0, %struct.TYPE_4__*** %3
store %struct.TYPE_4__** %1, %struct.TYPE_4__*** %4
%5 = load %struct.TYPE_4__**, %struct.TYPE_4__*** %3
%6 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%7 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = load %struct.TYPE_4__**, %struct.TYPE_4__*** %4
%10 = load %struct.TYPE_4__*, %struct.TYPE_4__** %9
%11 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @strcoll(i32 %8, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i32 }
define i32 @ftscompare(%struct.TYPE_4__** nocapture %0, %struct.TYPE_4__** nocapture %1) {
%3 = load %struct.TYPE_4__*, %struct.TYPE_4__** %0
%4 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i64 0, i32 0
%5 = load i32, i32* %4
%6 = load %struct.TYPE_4__*, %struct.TYPE_4__** %1
%7 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %6, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @strcoll(i32 %5, i32 %8)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a;
  a = 256;
  while (a++ < 512)
    printf("a = %d\n", a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x100,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x200,%eax
jge    1150 <main+0x40>
mov    -0x8(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x101,%ebx
lea    0xee0(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x201,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"a = %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 257, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 513
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
long long strtoll(char *, char **, int);
int convert_num(char *str, long long int *num) {
  *num = strtoll(str, &str, 10);
  if (*str) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<convert_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtoll@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1155 <convert_num+0x45>
movl   $0x0,-0x4(%rbp)
jmp    115c <convert_num+0x4c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_num>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    $0xa,%edx
call   1030 <strtoll@plt>
mov    %rax,(%rbx)
mov    0x8(%rsp),%rcx
xor    %eax,%eax
cmpb   $0x0,(%rcx)
sete   %al
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @convert_num(i8* %0, i64* nocapture writeonly %1) {
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i64 @strtoll(i8* %0, i8** %3, i32 10)
store i64 %4, i64* %1
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
int can_print_from_freq_coll_turbo(struct reg_dmn_freq_band *freq_coll) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.reg_dmn_freq_band = type opaque
define i32 @can_print_from_freq_coll_turbo(%struct.reg_dmn_freq_band* %0) {
%2 = alloca %struct.reg_dmn_freq_band*
store %struct.reg_dmn_freq_band* %0, %struct.reg_dmn_freq_band** %2
ret i32 0
}

LLVM IR (-O2):
%struct.reg_dmn_freq_band = type opaque
define i32 @can_print_from_freq_coll_turbo(%struct.reg_dmn_freq_band* nocapture readnone %0) {
ret i32 0
}
int kkk() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @kkk() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int pthread_self();
int /*<<< orphan*/ sleep(int);
void *thread_start(void *arg) {
  int my_id = pthread_self();
  printf("Thread #%d is starting execution...\n", my_id);
  sleep(1);
  printf("Thread #%d is executing...\n", my_id);
  sleep(1);
  printf("Thread #%d is finishing...\n", my_id);
  return NULL;
}


x86 assembly (clang, -O0):
<thread_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    -0xc(%rbp),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    -0xc(%rbp),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_start>:
push   %rbx
xor    %eax,%eax
call   1040 <pthread_self@plt>
mov    %eax,%ebx
lea    0xebf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
lea    0xecc(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
lea    0xed0(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Thread #%d is starting execution...\0A\00"
@.str.1 = [28 x i8] c"Thread #%d is executing...\0A\00"
@.str.2 = [28 x i8] c"Thread #%d is finishing...\0A\00"
define i8* @thread_start(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 (...) @pthread_self()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @sleep(i32 1)
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = call i32 @sleep(i32 1)
%11 = load i32, i32* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %11)
ret i8* null
}

LLVM IR (-O2):
@.str = [37 x i8] c"Thread #%d is starting execution...\0A\00"
@.str.1 = [28 x i8] c"Thread #%d is executing...\0A\00"
@.str.2 = [28 x i8] c"Thread #%d is finishing...\0A\00"
define noalias i8* @thread_start(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @sleep(i32 1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%6 = tail call i32 @sleep(i32 1)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %2)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ test_python_comment();
int /*<<< orphan*/ test_python_comment_entities();
int /*<<< orphan*/ test_python_doc_string();
int /*<<< orphan*/ test_python_strings();
void all_python_tests() {
  test_python_comment();
  test_python_doc_string();
  test_python_strings();
  test_python_comment_entities();
}


x86 assembly (clang, -O0):
<all_python_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <test_python_comment@plt>
mov    $0x0,%al
call   1050 <test_python_doc_string@plt>
mov    $0x0,%al
call   1030 <test_python_strings@plt>
mov    $0x0,%al
call   1040 <test_python_comment_entities@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_python_tests>:
push   %rax
xor    %eax,%eax
call   1060 <test_python_comment@plt>
xor    %eax,%eax
call   1050 <test_python_doc_string@plt>
xor    %eax,%eax
call   1030 <test_python_strings@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <test_python_comment_entities@plt>

LLVM IR (-O0):
define void @all_python_tests() {
%1 = call i32 (...) @test_python_comment()
%2 = call i32 (...) @test_python_doc_string()
%3 = call i32 (...) @test_python_strings()
%4 = call i32 (...) @test_python_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_python_tests() {
%1 = tail call i32 (...) @test_python_comment()
%2 = tail call i32 (...) @test_python_doc_string()
%3 = tail call i32 (...) @test_python_strings()
%4 = tail call i32 (...) @test_python_comment_entities()
ret void
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_add_before(struct list_head *, struct list_head *);
int /*<<< orphan*/ list_del(struct list_head *);
void list_move_tail(struct list_head *head, struct list_head *list) {
  list_del(list);
  list_add_before(head, list);
}


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

x86 assembly (clang, -O2):
<list_move_tail>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <list_del@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <list_add_before@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_move_tail(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %4
%6 = call i32 @list_del(%struct.list_head* %5)
%7 = load %struct.list_head*, %struct.list_head** %3
%8 = load %struct.list_head*, %struct.list_head** %4
%9 = call i32 @list_add_before(%struct.list_head* %7, %struct.list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_move_tail(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @list_del(%struct.list_head* %1)
%4 = tail call i32 @list_add_before(%struct.list_head* %0, %struct.list_head* %1)
ret void
}
int hash(char *sname) {
  int c, h;
  h = *sname;
  while ((c = *(++sname)))
    h = (h << 1) + c;
  return (h & 1023);
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl 0x1(%rax),%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1142 <hash+0x42>
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <hash+0x12>
mov    -0x10(%rbp),%eax
and    $0x3ff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
movsbl (%rdi),%eax
mov    0x1(%rdi),%cl
test   %cl,%cl
je     1121 <hash+0x21>
add    $0x2,%rdi
xchg   %ax,%ax
movsbl %cl,%ecx
lea    (%rcx,%rax,2),%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
and    $0x3ff,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %17, label %7
7: ; preds = %1, %7
%8 = phi i8 [ %15, %7 ], [ %5, %1 ]
%9 = phi i8* [ %14, %7 ], [ %4, %1 ]
%10 = phi i32 [ %13, %7 ], [ %3, %1 ]
%11 = sext i8 %8 to i32
%12 = shl i32 %10, 1
%13 = add nsw i32 %12, %11
%14 = getelementptr inbounds i8, i8* %9, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %7
17: ; preds = %7, %1
%18 = phi i32 [ %3, %1 ], [ %13, %7 ]
%19 = and i32 %18, 1023
ret i32 %19
}
int main() {
  int a, b, c;
  a = 6 * 4;
  b = a * 3 - 9;
  c = a / b;
  if (a > b) {
    a = 8;
  } else if (a < c) {
    b = 6;
  } else if (b > c) {
    c = 9;
  } else {
    a = b + c;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x18,-0x8(%rbp)
imul   $0x3,-0x8(%rbp),%eax
sub    $0x9,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113e <main+0x3e>
movl   $0x8,-0x8(%rbp)
jmp    1181 <main+0x81>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1156 <main+0x56>
movl   $0x6,-0xc(%rbp)
jmp    117c <main+0x7c>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    116e <main+0x6e>
movl   $0x9,-0x10(%rbp)
jmp    1177 <main+0x77>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    117c <main+0x7c>
jmp    1181 <main+0x81>
mov    -0x4(%rbp),%eax
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 i32
store i32 0, i32* %1
store i32 24, i32* %2
%5 = load i32, i32* %2
%6 = mul nsw i32 %5, 3
%7 = sub nsw i32 %6, 9
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = sdiv i32 %8, %9
store i32 %10, i32* %4
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = icmp sgt i32 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %0
store i32 8, i32* %2
br label %31
15: ; preds = %0
%16 = load i32, i32* %2
%17 = load i32, i32* %4
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %20
19: ; preds = %15
store i32 6, i32* %3
br label %30
20: ; preds = %15
%21 = load i32, i32* %3
%22 = load i32, i32* %4
%23 = icmp sgt i32 %21, %22
br i1 %23, label %24, label %25
24: ; preds = %20
store i32 9, i32* %4
br label %29
25: ; preds = %20
%26 = load i32, i32* %3
%27 = load i32, i32* %4
%28 = add nsw i32 %26, %27
store i32 %28, i32* %2
br label %29
29: ; preds = %25, %24
br label %30
30: ; preds = %29, %19
br label %31
31: ; preds = %30, %14
%32 = load i32, i32* %1
ret i32 %32
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void strplustospace(char *str) {
  register int x;
  for (x = 0; str[x]; x++)
    if (str[x] == '+')
      str[x] = ' ';
}


x86 assembly (clang, -O0):
<strplustospace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1155 <strplustospace+0x55>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2b,%eax
jne    1142 <strplustospace+0x42>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
jmp    1147 <strplustospace+0x47>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strplustospace+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strplustospace>:
jmp    1117 <strplustospace+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x20,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x2b,%al
je     1110 <strplustospace+0x10>
test   %al,%al
jne    1113 <strplustospace+0x13>
ret

LLVM IR (-O0):
define void @strplustospace(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %25, %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 = icmp ne i8 %9, 0
br i1 %10, label %11, label %28
11: ; preds = %4
%12 = load i8*, i8** %2
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 43
br i1 %18, label %19, label %24
19: ; preds = %11
%20 = load i8*, i8** %2
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
store i8 32, i8* %23
br label %24
24: ; preds = %19, %11
br label %25
25: ; preds = %24
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %4
28: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @strplustospace(i8* nocapture %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i64 [ %8, %7 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %7 [
i8 0, label %9
i8 43, label %6
]
6: ; preds = %2
store i8 32, i8* %4
br label %7
7: ; preds = %2, %6
%8 = add nuw i64 %3, 1
br label %2
9: ; preds = %2
ret void
}
/* Variables and functions */
char *strrchr(char *, char);
char *t9(void) { return strrchr("hello, world", 'w'); }


x86 assembly (clang, -O0):
<t9>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x77,%esi
call   1030 <strrchr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t9>:
lea    0xf00(%rip),%rax
ret

LLVM IR (-O0):
@.str = [13 x i8] c"hello, world\00"
define i8* @t9() {
%1 = call i8* @strrchr(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8 signext 119)
ret i8* %1
}

LLVM IR (-O2):
@.str = [13 x i8] c"hello, world\00"
define i8* @t9() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 7)
}
int test_imm_A5uint32_reg(unsigned int val) {
  return ((val) & (0xA5 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A5uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xa5,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A5uint32_reg>:
test   $0xa5,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A5uint32_reg(i32 %0) {
%2 = and i32 %0, 165
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ write_src(char *);
void pow_handler(void) {
  write_src("{\n");
  write_src("imm_t pow = POP();\n");
  write_src("imm_t base = POP();\n");
  write_src("PUSH(eval_exp(base, pow));\n");
  write_src("}\n");
}


x86 assembly (clang, -O0):
<pow_handler>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <write_src@plt>
lea    0xedc(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee4(%rip),%rdi
call   1030 <write_src@plt>
lea    0xeed(%rip),%rdi
call   1030 <write_src@plt>
lea    0xefd(%rip),%rdi
call   1030 <write_src@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow_handler>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <write_src@plt>
lea    0xedf(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee7(%rip),%rdi
call   1030 <write_src@plt>
lea    0xef0(%rip),%rdi
call   1030 <write_src@plt>
lea    0xf00(%rip),%rdi
pop    %rax
jmp    1030 <write_src@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"{\0A\00"
@.str.1 = [20 x i8] c"imm_t pow = POP();\0A\00"
@.str.2 = [21 x i8] c"imm_t base = POP();\0A\00"
@.str.3 = [28 x i8] c"PUSH(eval_exp(base, pow));\0A\00"
@.str.4 = [3 x i8] c"}\0A\00"
define void @pow_handler() {
%1 = call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @write_src(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @write_src(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @write_src(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"{\0A\00"
@.str.1 = [20 x i8] c"imm_t pow = POP();\0A\00"
@.str.2 = [21 x i8] c"imm_t base = POP();\0A\00"
@.str.3 = [28 x i8] c"PUSH(eval_exp(base, pow));\0A\00"
@.str.4 = [3 x i8] c"}\0A\00"
define void @pow_handler() {
%1 = tail call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @write_src(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @write_src(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @write_src(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[], char *env[]) {
  int i = 0;
  while (env[i])
    puts(env[i++]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1164 <main+0x54>
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x1c(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <puts@plt>
jmp    1131 <main+0x21>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    (%rdx),%rdi
test   %rdi,%rdi
je     1131 <main+0x21>
mov    %rdx,%rbx
add    $0x8,%rbx
call   1030 <puts@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture %2) {
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %14, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %9, %6 ], [ 0, %3 ]
%8 = phi i8* [ %12, %6 ], [ %4, %3 ]
%9 = add nuw i64 %7, 1
%10 = tail call i32 @puts(i8* %8)
%11 = getelementptr inbounds i8*, i8** %2, i64 %9
%12 = load i8*, i8** %11
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %6
14: ; preds = %6, %3
ret i32 0
}
/* Variables and functions */
unsigned char inb(unsigned int);
unsigned char INPORT8(unsigned idx) { return inb(idx); }


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

x86 assembly (clang, -O2):
<INPORT8>:
jmp    1030 <inb@plt>

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

LLVM IR (-O2):
define zeroext i8 @INPORT8(i32 %0) {
%2 = tail call zeroext i8 @inb(i32 %0)
ret i8 %2
}
int llz_clip_int(int a, int amin, int amax) {
  if (a < amin)
    return amin;
  else if (a > amax)
    return amax;
  else
    return a;
}


x86 assembly (clang, -O0):
<llz_clip_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1124 <llz_clip_int+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <llz_clip_int+0x41>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    113b <llz_clip_int+0x3b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <llz_clip_int+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<llz_clip_int>:
mov    %edx,%eax
cmp    %edx,%edi
cmovle %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @llz_clip_int(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%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 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load i32, i32* %6
store i32 %12, i32* %4
br label %21
13: ; preds = %3
%14 = load i32, i32* %5
%15 = load i32, i32* %7
%16 = icmp sgt i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load i32, i32* %7
store i32 %18, i32* %4
br label %21
19: ; preds = %13
%20 = load i32, i32* %5
store i32 %20, i32* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
define i32 @llz_clip_int(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
char *strerror(int /*<<< orphan*/);
void s_error(char *msg) {
  printf("ERROR: %s\n", strerror(errno));
  if (msg != NULL)
    printf("user message:%s\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<s_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %rax,%rsi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
cmpq   $0x0,-0x8(%rbp)
je     1174 <s_error+0x44>
mov    -0x8(%rbp),%rsi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<s_error>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeb7(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
test   %rbx,%rbx
je     1165 <s_error+0x35>
lea    0xeae(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"ERROR: %s\0A\00"
@errno = global i32 0
@.str.1 = [17 x i8] c"user message:%s\0A\00"
define void @s_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @errno
%4 = call i8* @strerror(i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %2
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %1
%12 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"ERROR: %s\0A\00"
@errno = global i32 0
@.str.1 = [17 x i8] c"user message:%s\0A\00"
define void @s_error(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i8* @strerror(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = icmp eq i8* %0, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %6, %1
%9 = tail call i32 @exit(i32 1)
unreachable
}