xunge/DecIR huggingface dataset:
int atoi(const char *str) {
  int res = 0;
  for (int i = 0; str[i] != '\0'; ++i) {
    res = res * 10 + str[i] - '0';
  }
  return res;
}


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1151 <atoi+0x51>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <atoi+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <atoi+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <atoi+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @atoi(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %24, %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %4
%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 %27
13: ; preds = %5
%14 = load i32, i32* %3
%15 = mul nsw i32 %14, 10
%16 = load i8*, i8** %2
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = add nsw i32 %15, %21
%23 = sub nsw i32 %22, 48
store i32 %23, i32* %3
br label %24
24: ; preds = %13
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %5
27: ; preds = %5
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %1
%5 = phi i32 [ 0, %1 ], [ %13, %6 ]
ret i32 %5
6: ; preds = %1, %6
%7 = phi i64 [ %14, %6 ], [ 0, %1 ]
%8 = phi i8 [ %16, %6 ], [ %2, %1 ]
%9 = phi i32 [ %13, %6 ], [ 0, %1 ]
%10 = sext i8 %8 to i32
%11 = mul nsw i32 %9, 10
%12 = add i32 %11, -48
%13 = add i32 %12, %10
%14 = add nuw nsw i64 %7, 1
%15 = getelementptr inbounds i8, i8* %0, i64 %14
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %4, label %6
}
void addnull(char *line) {
  int i = 0;
  while (line[i] != '\0')
    i++;
  line[i - 1] = '\0';
  return;
}


x86 assembly (clang, -O0):
<addnull>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <addnull+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <addnull+0xf>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<addnull>:
movabs $0xfffffffe00000000,%rax
ff ff ff
movabs $0x100000000,%rcx
mov    %rdi,%rdx
nopw   0x0(%rax,%rax,1)
add    %rcx,%rax
cmpb   $0x0,(%rdx)
lea    0x1(%rdx),%rdx
jne    1120 <addnull+0x20>
sar    $0x20,%rax
movb   $0x0,(%rdi,%rax,1)
ret

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

LLVM IR (-O2):
define void @addnull(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = shl i64 %3, 32
%10 = add i64 %9, -4294967296
%11 = ashr exact i64 %10, 32
%12 = getelementptr inbounds i8, i8* %0, i64 %11
store i8 0, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EconetClock_Init();
int /*<<< orphan*/ EconetClock_Start(int, int);
int /*<<< orphan*/ copro_32016_main(unsigned int, unsigned int, unsigned int);
int /*<<< orphan*/ copro_6502_main(unsigned int, unsigned int, unsigned int);
int /*<<< orphan*/ copro_65tube_main(unsigned int, unsigned int, unsigned int);
int /*<<< orphan*/ copro_80186_main(unsigned int, unsigned int, unsigned int);
int /*<<< orphan*/ copro_arm2_main(unsigned int, unsigned int, unsigned int);
int /*<<< orphan*/ copro_arm_main(unsigned int, unsigned int, unsigned int);
int /*<<< orphan*/ copro_lib6502_main(unsigned int, unsigned int, unsigned int);
int /*<<< orphan*/ printf(char *, ...);
void kernel_main(unsigned int r0, unsigned int r1, unsigned int atags) {
  if (6 == 0) {
    copro_arm_main(r0, r1, atags);
  } else if (6 == 1) {
    copro_arm2_main(r0, r1, atags);
  } else if (6 == 2) {
    copro_6502_main(r0, r1, atags);
  } else if (6 == 3) {
    copro_lib6502_main(r0, r1, atags);
  } else if (6 == 4) {
    copro_65tube_main(r0, r1, atags);
  } else if (6 == 5) {
    copro_80186_main(r0, r1, atags);
  } else if (6 == 6) {
    copro_32016_main(r0, r1, atags);
  } else if (6 == 7) {
    EconetClock_Init();
    EconetClock_Start(100, 50);
  } else {
    printf("Co Pro %d has not been defined yet\r\n", 6);
  }
  printf("Halted....\r\n");
  while (1) {
  }
}


x86 assembly (clang, -O0):
<kernel_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <copro_32016_main@plt>
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    114d <kernel_main+0x2d>

x86 assembly (clang, -O2):
<kernel_main>:
push   %rax
call   1030 <copro_32016_main@plt>
lea    0xed3(%rip),%rdi
call   1040 <puts@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
jmp    1140 <kernel_main+0x20>

LLVM IR (-O0):
@.str = [13 x i8] c"Halted....\0D\0A\00"
define void @kernel_main(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @copro_32016_main(i32 %7, i32 %8, i32 %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %3, %12
br label %12
}

LLVM IR (-O2):
@str = [12 x i8] c"Halted....\0D\00"
define void @kernel_main(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @copro_32016_main(i32 %0, i32 %1, i32 %2)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %3, %6
br label %6
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;

/* Variables and functions */
int pthread_mutexattr_init(pthread_mutexattr_t *__attr) {
  ;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @pthread_mutexattr_init(i32* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef scalar_t__ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ outb(int /*<<< orphan*/, scalar_t__);
void writeb_idx_reg(uint16_t port, uint8_t index, uint8_t val) {
  outb(index, port - 1);
  outb(val, port);
}


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

x86 assembly (clang, -O2):
<writeb_idx_reg>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %esi,%eax
mov    %rdi,%rbx
lea    -0x1(%rdi),%rsi
mov    %eax,%edi
call   1030 <outb@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @writeb_idx_reg(i64 %0, i32 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i64 %0, i64* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i64, i64* %4
%9 = sub nsw i64 %8, 1
%10 = call i32 @outb(i32 %7, i64 %9)
%11 = load i32, i32* %6
%12 = load i64, i64* %4
%13 = call i32 @outb(i32 %11, i64 %12)
ret void
}

LLVM IR (-O2):
define void @writeb_idx_reg(i64 %0, i32 %1, i32 %2) {
%4 = add nsw i64 %0, -1
%5 = tail call i32 @outb(i32 %1, i64 %4)
%6 = tail call i32 @outb(i32 %2, i64 %0)
ret void
}
int test_imm_C6int16_mem(short *val) {
  return ((*val) & (-0xC6 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_C6int16_mem>:
movzwl (%rdi),%eax
test   $0xff3a,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_C6int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -198
%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_C6int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -198
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int cvmx_fuse_read(int);
int cvmx_octeon_fuse_locked(void) { return cvmx_fuse_read(123); }


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

x86 assembly (clang, -O2):
<cvmx_octeon_fuse_locked>:
mov    $0x7b,%edi
jmp    1030 <cvmx_fuse_read@plt>

LLVM IR (-O0):
define i32 @cvmx_octeon_fuse_locked() {
%1 = call i32 @cvmx_fuse_read(i32 123)
ret i32 %1
}

LLVM IR (-O2):
define i32 @cvmx_octeon_fuse_locked() {
%1 = tail call i32 @cvmx_fuse_read(i32 123)
ret i32 %1
}
int mapif_itembound_ack(int fd, int aid, int guild_id) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mapif_itembound_ack(i32 %0, i32 %1, i32 %2) {
ret i32 0
}
void foo715(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo715(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arm_arith_cmp(int /*<<< orphan*/);
int /*<<< orphan*/ arm_data_imm_op();
void arm_cmp_imm() { arm_arith_cmp(arm_data_imm_op()); }


x86 assembly (clang, -O0):
<arm_cmp_imm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <arm_data_imm_op@plt>
mov    %eax,%edi
call   1040 <arm_arith_cmp@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @arm_cmp_imm() {
%1 = call i32 (...) @arm_data_imm_op()
%2 = call i32 @arm_arith_cmp(i32 %1)
ret void
}

LLVM IR (-O2):
define void @arm_cmp_imm() {
%1 = tail call i32 (...) @arm_data_imm_op()
%2 = tail call i32 @arm_arith_cmp(i32 %1)
ret void
}
/* Type definitions */
typedef unsigned char uint32_t;

/* Variables and functions */
uint32_t extract_uint32(unsigned char *p, int halfwordid) {
  uint32_t r;
  unsigned char *b = p;
  b += (halfwordid - 1) * 2;
  r = (b[0] << 24) + (b[1] << 16) + (b[2] << 8) + b[3];
  return (r);
}


x86 assembly (clang, -O0):
<extract_uint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
shl    $0x1,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x18(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x18(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x18(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
add    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xd(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_uint32>:
lea    (%rsi,%rsi,1),%eax
add    $0xfffffffe,%eax
cltq
mov    0x3(%rdi,%rax,1),%al
ret

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

LLVM IR (-O2):
define zeroext i8 @extract_uint32(i8* nocapture %0, i32 %1) {
%3 = shl i32 %1, 1
%4 = add i32 %3, -2
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = getelementptr inbounds i8, i8* %6, i64 3
%8 = load i8, i8* %7
ret i8 %8
}
/* Variables and functions */
int sqrt(scalar_t__);
scalar_t__ square(double const);
double SmoothInvCd(const double x, const double epsilon) {
  return 1 / sqrt(square(x) + square(epsilon));
}


x86 assembly (clang, -O0):
<SmoothInvCd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <square@plt>
mov    %rax,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <square@plt>
mov    -0x18(%rbp),%rdi
add    %rax,%rdi
call   1040 <sqrt@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SmoothInvCd>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,0x8(%rsp)
call   1030 <square@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1030 <square@plt>
add    %rax,%rbx
mov    %rbx,%rdi
call   1040 <sqrt@plt>
lea    0x1(%rax),%ecx
xor    %edx,%edx
cmp    $0x3,%ecx
cmovb  %eax,%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @SmoothInvCd(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call i64 @square(double %5)
%7 = load double, double* %4
%8 = call i64 @square(double %7)
%9 = add nsw i64 %6, %8
%10 = call i32 @sqrt(i64 %9)
%11 = sdiv i32 1, %10
%12 = sitofp i32 %11 to double
ret double %12
}

LLVM IR (-O2):
define double @SmoothInvCd(double %0, double %1) {
%3 = tail call i64 @square(double %0)
%4 = tail call i64 @square(double %1)
%5 = add nsw i64 %4, %3
%6 = tail call i32 @sqrt(i64 %5)
%7 = add i32 %6, 1
%8 = icmp ult i32 %7, 3
%9 = select i1 %8, i32 %6, i32 0
%10 = sitofp i32 %9 to double
ret double %10
}
int test_imm_CDuint32_mem(unsigned int *val) {
  return ((*val) & (0xCD << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_CDuint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 205
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int msgctl(int, int /*<<< orphan*/, int /*<<< orphan*/ *);
int elimsgq(int id) { return (msgctl(id, IPC_RMID, NULL)); }


x86 assembly (clang, -O0):
<elimsgq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <msgctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elimsgq>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <msgctl@plt>

LLVM IR (-O0):
@IPC_RMID = global i32 0
define i32 @elimsgq(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @IPC_RMID
%5 = call i32 @msgctl(i32 %3, i32 %4, i32* null)
ret i32 %5
}

LLVM IR (-O2):
@IPC_RMID = global i32 0
define i32 @elimsgq(i32 %0) {
%2 = load i32, i32* @IPC_RMID
%3 = tail call i32 @msgctl(i32 %0, i32 %2, i32* null)
ret i32 %3
}
int os_mem_free(void *mem) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @os_mem_free(i8* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
float clip_value(float, double, double);
float tansig_der(float value) {
  float temp2, df;
  temp2 = clip_value(value, -0.98, 0.98);
  df = (1.0 - temp2 * temp2);
  return df;
}


x86 assembly (clang, -O0):
<tansig_der>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
movsd  0xede(%rip),%xmm2
call   1030 <clip_value@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeae(%rip),%xmm0
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tansig_der>:
push   %rax
movsd  0xee7(%rip),%xmm1
movsd  0xee7(%rip),%xmm2
call   1030 <clip_value@plt>
mulss  %xmm0,%xmm0
movss  0xede(%rip),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @tansig_der(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %2
%5 = load float, float* %2
%6 = call float @clip_value(float %5, double 0xBFEF5C28F5C28F5C, double 0x3FEF5C28F5C28F5C)
store float %6, float* %3
%7 = load float, float* %3
%8 = load float, float* %3
%9 = fmul float %7, %8
%10 = fpext float %9 to double
%11 = fsub double 1.000000e+00, %10
%12 = fptrunc double %11 to float
store float %12, float* %4
%13 = load float, float* %4
ret float %13
}

LLVM IR (-O2):
define float @tansig_der(float %0) {
%2 = tail call float @clip_value(float %0, double 0xBFEF5C28F5C28F5C, double 0x3FEF5C28F5C28F5C)
%3 = fmul float %2, %2
%4 = fsub float 1.000000e+00, %3
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ simple_tic(double *);
double simple_toc(const double tic[2]) {
  double toc[2];
  simple_tic(toc);
  return ((toc[0] - tic[0]) + 1e-9 * (toc[1] - tic[1]));
}


x86 assembly (clang, -O0):
<simple_toc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <simple_tic@plt>
movsd  -0x20(%rbp),%xmm1
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm1
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x8(%rax),%xmm0
movsd  0xeb8(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_toc>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
call   1030 <simple_tic@plt>
movsd  (%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
subsd  (%rbx),%xmm1
subsd  0x8(%rbx),%xmm0
mulsd  0xec4(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @simple_toc(double* %0) {
%2 = alloca double*
%3 = alloca [2 x double]
store double* %0, double** %2
%4 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 0
%5 = call i32 @simple_tic(double* %4)
%6 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 0
%7 = load double, double* %6
%8 = load double*, double** %2
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = fsub double %7, %10
%12 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 1
%13 = load double, double* %12
%14 = load double*, double** %2
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = fsub double %13, %16
%18 = call double @llvm.fmuladd.f64(double 1.000000e-09, double %17, double %11)
ret double %18
}

LLVM IR (-O2):
define double @simple_toc(double* nocapture %0) {
%2 = alloca [2 x double]
%3 = bitcast [2 x double]* %2 to i8*
%4 = getelementptr inbounds [2 x double], [2 x double]* %2, i64 0, i64 0
%5 = call i32 @simple_tic(double* %4)
%6 = load double, double* %4
%7 = load double, double* %0
%8 = fsub double %6, %7
%9 = getelementptr inbounds [2 x double], [2 x double]* %2, i64 0, i64 1
%10 = load double, double* %9
%11 = getelementptr inbounds double, double* %0, i64 1
%12 = load double, double* %11
%13 = fsub double %10, %12
%14 = call double @llvm.fmuladd.f64(double %13, double 1.000000e-09, double %8)
ret double %14
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void consoleif_exit() { endwin(); }


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

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

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

LLVM IR (-O2):
define void @consoleif_exit() {
%1 = tail call i32 (...) @endwin()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf2(char *, int /*<<< orphan*/);
int /*<<< orphan*/ truncUint(unsigned int);
void GenZeroData(unsigned Size) {
  printf2("\ttimes\t%u db 0\n", truncUint(Size));
}


x86 assembly (clang, -O0):
<GenZeroData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <truncUint@plt>
mov    %eax,%esi
lea    0xec4(%rip),%rdi
call   1030 <printf2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenZeroData>:
push   %rax
call   1040 <truncUint@plt>
lea    0xed3(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf2@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"\09times\09%u db 0\0A\00"
define void @GenZeroData(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @truncUint(i32 %3)
%5 = call i32 @printf2(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"\09times\09%u db 0\0A\00"
define void @GenZeroData(i32 %0) {
%2 = tail call i32 @truncUint(i32 %0)
%3 = tail call i32 @printf2(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
unsigned long djb2(void *key, size_t keysize) {
  char *s, *sp;
  unsigned long hash;
  s = (char *)key;
  hash = 5381;
  for (sp = s; sp < s + keysize; sp++)
    hash = ((hash << 5) + hash) ^ *sp;
  return hash;
}


x86 assembly (clang, -O0):
<djb2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movq   $0x1505,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
add    -0x10(%rbp),%rcx
cmp    %rcx,%rax
jae    1165 <djb2+0x65>
mov    -0x28(%rbp),%rax
shl    $0x5,%rax
add    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbq (%rcx),%rcx
xor    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1124 <djb2+0x24>
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<djb2>:
test   %rsi,%rsi
jle    112b <djb2+0x2b>
add    %rdi,%rsi
mov    $0x1505,%eax
nopl   (%rax)
mov    %rax,%rcx
shl    $0x5,%rcx
add    %rax,%rcx
movsbq (%rdi),%rax
xor    %rcx,%rax
add    $0x1,%rdi
cmp    %rsi,%rdi
jb     1110 <djb2+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @djb2(i8* %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
%4 = icmp sgt i64 %1, 0
br i1 %4, label %5, label %14
5: ; preds = %2, %5
%6 = phi i64 [ %11, %5 ], [ 5381, %2 ]
%7 = phi i8* [ %12, %5 ], [ %0, %2 ]
%8 = mul i64 %6, 33
%9 = load i8, i8* %7
%10 = sext i8 %9 to i64
%11 = xor i64 %8, %10
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = icmp ult i8* %12, %3
br i1 %13, label %5, label %14
14: ; preds = %5, %2
%15 = phi i64 [ 5381, %2 ], [ %11, %5 ]
ret i64 %15
}
int install_handler() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @install_handler() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ENET_Error_DriverIRQHandler();
__attribute__((weak)) void ENET_Error_IRQHandler(void) {
  ENET_Error_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @ENET_Error_IRQHandler() {
%1 = call i32 (...) @ENET_Error_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @ENET_Error_IRQHandler() {
%1 = tail call i32 (...) @ENET_Error_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_alloc();
int /*<<< orphan*/ test_hashtable();
int /*<<< orphan*/ test_list();
int /*<<< orphan*/ test_printf();
int /*<<< orphan*/ test_vector();
int main(int argc, char *argv[]) {
  test_printf();
  test_alloc();
  test_list();
  test_vector();
  test_hashtable();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <test_printf@plt>
mov    $0x0,%al
call   1050 <test_alloc@plt>
mov    $0x0,%al
call   1070 <test_list@plt>
mov    $0x0,%al
call   1060 <test_vector@plt>
mov    $0x0,%al
call   1030 <test_hashtable@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_printf@plt>
xor    %eax,%eax
call   1050 <test_alloc@plt>
xor    %eax,%eax
call   1070 <test_list@plt>
xor    %eax,%eax
call   1060 <test_vector@plt>
xor    %eax,%eax
call   1030 <test_hashtable@plt>
xor    %eax,%eax
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 i32 (...) @test_printf()
%7 = call i32 (...) @test_alloc()
%8 = call i32 (...) @test_list()
%9 = call i32 (...) @test_vector()
%10 = call i32 (...) @test_hashtable()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_printf()
%4 = tail call i32 (...) @test_alloc()
%5 = tail call i32 (...) @test_list()
%6 = tail call i32 (...) @test_vector()
%7 = tail call i32 (...) @test_hashtable()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SEEK_CUR;
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ exit(int);
int lseek(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  if (lseek(STDIN_FILENO, 0, SEEK_CUR) == -1) {
    perror("cannot seek");
    exit(1);
  } else {
    printf("can seek\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
mov    0x2e89(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <lseek@plt>
cmp    $0xffffffff,%eax
jne    1187 <main+0x47>
lea    0xe88(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
mov    0x2e97(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <lseek@plt>
cmp    $0xffffffff,%eax
je     116f <main+0x2f>
lea    0xea6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xe8a(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
@SEEK_CUR = global i32 0
@.str = [12 x i8] c"cannot seek\00"
@.str.1 = [10 x i8] c"can seek\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @STDIN_FILENO
%3 = load i32, i32* @SEEK_CUR
%4 = call i32 @lseek(i32 %2, i32 0, i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
@SEEK_CUR = global i32 0
@.str = [12 x i8] c"cannot seek\00"
@str = [9 x i8] c"can seek\00"
define i32 @main() {
%1 = load i32, i32* @STDIN_FILENO
%2 = load i32, i32* @SEEK_CUR
%3 = tail call i32 @lseek(i32 %1, i32 0, i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %0
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void RTTermRunCallbacks(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTermRunCallbacks() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ata_device_info_detect();
void ata_device_initialize(void) { ata_device_info_detect(); }


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

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

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

LLVM IR (-O2):
define void @ata_device_initialize() {
%1 = tail call i32 (...) @ata_device_info_detect()
ret void
}
int emu_map(int x) { return (int)((x - -45) * (25 - 14) / (45 - -45) + 14); }


x86 assembly (clang, -O0):
<emu_map>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0xffffffd3,%eax
imul   $0xb,%eax,%eax
mov    $0x5a,%ecx
cltd
idiv   %ecx
add    $0xe,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<emu_map>:
lea    (%rdi,%rdi,4),%eax
lea    (%rdi,%rax,2),%ecx
lea    (%rdi,%rax,2),%eax
add    $0x1ef,%eax
cltq
imul   $0xffffffffb60b60b7,%rax,%rax
shr    $0x20,%rax
add    %ecx,%eax
add    $0x1ef,%eax
mov    %eax,%ecx
sar    $0x6,%ecx
shr    $0x1f,%eax
add    %ecx,%eax
add    $0xe,%eax
ret

LLVM IR (-O0):
define i32 @emu_map(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, -45
%5 = mul nsw i32 %4, 11
%6 = sdiv i32 %5, 90
%7 = add nsw i32 %6, 14
ret i32 %7
}

LLVM IR (-O2):
define i32 @emu_map(i32 %0) {
%2 = mul i32 %0, 11
%3 = add i32 %2, 495
%4 = sdiv i32 %3, 90
%5 = add nsw i32 %4, 14
ret i32 %5
}
/* Variables and functions */
char *concatenate(char *, char *, int, char const *, char const *, char const *,
                  char const *);
char *get_attempt_work_directory(const char *tt_root, const char *user,
                                 const char *job_id, const char *attempt_id) {
  return concatenate("%s/taskTracker/%s"
                     "/jobcache/%s"
                     "/%s/work",
                     "attempt_dir_path", 4, tt_root, user, job_id, attempt_id);
}


x86 assembly (clang, -O0):
<get_attempt_work_directory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%r9
mov    -0x20(%rbp),%rax
lea    0xec1(%rip),%rdi
lea    0xee0(%rip),%rsi
mov    $0x4,%edx
mov    %rax,(%rsp)
call   1030 <concatenate@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_attempt_work_directory>:
push   %rax
mov    %rdx,%r9
mov    %rsi,%r8
mov    %rdi,%rax
mov    %rcx,(%rsp)
lea    0xedb(%rip),%rdi
lea    0xefa(%rip),%rsi
mov    $0x4,%edx
mov    %rax,%rcx
call   1030 <concatenate@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"%s/taskTracker/%s/jobcache/%s/%s/work\00"
@.str.1 = [17 x i8] c"attempt_dir_path\00"
define i8* @get_attempt_work_directory(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i8* @concatenate(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 4, i8* %9, i8* %10, i8* %11, i8* %12)
ret i8* %13
}

LLVM IR (-O2):
@.str = [38 x i8] c"%s/taskTracker/%s/jobcache/%s/%s/work\00"
@.str.1 = [17 x i8] c"attempt_dir_path\00"
define i8* @get_attempt_work_directory(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i8* @concatenate(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 4, i8* %0, i8* %1, i8* %2, i8* %3)
ret i8* %5
}
unsigned short IPCCtoMFlagBusy(unsigned long ulFlags) {
  unsigned short returnStatus;
  if (((*((volatile unsigned long *)(0x400FB700 + 0x000000004))) & ulFlags) ==
      0) {
    returnStatus = 0U;
  } else {
    returnStatus = 1U;
  }
  return returnStatus;
}


x86 assembly (clang, -O0):
<IPCCtoMFlagBusy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x400fb704,%eax
mov    (%rax),%rax
and    -0x8(%rbp),%rax
cmp    $0x0,%rax
jne    1129 <IPCCtoMFlagBusy+0x29>
movw   $0x0,-0xa(%rbp)
jmp    112f <IPCCtoMFlagBusy+0x2f>
movw   $0x1,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IPCCtoMFlagBusy>:
xor    %eax,%eax
and    0x400fb704,%rdi
40
setne  %al
ret

LLVM IR (-O0):
define zeroext i16 @IPCCtoMFlagBusy(i64 %0) {
%2 = alloca i64
%3 = alloca i16
store i64 %0, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1074771716 to i64*)
%5 = load i64, i64* %2
%6 = and i64 %4, %5
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i16 0, i16* %3
br label %10
9: ; preds = %1
store i16 1, i16* %3
br label %10
10: ; preds = %9, %8
%11 = load i16, i16* %3
ret i16 %11
}

LLVM IR (-O2):
define zeroext i16 @IPCCtoMFlagBusy(i64 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1074771716 to i64*)
%3 = and i64 %2, %0
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i16
ret i16 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpord_sd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d f3(__m128d x, __m128d y) { return _mm_cmpord_sd(x, y); }


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

x86 assembly (clang, -O2):
<f3>:
jmp    1030 <_mm_cmpord_sd@plt>

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

LLVM IR (-O2):
define i32 @f3(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpord_sd(i32 %0, i32 %1)
ret i32 %3
}
void pinModeDummy(struct wiringPiNodeStruct *node, int pin, int mode) {
  return;
}


x86 assembly (clang, -O0):
<pinModeDummy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.wiringPiNodeStruct = type opaque
define void @pinModeDummy(%struct.wiringPiNodeStruct* %0, i32 %1, i32 %2) {
%4 = alloca %struct.wiringPiNodeStruct*
%5 = alloca i32
%6 = alloca i32
store %struct.wiringPiNodeStruct* %0, %struct.wiringPiNodeStruct** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
%struct.wiringPiNodeStruct = type opaque
define void @pinModeDummy(%struct.wiringPiNodeStruct* nocapture %0, i32 %1, i32 %2) {
ret void
}
int isblank(int c) { return !!((c == ' ') || (c == '\t')); }


x86 assembly (clang, -O0):
<isblank>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <isblank+0x20>
cmpl   $0x9,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isblank>:
cmp    $0x20,%edi
sete   %al
cmp    $0x9,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @isblank(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = icmp eq i32 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int a = 1;
  int b = 6;
  int t;
  t = a;
  a = b;
  b = t;
  printf("a=%d,b=%d", a, b);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"a=%d,b=%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 6, i32 1)
ret i32 0
}
double nmead_abs_double(const double x) { return x < (double)0 ? -x : x; }


x86 assembly (clang, -O0):
<nmead_abs_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    113d <nmead_abs_double+0x3d>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1147 <nmead_abs_double+0x47>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<nmead_abs_double>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @nmead_abs_double(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fneg double %6
br label %10
8: ; preds = %1
%9 = load double, double* %2
br label %10
10: ; preds = %8, %5
%11 = phi double [ %7, %5 ], [ %9, %8 ]
ret double %11
}

LLVM IR (-O2):
define double @nmead_abs_double(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
struct Value *handle_input_command(args)
char *args;
{
  handle_input_string(args, strlen(args));
  return newint_fl(1,
                   "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                   "outputs/2022-01-22/02-19-57/repos/gary9872/tf40s1/refs/"
                   "heads/master/src/keyboard.c",
                   266);
}


x86 assembly (clang, -O0):
<handle_input_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rsi
mov    $0x0,%al
call   1050 <handle_input_string@plt>
mov    $0x1,%edi
lea    0xe99(%rip),%rsi
mov    $0x10a,%edx
mov    $0x0,%al
call   1030 <newint_fl@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_input_command>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <handle_input_string@plt>
lea    0xeb3(%rip),%rsi
mov    $0x1,%edi
mov    $0x10a,%edx
xor    %eax,%eax
call   1030 <newint_fl@plt>
cltq
pop    %rbx
ret

LLVM IR (-O0):
%struct.Value = type opaque
@.str = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/gary9872/tf40s1/refs/heads/master/src/keyboard.c\00"
define %struct.Value* @handle_input_command(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = call i32 (i8*, i64, ...) bitcast (i32 (...)* @handle_input_string to i32 (i8*, i64, ...)*)(i8* %3, i64 %5)
%7 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @newint_fl to i32 (i32, i8*, i32, ...)*)(i32 1, i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i32 266)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to %struct.Value*
ret %struct.Value* %9
}

LLVM IR (-O2):
%struct.Value = type opaque
@.str = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/gary9872/tf40s1/refs/heads/master/src/keyboard.c\00"
define %struct.Value* @handle_input_command(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = tail call i32 (i8*, i64, ...) bitcast (i32 (...)* @handle_input_string to i32 (i8*, i64, ...)*)(i8* %0, i64 %2)
%4 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @newint_fl to i32 (i32, i8*, i32, ...)*)(i32 1, i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i32 266)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to %struct.Value*
ret %struct.Value* %6
}
/* Variables and functions */
int /*<<< orphan*/ memset(float *, int /*<<< orphan*/, int);
void glmGenerateZeroMatrix4f(float m[16]) { memset(m, 0, 16 * sizeof(float)); }


x86 assembly (clang, -O0):
<glmGenerateZeroMatrix4f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmGenerateZeroMatrix4f>:
xor    %esi,%esi
mov    $0x40,%edx
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @glmGenerateZeroMatrix4f(float* %0) {
%2 = tail call i32 @memset(float* %0, i32 0, i32 64)
ret void
}