xunge/DecIR huggingface dataset:
void l3_init(void) {
  (*(volatile unsigned *)0x15600030) |= (1 << 10) | (1 << 9);
  (*(volatile unsigned *)0x15600034) |= (1 << 10) | (1 << 9) | (1 << 11);
  (*(volatile unsigned *)0x1560002c) =
      ((*(volatile unsigned *)0x1560002c) & ~(0x3f << 18)) | (1 << 18) |
      (1 << 20) | (1 << 22);
}


x86 assembly (clang, -O0):
<l3_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x15600030,%eax
mov    (%rax),%ecx
or     $0x600,%ecx
mov    $0x15600030,%eax
mov    %ecx,(%rax)
mov    $0x15600034,%eax
mov    (%rax),%ecx
or     $0xe00,%ecx
mov    $0x15600034,%eax
mov    %ecx,(%rax)
mov    $0x1560002c,%eax
mov    (%rax),%ecx
and    $0xff03ffff,%ecx
or     $0x40000,%ecx
or     $0x100000,%ecx
or     $0x400000,%ecx
mov    $0x1560002c,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<l3_init>:
orl    $0x600,0x15600030
orl    $0xe00,0x15600034
mov    $0xff03ffff,%eax
and    0x1560002c,%eax
or     $0x540000,%eax
mov    %eax,0x1560002c
ret

LLVM IR (-O0):
define void @l3_init() {
%1 = load volatile i32, i32* inttoptr (i64 358613040 to i32*)
%2 = or i32 %1, 1536
store volatile i32 %2, i32* inttoptr (i64 358613040 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 358613044 to i32*)
%4 = or i32 %3, 3584
store volatile i32 %4, i32* inttoptr (i64 358613044 to i32*)
%5 = load volatile i32, i32* inttoptr (i64 358613036 to i32*)
%6 = and i32 %5, -16515073
%7 = or i32 %6, 262144
%8 = or i32 %7, 1048576
%9 = or i32 %8, 4194304
store volatile i32 %9, i32* inttoptr (i64 358613036 to i32*)
ret void
}

LLVM IR (-O2):
define void @l3_init() {
%1 = load volatile i32, i32* inttoptr (i64 358613040 to i32*)
%2 = or i32 %1, 1536
store volatile i32 %2, i32* inttoptr (i64 358613040 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 358613044 to i32*)
%4 = or i32 %3, 3584
store volatile i32 %4, i32* inttoptr (i64 358613044 to i32*)
%5 = load volatile i32, i32* inttoptr (i64 358613036 to i32*)
%6 = and i32 %5, -16515073
%7 = or i32 %6, 5505024
store volatile i32 %7, i32* inttoptr (i64 358613036 to i32*)
ret void
}
void os_deinit(void) {}


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

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

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

LLVM IR (-O2):
define void @os_deinit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i = 0;
  while (i < 20) {
    if (i % 2 == 0) {
      printf("%d\n", i);
    }
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jge    1161 <main+0x51>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1153 <main+0x43>
mov    -0x8(%rbp),%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
jmp    1128 <main+0x18>
nop
add    $0x1,%ebx
cmp    $0x14,%ebx
je     1139 <main+0x29>
test   $0x1,%bl
jne    1120 <main+0x10>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
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 = %13, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 20
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = load i32, i32* %2
%8 = srem i32 %7, 2
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load i32, i32* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %10, %6
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %3
16: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %7
%2 = phi i32 [ 0, %0 ], [ %8, %7 ]
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %7
7: ; preds = %5, %1
%8 = add nuw nsw i32 %2, 1
%9 = icmp eq i32 %8, 20
br i1 %9, label %10, label %1
10: ; preds = %7
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ api_end();
int /*<<< orphan*/ api_putstr0(char *);
void HariMain(void) {
  static char s[9] = {0xb2, 0xdb, 0xca, 0xc6, 0xce, 0xcd, 0xc4, 0x0a, 0x00};
  api_putstr0(s);
  api_end();
}


x86 assembly (clang, -O0):
<HariMain>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f05(%rip),%rdi
call   1040 <api_putstr0@plt>
mov    $0x0,%al
call   1030 <api_end@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HariMain>:
push   %rax
lea    0x2f08(%rip),%rdi
call   1040 <api_putstr0@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <api_end@plt>

LLVM IR (-O0):
@HariMain.s = internal global [9 x i8] c"\B2\DB\CA\C6\CE\CD\C4\0A\00"
define void @HariMain() {
%1 = call i32 @api_putstr0(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @HariMain.s, i64 0, i64 0))
%2 = call i32 (...) @api_end()
ret void
}

LLVM IR (-O2):
@HariMain.s = internal global [9 x i8] c"\B2\DB\CA\C6\CE\CD\C4\0A\00"
define void @HariMain() {
%1 = tail call i32 @api_putstr0(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @HariMain.s, i64 0, i64 0))
%2 = tail call i32 (...) @api_end()
ret void
}
int test_imm_25uint8_mem(unsigned char *val) {
  return ((*val) & (-0x25 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_25uint8_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, -37
%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_25uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -37
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
size_t UA_atomic_addSize(volatile size_t *addr, size_t increase) {
  *addr += increase;
  return *addr;
}


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

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

LLVM IR (-O0):
define i64 @UA_atomic_addSize(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64*, i64** %3
%7 = load volatile i64, i64* %6
%8 = add i64 %7, %5
store volatile i64 %8, i64* %6
%9 = load i64*, i64** %3
%10 = load volatile i64, i64* %9
ret i64 %10
}

LLVM IR (-O2):
define i64 @UA_atomic_addSize(i64* %0, i64 %1) {
%3 = load volatile i64, i64* %0
%4 = add i64 %3, %1
store volatile i64 %4, i64* %0
%5 = load volatile i64, i64* %0
ret i64 %5
}
void CloseOutputFile(void) {}


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

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

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

LLVM IR (-O2):
define void @CloseOutputFile() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ key_tasklist_scroll(char);
void key_tasklist_scroll_end(void) { key_tasklist_scroll('e'); }


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

x86 assembly (clang, -O2):
<key_tasklist_scroll_end>:
mov    $0x65,%edi
jmp    1030 <key_tasklist_scroll@plt>

LLVM IR (-O0):
define void @key_tasklist_scroll_end() {
%1 = call i32 @key_tasklist_scroll(i8 signext 101)
ret void
}

LLVM IR (-O2):
define void @key_tasklist_scroll_end() {
%1 = tail call i32 @key_tasklist_scroll(i8 signext 101)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sesc_acquire(int);
void sesc_acquire_(int vaddr) { sesc_acquire(vaddr); }


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

x86 assembly (clang, -O2):
<sesc_acquire_>:
jmp    1030 <sesc_acquire@plt>

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

LLVM IR (-O2):
define void @sesc_acquire_(i32 %0) {
%2 = tail call i32 @sesc_acquire(i32 %0)
ret void
}
/* Type definitions */
struct node {
  int dummy;
};
struct list {
  int dummy;
};

/* Variables and functions */
struct node *removeFront(struct list *list) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.node = type { i32 }
%struct.list = type { i32 }
define %struct.node* @removeFront(%struct.list* %0) {
%2 = alloca %struct.list*
store %struct.list* %0, %struct.list** %2
ret %struct.node* null
}

LLVM IR (-O2):
%struct.node = type { i32 }
%struct.list = type { i32 }
define noalias %struct.node* @removeFront(%struct.list* nocapture readnone %0) {
ret %struct.node* null
}
/* Variables and functions */
int /*<<< orphan*/ OPENSSL_free(char *);
void bridge_openssl_free(char *buffer) { OPENSSL_free(buffer); }


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

x86 assembly (clang, -O2):
<bridge_openssl_free>:
jmp    1030 <OPENSSL_free@plt>

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

LLVM IR (-O2):
define void @bridge_openssl_free(i8* %0) {
%2 = tail call i32 @OPENSSL_free(i8* %0)
ret void
}
int sdio_stop_transfer(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sdio_stop_transfer() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_arc_sleep(int);
void test_err_sleep(int a) { __builtin_arc_sleep(a); }


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

x86 assembly (clang, -O2):
<test_err_sleep>:
jmp    1030 <__builtin_arc_sleep@plt>

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

LLVM IR (-O2):
define void @test_err_sleep(i32 %0) {
%2 = tail call i32 @__builtin_arc_sleep(i32 %0)
ret void
}
int g(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @g() {
ret i32 1
}
/* Type definitions */
struct tree {
  int dummy;
};

/* Variables and functions */
double calc_tree(struct tree *);
double op_div(struct tree *left, struct tree *right) {
  return calc_tree(left) / calc_tree(right);
}


x86 assembly (clang, -O0):
<op_div>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <calc_tree@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <calc_tree@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_div>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
call   1030 <calc_tree@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <calc_tree@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tree = type { i32 }
define double @op_div(%struct.tree* %0, %struct.tree* %1) {
%3 = alloca %struct.tree*
%4 = alloca %struct.tree*
store %struct.tree* %0, %struct.tree** %3
store %struct.tree* %1, %struct.tree** %4
%5 = load %struct.tree*, %struct.tree** %3
%6 = call double @calc_tree(%struct.tree* %5)
%7 = load %struct.tree*, %struct.tree** %4
%8 = call double @calc_tree(%struct.tree* %7)
%9 = fdiv double %6, %8
ret double %9
}

LLVM IR (-O2):
%struct.tree = type { i32 }
define double @op_div(%struct.tree* %0, %struct.tree* %1) {
%3 = tail call double @calc_tree(%struct.tree* %0)
%4 = tail call double @calc_tree(%struct.tree* %1)
%5 = fdiv double %3, %4
ret double %5
}
unsigned XXH_versionNumber(void) { return (0 * 100 * 100 + 6 * 100 + 3); }


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

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

LLVM IR (-O0):
define i32 @XXH_versionNumber() {
ret i32 603
}

LLVM IR (-O2):
define i32 @XXH_versionNumber() {
ret i32 603
}
int grfmem(size, pointer)
int *size;
void **pointer;
{
  free(*pointer);
  return 1;
}


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

x86 assembly (clang, -O2):
<grfmem>:
push   %rax
mov    (%rsi),%rdi
call   1030 <free@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @grfmem(i32* nocapture readnone %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
tail call void @free(i8* %3)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printInfoMessage(char *msg) { printf("INFO: %s\n", msg); }


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

x86 assembly (clang, -O2):
<printInfoMessage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"INFO: %s\0A\00"
define void @printInfoMessage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
indreg0adr1_set(r0, r1, x0, x1, p0, p1) float r0, r1;
float *p0, *p1;
{ (*p0) = (*((float *)11111111)); }


x86 assembly (clang, -O0):
<indreg0adr1_set>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    $0xa98ac7,%eax
movss  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indreg0adr1_set>:
movss  0xa98ac7,%xmm0
movss  %xmm0,(%rdx)
ret

LLVM IR (-O0):
define i32 @indreg0adr1_set(double %0, double %1, i32 %2, i32 %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
%12 = alloca float*
%13 = alloca float*
%14 = fptrunc double %0 to float
%15 = fptrunc double %1 to float
store float %14, float* %8
store float %15, float* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store float* %4, float** %12
store float* %5, float** %13
%16 = load float, float* inttoptr (i64 11111111 to float*)
%17 = load float*, float** %12
store float %16, float* %17
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
define i32 @indreg0adr1_set(double %0, double %1, i32 %2, i32 %3, float* nocapture writeonly %4, float* nocapture readnone %5) {
%7 = load float, float* inttoptr (i64 11111111 to float*)
store float %7, float* %4
ret i32 undef
}
int test_imm_36int32_mem(int *val) {
  return ((*val) & (0x36 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_36int32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 54
%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_36int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 54
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
size_t get_data_tag_in_UnderlyingStipulations(size_t __tag) {
  (void)__tag;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i64 @get_data_tag_in_UnderlyingStipulations(i64 %0) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void initDevice(const char *mess) { printf("\n\nINIT: %s\n", mess); }


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

x86 assembly (clang, -O2):
<initDevice>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"\0A\0AINIT: %s\0A\00"
define void @initDevice(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void lprofT_start() {}


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

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

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

LLVM IR (-O2):
define void @lprofT_start() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int main(int argc, char **argv) {
  int i;
  for (i = 0; i < argc; i++)
    printf("[%02d]={%s}\n", i, argv[i]);
  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   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1162 <main+0x52>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

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


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

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

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

LLVM IR (-O2):
define void @X509V3_get_value_bool() {
ret void
}
/* Type definitions */
struct usb_endpoint_descriptor {
  int dummy;
};

/* Variables and functions */
scalar_t__ usb_endpoint_dir_out(struct usb_endpoint_descriptor const *);
scalar_t__ usb_endpoint_xfer_int(struct usb_endpoint_descriptor const *);
int usb_endpoint_is_int_out(const struct usb_endpoint_descriptor *epd) {
  return usb_endpoint_xfer_int(epd) && usb_endpoint_dir_out(epd);
}


x86 assembly (clang, -O0):
<usb_endpoint_is_int_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <usb_endpoint_xfer_int@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     115a <usb_endpoint_is_int_out+0x3a>
mov    -0x8(%rbp),%rdi
call   1030 <usb_endpoint_dir_out@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_endpoint_is_int_out>:
push   %rbx
mov    %rdi,%rbx
call   1040 <usb_endpoint_xfer_int@plt>
test   %rax,%rax
je     1143 <usb_endpoint_is_int_out+0x23>
mov    %rbx,%rdi
call   1030 <usb_endpoint_dir_out@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.usb_endpoint_descriptor = type { i32 }
define i32 @usb_endpoint_is_int_out(%struct.usb_endpoint_descriptor* %0) {
%2 = alloca %struct.usb_endpoint_descriptor*
store %struct.usb_endpoint_descriptor* %0, %struct.usb_endpoint_descriptor** %2
%3 = load %struct.usb_endpoint_descriptor*, %struct.usb_endpoint_descriptor** %2
%4 = call i64 @usb_endpoint_xfer_int(%struct.usb_endpoint_descriptor* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load %struct.usb_endpoint_descriptor*, %struct.usb_endpoint_descriptor** %2
%8 = call i64 @usb_endpoint_dir_out(%struct.usb_endpoint_descriptor* %7)
%9 = icmp ne i64 %8, 0
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):
%struct.usb_endpoint_descriptor = type { i32 }
define i32 @usb_endpoint_is_int_out(%struct.usb_endpoint_descriptor* %0) {
%2 = tail call i64 @usb_endpoint_xfer_int(%struct.usb_endpoint_descriptor* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @usb_endpoint_dir_out(%struct.usb_endpoint_descriptor* %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
int tosInt32_mul(int x, int y) { return x * y; }


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

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

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

LLVM IR (-O2):
define i32 @tosInt32_mul(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
void copy2(char *s1, char *s2) {
  for (; (*s1 = *s2) != '\0'; s1++, s2++) {
  }
}


x86 assembly (clang, -O0):
<copy2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1146 <copy2+0x46>
jmp    1129 <copy2+0x29>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <copy2+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy2>:
mov    (%rsi),%al
mov    %al,(%rdi)
test   %al,%al
je     111f <copy2+0x1f>
mov    $0x1,%eax
nopl   (%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <copy2+0x10>
ret

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

LLVM IR (-O2):
define void @copy2(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
store i8 %3, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %9, %5 ], [ %1, %2 ]
%7 = phi i8* [ %8, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i8, i8* %9
store i8 %10, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int isPowerOfTwo(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  printf("\n%d\n", isPowerOfTwo(atoi(argv[1])));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1030 <isPowerOfTwo@plt>
mov    %eax,%esi
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1030 <isPowerOfTwo@plt>
lea    0xeb8(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"\0A%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i32 @isPowerOfTwo(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
long long bit24() { return 0x0000000001000000LL; }


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

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

LLVM IR (-O0):
define i64 @bit24() {
ret i64 16777216
}

LLVM IR (-O2):
define i64 @bit24() {
ret i64 16777216
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void __sfree(void **x) {
  free(*x);
  *x = NULL;
  return;
}


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

x86 assembly (clang, -O2):
<__sfree>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @__sfree(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @free(i8* %2)
store i8* null, i8** %0
ret void
}
unsigned test3(unsigned x) { return (x & 0xFF00FF00) >> 8; }


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00ff00,%eax
shr    $0x8,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
mov    %edi,%eax
shr    $0x8,%eax
and    $0xff00ff,%eax
ret

LLVM IR (-O0):
define i32 @test3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -16711936
%5 = lshr i32 %4, 8
ret i32 %5
}

LLVM IR (-O2):
define i32 @test3(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 16711935
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void clean_array(int a[100]) {
  int i = 0;
  printf("in clean_array;\n");
  for (i = 0; i < 100; i++) {
    a[i] = 0;
  };
}


x86 assembly (clang, -O0):
<clean_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    115d <clean_array+0x4d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <clean_array+0x26>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_array>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x190,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [16 x i8] c"in clean_array;\00"
define void @clean_array(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
__attribute__((no)) long trampoline_fork(void) {
  long ret;
  __asm__ __volatile__("leaq 1f(%%rip), %%r11\n\t"
                       "movq %%r11, %%fs:0x20\n\t"
                       "jmpq *%%gs:0x10000+"
                       "0xE0"
                       "\n\t"
                       "1:\n\t"
                       : "=a"(ret)
                       :
                       : "memory");
  return ret;
}


x86 assembly (clang, -O0):
<trampoline_fork>:
push   %rbp
mov    %rsp,%rbp
lea    0x11(%rip),%r11
mov    %r11,%fs:0x20
jmp    *%gs:0x100e0
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trampoline_fork>:
lea    0x11(%rip),%r11
mov    %r11,%fs:0x20
jmp    *%gs:0x100e0
ret

LLVM IR (-O0):
define i64 @trampoline_fork() {
%1 = alloca i64
%2 = call i64 asm sideeffect "leaq 1f(%rip), %r11\0A\09movq %r11, %fs:0x20\0A\09jmpq *%gs:0x10000+0xE0\0A\091:\0A\09", "={ax},~{memory},~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @trampoline_fork() {
%1 = tail call i64 asm sideeffect "leaq 1f(%rip), %r11\0A\09movq %r11, %fs:0x20\0A\09jmpq *%gs:0x10000+0xE0\0A\091:\0A\09", "={ax},~{memory},~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ braf_displayErrorInInterpreter(char *, int const, int const);
unsigned int braf_valOverflowCheck(const char *dataPtr, const int col,
                                   const int rw) {
  int dataVal = *dataPtr;
  if (dataVal > 255) {
    braf_displayErrorInInterpreter(
        "Value overflow. Cell cannot handle ASCII values greater 255.", col,
        rw);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<braf_valOverflowCheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0xff,-0x1c(%rbp)
jle    1157 <braf_valOverflowCheck+0x47>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xeba(%rip),%rdi
call   1030 <braf_displayErrorInInterpreter@plt>
movl   $0x1,-0x4(%rbp)
jmp    115e <braf_valOverflowCheck+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [61 x i8] c"Value overflow. Cell cannot handle ASCII values greater 255.\00"
define i32 @braf_valOverflowCheck(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = load i8*, i8** %5
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
store i32 %11, i32* %8
%12 = load i32, i32* %8
%13 = icmp sgt i32 %12, 255
br i1 %13, label %14, label %18
14: ; preds = %3
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = call i32 @braf_displayErrorInInterpreter(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %16)
store i32 1, i32* %4
br label %19
18: ; preds = %3
store i32 0, i32* %4
br label %19
19: ; preds = %18, %14
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @braf_valOverflowCheck(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t threefish_lrotate(uint64_t x, int n) {
  return (x << n) | (x >> (64 - n));
}


x86 assembly (clang, -O0):
<threefish_lrotate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x40,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<threefish_lrotate>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @threefish_lrotate(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 64, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @threefish_lrotate(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 64, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ INIT_LIST_HEAD(struct list_head *);
int /*<<< orphan*/ list_replace(struct list_head *, struct list_head *);
void list_replace_init(struct list_head *old, struct list_head *new2add) {
  list_replace(old, new2add);
  INIT_LIST_HEAD(old);
}


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

x86 assembly (clang, -O2):
<list_replace_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <list_replace@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <INIT_LIST_HEAD@plt>

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

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_replace_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @list_replace(%struct.list_head* %0, %struct.list_head* %1)
%4 = tail call i32 @INIT_LIST_HEAD(%struct.list_head* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ canonicalize_file_name(char *);
int main(void) {
  canonicalize_file_name("/");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define i32 @main() {
%1 = tail call i32 @canonicalize_file_name(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int test(int, int);
int main() {
  if (test(1, 0) != 0)
    abort();
  if (test(1, 1) != 1)
    abort();
  if (test(1, 65535) != 1)
    abort();
  exit(0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
xor    %esi,%esi
call   1050 <test@plt>
cmp    $0x0,%eax
je     115b <main+0x2b>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x1,%esi
mov    %esi,%edi
call   1050 <test@plt>
cmp    $0x1,%eax
je     1177 <main+0x47>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x1,%edi
mov    $0xffff,%esi
call   1050 <test@plt>
cmp    $0x1,%eax
je     1196 <main+0x66>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
xor    %esi,%esi
call   1050 <test@plt>
test   %eax,%eax
jne    1170 <main+0x40>
mov    $0x1,%edi
mov    $0x1,%esi
call   1050 <test@plt>
cmp    $0x1,%eax
jne    1170 <main+0x40>
mov    $0x1,%edi
mov    $0xffff,%esi
call   1050 <test@plt>
cmp    $0x1,%eax
jne    1170 <main+0x40>
xor    %edi,%edi
call   1040 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @test(i32 1, i32 0)
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @test(i32 1, i32 1)
%8 = icmp ne i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %6
%12 = call i32 @test(i32 1, i32 65535)
%13 = icmp ne i32 %12, 1
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %11
%17 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(i32 1, i32 0)
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @test(i32 1, i32 1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %5
%11 = tail call i32 @test(i32 1, i32 65535)
%12 = icmp eq i32 %11, 1
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = tail call i32 (...) @abort()
unreachable
15: ; preds = %10
%16 = tail call i32 @exit(i32 0)
unreachable
}
int test_imm_6Auint32_reg(unsigned int val) {
  return ((val) & (0x6A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_6Auint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 106
%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_6Auint32_reg(i32 %0) {
%2 = and i32 %0, 106
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void OS_SigpipeHandler(int signal) {
  printf("%s : signal = %d\n", __func__, signal);
}


x86 assembly (clang, -O0):
<OS_SigpipeHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
lea    0xee6(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OS_SigpipeHandler>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xef2(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [18 x i8] c"%s : signal = %d\0A\00"
@__func__.OS_SigpipeHandler = [18 x i8] c"OS_SigpipeHandler\00"
define void @OS_SigpipeHandler(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.OS_SigpipeHandler, i64 0, i64 0), i32 %0)
ret void
}
int test_imm_58int64_lowword_reg(long long val) {
  return ((val) & (0x58 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_58int64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 88
%5 = icmp ne i64 %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_58int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 88
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int mintaka_index_allocate3(char const *, int, int /*<<< orphan*/ *,
                            int /*<<< orphan*/ *, int);
int mintaka_index_allocate(const char *string, int number, int event) {
  return mintaka_index_allocate3(string, number, NULL, NULL, event);
}


x86 assembly (clang, -O0):
<mintaka_index_allocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1030 <mintaka_index_allocate3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mintaka_index_allocate>:
mov    %edx,%r8d
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <mintaka_index_allocate3@plt>

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

LLVM IR (-O2):
define i32 @mintaka_index_allocate(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @mintaka_index_allocate3(i8* %0, i32 %1, i32* null, i32* null, i32 %2)
ret i32 %4
}