xunge/DecIR huggingface dataset:
int pass_move(int i, int j) { return i == -1 && j == -1; }


x86 assembly (clang, -O0):
<pass_move>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0xffffffff,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jne    1123 <pass_move+0x23>
cmpl   $0xffffffff,-0x8(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pass_move>:
and    %esi,%edi
xor    %eax,%eax
cmp    $0xffffffff,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @pass_move(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 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, -1
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @pass_move(i32 %0, i32 %1) {
%3 = and i32 %1, %0
%4 = icmp eq i32 %3, -1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int unlink(char const *);
int remove(const char *path) { return unlink(path); }


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

x86 assembly (clang, -O2):
<remove>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define i32 @remove(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret i32 %2
}
void multidim_arr2_Good() {
  int a[2][3];
  a[1][2] = 0;
}


x86 assembly (clang, -O0):
<multidim_arr2_Good>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @multidim_arr2_Good() {
%1 = alloca [2 x [3 x i32]]
%2 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %1, i64 0, i64 1
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
store i32 0, i32* %3
ret void
}

LLVM IR (-O2):
define void @multidim_arr2_Good() {
ret void
}
int test_imm_9Buint8_reg(unsigned char val) {
  return ((val) & (-0x9B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_9Buint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff65,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_9Buint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 101
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ __set_64bit(unsigned long long *, unsigned int,
                               unsigned int);
void __set_64bit_var(unsigned long long *ptr, unsigned long long value) {
  __set_64bit(ptr, *(((unsigned int *)&(value)) + 0),
              *(((unsigned int *)&(value)) + 1));
}


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

x86 assembly (clang, -O2):
<__set_64bit_var>:
mov    %rsi,%rdx
shr    $0x20,%rdx
jmp    1030 <__set_64bit@plt>

LLVM IR (-O0):
define void @__set_64bit_var(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 = bitcast i64* %4 to i32*
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = bitcast i64* %4 to i32*
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = call i32 @__set_64bit(i64* %5, i32 %8, i32 %11)
ret void
}

LLVM IR (-O2):
define void @__set_64bit_var(i64* %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = lshr i64 %1, 32
%5 = trunc i64 %4 to i32
%6 = tail call i32 @__set_64bit(i64* %0, i32 %3, i32 %5)
ret void
}
extern void libvampsdk_v_2_2_present(void) {}


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

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

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

LLVM IR (-O2):
define void @libvampsdk_v_2_2_present() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, int /*<<< orphan*/ *);
void post_user() { write("ganttproject.gan", " />\n", NULL); }


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

x86 assembly (clang, -O2):
<post_user>:
lea    0xee9(%rip),%rdi
lea    0xef3(%rip),%rsi
xor    %edx,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"ganttproject.gan\00"
@.str.1 = [5 x i8] c" />\0A\00"
define void @post_user() {
%1 = call i32 @write(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"ganttproject.gan\00"
@.str.1 = [5 x i8] c" />\0A\00"
define void @post_user() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int trio_vsprintf(char *, char const *, int /*<<< orphan*/);
int vsprintf(char *buffer, const char *format, va_list args) {
  return trio_vsprintf(buffer, format, args);
}


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

x86 assembly (clang, -O2):
<vsprintf>:
jmp    1030 <trio_vsprintf@plt>

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

LLVM IR (-O2):
define i32 @vsprintf(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @trio_vsprintf(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ execvp_test();
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  execvp_test();
  printf("hello,world");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <execvp_test@plt>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <execvp_test@plt>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"hello,world\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @execvp_test()
%7 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"hello,world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @execvp_test()
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
OP(fd, f8) {
  illegal_1();
  op_f8();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_f8@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_f8@plt>

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_f8()
ret i32 undef
}
void foo_2_1_2_2_1_2_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_2_2_1_2_2_2_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void sub_reg32_m32(int reg32, unsigned int *m32) {
  put8(0x2B);
  put8((reg32 << 3) | 5);
  put32((unsigned int)(m32));
}


x86 assembly (clang, -O0):
<sub_reg32_m32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x2b,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0x5,%edi
call   1030 <put8@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_reg32_m32>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
mov    $0x2b,%edi
call   1030 <put8@plt>
lea    0x5(,%rbx,8),%edi
call   1030 <put8@plt>
mov    %r14d,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @sub_reg32_m32(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = call i32 @put8(i32 43)
%6 = load i32, i32* %3
%7 = shl i32 %6, 3
%8 = or i32 %7, 5
%9 = call i32 @put8(i32 %8)
%10 = load i32*, i32** %4
%11 = ptrtoint i32* %10 to i32
%12 = call i32 @put32(i32 %11)
ret void
}

LLVM IR (-O2):
define void @sub_reg32_m32(i32 %0, i32* %1) {
%3 = tail call i32 @put8(i32 43)
%4 = shl i32 %0, 3
%5 = or i32 %4, 5
%6 = tail call i32 @put8(i32 %5)
%7 = ptrtoint i32* %1 to i64
%8 = trunc i64 %7 to i32
%9 = tail call i32 @put32(i32 %8)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int L3(int, int, int, int);
int /*<<< orphan*/ printf(char *, int, int, int, int, int);
int main() {
  uint32_t a, b, c, d;
  d = (c = (b = (a = 1) + 1) + 1) + 1;
  uint32_t f = L3(a, b, c, d);
  printf("%d+%d+%d+%d=%d\n", a, b, c, d, f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <L3@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
call   1030 <L3@plt>
lea    0xebf(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    %eax,%r9d
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"%d+%d+%d+%d=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 2, i32* %3
store i32 3, i32* %4
store i32 4, i32* %5
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = call i32 @L3(i32 %7, i32 %8, i32 %9, i32 %10)
store i32 %11, i32* %6
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13, i32 %14, i32 %15, i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"%d+%d+%d+%d=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @L3(i32 1, i32 2, i32 3, i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 3, i32 4, i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  int i;
  for (i = 1; i < argc; i++) {
    printf("%s ", argv[i]);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1161 <main+0x51>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     1157 <main+0x37>
mov    %rsi,%r15
mov    %edi,%r12d
mov    $0x1,%ebx
lea    0xec1(%rip),%r14
nop
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s \00"
@.str.1 = [2 x i8] c"\0A\00"
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
store i32 1, i32* %6
br label %7
7: ; preds = %18, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = load i8**, i8*** %5
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %16)
br label %18
18: ; preds = %11
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
store i32 %20, i32* %6
br label %7
21: ; preds = %7
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errmsg(int, int /*<<< orphan*/, int, char *, size_t const);
void *malloc(size_t const);
__attribute__((alloc_size(1))) void *xmalloc(const size_t size) {
  void *ret = malloc(size);
  if (!ret && size)
    errmsg(1, EXIT_FAILURE, 1, "cannot allocate %zu bytes", size);
  return ret;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116f <xmalloc+0x4f>
cmpq   $0x0,-0x8(%rbp)
je     116f <xmalloc+0x4f>
mov    0x2e8a(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%r8
mov    $0x1,%edx
lea    0xe98(%rip),%rcx
mov    %edx,%edi
call   1040 <errmsg@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <malloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     115b <xmalloc+0x3b>
test   %r14,%r14
jne    115b <xmalloc+0x3b>
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
lea    0xeb7(%rip),%rcx
mov    $0x1,%edi
mov    $0x1,%edx
mov    %rbx,%r8
call   1040 <errmsg@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [26 x i8] c"cannot allocate %zu bytes\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %15, label %8
8: ; preds = %1
%9 = load i64, i64* %2
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = load i32, i32* @EXIT_FAILURE
%13 = load i64, i64* %2
%14 = call i32 @errmsg(i32 1, i32 %12, i32 1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i64 %13)
br label %15
15: ; preds = %11, %8, %1
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [26 x i8] c"cannot allocate %zu bytes\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
%4 = icmp ne i64 %0, 0
%5 = and i1 %4, %3
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @errmsg(i32 1, i32 %7, i32 1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %9
9: ; preds = %6, %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void print_help(FILE *out, char *program) {
  fprintf(out, "Usage %s [-hd] [-G <temp-dir>] <file>\n", program);
}


x86 assembly (clang, -O0):
<print_help>:
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 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [39 x i8] c"Usage %s [-hd] [-G <temp-dir>] <file>\0A\00"
define void @print_help(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"Usage %s [-hd] [-G <temp-dir>] <file>\0A\00"
define void @print_help(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
unsigned long uDMAIntStatus(void) {
  return ((*((volatile unsigned long *)(0x400FF504))));
}


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

x86 assembly (clang, -O2):
<uDMAIntStatus>:
mov    0x400ff504,%rax
40
ret

LLVM IR (-O0):
define i64 @uDMAIntStatus() {
%1 = load volatile i64, i64* inttoptr (i64 1074787588 to i64*)
ret i64 %1
}

LLVM IR (-O2):
define i64 @uDMAIntStatus() {
%1 = load volatile i64, i64* inttoptr (i64 1074787588 to i64*)
ret i64 %1
}
int dram_init() { return 0; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ error(char *, int);
int /*<<< orphan*/ pnmReadHeader(int /*<<< orphan*/ *, int *, int *, int *,
                                 int *);
void ppmReadHeader(FILE *fp, int *magic, int *ncols, int *nrows, int *maxval) {
  pnmReadHeader(fp, magic, ncols, nrows, maxval);
  if (*magic != 6)
    error("(ppmReadHeader) Magic number is not 'P6', but 'P%d'", *magic);
}


x86 assembly (clang, -O0):
<ppmReadHeader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1040 <pnmReadHeader@plt>
mov    -0x10(%rbp),%rax
cmpl   $0x6,(%rax)
je     1174 <ppmReadHeader+0x54>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xe91(%rip),%rdi
call   1030 <error@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ppmReadHeader>:
push   %rbx
mov    %rsi,%rbx
call   1040 <pnmReadHeader@plt>
mov    (%rbx),%esi
cmp    $0x6,%esi
jne    1132 <ppmReadHeader+0x12>
pop    %rbx
ret
lea    0xec7(%rip),%rdi
pop    %rbx
jmp    1030 <error@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"(ppmReadHeader) Magic number is not 'P6', but 'P%d'\00"
define void @ppmReadHeader(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32*, i32** %6
%12 = load i32*, i32** %7
%13 = load i32*, i32** %8
%14 = load i32*, i32** %9
%15 = load i32*, i32** %10
%16 = call i32 @pnmReadHeader(i32* %11, i32* %12, i32* %13, i32* %14, i32* %15)
%17 = load i32*, i32** %7
%18 = load i32, i32* %17
%19 = icmp ne i32 %18, 6
br i1 %19, label %20, label %24
20: ; preds = %5
%21 = load i32*, i32** %7
%22 = load i32, i32* %21
%23 = call i32 @error(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %20, %5
ret void
}

LLVM IR (-O2):
@.str = [52 x i8] c"(ppmReadHeader) Magic number is not 'P6', but 'P%d'\00"
define void @ppmReadHeader(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = tail call i32 @pnmReadHeader(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4)
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, 6
br i1 %8, label %11, label %9
9: ; preds = %5
%10 = tail call i32 @error(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %11
11: ; preds = %9, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gendep__register_close(int);
int /*<<< orphan*/ real_close(int);
void __close(int fd) {
  gendep__register_close(fd);
  real_close(fd);
}


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

x86 assembly (clang, -O2):
<__close>:
push   %rbx
mov    %edi,%ebx
call   1030 <gendep__register_close@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <real_close@plt>

LLVM IR (-O0):
define void @__close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @gendep__register_close(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @real_close(i32 %5)
ret void
}

LLVM IR (-O2):
define void @__close(i32 %0) {
%2 = tail call i32 @gendep__register_close(i32 %0)
%3 = tail call i32 @real_close(i32 %0)
ret void
}
/* Variables and functions */
int muspcm_getwavelen(int);
int mus_wav_wavtime(int ch) { return muspcm_getwavelen(ch + 1); }


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

x86 assembly (clang, -O2):
<mus_wav_wavtime>:
add    $0x1,%edi
jmp    1030 <muspcm_getwavelen@plt>

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

LLVM IR (-O2):
define i32 @mus_wav_wavtime(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @muspcm_getwavelen(i32 %2)
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  double member_0;
  double member_1;
  double member_2;
  double member_3;
};
typedef TYPE_1__ __v4sf;

/* Variables and functions */
__v4sf setupa() {
  __v4sf t = {1.0, 2.0, 3.0, 4.0};
  return t;
}


x86 assembly (clang, -O0):
<setupa>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,%rax
mov    0xef2(%rip),%rcx
mov    %rcx,(%rdi)
mov    0xef0(%rip),%rcx
mov    %rcx,0x8(%rdi)
mov    0xeed(%rip),%rcx
mov    %rcx,0x10(%rdi)
mov    0xeea(%rip),%rcx
mov    %rcx,0x18(%rdi)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setupa>:
mov    %rdi,%rax
movups 0xf06(%rip),%xmm0
movups %xmm0,0x10(%rdi)
movups 0xeeb(%rip),%xmm0
movups %xmm0,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { double, double, double, double }
@__const.setupa.t = %struct.TYPE_3__ { double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00 }
define void @setupa(%struct.TYPE_3__* noalias sret(%struct.TYPE_3__) align 8 %0) {
%2 = bitcast %struct.TYPE_3__* %0 to i8*
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { double, double, double, double }
@__const.setupa.t = %struct.TYPE_3__ { double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00 }
define void @setupa(%struct.TYPE_3__* noalias nocapture writeonly sret(%struct.TYPE_3__) align 8 %0) {
%2 = bitcast %struct.TYPE_3__* %0 to i8*
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 dereferenceable(32) %2, i8* align 8 dereferenceable(32) bitcast (%struct.TYPE_3__* @__const.setupa.t to i8*), i64 32, i1 false)
ret void
}
/* Variables and functions */
double rgamma(double, double);
double rbeta(double alpha, double beta) {
  double x = rgamma(alpha, 1.0);
  double y = rgamma(beta, 1.0);
  return x / (x + y);
}


x86 assembly (clang, -O0):
<rbeta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed1(%rip),%xmm1
call   1030 <rgamma@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeba(%rip),%xmm1
call   1030 <rgamma@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
addsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rbeta>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  0xede(%rip),%xmm1
call   1030 <rgamma@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0xec5(%rip),%xmm1
call   1030 <rgamma@plt>
movsd  0x8(%rsp),%xmm1
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @rbeta(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
%8 = call double @rgamma(double %7, double 1.000000e+00)
store double %8, double* %5
%9 = load double, double* %4
%10 = call double @rgamma(double %9, double 1.000000e+00)
store double %10, double* %6
%11 = load double, double* %5
%12 = load double, double* %5
%13 = load double, double* %6
%14 = fadd double %12, %13
%15 = fdiv double %11, %14
ret double %15
}

LLVM IR (-O2):
define double @rbeta(double %0, double %1) {
%3 = tail call double @rgamma(double %0, double 1.000000e+00)
%4 = tail call double @rgamma(double %1, double 1.000000e+00)
%5 = fadd double %3, %4
%6 = fdiv double %3, %5
ret double %6
}
/* Type definitions */
struct _stor_fwritesnap_rsp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ osapi_free(struct _stor_fwritesnap_rsp *);
void stor_fwritesnap_rsp_free(struct _stor_fwritesnap_rsp *ptr) {
  osapi_free(ptr);
}


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

x86 assembly (clang, -O2):
<stor_fwritesnap_rsp_free>:
jmp    1030 <osapi_free@plt>

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

LLVM IR (-O2):
%struct._stor_fwritesnap_rsp = type { i32 }
define void @stor_fwritesnap_rsp_free(%struct._stor_fwritesnap_rsp* %0) {
%2 = tail call i32 @osapi_free(%struct._stor_fwritesnap_rsp* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_maze(char **maze, int w, int h) {
  int y = 0;
  for (y = 0; y < h; y++) {
    printf("%s\n", maze[y]);
  }
}


x86 assembly (clang, -O0):
<print_maze>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1162 <print_maze+0x52>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1130 <print_maze+0x20>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_maze>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
jle    1145 <print_maze+0x35>
mov    %rdi,%r15
mov    %edx,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_maze+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @print_maze(i8** nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fclose(FILE *stream) {}


x86 assembly (clang, -O0):
<fclose>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fclose(i32* nocapture readnone %0) {
ret i32 undef
}
int test_imm_FEuint8_mem(unsigned char *val) {
  return ((*val) & (0xFE << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FEuint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xfe,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_FEuint8_mem>:
cmpb   $0x2,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_FEuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp ult i8 %2, 2
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t NativeVoidToI32() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @NativeVoidToI32() {
ret i32 0
}
void test___atomic_and_fetch_2(int *mem) { __atomic_and_fetch(mem, 1, 4); }


x86 assembly (clang, -O0):
<test___atomic_and_fetch_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,-0x18(%rbp)
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%esi
mov    %eax,%edx
and    %esi,%edx
lock cmpxchg %edx,(%rcx)
sete   %cl
mov    %eax,-0x24(%rbp)
test   $0x1,%cl
mov    %eax,-0x14(%rbp)
jne    114b <test___atomic_and_fetch_2+0x4b>
jmp    1122 <test___atomic_and_fetch_2+0x22>
mov    -0x18(%rbp),%ecx
mov    -0x24(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test___atomic_and_fetch_2>:
lock andl $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @test___atomic_and_fetch_2(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
store i32 1, i32* %3
%6 = load i32, i32* %3
%7 = atomicrmw and i32* %5, i32 %6 acq_rel
%8 = and i32 %7, %6
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret void
}

LLVM IR (-O2):
define void @test___atomic_and_fetch_2(i32* nocapture %0) {
%2 = atomicrmw and i32* %0, i32 1 acq_rel
ret void
}
void wlan_init(void) {}


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

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

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

LLVM IR (-O2):
define void @wlan_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_relative_uri();
int /*<<< orphan*/ test_uri_from_string();
int /*<<< orphan*/ test_uri_parsing();
int /*<<< orphan*/ test_uri_to_path();
int main(void) {
  test_uri_to_path();
  test_uri_parsing();
  test_uri_from_string();
  test_relative_uri();
  printf("Success\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <test_uri_to_path@plt>
mov    $0x0,%al
call   1070 <test_uri_parsing@plt>
mov    $0x0,%al
call   1060 <test_uri_from_string@plt>
mov    $0x0,%al
call   1030 <test_relative_uri@plt>
lea    0xe7e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <test_uri_to_path@plt>
xor    %eax,%eax
call   1070 <test_uri_parsing@plt>
xor    %eax,%eax
call   1060 <test_uri_from_string@plt>
xor    %eax,%eax
call   1040 <test_relative_uri@plt>
lea    0xe8c(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Success\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_uri_to_path()
%3 = call i32 (...) @test_uri_parsing()
%4 = call i32 (...) @test_uri_from_string()
%5 = call i32 (...) @test_relative_uri()
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [8 x i8] c"Success\00"
define i32 @main() {
%1 = tail call i32 (...) @test_uri_to_path()
%2 = tail call i32 (...) @test_uri_parsing()
%3 = tail call i32 (...) @test_uri_from_string()
%4 = tail call i32 (...) @test_relative_uri()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int hash_tune(char *tune) {
  return (tune[4] - 'A') +
         7 * ((tune[3] - 'A') +
              7 * ((tune[2] - 'A') +
                   7 * ((tune[1] - 'A') + 7 * (tune[0] - 'A'))));
}


x86 assembly (clang, -O0):
<hash_tune>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x4(%rax),%eax
sub    $0x41,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x3(%rcx),%ecx
sub    $0x41,%ecx
mov    -0x8(%rbp),%rdx
movsbl 0x2(%rdx),%edx
sub    $0x41,%edx
mov    -0x8(%rbp),%rsi
movsbl 0x1(%rsi),%esi
sub    $0x41,%esi
mov    -0x8(%rbp),%rdi
movsbl (%rdi),%edi
sub    $0x41,%edi
imul   $0x7,%edi,%edi
add    %edi,%esi
imul   $0x7,%esi,%esi
add    %esi,%edx
imul   $0x7,%edx,%edx
add    %edx,%ecx
imul   $0x7,%ecx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_tune>:
movsbl 0x4(%rdi),%r8d
movsbl 0x3(%rdi),%ecx
movsbl 0x2(%rdi),%edx
movsbl 0x1(%rdi),%esi
movsbl (%rdi),%edi
lea    0x0(,%rdi,8),%eax
sub    %edi,%eax
add    %esi,%eax
lea    0x0(,%rax,8),%esi
sub    %eax,%esi
add    %edx,%esi
lea    0x0(,%rsi,8),%eax
sub    %esi,%eax
add    %ecx,%eax
lea    0x0(,%rax,8),%ecx
sub    %eax,%ecx
lea    (%r8,%rcx,1),%eax
add    $0xfffd38cf,%eax
ret

LLVM IR (-O0):
define i32 @hash_tune(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %6, 65
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 3
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = sub nsw i32 %11, 65
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = sub nsw i32 %16, 65
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = sub nsw i32 %21, 65
%23 = load i8*, i8** %2
%24 = getelementptr inbounds i8, i8* %23, i64 0
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = sub nsw i32 %26, 65
%28 = mul nsw i32 7, %27
%29 = add nsw i32 %22, %28
%30 = mul nsw i32 7, %29
%31 = add nsw i32 %17, %30
%32 = mul nsw i32 7, %31
%33 = add nsw i32 %12, %32
%34 = mul nsw i32 7, %33
%35 = add nsw i32 %7, %34
ret i32 %35
}

LLVM IR (-O2):
define i32 @hash_tune(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 4
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = getelementptr inbounds i8, i8* %0, i64 2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = load i8, i8* %0
%15 = sext i8 %14 to i32
%16 = mul nsw i32 %15, 7
%17 = add nsw i32 %16, %13
%18 = mul nsw i32 %17, 7
%19 = add nsw i32 %18, %10
%20 = mul nsw i32 %19, 7
%21 = add nsw i32 %20, %7
%22 = mul nsw i32 %21, 7
%23 = add nsw i32 %4, -182065
%24 = add nsw i32 %23, %22
ret i32 %24
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void funcao2(int *var) { printf("%d", *var); }


x86 assembly (clang, -O0):
<funcao2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcao2>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @funcao2(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @funcao2(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
unsigned int _create_joinable(void) {
  unsigned int res;
  unsigned int cmd;
  cmd = ((0x11000000) | (((0x0) & 0x00000003) << 16) |
         (((0) & 0x000000FF) << 2) | (((0x05) & 0x0000001F) << 10));
  res = (*(volatile unsigned int *)(cmd));
  return res;
}


x86 assembly (clang, -O0):
<_create_joinable>:
push   %rbp
mov    %rsp,%rbp
movl   $0x11001400,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_create_joinable>:
mov    0x11001400,%eax
ret

LLVM IR (-O0):
define i32 @_create_joinable() {
%1 = alloca i32
%2 = alloca i32
store i32 285217792, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
store i32 %6, i32* %1
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @_create_joinable() {
%1 = load volatile i32, i32* inttoptr (i64 285217792 to i32*)
ret i32 %1
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ ngaProcessOpcode(int);
void ngaProcessPackedOpcodes(int opcode) {
  int32_t raw = opcode;
  for (int i = 0; i < 4; i++) {
    ngaProcessOpcode(raw & 0xFF);
    raw = raw >> 8;
  }
}


x86 assembly (clang, -O0):
<ngaProcessPackedOpcodes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1157 <ngaProcessPackedOpcodes+0x47>
mov    -0x8(%rbp),%edi
and    $0xff,%edi
call   1030 <ngaProcessOpcode@plt>
mov    -0x8(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <ngaProcessPackedOpcodes+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ngaProcessPackedOpcodes>:
push   %rbx
mov    %edi,%ebx
movzbl %bl,%edi
call   1030 <ngaProcessOpcode@plt>
movzbl %bh,%edi
call   1030 <ngaProcessOpcode@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
call   1030 <ngaProcessOpcode@plt>
shr    $0x18,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <ngaProcessOpcode@plt>

LLVM IR (-O0):
define void @ngaProcessPackedOpcodes(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
store i32 %5, i32* %3
store i32 0, i32* %4
br label %6
6: ; preds = %15, %1
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 4
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = load i32, i32* %3
%11 = and i32 %10, 255
%12 = call i32 @ngaProcessOpcode(i32 %11)
%13 = load i32, i32* %3
%14 = ashr i32 %13, 8
store i32 %14, i32* %3
br label %15
15: ; preds = %9
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
store i32 %17, i32* %4
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @ngaProcessPackedOpcodes(i32 %0) {
%2 = and i32 %0, 255
%3 = tail call i32 @ngaProcessOpcode(i32 %2)
%4 = lshr i32 %0, 8
%5 = and i32 %4, 255
%6 = tail call i32 @ngaProcessOpcode(i32 %5)
%7 = lshr i32 %0, 16
%8 = and i32 %7, 255
%9 = tail call i32 @ngaProcessOpcode(i32 %8)
%10 = lshr i32 %0, 24
%11 = tail call i32 @ngaProcessOpcode(i32 %10)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int label_isstr(const uint8_t *label) {
  return (((*label) > 0) && ((*label) < 0xC0));
}


x86 assembly (clang, -O0):
<label_isstr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmpl   $0x0,(%rcx)
mov    %al,-0x9(%rbp)
jle    112a <label_isstr+0x2a>
mov    -0x8(%rbp),%rax
cmpl   $0xc0,(%rax)
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<label_isstr>:
mov    (%rdi),%ecx
add    $0xffffffff,%ecx
xor    %eax,%eax
cmp    $0xbf,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @label_isstr(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = icmp slt i32 %8, 192
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @label_isstr(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add i32 %2, -1
%4 = icmp ult i32 %3, 191
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ A();
int /*<<< orphan*/ B();
scalar_t__ xx();
int main(void) {
  if (xx())
    A();
  else
    B();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <xx@plt>
cmp    $0x0,%rax
je     115c <main+0x2c>
mov    $0x0,%al
call   1050 <A@plt>
jmp    1163 <main+0x33>
mov    $0x0,%al
call   1030 <B@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <xx@plt>
test   %rax,%rax
je     1146 <main+0x16>
xor    %eax,%eax
call   1050 <A@plt>
jmp    114d <main+0x1d>
xor    %eax,%eax
call   1030 <B@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @xx()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @A()
br label %7
5: ; preds = %0
%6 = tail call i32 (...) @B()
br label %7
7: ; preds = %5, %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void internalFree(void *ptr, void *userPtr) {
  (void)userPtr;
  free(ptr);
}


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

x86 assembly (clang, -O2):
<internalFree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @internalFree(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}