xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_header(void) {
  printf("TIPO\t\tNOMBRE\t\tLINEA\tTIEMPO\t\t\t\tID.\tHOST\tSALIDA\n");
  printf("---------------------------------------------------------------------"
         "--------------------\n");
}


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

x86 assembly (clang, -O2):
<print_header>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0a(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"TIPO\09\09NOMBRE\09\09LINEA\09TIEMPO\09\09\09\09ID.\09HOST\09SALIDA\0A\00"
@.str.1 = [91 x i8] c"-----------------------------------------------------------------------------------------\0A\00"
define void @print_header() {
%1 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [46 x i8] c"TIPO\09\09NOMBRE\09\09LINEA\09TIEMPO\09\09\09\09ID.\09HOST\09SALIDA\00"
@str.2 = [90 x i8] c"-----------------------------------------------------------------------------------------\00"
define void @print_header() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([90 x i8], [90 x i8]* @str.2, i64 0, i64 0))
ret void
}
int test_imm_6Euint8_mem(unsigned char *val) {
  return ((*val) & (-0x6E << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_6Euint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -110
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *p = malloc(size);
  if (!p)
    die("Out of memory");
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <xmalloc+0x30>
lea    0xeb5(%rip),%rdi
call   1040 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xmalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Out of memory\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
unsigned int seed_step(unsigned int seed) { return 0x10dcd * seed + 0x4271; }


x86 assembly (clang, -O0):
<seed_step>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x10dcd,-0x4(%rbp),%eax
add    $0x4271,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<seed_step>:
imul   $0x10dcd,%edi,%eax
add    $0x4271,%eax
ret

LLVM IR (-O0):
define i32 @seed_step(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 69069, %3
%5 = add i32 %4, 17009
ret i32 %5
}

LLVM IR (-O2):
define i32 @seed_step(i32 %0) {
%2 = mul i32 %0, 69069
%3 = add i32 %2, 17009
ret i32 %3
}
/* Type definitions */
struct sbuffer {
  int dummy;
};

/* Variables and functions */
struct sbuffer *sbuf_new_size(int);
struct sbuffer *sbuf_new(void) {
  return sbuf_new_size((64 * 1024));
}


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

x86 assembly (clang, -O2):
<sbuf_new>:
mov    $0x10000,%edi
jmp    1030 <sbuf_new_size@plt>

LLVM IR (-O0):
%struct.sbuffer = type { i32 }
define %struct.sbuffer* @sbuf_new() {
%1 = call %struct.sbuffer* @sbuf_new_size(i32 65536)
ret %struct.sbuffer* %1
}

LLVM IR (-O2):
%struct.sbuffer = type { i32 }
define %struct.sbuffer* @sbuf_new() {
%1 = tail call %struct.sbuffer* @sbuf_new_size(i32 65536)
ret %struct.sbuffer* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ OPENSSL_STACK;

/* Variables and functions */
int sk_num(int /*<<< orphan*/ const *);
int OPENSSL_sk_num(const OPENSSL_STACK *st) { return sk_num(st); }


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

x86 assembly (clang, -O2):
<OPENSSL_sk_num>:
jmp    1030 <sk_num@plt>

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

LLVM IR (-O2):
define i32 @OPENSSL_sk_num(i32* %0) {
%2 = tail call i32 @sk_num(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ output_with_tab(char *);
gen_immediate() { output_with_tab("lxi \th,"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"lxi \09h,\00"
define i32 @gen_immediate() {
%1 = alloca i32
%2 = call i32 @output_with_tab(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [8 x i8] c"lxi \09h,\00"
define i32 @gen_immediate() {
%1 = tail call i32 @output_with_tab(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
void foo39() {}


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

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

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

LLVM IR (-O2):
define void @foo39() {
ret void
}
int xh_int_equal(const void *key1, const void *key2, void *data) {
  (void)data;
  return *(int *)key1 == *(int *)key2;
}


x86 assembly (clang, -O0):
<xh_int_equal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xh_int_equal>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @xh_int_equal(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
%14 = icmp eq i32 %10, %13
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @xh_int_equal(i8* nocapture %0, i8* nocapture %1, i8* nocapture readnone %2) {
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = bitcast i8* %1 to i32*
%7 = load i32, i32* %6
%8 = icmp eq i32 %5, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ japi_enable(int);
void j_enable(int arg0) { japi_enable(arg0); }


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

x86 assembly (clang, -O2):
<j_enable>:
jmp    1030 <japi_enable@plt>

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

LLVM IR (-O2):
define void @j_enable(i32 %0) {
%2 = tail call i32 @japi_enable(i32 %0)
ret void
}
void socfpga_fpga_add(void) {}


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

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

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

LLVM IR (-O2):
define void @socfpga_fpga_add() {
ret void
}
void swap(int *a, int *b) {
  if (*a > *b) {
    int temp = *a;
    *a = *b;
    *b = temp;
  }
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jle    113c <swap+0x3c>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
cmp    %ecx,%eax
jle    110c <swap+0xc>
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp sgt i32 %3, %4
br i1 %5, label %6, label %7
6: ; preds = %2
store i32 %4, i32* %0
store i32 %3, i32* %1
br label %7
7: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430Usart0P__Usart__enableRxIntr();
void Msp430SpiNoDmaP__0__Usart__enableRxIntr(void) {
  HplMsp430Usart0P__Usart__enableRxIntr();
}


x86 assembly (clang, -O0):
<Msp430SpiNoDmaP__0__Usart__enableRxIntr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <HplMsp430Usart0P__Usart__enableRxIntr@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @Msp430SpiNoDmaP__0__Usart__enableRxIntr() {
%1 = call i32 (...) @HplMsp430Usart0P__Usart__enableRxIntr()
ret void
}

LLVM IR (-O2):
define void @Msp430SpiNoDmaP__0__Usart__enableRxIntr() {
%1 = tail call i32 (...) @HplMsp430Usart0P__Usart__enableRxIntr()
ret void
}
int DNSServiceRefSockFD() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @DNSServiceRefSockFD() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Bubble_Sort(int *, int);
int /*<<< orphan*/ Print_Array(int *, int);
int main() {
  int array[] = {2, 4, 3, 1, 6, 8, 4};
  Bubble_Sort(array, 7);
  Print_Array(array, 7);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec2(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x7,%esi
call   1040 <Bubble_Sort@plt>
lea    -0x20(%rbp),%rdi
mov    $0x7,%esi
call   1030 <Print_Array@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movups 0xee0(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x7,%esi
call   1040 <Bubble_Sort@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <Print_Array@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.array = [7 x i32] [i32 2, i32 4, i32 3, i32 1, i32 6, i32 8, i32 4]
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i32]
store i32 0, i32* %1
%3 = bitcast [7 x i32]* %2 to i8*
%4 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%5 = call i32 @Bubble_Sort(i32* %4, i32 7)
%6 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%7 = call i32 @Print_Array(i32* %6, i32 7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [7 x i32] [i32 2, i32 4, i32 3, i32 1, i32 6, i32 8, i32 4]
define i32 @main() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @Bubble_Sort(i32* %3, i32 7)
%5 = call i32 @Print_Array(i32* %3, i32 7)
ret i32 0
}
void downloader_worker_thread(void *worker_data) {}


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

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

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

LLVM IR (-O2):
define void @downloader_worker_thread(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main(int argc, char **argv) {
  int v1, v2;
  int x;
  x = 99;
#pragma acc parallel copy(v1, v2, x)
  {
#pragma acc atomic read
    v1 = x;
#pragma acc atomic write
    x = 32;
#pragma acc atomic read
    v2 = x;
  }
  if (v1 != 99)
    abort();
  if (v2 != 32)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x63,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x14(%rbp)
movl   $0x20,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x63,-0x14(%rbp)
je     1151 <main+0x41>
mov    $0x0,%al
call   1030 <abort@plt>
cmpl   $0x20,-0x18(%rbp)
je     1162 <main+0x52>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int number(const char *w) {
  int i, n = 1;
  for (i = 0; w[i] != '\0'; ++i) {
    n *= w[i] - 64;
  }
  return n % 47;
}


x86 assembly (clang, -O0):
<number>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114f <number+0x4f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
sub    $0x40,%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <number+0x16>
mov    -0x10(%rbp),%eax
mov    $0x2f,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<number>:
mov    (%rdi),%cl
test   %cl,%cl
je     1143 <number+0x43>
add    $0x1,%rdi
mov    $0x1,%eax
nop
movsbl %cl,%ecx
add    $0xffffffc0,%ecx
imul   %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <number+0x10>
cltq
imul   $0xffffffffae4c415d,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x2f,%ecx,%ecx
sub    %ecx,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @number(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 1, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %23, %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %26
13: ; preds = %5
%14 = load i8*, i8** %2
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = sub nsw i32 %19, 64
%21 = load i32, i32* %4
%22 = mul nsw i32 %21, %20
store i32 %22, i32* %4
br label %23
23: ; preds = %13
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %5
26: ; preds = %5
%27 = load i32, i32* %4
%28 = srem i32 %27, 47
ret i32 %28
}

LLVM IR (-O2):
define i32 @number(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %11, %4 ], [ 0, %1 ]
%6 = phi i8 [ %13, %4 ], [ %2, %1 ]
%7 = phi i32 [ %10, %4 ], [ 1, %1 ]
%8 = sext i8 %6 to i32
%9 = add nsw i32 %8, -64
%10 = mul nsw i32 %9, %7
%11 = add nuw nsw i64 %5, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4
%16 = srem i32 %10, 47
br label %17
17: ; preds = %15, %1
%18 = phi i32 [ 1, %1 ], [ %16, %15 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int);
void cgdefb(int v) { ngen("%s\t%d", "db", v); }


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

x86 assembly (clang, -O2):
<cgdefb>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xee6(%rip),%rsi
jmp    1030 <ngen@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%s\09%d\00"
@.str.1 = [3 x i8] c"db\00"
define void @cgdefb(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
void *_dictStringCopyHTKeyDup(void *privdata, const void *key) {
  int len = strlen(key);
  char *copy = _dictAlloc(len + 1);
  ((void)privdata);
  memcpy(copy, key, len);
  copy[len] = '\0';
  return copy;
}


x86 assembly (clang, -O0):
<_dictStringCopyHTKeyDup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
mov    $0x0,%al
call   1040 <_dictAlloc@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rdx
call   1050 <memcpy@plt>
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dictStringCopyHTKeyDup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %rax,%r15
lea    0x1(%rax),%edi
xor    %eax,%eax
call   1040 <_dictAlloc@plt>
movslq %eax,%rbx
movslq %r15d,%r15
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <memcpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @_dictStringCopyHTKeyDup(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = trunc i64 %8 to i32
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = add nsw i32 %10, 1
%12 = call i32 (i32, ...) bitcast (i32 (...)* @_dictAlloc to i32 (i32, ...)*)(i32 %11)
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %6
%15 = load i8*, i8** %3
%16 = load i8*, i8** %6
%17 = load i8*, i8** %4
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = load i8*, i8** %6
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
store i8 0, i8* %23
%24 = load i8*, i8** %6
ret i8* %24
}

LLVM IR (-O2):
define i8* @_dictStringCopyHTKeyDup(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = trunc i64 %3 to i32
%5 = add nsw i32 %4, 1
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @_dictAlloc to i32 (i32, ...)*)(i32 %5)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = shl i64 %3, 32
%10 = ashr exact i64 %9, 32
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %8, i8* align 1 %1, i64 %10, i1 false)
%11 = getelementptr inbounds i8, i8* %8, i64 %10
store i8 0, i8* %11
ret i8* %8
}
/* Variables and functions */
double fabs(scalar_t__);
scalar_t__ log(int);
int main(int argc, char const *argv[]) {
  if (fabs(log(1) - 0.0) < 0.000001) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
call   1040 <log@plt>
cvtsi2sd %rax,%xmm0
xorps  %xmm1,%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1030 <fabs@plt>
movaps %xmm0,%xmm1
movsd  0xe9f(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1177 <main+0x57>
movl   $0x0,-0x4(%rbp)
jmp    117e <main+0x5e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <log@plt>
cvtsi2sd %rax,%xmm0
cvttsd2si %xmm0,%rdi
call   1030 <fabs@plt>
movsd  0xebe(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setbe  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i64 @log(i32 1)
%7 = sitofp i64 %6 to double
%8 = fsub double %7, 0.000000e+00
%9 = fptosi double %8 to i64
%10 = call double @fabs(i64 %9)
%11 = fcmp olt double %10, 0x3EB0C6F7A0B5ED8D
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 0, i32* %3
br label %14
13: ; preds = %2
store i32 1, i32* %3
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @log(i32 1)
%4 = sitofp i64 %3 to double
%5 = fptosi double %4 to i64
%6 = tail call double @fabs(i64 %5)
%7 = fcmp uge double %6, 0x3EB0C6F7A0B5ED8D
%8 = zext i1 %7 to i32
ret i32 %8
}
int opng_isupper(int ch) { return (ch >= 'A' && ch <= 'Z'); }


x86 assembly (clang, -O0):
<opng_isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <opng_isupper+0x20>
cmpl   $0x5a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<opng_isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @opng_isupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @opng_isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
void _IntLibInit(void) {}


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

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

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

LLVM IR (-O2):
define void @_IntLibInit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isupperr(char);
int main(int argc, char *argv[]) {
  int i;
  char c = 'C';
  for (i = 0; i != 1000000; ++i) {
    isupperr(c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x43,-0x15(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xf4240,-0x14(%rbp)
je     1155 <main+0x45>
movsbl -0x15(%rbp),%edi
call   1030 <isupperr@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1131 <main+0x21>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xf4240,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x43,%edi
call   1030 <isupperr@plt>
add    $0xffffffff,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8 67, i8* %7
store i32 0, i32* %6
br label %8
8: ; preds = %14, %2
%9 = load i32, i32* %6
%10 = icmp ne i32 %9, 1000000
br i1 %10, label %11, label %17
11: ; preds = %8
%12 = load i8, i8* %7
%13 = call i32 @isupperr(i8 signext %12)
br label %14
14: ; preds = %11
%15 = load i32, i32* %6
%16 = add nsw i32 %15, 1
store i32 %16, i32* %6
br label %8
17: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 0, %2 ], [ %6, %3 ]
%5 = tail call i32 @isupperr(i8 signext 67)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 1000000
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 0
}
unsigned _next_power(unsigned x) {
  --x;
  x |= x >> 0x01;
  x |= x >> 0x02;
  x |= x >> 0x04;
  x |= x >> 0x08;
  x |= x >> 0x10;
  return ++x;
}


x86 assembly (clang, -O0):
<_next_power>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_next_power>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
shr    %ecx
or     %eax,%ecx
mov    %ecx,%eax
shr    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
shr    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
shr    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
shr    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @_next_power(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, -1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = lshr i32 %5, 1
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = lshr i32 %9, 2
%11 = load i32, i32* %2
%12 = or i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = lshr i32 %13, 4
%15 = load i32, i32* %2
%16 = or i32 %15, %14
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = lshr i32 %17, 8
%19 = load i32, i32* %2
%20 = or i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = lshr i32 %21, 16
%23 = load i32, i32* %2
%24 = or i32 %23, %22
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = add i32 %25, 1
store i32 %26, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @_next_power(i32 %0) {
%2 = add i32 %0, -1
%3 = lshr i32 %2, 1
%4 = or i32 %3, %2
%5 = lshr i32 %4, 2
%6 = or i32 %5, %4
%7 = lshr i32 %6, 4
%8 = or i32 %7, %6
%9 = lshr i32 %8, 8
%10 = or i32 %9, %8
%11 = lshr i32 %10, 16
%12 = or i32 %11, %10
%13 = add i32 %12, 1
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __sh_or(int *, int /*<<< orphan*/);
void a_or_64(volatile uint64_t *p, uint64_t v) {
  union {
    uint64_t v;
    uint32_t r[2];
  } u = {v};
  __sh_or((int *)p, u.r[0]);
  __sh_or((int *)p + 1, u.r[1]);
}


x86 assembly (clang, -O0):
<a_or_64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1030 <__sh_or@plt>
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
mov    -0x14(%rbp),%esi
call   1030 <__sh_or@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_or_64>:
push   %rbx
mov    %rdi,%rbx
call   1030 <__sh_or@plt>
add    $0x4,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <__sh_or@plt>

LLVM IR (-O0):
%union.anon = type { [2 x i32] }
define void @a_or_64(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca %union.anon
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = bitcast %union.anon* %5 to i32*
%7 = load i32, i32* %4
store i32 %7, i32* %6
%8 = load i32*, i32** %3
%9 = bitcast %union.anon* %5 to [2 x i32]*
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%11 = load i32, i32* %10
%12 = call i32 @__sh_or(i32* %8, i32 %11)
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 1
%15 = bitcast %union.anon* %5 to [2 x i32]*
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %15, i64 0, i64 1
%17 = load i32, i32* %16
%18 = call i32 @__sh_or(i32* %14, i32 %17)
ret void
}

LLVM IR (-O2):
define void @a_or_64(i32* %0, i32 %1) {
%3 = tail call i32 @__sh_or(i32* %0, i32 %1)
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = tail call i32 @__sh_or(i32* %4, i32 undef)
ret void
}
/* Variables and functions */
int errno;
long strtol(char const *, int /*<<< orphan*/ *, int);
long int atol(const char *nptr) {
  int tmp;
  long int res;
  tmp = errno;
  res = strtol(nptr, NULL, 10);
  errno = tmp;
  return res;
}


x86 assembly (clang, -O0):
<atol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    0x2e98(%rip),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atol>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i32 0
define i64 @atol(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i32, i32* @errno
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = call i64 @strtol(i8* %6, i32* null, i32 10)
store i64 %7, i64* %4
%8 = load i32, i32* %3
store i32 %8, i32* @errno
%9 = load i64, i64* %4
ret i64 %9
}

LLVM IR (-O2):
@errno = global i32 0
define i64 @atol(i8* nocapture %0) {
%2 = load i32, i32* @errno
%3 = tail call i64 @strtol(i8* nocapture %0, i32* null, i32 10)
store i32 %2, i32* @errno
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ SIGHUP;
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
ignore_signals() {
  (void)signal(SIGHUP, SIG_IGN);
  (void)signal(SIGINT, SIG_IGN);
}


x86 assembly (clang, -O0):
<ignore_signals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignore_signals>:
push   %rbx
mov    0x2ed8(%rip),%rax
mov    (%rax),%edi
mov    0x2eb7(%rip),%rbx
mov    (%rbx),%esi
call   1030 <signal@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
pop    %rbx
jmp    1030 <signal@plt>

LLVM IR (-O0):
@SIGHUP = global i32 0
@SIG_IGN = global i32 0
@SIGINT = global i32 0
define i32 @ignore_signals() {
%1 = alloca i32
%2 = load i32, i32* @SIGHUP
%3 = load i32, i32* @SIG_IGN
%4 = call i32 @signal(i32 %2, i32 %3)
%5 = load i32, i32* @SIGINT
%6 = load i32, i32* @SIG_IGN
%7 = call i32 @signal(i32 %5, i32 %6)
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@SIGHUP = global i32 0
@SIG_IGN = global i32 0
@SIGINT = global i32 0
define i32 @ignore_signals() {
%1 = load i32, i32* @SIGHUP
%2 = load i32, i32* @SIG_IGN
%3 = tail call i32 @signal(i32 %1, i32 %2)
%4 = load i32, i32* @SIGINT
%5 = load i32, i32* @SIG_IGN
%6 = tail call i32 @signal(i32 %4, i32 %5)
ret i32 undef
}
int CharDoubleOp(char c) { return (c == '&') || (c == '>') || (c == '|'); }


x86 assembly (clang, -O0):
<CharDoubleOp>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x26,%ecx
mov    %al,-0x2(%rbp)
je     113b <CharDoubleOp+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x3e,%ecx
mov    %al,-0x2(%rbp)
je     113b <CharDoubleOp+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0x7c,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CharDoubleOp>:
mov    $0x1,%eax
cmp    $0x26,%dil
je     1111 <CharDoubleOp+0x11>
cmp    $0x3e,%dil
jne    1112 <CharDoubleOp+0x12>
ret
xor    %eax,%eax
cmp    $0x7c,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @CharDoubleOp(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 38
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 62
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 124
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @CharDoubleOp(i8 signext %0) {
switch i8 %0, label %2 [
i8 62, label %5
i8 38, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 124
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
int get_int(string, length)
char *string;
int length;
{
  char buffer[256];
  int val;
  strncpy(buffer, string, length);
  buffer[length] = '\0';
  sscanf(buffer, "%d", &val);
  return (val);
}


x86 assembly (clang, -O0):
<get_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rdx
call   1030 <strncpy@plt>
movslq -0xc(%rbp),%rax
movb   $0x0,-0x110(%rbp,%rax,1)
lea    -0x110(%rbp),%rdi
lea    0xea0(%rip),%rsi
lea    -0x114(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
mov    -0x114(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_int>:
push   %r14
push   %rbx
sub    $0x118,%rsp
mov    %rdi,%rax
movslq %esi,%rbx
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    %rax,%rsi
mov    %rbx,%rdx
call   1030 <strncpy@plt>
movb   $0x0,0x10(%rsp,%rbx,1)
lea    0xeb1(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <sscanf@plt>
mov    0xc(%rsp),%eax
add    $0x118,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @get_int(i8* nocapture %0, i32 %1) {
%3 = alloca [256 x i8]
%4 = alloca i32
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%6 = bitcast i32* %4 to i8*
%7 = sext i32 %1 to i64
%8 = call i8* @strncpy(i8* %5, i8* %0, i64 %7)
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %7
store i8 0, i8* %9
%10 = call i32 (i8*, i8*, ...) @sscanf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%11 = load i32, i32* %4
ret i32 %11
}
int XFilterEvent() {}


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

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

LLVM IR (-O0):
define i32 @XFilterEvent() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XFilterEvent() {
ret i32 undef
}
/* Variables and functions */
double log10f(double);
double log10(double x) { return log10f(x); }


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

x86 assembly (clang, -O2):
<log10>:
jmp    1030 <log10f@plt>

LLVM IR (-O0):
define double @log10(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @log10f(double %3)
ret double %4
}

LLVM IR (-O2):
define double @log10(double %0) {
%2 = tail call double @log10f(double %0)
ret double %2
}
int max(int num1, int num2) {
  if (num1 > num2)
    return num1;
  else
    return num2;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <max+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @max(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* %4
%7 = load i32, i32* %5
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
long currentTimeMs() {
  struct timespec spec;
  clock_gettime(CLOCK_MONOTONIC, &spec);
  return 1000000 * spec.tv_sec + spec.tv_nsec / 1000;
}


x86 assembly (clang, -O0):
<currentTimeMs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0xf4240,-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):
<currentTimeMs>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
movslq (%rsp),%rax
imul   $0xf4240,%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.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define i64 @currentTimeMs() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 1000000, %5
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %6, %9
%11 = sext i32 %10 to i64
ret i64 %11
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define i64 @currentTimeMs() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000
%11 = add nsw i32 %10, %7
%12 = sext i32 %11 to i64
ret i64 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
void initRandom(void) { srand((unsigned int)time((time_t *)NULL)); }


x86 assembly (clang, -O0):
<initRandom>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initRandom>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <srand@plt>

LLVM IR (-O0):
define void @initRandom() {
%1 = call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = call i32 @srand(i32 %2)
ret void
}

LLVM IR (-O2):
define void @initRandom() {
%1 = tail call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = tail call i32 @srand(i32 %2)
ret void
}
/* Variables and functions */
int port_inb(int);
int /*<<< orphan*/ port_outb(int, int);
void gled_on(void) { port_outb((2), port_inb((2)) | (1 << 1)); }


x86 assembly (clang, -O0):
<gled_on>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <port_inb@plt>
mov    %eax,%esi
or     $0x2,%esi
mov    $0x2,%edi
call   1040 <port_outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gled_on>:
push   %rax
mov    $0x2,%edi
call   1030 <port_inb@plt>
or     $0x2,%eax
mov    $0x2,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <port_outb@plt>

LLVM IR (-O0):
define void @gled_on() {
%1 = call i32 @port_inb(i32 2)
%2 = or i32 %1, 2
%3 = call i32 @port_outb(i32 2, i32 %2)
ret void
}

LLVM IR (-O2):
define void @gled_on() {
%1 = tail call i32 @port_inb(i32 2)
%2 = or i32 %1, 2
%3 = tail call i32 @port_outb(i32 2, i32 %2)
ret void
}
/* Type definitions */
typedef size_t int64_t;

/* Variables and functions */
int64_t stdlib_ndarray_strides2offset(int64_t ndims, int64_t *shape,
                                      int64_t *strides) {
  int64_t offset;
  int64_t i;
  offset = 0;
  for (i = 0; i < ndims; i++) {
    if (strides[i] < 0) {
      offset -= strides[i] * (shape[i] - 1);
    }
  }
  return offset;
}


x86 assembly (clang, -O0):
<stdlib_ndarray_strides2offset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1182 <stdlib_ndarray_strides2offset+0x82>
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
jae    116c <stdlib_ndarray_strides2offset+0x6c>
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rdx
mov    (%rax,%rdx,8),%rax
sub    $0x1,%rax
imul   %rax,%rcx
mov    -0x20(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    1171 <stdlib_ndarray_strides2offset+0x71>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1120 <stdlib_ndarray_strides2offset+0x20>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @stdlib_ndarray_strides2offset(i64 %0, i64* %1, i64* %2) {
%4 = alloca i64
%5 = alloca i64*
%6 = alloca i64*
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %4
store i64* %1, i64** %5
store i64* %2, i64** %6
store i64 0, i64* %7
store i64 0, i64* %8
br label %9
9: ; preds = %33, %3
%10 = load i64, i64* %8
%11 = load i64, i64* %4
%12 = icmp ult i64 %10, %11
br i1 %12, label %13, label %36
13: ; preds = %9
%14 = load i64*, i64** %6
%15 = load i64, i64* %8
%16 = getelementptr inbounds i64, i64* %14, i64 %15
%17 = load i64, i64* %16
%18 = icmp ult i64 %17, 0
br i1 %18, label %19, label %32
19: ; preds = %13
%20 = load i64*, i64** %6
%21 = load i64, i64* %8
%22 = getelementptr inbounds i64, i64* %20, i64 %21
%23 = load i64, i64* %22
%24 = load i64*, i64** %5
%25 = load i64, i64* %8
%26 = getelementptr inbounds i64, i64* %24, i64 %25
%27 = load i64, i64* %26
%28 = sub i64 %27, 1
%29 = mul i64 %23, %28
%30 = load i64, i64* %7
%31 = sub i64 %30, %29
store i64 %31, i64* %7
br label %32
32: ; preds = %19, %13
br label %33
33: ; preds = %32
%34 = load i64, i64* %8
%35 = add i64 %34, 1
store i64 %35, i64* %8
br label %9
36: ; preds = %9
%37 = load i64, i64* %7
ret i64 %37
}

LLVM IR (-O2):
define i64 @stdlib_ndarray_strides2offset(i64 %0, i64* nocapture readnone %1, i64* nocapture readnone %2) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ i2c_SendAddress(int);
int /*<<< orphan*/ i2c_SendByte(char);
int /*<<< orphan*/ i2c_Start();
int /*<<< orphan*/ i2c_Stop();
void LCD_PrintChar(char ch) {
  i2c_Start();
  i2c_SendAddress(0x74);
  i2c_SendByte(0b01000000);
  i2c_SendByte(ch + 128);
  i2c_Stop();
}


x86 assembly (clang, -O0):
<LCD_PrintChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <i2c_Start@plt>
mov    $0x74,%edi
call   1040 <i2c_SendAddress@plt>
mov    $0x40,%edi
call   1060 <i2c_SendByte@plt>
movsbl -0x1(%rbp),%eax
add    $0x80,%eax
movsbl %al,%edi
call   1060 <i2c_SendByte@plt>
mov    $0x0,%al
call   1050 <i2c_Stop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_PrintChar>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <i2c_Start@plt>
mov    $0x74,%edi
call   1040 <i2c_SendAddress@plt>
mov    $0x40,%edi
call   1060 <i2c_SendByte@plt>
xor    $0x80,%bl
movsbl %bl,%edi
call   1060 <i2c_SendByte@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <i2c_Stop@plt>

LLVM IR (-O0):
define void @LCD_PrintChar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 (...) @i2c_Start()
%4 = call i32 @i2c_SendAddress(i32 116)
%5 = call i32 @i2c_SendByte(i8 signext 64)
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = add nsw i32 %7, 128
%9 = trunc i32 %8 to i8
%10 = call i32 @i2c_SendByte(i8 signext %9)
%11 = call i32 (...) @i2c_Stop()
ret void
}

LLVM IR (-O2):
define void @LCD_PrintChar(i8 signext %0) {
%2 = tail call i32 (...) @i2c_Start()
%3 = tail call i32 @i2c_SendAddress(i32 116)
%4 = tail call i32 @i2c_SendByte(i8 signext 64)
%5 = xor i8 %0, -128
%6 = tail call i32 @i2c_SendByte(i8 signext %5)
%7 = tail call i32 (...) @i2c_Stop()
ret void
}