xunge/DecIR huggingface dataset:
int select_col1_by_row(int row) { return 9 * 9 + row / (9 * 9) * 9 + row % 9; }


x86 assembly (clang, -O0):
<select_col1_by_row>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x51,%ecx
cltd
idiv   %ecx
imul   $0x9,%eax,%eax
add    $0x51,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%eax
add    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<select_col1_by_row>:
movslq %edi,%rax
imul   $0x1948b0fd,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,8),%ecx
imul   $0x38e38e39,%rax,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x21,%rdx
add    %esi,%edx
lea    (%rdx,%rdx,8),%edx
sub    %edx,%eax
add    %ecx,%eax
add    $0x51,%eax
ret

LLVM IR (-O0):
define i32 @select_col1_by_row(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 81
%5 = mul nsw i32 %4, 9
%6 = add nsw i32 81, %5
%7 = load i32, i32* %2
%8 = srem i32 %7, 9
%9 = add nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @select_col1_by_row(i32 %0) {
%2 = sdiv i32 %0, 81
%3 = mul nsw i32 %2, 9
%4 = srem i32 %0, 9
%5 = add nsw i32 %4, 81
%6 = add nsw i32 %5, %3
ret i32 %6
}
void consume_tdata(void *arg) { (void)arg; }


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

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

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

LLVM IR (-O2):
define void @consume_tdata(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main() {
  int i = 0;
loop:
  printf("%d\n", i++);
  if (i == 5) {
    goto break_loop;
  }
  goto loop;
break_loop:
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x5,-0x8(%rbp)
jne    114c <main+0x3c>
jmp    1151 <main+0x41>
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
/* Type definitions */
struct eembed_log {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ eembed_sprintf_append(struct eembed_log *, char *,
                                         void const *);
void eembed_sprintf_append_vp(struct eembed_log *log, const void *ptr) {
  eembed_sprintf_append(log, "%p", ptr);
}


x86 assembly (clang, -O0):
<eembed_sprintf_append_vp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rsi
call   1030 <eembed_sprintf_append@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eembed_sprintf_append_vp>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <eembed_sprintf_append@plt>

LLVM IR (-O0):
%struct.eembed_log = type { i32 }
@.str = [3 x i8] c"%p\00"
define void @eembed_sprintf_append_vp(%struct.eembed_log* %0, i8* %1) {
%3 = alloca %struct.eembed_log*
%4 = alloca i8*
store %struct.eembed_log* %0, %struct.eembed_log** %3
store i8* %1, i8** %4
%5 = load %struct.eembed_log*, %struct.eembed_log** %3
%6 = load i8*, i8** %4
%7 = call i32 @eembed_sprintf_append(%struct.eembed_log* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
%struct.eembed_log = type { i32 }
@.str = [3 x i8] c"%p\00"
define void @eembed_sprintf_append_vp(%struct.eembed_log* %0, i8* %1) {
%3 = tail call i32 @eembed_sprintf_append(%struct.eembed_log* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_91() {
  Assert_real((isqrt(91) == 9),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              460, ("Integer square root of 91 should be 9"));
}


x86 assembly (clang, -O0):
<t_sqrt_91>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5b,%edi
call   1030 <isqrt@plt>
cmp    $0x9,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x1cc,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_91>:
push   %rax
mov    $0x5b,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x9,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x1cc,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 91 should be 9\00"
define void @t_sqrt_91() {
%1 = call i32 @isqrt(i32 91)
%2 = icmp eq i32 %1, 9
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 460, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 91 should be 9\00"
define void @t_sqrt_91() {
%1 = tail call i32 @isqrt(i32 91)
%2 = icmp eq i32 %1, 9
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 460, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int tst_persist_entry(int, char **);
int main(int argc, char **argv) { return tst_persist_entry(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <tst_persist_entry@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @tst_persist_entry(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *program_name) {
  printf("Usage: %s [input.flv]\n", program_name);
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Usage: %s [input.flv]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [23 x i8] c"Usage: %s [input.flv]\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
const char *dyad_intToStr(int x) {
  static char buf[64];
  sprintf(buf, "%d", x);
  return buf;
}


x86 assembly (clang, -O0):
<dyad_intToStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0x2f1b(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2f08(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dyad_intToStr>:
push   %rbx
mov    %edi,%edx
lea    0x2f26(%rip),%rbx
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@dyad_intToStr.buf = internal global [64 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @dyad_intToStr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @dyad_intToStr.buf, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @dyad_intToStr.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@dyad_intToStr.buf = internal global [64 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @dyad_intToStr(i32 %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @dyad_intToStr.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @dyad_intToStr.buf, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ initialize();
int /*<<< orphan*/ pre_initialize();
int /*<<< orphan*/ process_args(int, char **);
int send_files();
int main(int argc, char *argv[]) {
  int rval;
  pre_initialize();
  process_args(argc, argv);
  initialize();
  rval = send_files();
  return rval;
}


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    $0x0,%al
call   1040 <pre_initialize@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <process_args@plt>
mov    $0x0,%al
call   1050 <initialize@plt>
mov    $0x0,%al
call   1030 <send_files@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <pre_initialize@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1060 <process_args@plt>
xor    %eax,%eax
call   1050 <initialize@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <send_files@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @pre_initialize()
%8 = load i32, i32* %4
%9 = load i8**, i8*** %5
%10 = call i32 @process_args(i32 %8, i8** %9)
%11 = call i32 (...) @initialize()
%12 = call i32 (...) @send_files()
store i32 %12, i32* %6
%13 = load i32, i32* %6
ret i32 %13
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (...) @pre_initialize()
%4 = tail call i32 @process_args(i32 %0, i8** %1)
%5 = tail call i32 (...) @initialize()
%6 = tail call i32 (...) @send_files()
ret i32 %6
}
/* Variables and functions */
int guess_delay();
int /*<<< orphan*/ usleep(int);
void nap(void) {
  static int delay;
  if (!delay)
    delay = guess_delay();
  usleep(delay);
}


x86 assembly (clang, -O0):
<nap>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f09(%rip)
jne    113e <nap+0x1e>
mov    $0x0,%al
call   1030 <guess_delay@plt>
mov    %eax,0x2ef6(%rip)
mov    0x2ef0(%rip),%edi
call   1040 <usleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nap>:
push   %rax
mov    0x2f0d(%rip),%edi
test   %edi,%edi
je     1131 <nap+0x11>
pop    %rax
jmp    1040 <usleep@plt>
xor    %eax,%eax
call   1030 <guess_delay@plt>
mov    %eax,%edi
mov    %eax,0x2ef4(%rip)
pop    %rax
jmp    1040 <usleep@plt>

LLVM IR (-O0):
@nap.delay = internal global i32 0
define void @nap() {
%1 = load i32, i32* @nap.delay
%2 = icmp ne i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = call i32 (...) @guess_delay()
store i32 %4, i32* @nap.delay
br label %5
5: ; preds = %3, %0
%6 = load i32, i32* @nap.delay
%7 = call i32 @usleep(i32 %6)
ret void
}

LLVM IR (-O2):
@nap.delay = internal unnamed_addr global i32 0
define void @nap() {
%1 = load i32, i32* @nap.delay
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @guess_delay()
store i32 %4, i32* @nap.delay
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ %4, %3 ], [ %1, %0 ]
%7 = tail call i32 @usleep(i32 %6)
ret void
}
double mult2_1(double a, double b) { return a * b; }


x86 assembly (clang, -O0):
<mult2_1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mult2_1>:
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @mult2_1(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fmul double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @mult2_1(double %0, double %1) {
%3 = fmul double %0, %1
ret double %3
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ __stdfix_sat_ur(scalar_t__);
uint32_t __stdfix_sadd_ur(uint32_t x, uint32_t y) {
  return (__stdfix_sat_ur((uint32_t)x + (uint32_t)y));
}


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

x86 assembly (clang, -O2):
<__stdfix_sadd_ur>:
add    %rsi,%rdi
jmp    1030 <__stdfix_sat_ur@plt>

LLVM IR (-O0):
define i64 @__stdfix_sadd_ur(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = add nsw i64 %5, %6
%8 = call i64 @__stdfix_sat_ur(i64 %7)
ret i64 %8
}

LLVM IR (-O2):
define i64 @__stdfix_sadd_ur(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
%4 = tail call i64 @__stdfix_sat_ur(i64 %3)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ write(char *);
void print_star() { write("*"); }


x86 assembly (clang, -O0):
<print_star>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_star>:
lea    0xee9(%rip),%rdi
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"*\00"
define void @print_star() {
%1 = call i32 @write(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"*\00"
define void @print_star() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void __wleu16(uint8_t *buffer, uint16_t value) {
  buffer[1] = (uint8_t)(value >> 8) & 0xFF;
  buffer[0] = (uint8_t)(value >> 0) & 0xFF;
}


x86 assembly (clang, -O0):
<__wleu16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x0,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wleu16>:
mov    %esi,%eax
movzbl %ah,%ecx
mov    %ecx,0x4(%rdi)
movzbl %al,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @__wleu16(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 8
%7 = and i32 %6, 255
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 1
store i32 %7, i32* %9
%10 = load i32, i32* %4
%11 = ashr i32 %10, 0
%12 = and i32 %11, 255
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 0
store i32 %12, i32* %14
ret void
}

LLVM IR (-O2):
define void @__wleu16(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = and i32 %3, 255
%5 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %4, i32* %5
%6 = and i32 %1, 255
store i32 %6, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hoic_sw(int, int);
int hdoip_cli_vrb_pause(int fd, int fdr, char **argv, int argc) {
  hoic_sw(fd, (0x31000011));
  return 0;
}


x86 assembly (clang, -O0):
<hdoip_cli_vrb_pause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x31000011,%esi
call   1030 <hoic_sw@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hdoip_cli_vrb_pause>:
push   %rax
mov    $0x31000011,%esi
call   1030 <hoic_sw@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @hdoip_cli_vrb_pause(i32 %0, i32 %1, i8** %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = call i32 @hoic_sw(i32 %9, i32 822083601)
ret i32 0
}

LLVM IR (-O2):
define i32 @hdoip_cli_vrb_pause(i32 %0, i32 %1, i8** nocapture readnone %2, i32 %3) {
%5 = tail call i32 @hoic_sw(i32 %0, i32 822083601)
ret i32 0
}
/* Variables and functions */
char *libirc_colorparser_irc2code(char const *, int /*<<< orphan*/);
char *irc_color_convert_from_mirc(const char *message) {
  return libirc_colorparser_irc2code(message, 0);
}


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

x86 assembly (clang, -O2):
<irc_color_convert_from_mirc>:
xor    %esi,%esi
jmp    1030 <libirc_colorparser_irc2code@plt>

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

LLVM IR (-O2):
define i8* @irc_color_convert_from_mirc(i8* %0) {
%2 = tail call i8* @libirc_colorparser_irc2code(i8* %0, i32 0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ list_integers();
int main() {
  list_integers();
  return 0;
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @timer_init() {
ret void
}
unsigned char check_range_di(int start, int end) { return 1; }


x86 assembly (clang, -O0):
<check_range_di>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i8 @check_range_di(i32 %0, i32 %1) {
ret i8 1
}
/* Variables and functions */
int /*<<< orphan*/ g0(int, int, int);
void f0() { g0(1, 2, 3); }


x86 assembly (clang, -O0):
<f0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <g0@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f0>:
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
jmp    1030 <g0@plt>

LLVM IR (-O0):
define void @f0() {
%1 = call i32 @g0(i32 1, i32 2, i32 3)
ret void
}

LLVM IR (-O2):
define void @f0() {
%1 = tail call i32 @g0(i32 1, i32 2, i32 3)
ret void
}
unsigned int mul_hi(unsigned int x, unsigned int y) {
  unsigned long long xx = x;
  xx *= y;
  return (unsigned int)(xx >> 32);
}


x86 assembly (clang, -O0):
<mul_hi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x20,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul_hi>:
mov    %edi,%ecx
mov    %esi,%eax
imul   %rcx,%rax
shr    $0x20,%rax
ret

LLVM IR (-O0):
define i32 @mul_hi(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = zext i32 %6 to i64
store i64 %7, i64* %5
%8 = load i32, i32* %4
%9 = zext i32 %8 to i64
%10 = load i64, i64* %5
%11 = mul i64 %10, %9
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = lshr i64 %12, 32
%14 = trunc i64 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @mul_hi(i32 %0, i32 %1) {
%3 = zext i32 %0 to i64
%4 = zext i32 %1 to i64
%5 = mul nuw i64 %4, %3
%6 = lshr i64 %5, 32
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Variables and functions */
char const *findJsonBeginning(char const *);
char *findJsonEnd(char const *);
const char *findSecondJson(const char *data) {
  data = findJsonBeginning(data);
  if (!data)
    return NULL;
  data = findJsonEnd(data);
  if (!data)
    return NULL;
  return findJsonBeginning(data);
}


x86 assembly (clang, -O0):
<findSecondJson>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <findJsonBeginning@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1151 <findSecondJson+0x31>
movq   $0x0,-0x8(%rbp)
jmp    1183 <findSecondJson+0x63>
mov    -0x10(%rbp),%rdi
call   1030 <findJsonEnd@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1176 <findSecondJson+0x56>
movq   $0x0,-0x8(%rbp)
jmp    1183 <findSecondJson+0x63>
mov    -0x10(%rbp),%rdi
call   1040 <findJsonBeginning@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findSecondJson>:
push   %rax
call   1040 <findJsonBeginning@plt>
test   %rax,%rax
je     1141 <findSecondJson+0x21>
mov    %rax,%rdi
call   1030 <findJsonEnd@plt>
test   %rax,%rax
je     1141 <findSecondJson+0x21>
mov    %rax,%rdi
pop    %rax
jmp    1040 <findJsonBeginning@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @findSecondJson(i8* %0) {
%2 = tail call i8* @findJsonBeginning(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i8* @findJsonEnd(i8* %2)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i8* @findJsonBeginning(i8* %5)
br label %9
9: ; preds = %4, %1, %7
%10 = phi i8* [ %8, %7 ], [ null, %1 ], [ null, %4 ]
ret i8* %10
}
void I2C4_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<I2C4_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <I2C4_Handler+0x9>
jmp    1109 <I2C4_Handler+0x9>

x86 assembly (clang, -O2):
<I2C4_Handler>:
jmp    1100 <I2C4_Handler>

LLVM IR (-O0):
define void @I2C4_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @I2C4_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void LOAD_OP(int I, uint32_t *W, const uint8_t *input) {
  W[I] = (((uint32_t *)(input))[I]);
}


x86 assembly (clang, -O0):
<LOAD_OP>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<LOAD_OP>:
movslq %edi,%rax
mov    (%rdx,%rax,4),%ecx
mov    %ecx,(%rsi,%rax,4)
ret

LLVM IR (-O0):
define void @LOAD_OP(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %6
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
%11 = load i32, i32* %10
%12 = load i32*, i32** %5
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
store i32 %11, i32* %15
ret void
}

LLVM IR (-O2):
define void @LOAD_OP(i32 %0, i32* nocapture writeonly %1, i32* nocapture %2) {
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds i32, i32* %2, i64 %4
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %1, i64 %4
store i32 %6, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_error(char *);
void listfileerr(int code) {
  if (code == 1)
    write_error("Error loading filter list file");
  else
    write_error("Error writing filter list file");
}


x86 assembly (clang, -O0):
<listfileerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1136 <listfileerr+0x26>
lea    0xed4(%rip),%rdi
call   1030 <write_error@plt>
jmp    1142 <listfileerr+0x32>
lea    0xee2(%rip),%rdi
call   1030 <write_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<listfileerr>:
cmp    $0x1,%edi
lea    0xee6(%rip),%rax
lea    0xefe(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <write_error@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Error loading filter list file\00"
@.str.1 = [31 x i8] c"Error writing filter list file\00"
define void @listfileerr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @write_error(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = call i32 @write_error(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"Error loading filter list file\00"
@.str.1 = [31 x i8] c"Error writing filter list file\00"
define void @listfileerr(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @write_error(i8* %3)
ret void
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strdup(const char *str) {
  char *res = malloc(strlen(str) + 1);
  strcpy(res, str);
  return res;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Type definitions */
struct rmDsummary {
  int dummy;
};
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cctools_list_first_item(struct list *);
struct rmDsummary *cctools_list_next_item(struct list *);
int /*<<< orphan*/ denormalize_summary(struct rmDsummary *);
void denormalize_summaries(struct list *summaries) {
  struct rmDsummary *s;
  cctools_list_first_item(summaries);
  while ((s = cctools_list_next_item(summaries)))
    denormalize_summary(s);
}


x86 assembly (clang, -O0):
<denormalize_summaries>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <cctools_list_first_item@plt>
mov    -0x8(%rbp),%rdi
call   1030 <cctools_list_next_item@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     116a <denormalize_summaries+0x3a>
mov    -0x10(%rbp),%rdi
call   1040 <denormalize_summary@plt>
jmp    1145 <denormalize_summaries+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<denormalize_summaries>:
push   %rbx
mov    %rdi,%rbx
call   1050 <cctools_list_first_item@plt>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <cctools_list_next_item@plt>
test   %rax,%rax
je     1157 <denormalize_summaries+0x27>
mov    %rax,%rdi
call   1040 <denormalize_summary@plt>
jmp    1140 <denormalize_summaries+0x10>
pop    %rbx
ret

LLVM IR (-O0):
%struct.list = type { i32 }
%struct.rmDsummary = type { i32 }
define void @denormalize_summaries(%struct.list* %0) {
%2 = alloca %struct.list*
%3 = alloca %struct.rmDsummary*
store %struct.list* %0, %struct.list** %2
%4 = load %struct.list*, %struct.list** %2
%5 = call i32 @cctools_list_first_item(%struct.list* %4)
br label %6
6: ; preds = %10, %1
%7 = load %struct.list*, %struct.list** %2
%8 = call %struct.rmDsummary* @cctools_list_next_item(%struct.list* %7)
store %struct.rmDsummary* %8, %struct.rmDsummary** %3
%9 = icmp ne %struct.rmDsummary* %8, null
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load %struct.rmDsummary*, %struct.rmDsummary** %3
%12 = call i32 @denormalize_summary(%struct.rmDsummary* %11)
br label %6
13: ; preds = %6
ret void
}

LLVM IR (-O2):
%struct.list = type { i32 }
%struct.rmDsummary = type { i32 }
define void @denormalize_summaries(%struct.list* %0) {
%2 = tail call i32 @cctools_list_first_item(%struct.list* %0)
%3 = tail call %struct.rmDsummary* @cctools_list_next_item(%struct.list* %0)
%4 = icmp eq %struct.rmDsummary* %3, null
br i1 %4, label %10, label %5
5: ; preds = %1, %5
%6 = phi %struct.rmDsummary* [ %8, %5 ], [ %3, %1 ]
%7 = tail call i32 @denormalize_summary(%struct.rmDsummary* %6)
%8 = tail call %struct.rmDsummary* @cctools_list_next_item(%struct.list* %0)
%9 = icmp eq %struct.rmDsummary* %8, null
br i1 %9, label %10, label %5
10: ; preds = %5, %1
ret void
}
int fstat(int file, struct stat *st) {}


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

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

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

LLVM IR (-O2):
%struct.stat = type opaque
define i32 @fstat(i32 %0, %struct.stat* nocapture readnone %1) {
ret i32 undef
}
int main(void) {
  int a = 0;
  int *c;
  char b = (char)(a == 0 ? &a : c);
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1129 <main+0x29>
lea    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1131 <main+0x31>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %al,-0x11(%rbp)
mov    -0x8(%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 i8
store i32 0, i32* %1
store i32 0, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
br label %10
8: ; preds = %0
%9 = load i32*, i32** %3
br label %10
10: ; preds = %8, %7
%11 = phi i32* [ %2, %7 ], [ %9, %8 ]
%12 = ptrtoint i32* %11 to i8
store i8 %12, i8* %4
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRC0_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRC0_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRC0_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage:\n"
                  "   syslog-postprocess [-f syslogd.ini] syslog.txt\n");
  exit(1);
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [58 x i8] c"usage:\0A syslog-postprocess [-f syslogd.ini] syslog.txt\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct pci_dev {
  int dummy;
};

/* Variables and functions */
int EINVAL;
int pci_aer_clear_nonfatal_status(struct pci_dev *dev) { return -EINVAL; }


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

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

LLVM IR (-O0):
%struct.pci_dev = type { i32 }
@EINVAL = global i32 0
define i32 @pci_aer_clear_nonfatal_status(%struct.pci_dev* %0) {
%2 = alloca %struct.pci_dev*
store %struct.pci_dev* %0, %struct.pci_dev** %2
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
%struct.pci_dev = type { i32 }
@EINVAL = global i32 0
define i32 @pci_aer_clear_nonfatal_status(%struct.pci_dev* nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
%3 = sub nsw i32 0, %2
ret i32 %3
}
int sequencer(int count, int max) { return count; }


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

x86 assembly (clang, -O2):
<sequencer>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @sequencer(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
ret i32 %5
}

LLVM IR (-O2):
define i32 @sequencer(i32 returned %0, i32 %1) {
ret i32 %0
}
int test_imm_D3uint32_reg(unsigned int val) {
  return ((val) & (0xD3 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D3uint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 211
%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_D3uint32_reg(i32 %0) {
%2 = and i32 %0, 211
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct SN_env {
  int dummy;
};

/* Variables and functions */
struct SN_env *SN_create_env(int /*<<< orphan*/, int, int /*<<< orphan*/);
extern struct SN_env *spanish_UTF_8_create_env(void) {
  return SN_create_env(0, 3, 0);
}


x86 assembly (clang, -O0):
<spanish_UTF_8_create_env>:
push   %rbp
mov    %rsp,%rbp
xor    %edx,%edx
mov    $0x3,%esi
mov    %edx,%edi
call   1030 <SN_create_env@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<spanish_UTF_8_create_env>:
xor    %edi,%edi
mov    $0x3,%esi
xor    %edx,%edx
jmp    1030 <SN_create_env@plt>

LLVM IR (-O0):
%struct.SN_env = type { i32 }
define %struct.SN_env* @spanish_UTF_8_create_env() {
%1 = call %struct.SN_env* @SN_create_env(i32 0, i32 3, i32 0)
ret %struct.SN_env* %1
}

LLVM IR (-O2):
%struct.SN_env = type { i32 }
define %struct.SN_env* @spanish_UTF_8_create_env() {
%1 = tail call %struct.SN_env* @SN_create_env(i32 0, i32 3, i32 0)
ret %struct.SN_env* %1
}
/* Variables and functions */
int frame1();
int main(void) { return frame1() - 1; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @frame1()
%2 = add nsw i32 %1, -1
ret i32 %2
}
double t20(double x) {
  register long double result;
  __asm __volatile("frndint" : "=t"(result) : "0"(x));
  return result;
}


x86 assembly (clang, -O0):
<t20>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
fldl   -0x8(%rbp)
frndint
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
fstpl  -0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<t20>:
movsd  %xmm0,-0x8(%rsp)
fldl   -0x8(%rsp)
frndint
fstpl  -0x10(%rsp)
movsd  -0x10(%rsp),%xmm0
ret

LLVM IR (-O0):
define double @t20(double %0) {
%2 = alloca double
%3 = alloca x86_fp80
store double %0, double* %2
%4 = load double, double* %2
%5 = fpext double %4 to x86_fp80
%6 = call x86_fp80 asm sideeffect "frndint", "={st},0,~{dirflag},~{fpsr},~{flags}"(x86_fp80 %5)
store x86_fp80 %6, x86_fp80* %3
%7 = load x86_fp80, x86_fp80* %3
%8 = fptrunc x86_fp80 %7 to double
ret double %8
}

LLVM IR (-O2):
define double @t20(double %0) {
%2 = fpext double %0 to x86_fp80
%3 = tail call x86_fp80 asm sideeffect "frndint", "={st},0,~{dirflag},~{fpsr},~{flags}"(x86_fp80 %2)
%4 = fptrunc x86_fp80 %3 to double
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
__attribute__((always_)) void __set_FPSCR(uint32_t fpscr) {}


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

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

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

LLVM IR (-O2):
define void @__set_FPSCR(i32 %0) {
ret void
}
struct node *firstel(struct node *head) {
  return head;
}


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

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

LLVM IR (-O0):
%struct.node = type opaque
define %struct.node* @firstel(%struct.node* %0) {
%2 = alloca %struct.node*
store %struct.node* %0, %struct.node** %2
%3 = load %struct.node*, %struct.node** %2
ret %struct.node* %3
}

LLVM IR (-O2):
%struct.node = type opaque
define %struct.node* @firstel(%struct.node* readnone returned %0) {
ret %struct.node* %0
}
void GB_ISEQ_f_FP64(double *z, const double *x, const double *y) {
  (*z) = ((*x) == (*y));
}


x86 assembly (clang, -O0):
<GB_ISEQ_f_FP64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GB_ISEQ_f_FP64>:
movsd  (%rdx),%xmm0
cmpeqsd (%rsi),%xmm0
movsd  0xeef(%rip),%xmm1
andpd  %xmm0,%xmm1
movlpd %xmm1,(%rdi)
ret

LLVM IR (-O0):
define void @GB_ISEQ_f_FP64(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %5
%8 = load double, double* %7
%9 = load double*, double** %6
%10 = load double, double* %9
%11 = fcmp oeq double %8, %10
%12 = zext i1 %11 to i32
%13 = sitofp i32 %12 to double
%14 = load double*, double** %4
store double %13, double* %14
ret void
}

LLVM IR (-O2):
define void @GB_ISEQ_f_FP64(double* nocapture writeonly %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %1
%5 = load double, double* %2
%6 = fcmp oeq double %4, %5
%7 = uitofp i1 %6 to double
store double %7, double* %0
ret void
}
int cambioINT(char a) {
  a = (int)(a - 48);
  return a;
}


x86 assembly (clang, -O0):
<cambioINT>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cambioINT>:
add    $0xd0,%dil
movsbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @cambioINT(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 48
%6 = trunc i32 %5 to i8
store i8 %6, i8* %2
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @cambioINT(i8 signext %0) {
%2 = add i8 %0, -48
%3 = sext i8 %2 to i32
ret i32 %3
}
/* Variables and functions */
int match_string(char const *, int, char const *);
int mg_match_string(const char *pattern, int pattern_len, const char *str) {
  if (!str || !pattern)
    return -1;
  return match_string(pattern, pattern_len, str);
}


x86 assembly (clang, -O0):
<mg_match_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1139 <mg_match_string+0x29>
cmpq   $0x0,-0x10(%rbp)
jne    1145 <mg_match_string+0x35>
movl   $0xffffffff,-0x4(%rbp)
jmp    1158 <mg_match_string+0x48>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1030 <match_string@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mg_match_string>:
test   %rdi,%rdi
je     111f <mg_match_string+0xf>
test   %rdx,%rdx
je     111f <mg_match_string+0xf>
jmp    1030 <match_string@plt>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @mg_match_string(i8* %0, i32 %1, i8* %2) {
%4 = icmp ne i8* %2, null
%5 = icmp ne i8* %0, null
%6 = and i1 %5, %4
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @match_string(i8* %0, i32 %1, i8* %2)
br label %9
9: ; preds = %3, %7
%10 = phi i32 [ %8, %7 ], [ -1, %3 ]
ret i32 %10
}