xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ gnss_enable_irq(int);
void interrupts(void) {
  gnss_enable_irq(14);
  gnss_enable_irq(5);
  gnss_enable_irq(7);
  gnss_enable_irq(6);
}


x86 assembly (clang, -O0):
<interrupts>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe,%edi
call   1030 <gnss_enable_irq@plt>
mov    $0x5,%edi
call   1030 <gnss_enable_irq@plt>
mov    $0x7,%edi
call   1030 <gnss_enable_irq@plt>
mov    $0x6,%edi
call   1030 <gnss_enable_irq@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<interrupts>:
push   %rax
mov    $0xe,%edi
call   1030 <gnss_enable_irq@plt>
mov    $0x5,%edi
call   1030 <gnss_enable_irq@plt>
mov    $0x7,%edi
call   1030 <gnss_enable_irq@plt>
mov    $0x6,%edi
pop    %rax
jmp    1030 <gnss_enable_irq@plt>

LLVM IR (-O0):
define void @interrupts() {
%1 = call i32 @gnss_enable_irq(i32 14)
%2 = call i32 @gnss_enable_irq(i32 5)
%3 = call i32 @gnss_enable_irq(i32 7)
%4 = call i32 @gnss_enable_irq(i32 6)
ret void
}

LLVM IR (-O2):
define void @interrupts() {
%1 = tail call i32 @gnss_enable_irq(i32 14)
%2 = tail call i32 @gnss_enable_irq(i32 5)
%3 = tail call i32 @gnss_enable_irq(i32 7)
%4 = tail call i32 @gnss_enable_irq(i32 6)
ret void
}
int cycle(m)
int m;
{
  int i = 1;
  while (m != 1) {
    if (m % 2 == 0) {
      m = m / 2;
    } else {
      m = 3 * m + 1;
    }
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<cycle>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
je     1157 <cycle+0x57>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    113f <cycle+0x3f>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1149 <cycle+0x49>
imul   $0x3,-0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <cycle+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cycle>:
mov    $0x1,%eax
cmp    $0x1,%edi
jne    110b <cycle+0xb>
ret
mov    $0x1,%eax
jmp    112e <cycle+0x2e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    (%rdi,%rdi,2),%edi
add    $0x1,%edi
add    $0x1,%eax
cmp    $0x1,%edi
je     110a <cycle+0xa>
test   $0x1,%dil
jne    1120 <cycle+0x20>
mov    %edi,%ecx
shr    $0x1f,%ecx
add    %edi,%ecx
sar    %ecx
mov    %ecx,%edi
jmp    1126 <cycle+0x26>

LLVM IR (-O0):
define i32 @cycle(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %18, %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 1
br i1 %6, label %7, label %21
7: ; preds = %4
%8 = load i32, i32* %2
%9 = srem i32 %8, 2
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* %2
%13 = sdiv i32 %12, 2
store i32 %13, i32* %2
br label %18
14: ; preds = %7
%15 = load i32, i32* %2
%16 = mul nsw i32 3, %15
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %18
18: ; preds = %14, %11
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %4
21: ; preds = %4
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @cycle(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %17, label %3
3: ; preds = %1, %13
%4 = phi i32 [ %15, %13 ], [ 1, %1 ]
%5 = phi i32 [ %14, %13 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = sdiv i32 %5, 2
br label %13
10: ; preds = %3
%11 = mul nsw i32 %5, 3
%12 = add nsw i32 %11, 1
br label %13
13: ; preds = %10, %8
%14 = phi i32 [ %9, %8 ], [ %12, %10 ]
%15 = add nuw nsw i32 %4, 1
%16 = icmp eq i32 %14, 1
br i1 %16, label %17, label %3
17: ; preds = %13, %1
%18 = phi i32 [ 1, %1 ], [ %15, %13 ]
ret i32 %18
}
void handle_53(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_53(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ tuple;
struct bpf_sock_tuple {
  int dummy;
};
struct __sk_buff {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ BPF_F_CURRENT_NETNS;
int /*<<< orphan*/ bpf_sk_lookup_tcp(struct __sk_buff *,
                                     struct bpf_sock_tuple *, int,
                                     int /*<<< orphan*/, int /*<<< orphan*/);
void lookup_no_release(struct __sk_buff *skb) {
  struct bpf_sock_tuple tuple = {};
  bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), BPF_F_CURRENT_NETNS, 0);
}


x86 assembly (clang, -O0):
<lookup_no_release>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%ecx
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
xor    %r8d,%r8d
call   1040 <bpf_sk_lookup_tcp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookup_no_release>:
push   %rax
movl   $0x0,(%rsp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    %rsp,%rsi
mov    $0x4,%edx
xor    %r8d,%r8d
call   1030 <bpf_sk_lookup_tcp@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.__sk_buff = type { i32 }
%struct.bpf_sock_tuple = type { i32 }
@BPF_F_CURRENT_NETNS = global i32 0
define void @lookup_no_release(%struct.__sk_buff* %0) {
%2 = alloca %struct.__sk_buff*
%3 = alloca %struct.bpf_sock_tuple
store %struct.__sk_buff* %0, %struct.__sk_buff** %2
%4 = bitcast %struct.bpf_sock_tuple* %3 to i8*
%5 = load %struct.__sk_buff*, %struct.__sk_buff** %2
%6 = load i32, i32* @BPF_F_CURRENT_NETNS
%7 = call i32 @bpf_sk_lookup_tcp(%struct.__sk_buff* %5, %struct.bpf_sock_tuple* %3, i32 4, i32 %6, i32 0)
ret void
}

LLVM IR (-O2):
%struct.__sk_buff = type { i32 }
%struct.bpf_sock_tuple = type { i32 }
@BPF_F_CURRENT_NETNS = global i32 0
define void @lookup_no_release(%struct.__sk_buff* %0) {
%2 = alloca %struct.bpf_sock_tuple
%3 = bitcast %struct.bpf_sock_tuple* %2 to i8*
%4 = getelementptr inbounds %struct.bpf_sock_tuple, %struct.bpf_sock_tuple* %2, i64 0, i32 0
store i32 0, i32* %4
%5 = load i32, i32* @BPF_F_CURRENT_NETNS
%6 = call i32 @bpf_sk_lookup_tcp(%struct.__sk_buff* %0, %struct.bpf_sock_tuple* %2, i32 4, i32 %5, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int chu(int x, int y) {
  if (y == 0) {
    printf("divide by zero.");
    return 0;
  }
  return x / y;
}


x86 assembly (clang, -O0):
<chu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1140 <chu+0x30>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    114a <chu+0x3a>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chu>:
test   %esi,%esi
je     111a <chu+0xa>
mov    %edi,%eax
cltd
idiv   %esi
ret
push   %rax
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"divide by zero.\00"
define i32 @chu(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %2
%7 = sdiv i32 %0, %1
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ 0, %4 ], [ %7, %6 ]
ret i32 %9
}
/* Type definitions */
struct shmhandle {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct shmhandle *);
int shm_close(struct shmhandle *);
int shm_delete(struct shmhandle *handle) {
  int ret;
  ret = shm_close(handle);
  if (ret < 0)
    return -1;
  free(handle);
  return 0;
}


x86 assembly (clang, -O0):
<shm_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <shm_close@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    114e <shm_delete+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <shm_delete+0x3e>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shm_delete>:
push   %rbx
mov    %rdi,%rbx
call   1040 <shm_close@plt>
test   %eax,%eax
js     1139 <shm_delete+0x19>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.shmhandle = type { i32 }
define i32 @shm_delete(%struct.shmhandle* %0) {
%2 = alloca i32
%3 = alloca %struct.shmhandle*
%4 = alloca i32
store %struct.shmhandle* %0, %struct.shmhandle** %3
%5 = load %struct.shmhandle*, %struct.shmhandle** %3
%6 = call i32 @shm_close(%struct.shmhandle* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %13
10: ; preds = %1
%11 = load %struct.shmhandle*, %struct.shmhandle** %3
%12 = call i32 @free(%struct.shmhandle* %11)
store i32 0, i32* %2
br label %13
13: ; preds = %10, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.shmhandle = type { i32 }
define i32 @shm_delete(%struct.shmhandle* %0) {
%2 = tail call i32 @shm_close(%struct.shmhandle* %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @free(%struct.shmhandle* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 0, %4 ], [ -1, %1 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
uint32_t __afl_get_bbarea_size(void) {
  printf("bb area size\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"bb area size\0A\00"
define i32 @__afl_get_bbarea_size() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"bb area size\00"
define i32 @__afl_get_bbarea_size() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(uintptr_t *, void *, size_t);
uintptr_t _br2_load(uintptr_t a, size_t sz) {
  uintptr_t r = 0;
  memcpy(&r, (void *)a, sz);
  return r;
}


x86 assembly (clang, -O0):
<_br2_load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rdi
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_br2_load>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
movq   $0x0,(%rsp)
mov    %rsp,%rdi
call   1030 <memcpy@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @_br2_load(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
store i64 0, i64* %5
%6 = load i64, i64* %3
%7 = inttoptr i64 %6 to i8*
%8 = load i64, i64* %4
%9 = call i32 @memcpy(i64* %5, i8* %7, i64 %8)
%10 = load i64, i64* %5
ret i64 %10
}

LLVM IR (-O2):
define i64 @_br2_load(i64 %0, i64 %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
store i64 0, i64* %3
%5 = inttoptr i64 %0 to i8*
%6 = call i32 @memcpy(i64* %3, i8* %5, i64 %1)
%7 = load i64, i64* %3
ret i64 %7
}
int IsSpecialChar(char c) {
  if (((c >= 0x5B) && (c <= 0x60)) || ((c >= 0x7B) && (c <= 0x7D))) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<IsSpecialChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x5b,%eax
jl     1124 <IsSpecialChar+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x60,%eax
jle    113e <IsSpecialChar+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x7b,%eax
jl     114a <IsSpecialChar+0x4a>
movsbl -0x5(%rbp),%eax
cmp    $0x7d,%eax
jg     114a <IsSpecialChar+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <IsSpecialChar+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsSpecialChar>:
lea    -0x5b(%rdi),%eax
cmp    $0x6,%al
setb   %al
add    $0x85,%dil
cmp    $0x3,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @IsSpecialChar(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 91
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 96
br i1 %10, label %19, label %11
11: ; preds = %7, %1
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 123
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 125
br i1 %18, label %19, label %20
19: ; preds = %15, %7
store i32 1, i32* %2
br label %21
20: ; preds = %15, %11
store i32 0, i32* %2
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @IsSpecialChar(i8 signext %0) {
%2 = add i8 %0, -91
%3 = icmp ult i8 %2, 6
%4 = add i8 %0, -123
%5 = icmp ult i8 %4, 3
%6 = or i1 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
void nand_reset(void) {
  (*(volatile unsigned int *)(0x70200004)) &= ~2;
  (*(volatile unsigned int *)(0x70200008)) = 0xFF;
  while (1) {
    if ((*(volatile unsigned int *)(0x70200028)) & 1)
      break;
  }
  (*(volatile unsigned int *)(0x70200004)) |= 2;
  return;
}


x86 assembly (clang, -O0):
<nand_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x70200004,%eax
mov    (%rax),%ecx
and    $0xfffffffd,%ecx
mov    $0x70200004,%eax
mov    %ecx,(%rax)
mov    $0x70200008,%eax
movl   $0xff,(%rax)
mov    $0x70200028,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1138 <nand_reset+0x38>
jmp    113d <nand_reset+0x3d>
jmp    1120 <nand_reset+0x20>
mov    $0x70200004,%eax
mov    (%rax),%ecx
or     $0x2,%ecx
mov    $0x70200004,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_reset>:
andl   $0xfffffffd,0x70200004
fd
movl   $0xff,0x70200008
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
testl  $0x1,0x70200028
je     1120 <nand_reset+0x20>
orl    $0x2,0x70200004
02
ret

LLVM IR (-O0):
define void @nand_reset() {
%1 = load volatile i32, i32* inttoptr (i64 1881145348 to i32*)
%2 = and i32 %1, -3
store volatile i32 %2, i32* inttoptr (i64 1881145348 to i32*)
store volatile i32 255, i32* inttoptr (i64 1881145352 to i32*)
br label %3
3: ; preds = %0, %8
%4 = load volatile i32, i32* inttoptr (i64 1881145384 to i32*)
%5 = and i32 %4, 1
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %9
8: ; preds = %3
br label %3
9: ; preds = %7
%10 = load volatile i32, i32* inttoptr (i64 1881145348 to i32*)
%11 = or i32 %10, 2
store volatile i32 %11, i32* inttoptr (i64 1881145348 to i32*)
ret void
}

LLVM IR (-O2):
define void @nand_reset() {
%1 = load volatile i32, i32* inttoptr (i64 1881145348 to i32*)
%2 = and i32 %1, -3
store volatile i32 %2, i32* inttoptr (i64 1881145348 to i32*)
store volatile i32 255, i32* inttoptr (i64 1881145352 to i32*)
br label %3
3: ; preds = %3, %0
%4 = load volatile i32, i32* inttoptr (i64 1881145384 to i32*)
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3
%8 = load volatile i32, i32* inttoptr (i64 1881145348 to i32*)
%9 = or i32 %8, 2
store volatile i32 %9, i32* inttoptr (i64 1881145348 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void titlecard(void) { printf("nv-spASM version 0.34 (c) 2014 nextvolume\n"); }


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

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

LLVM IR (-O0):
@.str = [43 x i8] c"nv-spASM version 0.34 (c) 2014 nextvolume\0A\00"
define void @titlecard() {
%1 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [42 x i8] c"nv-spASM version 0.34 (c) 2014 nextvolume\00"
define void @titlecard() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret void
}
int fun_6() { return 6; }


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

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

LLVM IR (-O0):
define i32 @fun_6() {
ret i32 6
}

LLVM IR (-O2):
define i32 @fun_6() {
ret i32 6
}
/* Variables and functions */
int /*<<< orphan*/ _xabort(int);
__attribute__((always_)) void tx_abort(void) { _xabort(0x40); }


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

x86 assembly (clang, -O2):
<tx_abort>:
mov    $0x40,%edi
jmp    1030 <_xabort@plt>

LLVM IR (-O0):
define void @tx_abort() {
%1 = call i32 @_xabort(i32 64)
ret void
}

LLVM IR (-O2):
define void @tx_abort() {
%1 = tail call i32 @_xabort(i32 64)
ret void
}
void exchange(int arr[], int i, int j) {
  int temp = arr[i];
  arr[i] = arr[j];
  arr[j] = temp;
}


x86 assembly (clang, -O0):
<exchange>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<exchange>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @exchange(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ base_width;
};
typedef TYPE_1__ XSizeHints;

/* Variables and functions */
int get_XSizeHints_base_width(void *_p) {
  return (int)((XSizeHints *)_p)->base_width;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XSizeHints_base_width(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ writefile(char const *, int *, int const *, char const *,
                             int *, int *);
void dwritefile(const char *filename, const int *m, const int *n,
                const double *A, const int *ldA, int *info) {
  int cm = *m * (int)(sizeof(double) / sizeof(char));
  int cldA = *ldA * (int)(sizeof(double) / sizeof(char));
  writefile(filename, &cm, n, (const char *)A, &cldA, info);
}


x86 assembly (clang, -O0):
<dwritefile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
shl    $0x3,%eax
mov    %eax,-0x34(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
shl    $0x3,%eax
mov    %eax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x30(%rbp),%r9
lea    -0x34(%rbp),%rsi
lea    -0x38(%rbp),%r8
call   1030 <writefile@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dwritefile>:
push   %rax
mov    (%rsi),%eax
shl    $0x3,%eax
mov    %eax,0x4(%rsp)
mov    (%r8),%eax
shl    $0x3,%eax
mov    %eax,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%r8
call   1030 <writefile@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @dwritefile(i8* %0, i32* %1, i32* %2, double* %3, i32* %4, i32* %5) {
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca double*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32
%14 = alloca i32
store i8* %0, i8** %7
store i32* %1, i32** %8
store i32* %2, i32** %9
store double* %3, double** %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%15 = load i32*, i32** %8
%16 = load i32, i32* %15
%17 = mul nsw i32 %16, 8
store i32 %17, i32* %13
%18 = load i32*, i32** %11
%19 = load i32, i32* %18
%20 = mul nsw i32 %19, 8
store i32 %20, i32* %14
%21 = load i8*, i8** %7
%22 = load i32*, i32** %9
%23 = load double*, double** %10
%24 = bitcast double* %23 to i8*
%25 = load i32*, i32** %12
%26 = call i32 @writefile(i8* %21, i32* %13, i32* %22, i8* %24, i32* %14, i32* %25)
ret void
}

LLVM IR (-O2):
define void @dwritefile(i8* %0, i32* nocapture %1, i32* %2, double* %3, i32* nocapture %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = bitcast i32* %7 to i8*
%10 = load i32, i32* %1
%11 = shl nsw i32 %10, 3
store i32 %11, i32* %7
%12 = bitcast i32* %8 to i8*
%13 = load i32, i32* %4
%14 = shl nsw i32 %13, 3
store i32 %14, i32* %8
%15 = bitcast double* %3 to i8*
%16 = call i32 @writefile(i8* %0, i32* %7, i32* %2, i8* %15, i32* %8, i32* %5)
ret void
}
/* Variables and functions */
int int_swap(int);
scalar_t__ is_le();
int int_to_le(int i) {
  if (is_le())
    return i;
  else
    return int_swap(i);
}


x86 assembly (clang, -O0):
<int_to_le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <is_le@plt>
cmp    $0x0,%rax
je     1147 <int_to_le+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <int_to_le+0x32>
mov    -0x8(%rbp),%edi
call   1040 <int_swap@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_le>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <is_le@plt>
test   %rax,%rax
je     1133 <int_to_le+0x13>
mov    %ebx,%eax
pop    %rbx
ret
mov    %ebx,%edi
pop    %rbx
jmp    1040 <int_swap@plt>

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

LLVM IR (-O2):
define i32 @int_to_le(i32 %0) {
%2 = tail call i64 (...) @is_le()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @int_swap(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %0, %1 ]
ret i32 %7
}
void av_strtok() {}


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

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

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

LLVM IR (-O2):
define void @av_strtok() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ str_printf(char *, int *, char *, int);
void write_int(char *out, int *written, void *d) {
  str_printf(out, written, "%d", (int)(long)d);
}


x86 assembly (clang, -O0):
<write_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    %eax,%ecx
lea    0xec7(%rip),%rdx
call   1030 <str_printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_int>:
mov    %rdx,%rcx
lea    0xee6(%rip),%rdx
jmp    1030 <str_printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @write_int(i8* %0, i32* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i8*
store i8* %0, i8** %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32*, i32** %5
%9 = load i8*, i8** %6
%10 = ptrtoint i8* %9 to i64
%11 = trunc i64 %10 to i32
%12 = call i32 @str_printf(i8* %7, i32* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @write_int(i8* %0, i32* %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @str_printf(i8* %0, i32* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
int f(int a) {
  switch (a) {
  case 0x402:
    return a + 1;
  case 0x403:
    return a + 2;
  case 0x404:
    return a + 3;
  case 0x405:
    return a + 4;
  case 0x406:
    return 1;
  case 0x407:
    return 4;
  }
  return 0;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xfffffbfe,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5,%eax
ja     1182 <f+0x82>
mov    -0x10(%rbp),%rax
lea    0xed7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1189 <f+0x89>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    1189 <f+0x89>
mov    -0x8(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x4(%rbp)
jmp    1189 <f+0x89>
mov    -0x8(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x4(%rbp)
jmp    1189 <f+0x89>
movl   $0x1,-0x4(%rbp)
jmp    1189 <f+0x89>
movl   $0x4,-0x4(%rbp)
jmp    1189 <f+0x89>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
add    $0xfffffbfe,%edi
xor    %eax,%eax
cmp    $0x5,%edi
ja     111a <f+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %19 [
i32 1026, label %5
i32 1027, label %8
i32 1028, label %11
i32 1029, label %14
i32 1030, label %17
i32 1031, label %18
]
5: ; preds = %1
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
br label %20
8: ; preds = %1
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 2
store i32 %10, i32* %2
br label %20
11: ; preds = %1
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 3
store i32 %13, i32* %2
br label %20
14: ; preds = %1
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 4
store i32 %16, i32* %2
br label %20
17: ; preds = %1
store i32 1, i32* %2
br label %20
18: ; preds = %1
store i32 4, i32* %2
br label %20
19: ; preds = %1
store i32 0, i32* %2
br label %20
20: ; preds = %19, %18, %17, %14, %11, %8, %5
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
@switch.table.f = [6 x i32] [i32 1027, i32 1029, i32 1031, i32 1033, i32 1, i32 4]
define i32 @f(i32 %0) {
%2 = add i32 %0, -1026
%3 = icmp ult i32 %2, 6
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [6 x i32], [6 x i32]* @switch.table.f, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ handle_LOST(int /*<<< orphan*/);
int gen_LOST() { handle_LOST(0); }


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

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

LLVM IR (-O0):
define i32 @gen_LOST() {
%1 = alloca i32
%2 = call i32 @handle_LOST(i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @gen_LOST() {
%1 = tail call i32 @handle_LOST(i32 0)
ret i32 undef
}
/* Variables and functions */
size_t modular_power_size_t_unsafe(size_t, size_t, size_t);
size_t modular_power_size_t(size_t x, size_t y, size_t m) {
  return modular_power_size_t_unsafe(x % m, y, m);
}


x86 assembly (clang, -O0):
<modular_power_size_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %rdx,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <modular_power_size_t_unsafe@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modular_power_size_t>:
mov    %rdx,%rcx
mov    %rdi,%rax
mov    %rdi,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1132 <modular_power_size_t+0x22>
xor    %edx,%edx
div    %rcx
mov    %rdx,%rdi
mov    %rcx,%rdx
jmp    1030 <modular_power_size_t_unsafe@plt>
xor    %edx,%edx
div    %ecx
mov    %edx,%edi
mov    %rcx,%rdx
jmp    1030 <modular_power_size_t_unsafe@plt>

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

LLVM IR (-O2):
define i64 @modular_power_size_t(i64 %0, i64 %1, i64 %2) {
%4 = urem i64 %0, %2
%5 = tail call i64 @modular_power_size_t_unsafe(i64 %4, i64 %1, i64 %2)
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ execve(char *, char **, int /*<<< orphan*/ *);
void main(void) {
  char *name[2];
  name[0] = "/bin/sh";
  name[1] = NULL;
  execve(name[0], name, NULL);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <execve@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rdi
mov    %rdi,(%rsp)
movq   $0x0,0x8(%rsp)
mov    %rsp,%rsi
xor    %edx,%edx
call   1030 <execve@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"/bin/sh\00"
define void @main() {
%1 = alloca [2 x i8*]
%2 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 1
store i8* null, i8** %3
%4 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%5 = load i8*, i8** %4
%6 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%7 = call i32 @execve(i8* %5, i8** %6, i32* null)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/sh\00"
define void @main() {
%1 = alloca [2 x i8*]
%2 = bitcast [2 x i8*]* %1 to i8*
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 1
store i8* null, i8** %4
%5 = call i32 @execve(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %3, i32* null)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int bitmap_bit_order;
};
typedef TYPE_1__ XImage;

/* Variables and functions */
void set_XImage_bitmap_bit_order(void *_p, int _v) {
  ((XImage *)_p)->bitmap_bit_order = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XImage_bitmap_bit_order>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XImage_bitmap_bit_order(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_byte(int /*<<< orphan*/);
void PrintString(char *fmt, char *s) {
  if (!fmt || !s)
    return;
  while (*s)
    print_byte(*s++);
  return;
}


x86 assembly (clang, -O0):
<PrintString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1136 <PrintString+0x26>
cmpq   $0x0,-0x10(%rbp)
jne    113b <PrintString+0x2b>
jmp    116e <PrintString+0x5e>
jmp    1140 <PrintString+0x30>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1169 <PrintString+0x59>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <print_byte@plt>
jmp    1140 <PrintString+0x30>
jmp    116e <PrintString+0x5e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintString>:
push   %rbx
test   %rdi,%rdi
je     1143 <PrintString+0x33>
mov    %rsi,%rbx
test   %rsi,%rsi
je     1143 <PrintString+0x33>
mov    (%rbx),%al
test   %al,%al
je     1143 <PrintString+0x33>
add    $0x1,%rbx
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <print_byte@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <PrintString+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @PrintString(i8* readnone %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2
%7 = load i8, i8* %1
%8 = icmp eq i8 %7, 0
br i1 %8, label %17, label %9
9: ; preds = %6, %9
%10 = phi i8 [ %15, %9 ], [ %7, %6 ]
%11 = phi i8* [ %12, %9 ], [ %1, %6 ]
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = sext i8 %10 to i32
%14 = tail call i32 @print_byte(i32 %13)
%15 = load i8, i8* %12
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %9
17: ; preds = %9, %6, %2
ret void
}
/* Variables and functions */
unsigned long CountLeadingZeroes(unsigned long);
unsigned long CountLeadingOnes(unsigned long x) {
  return CountLeadingZeroes(~x);
}


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

x86 assembly (clang, -O2):
<CountLeadingOnes>:
not    %rdi
jmp    1030 <CountLeadingZeroes@plt>

LLVM IR (-O0):
define i64 @CountLeadingOnes(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = xor i64 %3, -1
%5 = call i64 @CountLeadingZeroes(i64 %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @CountLeadingOnes(i64 %0) {
%2 = xor i64 %0, -1
%3 = tail call i64 @CountLeadingZeroes(i64 %2)
ret i64 %3
}
/* Type definitions */
struct constructHeader {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SetNextConstruct(struct constructHeader *,
                                    struct constructHeader *);
void SetNextDefgeneric(void *theDefgeneric, void *targetDefgeneric) {
  SetNextConstruct((struct constructHeader *)theDefgeneric,
                   (struct constructHeader *)targetDefgeneric);
}


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

x86 assembly (clang, -O2):
<SetNextDefgeneric>:
jmp    1030 <SetNextConstruct@plt>

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

LLVM IR (-O2):
%struct.constructHeader = type { i32 }
define void @SetNextDefgeneric(i8* %0, i8* %1) {
%3 = bitcast i8* %0 to %struct.constructHeader*
%4 = bitcast i8* %1 to %struct.constructHeader*
%5 = tail call i32 @SetNextConstruct(%struct.constructHeader* %3, %struct.constructHeader* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getParLong(long *);
int /*<<< orphan*/ i2c_read(long, long, long);
void IF_I2CRead(void) {
  long id, add, off;
  if (!getParLong(&id))
    return;
  if (!getParLong(&add))
    return;
  if (!getParLong(&off))
    return;
  i2c_read(id, add, off);
}


x86 assembly (clang, -O0):
<IF_I2CRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x8(%rbp),%rdi
call   1040 <getParLong@plt>
cmp    $0x0,%eax
jne    113f <IF_I2CRead+0x1f>
jmp    117e <IF_I2CRead+0x5e>
lea    -0x10(%rbp),%rdi
call   1040 <getParLong@plt>
cmp    $0x0,%eax
jne    1156 <IF_I2CRead+0x36>
jmp    117e <IF_I2CRead+0x5e>
lea    -0x18(%rbp),%rdi
call   1040 <getParLong@plt>
cmp    $0x0,%eax
jne    116d <IF_I2CRead+0x4d>
jmp    117e <IF_I2CRead+0x5e>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <i2c_read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IF_I2CRead>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rdi
call   1040 <getParLong@plt>
test   %eax,%eax
je     115f <IF_I2CRead+0x3f>
lea    0x8(%rsp),%rdi
call   1040 <getParLong@plt>
test   %eax,%eax
je     115f <IF_I2CRead+0x3f>
mov    %rsp,%rdi
call   1040 <getParLong@plt>
test   %eax,%eax
je     115f <IF_I2CRead+0x3f>
mov    0x10(%rsp),%rdi
mov    0x8(%rsp),%rsi
mov    (%rsp),%rdx
call   1030 <i2c_read@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define void @IF_I2CRead() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = bitcast i64* %1 to i8*
%5 = bitcast i64* %2 to i8*
%6 = bitcast i64* %3 to i8*
%7 = call i32 @getParLong(i64* %1)
%8 = icmp eq i32 %7, 0
br i1 %8, label %20, label %9
9: ; preds = %0
%10 = call i32 @getParLong(i64* %2)
%11 = icmp eq i32 %10, 0
br i1 %11, label %20, label %12
12: ; preds = %9
%13 = call i32 @getParLong(i64* %3)
%14 = icmp eq i32 %13, 0
br i1 %14, label %20, label %15
15: ; preds = %12
%16 = load i64, i64* %1
%17 = load i64, i64* %2
%18 = load i64, i64* %3
%19 = call i32 @i2c_read(i64 %16, i64 %17, i64 %18)
br label %20
20: ; preds = %12, %9, %0, %15
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ srand(unsigned int);
void randomNumberInit() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  srand((unsigned int)(tv.tv_sec ^ tv.tv_usec));
}


x86 assembly (clang, -O0):
<randomNumberInit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%edi
xor    -0x4(%rbp),%edi
call   1040 <srand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomNumberInit>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    0x4(%rsp),%edi
xor    (%rsp),%edi
pop    %rax
jmp    1040 <srand@plt>

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define void @randomNumberInit() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load i32, i32* %5
%7 = xor i32 %4, %6
%8 = call i32 @srand(i32 %7)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define void @randomNumberInit() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i32, i32* %6
%8 = xor i32 %7, %5
%9 = tail call i32 @srand(i32 %8)
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
long timeGetTime(void) {
  struct timeval now;
  gettimeofday(&now, 0);
  return (long)((now.tv_sec * 1000) + (now.tv_usec / 1000));
}


x86 assembly (clang, -O0):
<timeGetTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeGetTime>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq (%rsp),%rax
imul   $0x3e8,%rax,%rcx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @timeGetTime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = add nsw i32 %5, %8
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @timeGetTime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
%11 = sext i32 %10 to i64
ret i64 %11
}
/* Type definitions */
typedef struct dirent dirent;

/* Variables and functions */
int alphasort_thunk(void *thunk, const void *p1, const void *p2) {
  int (*dc)(const struct dirent **, const struct dirent **);
  dc = *(int (**)(const struct dirent **, const struct dirent **))thunk;
  return (dc((const struct dirent **)p1, (const struct dirent **)p2));
}


x86 assembly (clang, -O0):
<alphasort_thunk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alphasort_thunk>:
mov    (%rdi),%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    *%rax

LLVM IR (-O0):
%struct.dirent = type opaque
define i32 @alphasort_thunk(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32 (%struct.dirent**, %struct.dirent**)*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32 (%struct.dirent**, %struct.dirent**)**
%10 = load i32 (%struct.dirent**, %struct.dirent**)*, i32 (%struct.dirent**, %struct.dirent**)** %9
store i32 (%struct.dirent**, %struct.dirent**)* %10, i32 (%struct.dirent**, %struct.dirent**)** %7
%11 = load i32 (%struct.dirent**, %struct.dirent**)*, i32 (%struct.dirent**, %struct.dirent**)** %7
%12 = load i8*, i8** %5
%13 = bitcast i8* %12 to %struct.dirent**
%14 = load i8*, i8** %6
%15 = bitcast i8* %14 to %struct.dirent**
%16 = call i32 %11(%struct.dirent** %13, %struct.dirent** %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.dirent = type opaque
define i32 @alphasort_thunk(i8* nocapture %0, i8* %1, i8* %2) {
%4 = bitcast i8* %0 to i32 (%struct.dirent**, %struct.dirent**)**
%5 = load i32 (%struct.dirent**, %struct.dirent**)*, i32 (%struct.dirent**, %struct.dirent**)** %4
%6 = bitcast i8* %1 to %struct.dirent**
%7 = bitcast i8* %2 to %struct.dirent**
%8 = tail call i32 %5(%struct.dirent** %6, %struct.dirent** %7)
ret i32 %8
}