xunge/DecIR huggingface dataset:
unsigned getbits(unsigned x, int p, int n) {
  if ((p + 1 - n) < 0)
    return (x & (~(~0 << n)));
  return ((x >> (p + 1 - n)) & (~(~0 << n)));
}


x86 assembly (clang, -O0):
<getbits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
sub    -0x10(%rbp),%eax
cmp    $0x0,%eax
jge    113b <getbits+0x3b>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    115d <getbits+0x5d>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
sub    -0x10(%rbp),%ecx
shr    %cl,%eax
mov    -0x10(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getbits>:
mov    %edi,%eax
sub    %edx,%esi
inc    %esi
js     111c <getbits+0x1c>
mov    %eax,%edi
mov    %esi,%ecx
shr    %cl,%edi
mov    $0xffffffff,%eax
mov    %edx,%ecx
shl    %cl,%eax
not    %eax
and    %edi,%eax
ret
mov    $0xffffffff,%edi
mov    %edx,%ecx
shl    %cl,%edi
not    %edi
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @getbits(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %6
%9 = add nsw i32 %8, 1
%10 = load i32, i32* %7
%11 = sub nsw i32 %9, %10
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %3
%14 = load i32, i32* %5
%15 = load i32, i32* %7
%16 = shl i32 -1, %15
%17 = xor i32 %16, -1
%18 = and i32 %14, %17
store i32 %18, i32* %4
br label %30
19: ; preds = %3
%20 = load i32, i32* %5
%21 = load i32, i32* %6
%22 = add nsw i32 %21, 1
%23 = load i32, i32* %7
%24 = sub nsw i32 %22, %23
%25 = lshr i32 %20, %24
%26 = load i32, i32* %7
%27 = shl i32 -1, %26
%28 = xor i32 %27, -1
%29 = and i32 %25, %28
store i32 %29, i32* %4
br label %30
30: ; preds = %19, %13
%31 = load i32, i32* %4
ret i32 %31
}

LLVM IR (-O2):
define i32 @getbits(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, 1
%5 = sub i32 %4, %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = shl nsw i32 -1, %2
%9 = xor i32 %8, -1
br label %14
10: ; preds = %3
%11 = lshr i32 %0, %5
%12 = shl nsw i32 -1, %2
%13 = xor i32 %12, -1
br label %14
14: ; preds = %10, %7
%15 = phi i32 [ %13, %10 ], [ %0, %7 ]
%16 = phi i32 [ %11, %10 ], [ %9, %7 ]
%17 = and i32 %16, %15
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ CloseCOM(int);
int /*<<< orphan*/ DS2480Detect(int);
int /*<<< orphan*/ OpenCOM(int, char *);
int /*<<< orphan*/ owRaiseError(int);
int owAcquire(int portnum, char *port_zstr) {
  if (!OpenCOM(portnum, port_zstr)) {
    owRaiseError(8);
    return 0;
  }
  if (!DS2480Detect(portnum)) {
    CloseCOM(portnum);
    owRaiseError(5);
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<owAcquire>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <OpenCOM@plt>
cmp    $0x0,%eax
jne    117a <owAcquire+0x3a>
mov    $0x8,%edi
call   1050 <owRaiseError@plt>
movl   $0x0,-0x4(%rbp)
jmp    11b0 <owAcquire+0x70>
mov    -0x8(%rbp),%edi
call   1030 <DS2480Detect@plt>
cmp    $0x0,%eax
jne    11a9 <owAcquire+0x69>
mov    -0x8(%rbp),%edi
call   1040 <CloseCOM@plt>
mov    $0x5,%edi
call   1050 <owRaiseError@plt>
movl   $0x0,-0x4(%rbp)
jmp    11b0 <owAcquire+0x70>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<owAcquire>:
push   %rbx
mov    %edi,%ebx
call   1060 <OpenCOM@plt>
test   %eax,%eax
je     1160 <owAcquire+0x20>
mov    %ebx,%edi
call   1030 <DS2480Detect@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
je     1167 <owAcquire+0x27>
pop    %rbx
ret
mov    $0x8,%edi
jmp    1173 <owAcquire+0x33>
mov    %ebx,%edi
call   1040 <CloseCOM@plt>
mov    $0x5,%edi
call   1050 <owRaiseError@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @owAcquire(i32 %0, i8* %1) {
%3 = tail call i32 @OpenCOM(i32 %0, i8* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i32 @DS2480Detect(i32 %0)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = tail call i32 @CloseCOM(i32 %0)
br label %10
10: ; preds = %2, %8
%11 = phi i32 [ 5, %8 ], [ 8, %2 ]
%12 = tail call i32 @owRaiseError(i32 %11)
br label %13
13: ; preds = %10, %5
%14 = phi i32 [ 1, %5 ], [ 0, %10 ]
ret i32 %14
}
void init(int bucket[512 * 4]) {
  int radixID, i;
loop1_outter:
  for (radixID = 0; radixID < 512 * 4; ++radixID)
    bucket[radixID] = 0;
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x800,-0xc(%rbp)
jge    1139 <init+0x39>
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    110f <init+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
mov    $0x2000,%edx
xor    %esi,%esi
call   1030 <memset@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @init(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to i8*
ret void
}
int snd_media_start_pipeline(struct snd_usb_substream *subs) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.snd_usb_substream = type opaque
define i32 @snd_media_start_pipeline(%struct.snd_usb_substream* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ temperatureConversion();
int main() {
  temperatureConversion();
  return 0;
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @ScalePlaneVertical() {
ret void
}
void func4() {}


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

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

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

LLVM IR (-O2):
define void @func4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vrna_message_constraint_options(unsigned int);
void print_tty_constraint(unsigned int option) {
  vrna_message_constraint_options(option);
}


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

x86 assembly (clang, -O2):
<print_tty_constraint>:
jmp    1030 <vrna_message_constraint_options@plt>

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

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

/* Variables and functions */
int bits_get(struct bitstream *, int);
int bits_get_signed_linear(struct bitstream *bits, int n) {
  if (n == 0)
    return 0;
  int v = bits_get(bits, n);
  return (v >> 1) ^ -(v & 1);
}


x86 assembly (clang, -O0):
<bits_get_signed_linear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1135 <bits_get_signed_linear+0x25>
movl   $0x0,-0x4(%rbp)
jmp    1159 <bits_get_signed_linear+0x49>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <bits_get@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
sar    $0x1,%eax
mov    -0x18(%rbp),%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits_get_signed_linear>:
test   %esi,%esi
je     112a <bits_get_signed_linear+0x1a>
push   %rax
call   1030 <bits_get@plt>
mov    %eax,%ecx
sar    %ecx
and    $0x1,%eax
neg    %eax
xor    %ecx,%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.bitstream = type { i32 }
define i32 @bits_get_signed_linear(%struct.bitstream* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.bitstream*
%5 = alloca i32
%6 = alloca i32
store %struct.bitstream* %0, %struct.bitstream** %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %20
10: ; preds = %2
%11 = load %struct.bitstream*, %struct.bitstream** %4
%12 = load i32, i32* %5
%13 = call i32 @bits_get(%struct.bitstream* %11, i32 %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = ashr i32 %14, 1
%16 = load i32, i32* %6
%17 = and i32 %16, 1
%18 = sub nsw i32 0, %17
%19 = xor i32 %15, %18
store i32 %19, i32* %3
br label %20
20: ; preds = %10, %9
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
%struct.bitstream = type { i32 }
define i32 @bits_get_signed_linear(%struct.bitstream* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = tail call i32 @bits_get(%struct.bitstream* %0, i32 %1)
%6 = ashr i32 %5, 1
%7 = and i32 %5, 1
%8 = sub nsw i32 0, %7
%9 = xor i32 %6, %8
br label %10
10: ; preds = %2, %4
%11 = phi i32 [ %9, %4 ], [ 0, %2 ]
ret i32 %11
}
int copy_size(unsigned long file_size, int send_qtd) {
  if (file_size > 100 * send_qtd)
    return 100;
  else
    return 100 + file_size - (100 * send_qtd);
}


x86 assembly (clang, -O0):
<copy_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
imul   $0x64,-0x14(%rbp),%ecx
movslq %ecx,%rcx
cmp    %rcx,%rax
jbe    112b <copy_size+0x2b>
movl   $0x64,-0x4(%rbp)
jmp    1140 <copy_size+0x40>
mov    -0x10(%rbp),%rax
add    $0x64,%rax
imul   $0x64,-0x14(%rbp),%ecx
movslq %ecx,%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_size>:
imul   $0x64,%esi,%eax
cltq
mov    %edi,%ecx
sub    %eax,%ecx
add    $0x64,%ecx
cmp    %rdi,%rax
mov    $0x64,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @copy_size(i64 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32
store i64 %0, i64* %4
store i32 %1, i32* %5
%6 = load i64, i64* %4
%7 = load i32, i32* %5
%8 = mul nsw i32 100, %7
%9 = sext i32 %8 to i64
%10 = icmp ugt i64 %6, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 100, i32* %3
br label %20
12: ; preds = %2
%13 = load i64, i64* %4
%14 = add i64 100, %13
%15 = load i32, i32* %5
%16 = mul nsw i32 100, %15
%17 = sext i32 %16 to i64
%18 = sub i64 %14, %17
%19 = trunc i64 %18 to i32
store i32 %19, i32* %3
br label %20
20: ; preds = %12, %11
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @copy_size(i64 %0, i32 %1) {
%3 = mul nsw i32 %1, 100
%4 = sext i32 %3 to i64
%5 = icmp ult i64 %4, %0
%6 = trunc i64 %0 to i32
%7 = add i32 %6, 100
%8 = sub i32 %7, %3
%9 = select i1 %5, i32 100, i32 %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ CreateWin42(unsigned long, unsigned long);
void createwin(unsigned long w, unsigned long h) { CreateWin42(w, h); }


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

x86 assembly (clang, -O2):
<createwin>:
jmp    1030 <CreateWin42@plt>

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

LLVM IR (-O2):
define void @createwin(i64 %0, i64 %1) {
%3 = tail call i32 @CreateWin42(i64 %0, i64 %1)
ret void
}
int main() {
  int x = 10, y = 20;
  printf("x = %d, y = %d\n", x, y);
  __asm__ __volatile__("movl %1, %%eax\n\t"
                       "movl %0, %1\n\t"
                       "movl %%eax, %0\n\t"
                       : "=r"(y), "=r"(x)
                       : "0"(y), "1"(x)
                       : "%eax");
  printf("x = %d, y = %d\n", x, y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%edx
mov    %edx,%eax
mov    %ecx,%edx
mov    %eax,%ecx
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %ecx,-0xc(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
lea    0xee5(%rip),%r14
mov    $0xa,%ebp
mov    $0x14,%ebx
mov    %r14,%rdi
mov    $0xa,%esi
mov    $0x14,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebp,%eax
mov    %ebx,%ebp
mov    %eax,%ebx
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"x = %d, y = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = call { i32, i32 } asm sideeffect "movl $1, %eax\0A\09movl $0, $1\0A\09movl %eax, $0\0A\09", "=r,=r,0,1,~{eax},~{dirflag},~{fpsr},~{flags}"(i32 %7, i32 %8)
%10 = extractvalue { i32, i32 } %9, 0
%11 = extractvalue { i32, i32 } %9, 1
store i32 %10, i32* %3
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"x = %d, y = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 10, i32 20)
%2 = tail call { i32, i32 } asm sideeffect "movl $1, %eax\0A\09movl $0, $1\0A\09movl %eax, $0\0A\09", "=r,=r,0,1,~{eax},~{dirflag},~{fpsr},~{flags}"(i32 20, i32 10)
%3 = extractvalue { i32, i32 } %2, 0
%4 = extractvalue { i32, i32 } %2, 1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %3)
ret i32 0
}
long long testll(long long *p) {
  if (*p > 0x123456789ABCDEFll)
    return 0x111111111ll;
  else
    return 0x222222222ll;
}


x86 assembly (clang, -O0):
<testll>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movabs $0x123456789abcdef,%rcx
45 23 01
cmp    %rcx,(%rax)
jle    1132 <testll+0x32>
movabs $0x111111111,%rax
mov    %rax,-0x8(%rbp)
jmp    1140 <testll+0x40>
movabs $0x222222222,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testll>:
movabs $0x123456789abcdef,%rax
45 23 01
cmp    %rax,(%rdi)
movabs $0x111111111,%rcx
movabs $0x222222222,%rax
cmovg  %rcx,%rax
ret

LLVM IR (-O0):
define i64 @testll(i64* %0) {
%2 = alloca i64
%3 = alloca i64*
store i64* %0, i64** %3
%4 = load i64*, i64** %3
%5 = load i64, i64* %4
%6 = icmp sgt i64 %5, 81985529216486895
br i1 %6, label %7, label %8
7: ; preds = %1
store i64 4581298449, i64* %2
br label %9
8: ; preds = %1
store i64 9162596898, i64* %2
br label %9
9: ; preds = %8, %7
%10 = load i64, i64* %2
ret i64 %10
}

LLVM IR (-O2):
define i64 @testll(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = icmp sgt i64 %2, 81985529216486895
%4 = select i1 %3, i64 4581298449, i64 9162596898
ret i64 %4
}
/* Variables and functions */
int floor(int /*<<< orphan*/);
int /*<<< orphan*/ log10(int);
int pow(int, char);
int rotate(int n) {
  char len;
  len = floor(log10(n)) + 1;
  return (n / 10) + (n % 10) * pow(10, len - 1);
}


x86 assembly (clang, -O0):
<rotate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <log10@plt>
mov    %eax,%edi
call   1050 <floor@plt>
add    $0x1,%eax
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
movsbl -0x5(%rbp),%eax
sub    $0x1,%eax
mov    $0xa,%edi
movsbl %al,%esi
call   1030 <pow@plt>
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%edx
add    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
call   1040 <log10@plt>
mov    %eax,%edi
call   1050 <floor@plt>
movslq %ebx,%r14
imul   $0x66666667,%r14,%rbx
mov    %rbx,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rbx
add    %ecx,%ebx
lea    (%rbx,%rbx,1),%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%r14d
movsbl %al,%esi
mov    $0xa,%edi
call   1030 <pow@plt>
imul   %r14d,%eax
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @rotate(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @log10(i32 %4)
%6 = call i32 @floor(i32 %5)
%7 = add nsw i32 %6, 1
%8 = trunc i32 %7 to i8
store i8 %8, i8* %3
%9 = load i32, i32* %2
%10 = sdiv i32 %9, 10
%11 = load i32, i32* %2
%12 = srem i32 %11, 10
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = sub nsw i32 %14, 1
%16 = trunc i32 %15 to i8
%17 = call i32 @pow(i32 10, i8 signext %16)
%18 = mul nsw i32 %12, %17
%19 = add nsw i32 %10, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @rotate(i32 %0) {
%2 = tail call i32 @log10(i32 %0)
%3 = tail call i32 @floor(i32 %2)
%4 = sdiv i32 %0, 10
%5 = srem i32 %0, 10
%6 = trunc i32 %3 to i8
%7 = tail call i32 @pow(i32 10, i8 signext %6)
%8 = mul nsw i32 %7, %5
%9 = add nsw i32 %8, %4
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ client_DISCONNECT();
void othello_DISCONNECT(char *t) { client_DISCONNECT(); }


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

x86 assembly (clang, -O2):
<othello_DISCONNECT>:
xor    %eax,%eax
jmp    1030 <client_DISCONNECT@plt>

LLVM IR (-O0):
define void @othello_DISCONNECT(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @client_DISCONNECT()
ret void
}

LLVM IR (-O2):
define void @othello_DISCONNECT(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @client_DISCONNECT()
ret void
}
void change_output_port(unsigned int port) {}


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

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

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

LLVM IR (-O2):
define void @change_output_port(i32 %0) {
ret void
}
int funcFace() { return 0x42 * 7; }


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

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

LLVM IR (-O0):
define i32 @funcFace() {
ret i32 462
}

LLVM IR (-O2):
define i32 @funcFace() {
ret i32 462
}
char *strcpy(char *dest, const char *src) {
  char *bk = dest;
  while (*src != 0) {
    *dest = *src;
    src++;
    dest++;
  }
  *dest = 0;
  return bk;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114d <strcpy+0x4d>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %rdi,%rdx
test   %cl,%cl
je     1131 <strcpy+0x31>
add    $0x1,%rsi
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %cl,(%rdx)
add    $0x1,%rdx
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <strcpy+0x20>
movb   $0x0,(%rdx)
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
store i8 %6, i8* %7
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %0
}
float Immato_Clamp(float in_t, int high_i, int low_i) {
  return (in_t < low_i) ? low_i : (in_t > high_i) ? high_i : in_t;
}


x86 assembly (clang, -O0):
<Immato_Clamp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
cvtsi2ssl -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1131 <Immato_Clamp+0x31>
cvtsi2ssl -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1167 <Immato_Clamp+0x67>
movss  -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
ucomiss %xmm1,%xmm0
jbe    1153 <Immato_Clamp+0x53>
cvtsi2ssl -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    115d <Immato_Clamp+0x5d>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Immato_Clamp>:
cvtsi2ss %esi,%xmm1
cvtsi2ss %edi,%xmm2
minss  %xmm0,%xmm2
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm3
andnps %xmm2,%xmm3
andps  %xmm1,%xmm0
orps   %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @Immato_Clamp(float %0, i32 %1, i32 %2) {
%4 = alloca float
%5 = alloca i32
%6 = alloca i32
store float %0, float* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load float, float* %4
%8 = load i32, i32* %6
%9 = sitofp i32 %8 to float
%10 = fcmp olt float %7, %9
br i1 %10, label %11, label %14
11: ; preds = %3
%12 = load i32, i32* %6
%13 = sitofp i32 %12 to float
br label %26
14: ; preds = %3
%15 = load float, float* %4
%16 = load i32, i32* %5
%17 = sitofp i32 %16 to float
%18 = fcmp ogt float %15, %17
br i1 %18, label %19, label %22
19: ; preds = %14
%20 = load i32, i32* %5
%21 = sitofp i32 %20 to float
br label %24
22: ; preds = %14
%23 = load float, float* %4
br label %24
24: ; preds = %22, %19
%25 = phi float [ %21, %19 ], [ %23, %22 ]
br label %26
26: ; preds = %24, %11
%27 = phi float [ %13, %11 ], [ %25, %24 ]
ret float %27
}

LLVM IR (-O2):
define float @Immato_Clamp(float %0, i32 %1, i32 %2) {
%4 = sitofp i32 %2 to float
%5 = fcmp ogt float %4, %0
%6 = sitofp i32 %1 to float
%7 = fcmp olt float %6, %0
%8 = select i1 %7, float %6, float %0
%9 = select i1 %5, float %4, float %8
ret float %9
}
/* Type definitions */
struct type {
  int dummy;
};
struct compile_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ align_of(struct compile_state *, struct type *);
size_t bits_to_bytes(int /*<<< orphan*/);
size_t align_of_in_bytes(struct compile_state *state, struct type *type) {
  return bits_to_bytes(align_of(state, type));
}


x86 assembly (clang, -O0):
<align_of_in_bytes>:
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 <align_of@plt>
mov    %eax,%edi
call   1030 <bits_to_bytes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<align_of_in_bytes>:
push   %rax
call   1040 <align_of@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <bits_to_bytes@plt>

LLVM IR (-O0):
%struct.compile_state = type { i32 }
%struct.type = type { i32 }
define i64 @align_of_in_bytes(%struct.compile_state* %0, %struct.type* %1) {
%3 = alloca %struct.compile_state*
%4 = alloca %struct.type*
store %struct.compile_state* %0, %struct.compile_state** %3
store %struct.type* %1, %struct.type** %4
%5 = load %struct.compile_state*, %struct.compile_state** %3
%6 = load %struct.type*, %struct.type** %4
%7 = call i32 @align_of(%struct.compile_state* %5, %struct.type* %6)
%8 = call i64 @bits_to_bytes(i32 %7)
ret i64 %8
}

LLVM IR (-O2):
%struct.compile_state = type { i32 }
%struct.type = type { i32 }
define i64 @align_of_in_bytes(%struct.compile_state* %0, %struct.type* %1) {
%3 = tail call i32 @align_of(%struct.compile_state* %0, %struct.type* %1)
%4 = tail call i64 @bits_to_bytes(i32 %3)
ret i64 %4
}
int test_and_clear_bit(int nr, volatile void *addr) {
  int oldbit;
  asm volatile("lock; btrl %2,%1 ;\n \tsbbl %0,%0"
               : "=r"(oldbit), "=m"(*(volatile long *)addr)
               : "Ir"(nr), "m"(*(volatile long *)addr)
               : "memory");
  return oldbit;
}


x86 assembly (clang, -O0):
<test_and_clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rdx
lock btr %ecx,(%rax)
sbb    %eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_and_clear_bit>:
lock btr %edi,(%rsi)
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @test_and_clear_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i64*
%8 = load i32, i32* %3
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i64*
%11 = call i32 asm sideeffect "lock; btrl $2,$1 ;\0A \09sbbl $0,$0", "=r,=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %7, i32 %8, i64* elementtype(i64) %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @test_and_clear_bit(i32 %0, i8* %1) {
%3 = bitcast i8* %1 to i64*
%4 = tail call i32 asm sideeffect "lock; btrl $2,$1 ;\0A \09sbbl $0,$0", "=r,=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %3, i32 %0, i64* elementtype(i64) %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_idxset_put() {
  printf("NOT IMPLEMENTED:"
         "pa_idxset_put"
         "\n");
}


x86 assembly (clang, -O0):
<pa_idxset_put>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [31 x i8] c"NOT IMPLEMENTED:pa_idxset_put\0A\00"
define i32 @pa_idxset_put() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [30 x i8] c"NOT IMPLEMENTED:pa_idxset_put\00"
define i32 @pa_idxset_put() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void free_mixy(int **mxy, int alen) {
  int j;
  for (j = 1; j < alen; j++)
    free(mxy[j]);
  free(mxy);
}


x86 assembly (clang, -O0):
<free_mixy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <free_mixy+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_mixy+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_mixy>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
cmp    $0x2,%esi
jl     1142 <free_mixy+0x32>
mov    %esi,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_mixy+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_mixy(i32** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32*, i32** %0, i64 %7
%9 = bitcast i32** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast i32** %0 to i8*
tail call void @free(i8* %14)
ret void
}
/* Type definitions */
struct timeval {
  unsigned int tv_sec;
  unsigned int tv_usec;
};

/* Variables and functions */
void BFD_US2TIMEVAL(unsigned int *pus, struct timeval *ptv) {
  if (pus && ptv) {
    ptv->tv_sec = (*pus) / (1000000);
    ptv->tv_usec = (*pus) % (1000000);
  }
}


x86 assembly (clang, -O0):
<BFD_US2TIMEVAL>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114f <BFD_US2TIMEVAL+0x4f>
cmpq   $0x0,-0x10(%rbp)
je     114f <BFD_US2TIMEVAL+0x4f>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    $0xf4240,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    $0xf4240,%ecx
xor    %edx,%edx
div    %ecx
mov    -0x10(%rbp),%rax
mov    %edx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<BFD_US2TIMEVAL>:
test   %rdi,%rdi
je     1131 <BFD_US2TIMEVAL+0x31>
test   %rsi,%rsi
je     1131 <BFD_US2TIMEVAL+0x31>
mov    (%rdi),%eax
imul   $0x431bde83,%rax,%rax
shr    $0x32,%rax
mov    %eax,(%rsi)
mov    (%rdi),%eax
imul   $0x431bde83,%rax,%rcx
shr    $0x32,%rcx
imul   $0xf4240,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,0x4(%rsi)
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define void @BFD_US2TIMEVAL(i32* %0, %struct.timeval* %1) {
%3 = alloca i32*
%4 = alloca %struct.timeval*
store i32* %0, i32** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load i32*, i32** %3
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %21
7: ; preds = %2
%8 = load %struct.timeval*, %struct.timeval** %4
%9 = icmp ne %struct.timeval* %8, null
br i1 %9, label %10, label %21
10: ; preds = %7
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = udiv i32 %12, 1000000
%14 = load %struct.timeval*, %struct.timeval** %4
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %14, i32 0, i32 0
store i32 %13, i32* %15
%16 = load i32*, i32** %3
%17 = load i32, i32* %16
%18 = urem i32 %17, 1000000
%19 = load %struct.timeval*, %struct.timeval** %4
%20 = getelementptr inbounds %struct.timeval, %struct.timeval* %19, i32 0, i32 1
store i32 %18, i32* %20
br label %21
21: ; preds = %10, %7, %2
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define void @BFD_US2TIMEVAL(i32* %0, %struct.timeval* writeonly %1) {
%3 = icmp ne i32* %0, null
%4 = icmp ne %struct.timeval* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %13
6: ; preds = %2
%7 = load i32, i32* %0
%8 = udiv i32 %7, 1000000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
store i32 %8, i32* %9
%10 = load i32, i32* %0
%11 = urem i32 %10, 1000000
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
store i32 %11, i32* %12
br label %13
13: ; preds = %6, %2
ret void
}
void FlashGainPump(void) {
  while ((*((volatile unsigned long *)(0x400FB700 + 0x000000048))) != 0) {
  }
  (*((volatile unsigned long *)(0x400FB700 + 0x000000048))) = 0xA5937EC0 | 0x2;
}


x86 assembly (clang, -O0):
<FlashGainPump>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <FlashGainPump+0x9>
mov    $0x400fb748,%eax
mov    (%rax),%rax
cmp    $0x0,%rax
je     1120 <FlashGainPump+0x20>
jmp    1109 <FlashGainPump+0x9>
mov    $0x400fb748,%eax
mov    $0xa5937ec2,%ecx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlashGainPump>:
cmpq   $0x0,0x400fb748
jne    1100 <FlashGainPump>
mov    $0xa5937ec2,%eax
mov    %rax,0x400fb748
40
ret

LLVM IR (-O0):
define void @FlashGainPump() {
br label %1
1: ; preds = %4, %0
%2 = load volatile i64, i64* inttoptr (i64 1074771784 to i64*)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
br label %1
5: ; preds = %1
store volatile i64 2777906882, i64* inttoptr (i64 1074771784 to i64*)
ret void
}

LLVM IR (-O2):
define void @FlashGainPump() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i64, i64* inttoptr (i64 1074771784 to i64*)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
store volatile i64 2777906882, i64* inttoptr (i64 1074771784 to i64*)
ret void
}
unsigned xrop3_116_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = T ^ D;
  stk2 = S | stk3;
  stk1 = D ^ stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_116_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_116_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
xor    $0xff,%eax
or     %ecx,%eax
xor    $0xff,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_116_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = load i32, i32* %5
%25 = xor i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %6
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %5
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
ret i32 %32
}

LLVM IR (-O2):
define i32 @xrop3_116_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %6, 255
%8 = or i32 %7, %4
%9 = xor i32 %8, 255
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ send_msg(int, char *);
void not_found_404(int send_to) { send_msg(send_to, "<h3>Not Found 404</h3>"); }


x86 assembly (clang, -O0):
<not_found_404>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
call   1030 <send_msg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<not_found_404>:
lea    0xee9(%rip),%rsi
jmp    1030 <send_msg@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"<h3>Not Found 404</h3>\00"
define void @not_found_404(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @send_msg(i32 %3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"<h3>Not Found 404</h3>\00"
define void @not_found_404(i32 %0) {
%2 = tail call i32 @send_msg(i32 %0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int __builtin_mips_cabs_ngle_s(float, float);
int test9(float a, float b) { return __builtin_mips_cabs_ngle_s(a, b); }


x86 assembly (clang, -O0):
<test9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <__builtin_mips_cabs_ngle_s@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test9>:
jmp    1030 <__builtin_mips_cabs_ngle_s@plt>

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

LLVM IR (-O2):
define i32 @test9(float %0, float %1) {
%3 = tail call i32 @__builtin_mips_cabs_ngle_s(float %0, float %1)
ret i32 %3
}
extern void l(void) {}


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

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

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

LLVM IR (-O2):
define void @l() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *toString();
void printQueue() { printf("Print queue: [%s]\n", toString()); }


x86 assembly (clang, -O0):
<printQueue>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <toString@plt>
mov    %rax,%rsi
lea    0xecb(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printQueue>:
push   %rax
xor    %eax,%eax
call   1030 <toString@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Print queue: [%s]\0A\00"
define void @printQueue() {
%1 = call i8* (...) @toString()
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Print queue: [%s]\0A\00"
define void @printQueue() {
%1 = tail call i8* (...) @toString()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ __softboundmpx_store_return_metadata(void *, void *);
scalar_t__ fdopendir(int);
__attribute__((__weak__, __always___)) DIR *softboundmpx_fdopendir(int fd) {
  void *ret_ptr = (void *)fdopendir(fd);
  void *ret_ptr_bound = (char *)ret_ptr + 1024 * 1024;
  __softboundmpx_store_return_metadata(ret_ptr, ret_ptr_bound);
  return (DIR *)ret_ptr;
}


x86 assembly (clang, -O0):
<softboundmpx_fdopendir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <fdopendir@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x100000,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <__softboundmpx_store_return_metadata@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundmpx_fdopendir>:
push   %rbx
call   1030 <fdopendir@plt>
mov    %rax,%rbx
lea    0x100000(%rax),%rsi
mov    %rax,%rdi
call   1040 <__softboundmpx_store_return_metadata@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define weak i32* @softboundmpx_fdopendir(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i64 @fdopendir(i32 %5)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 1048576
store i8* %9, i8** %4
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = call i32 @__softboundmpx_store_return_metadata(i8* %10, i8* %11)
%13 = load i8*, i8** %3
%14 = bitcast i8* %13 to i32*
ret i32* %14
}

LLVM IR (-O2):
define weak i32* @softboundmpx_fdopendir(i32 %0) {
%2 = tail call i64 @fdopendir(i32 %0)
%3 = inttoptr i64 %2 to i8*
%4 = getelementptr inbounds i8, i8* %3, i64 1048576
%5 = tail call i32 @__softboundmpx_store_return_metadata(i8* %3, i8* %4)
%6 = inttoptr i64 %2 to i32*
ret i32* %6
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int irmo_string_equal(void *string1, void *string2) {
  return strcmp((char *)string1, (char *)string2) == 0;
}


x86 assembly (clang, -O0):
<irmo_string_equal>:
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 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irmo_string_equal>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @irmo_string_equal(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 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @irmo_string_equal(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int _braille_register_console(struct console *console,
                              struct console_cmdline *c) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.console = type opaque
%struct.console_cmdline = type opaque
define i32 @_braille_register_console(%struct.console* %0, %struct.console_cmdline* %1) {
%3 = alloca %struct.console*
%4 = alloca %struct.console_cmdline*
store %struct.console* %0, %struct.console** %3
store %struct.console_cmdline* %1, %struct.console_cmdline** %4
ret i32 0
}

LLVM IR (-O2):
%struct.console = type opaque
%struct.console_cmdline = type opaque
define i32 @_braille_register_console(%struct.console* nocapture readnone %0, %struct.console_cmdline* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int syscall(int, int, char const *, int /*<<< orphan*/);
int mkdirat(int fd, const char *path, mode_t mode) {
  return syscall(323, fd, path, mode);
}


x86 assembly (clang, -O0):
<mkdirat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x143,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkdirat>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x143,%edi
jmp    1030 <syscall@plt>

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

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