xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int pthread_mutex_trylock(pthread_mutex_t *__mutex) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pthread_mutex_trylock(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void ifree(char **ptrp) { free(*ptrp); }


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

x86 assembly (clang, -O2):
<ifree>:
mov    (%rdi),%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @ifree(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @free(i8* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct packed_buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ packed_buffer_extract_u32(struct packed_buffer *);
double u32tod(int /*<<< orphan*/, int /*<<< orphan*/);
double packed_buffer_extract_du32(struct packed_buffer *pb, uint32_t scale) {
  return u32tod(packed_buffer_extract_u32(pb), scale);
}


x86 assembly (clang, -O0):
<packed_buffer_extract_du32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <packed_buffer_extract_u32@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
call   1040 <u32tod@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<packed_buffer_extract_du32>:
push   %rbx
mov    %esi,%ebx
call   1030 <packed_buffer_extract_u32@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <u32tod@plt>

LLVM IR (-O0):
%struct.packed_buffer = type { i32 }
define double @packed_buffer_extract_du32(%struct.packed_buffer* %0, i32 %1) {
%3 = alloca %struct.packed_buffer*
%4 = alloca i32
store %struct.packed_buffer* %0, %struct.packed_buffer** %3
store i32 %1, i32* %4
%5 = load %struct.packed_buffer*, %struct.packed_buffer** %3
%6 = call i32 @packed_buffer_extract_u32(%struct.packed_buffer* %5)
%7 = load i32, i32* %4
%8 = call double @u32tod(i32 %6, i32 %7)
ret double %8
}

LLVM IR (-O2):
%struct.packed_buffer = type { i32 }
define double @packed_buffer_extract_du32(%struct.packed_buffer* %0, i32 %1) {
%3 = tail call i32 @packed_buffer_extract_u32(%struct.packed_buffer* %0)
%4 = tail call double @u32tod(i32 %3, i32 %1)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xc3() {
  Assert_real((isascii(195) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              980, ("isascii should be 0 for 0xc3"));
}


x86 assembly (clang, -O0):
<t_isascii_0xc3>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc3,%edi
call   1030 <isascii@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x3d4,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0xc3>:
push   %rax
mov    $0xc3,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3d4,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xc3\00"
define void @t_isascii_0xc3() {
%1 = call i64 @isascii(i32 195)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 980, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xc3\00"
define void @t_isascii_0xc3() {
%1 = tail call i64 @isascii(i32 195)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 980, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void f(void) {
  int i;
#pragma acc parallel one
  ;
#pragma acc kernels eins
  ;
#pragma acc data two
  ;
#pragma acc loop deux
  for (i = 0; i < 2; ++i)
    ;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    1128 <f+0x28>
jmp    111a <f+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <f+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 2
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @f() {
ret void
}
/* Variables and functions */
char *generatePasscode(int);
int /*<<< orphan*/ phase(int);
void phase_1() {
  char *pass = generatePasscode(1);
  phase(1);
}


x86 assembly (clang, -O0):
<phase_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <generatePasscode@plt>
mov    %rax,-0x8(%rbp)
mov    $0x1,%edi
call   1040 <phase@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phase_1>:
push   %rax
mov    $0x1,%edi
call   1030 <generatePasscode@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <phase@plt>

LLVM IR (-O0):
define void @phase_1() {
%1 = alloca i8*
%2 = call i8* @generatePasscode(i32 1)
store i8* %2, i8** %1
%3 = call i32 @phase(i32 1)
ret void
}

LLVM IR (-O2):
define void @phase_1() {
%1 = tail call i8* @generatePasscode(i32 1)
%2 = tail call i32 @phase(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char hello[20] = "Hello world!";
  printf("%s\n", hello);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x10(%rsp)
lea    0xee6(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.hello = [20 x i8] c"Hello world!\00\00\00\00\00\00\00\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
store i32 0, i32* %1
%3 = bitcast [20 x i8]* %2 to i8*
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.hello = [20 x i8] c"Hello world!\00\00\00\00\00\00\00\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
struct mempool {
  int dummy;
};

/* Variables and functions */
scalar_t__ mp_avail(struct mempool *);
void *mp_grow_internal(struct mempool *, scalar_t__);
void *mp_expand(struct mempool *pool) {
  return mp_grow_internal(pool, mp_avail(pool) + 1);
}


x86 assembly (clang, -O0):
<mp_expand>:
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 <mp_avail@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rsi
add    $0x1,%rsi
call   1030 <mp_grow_internal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_expand>:
push   %rbx
mov    %rdi,%rbx
call   1040 <mp_avail@plt>
lea    0x1(%rax),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <mp_grow_internal@plt>

LLVM IR (-O0):
%struct.mempool = type { i32 }
define i8* @mp_expand(%struct.mempool* %0) {
%2 = alloca %struct.mempool*
store %struct.mempool* %0, %struct.mempool** %2
%3 = load %struct.mempool*, %struct.mempool** %2
%4 = load %struct.mempool*, %struct.mempool** %2
%5 = call i64 @mp_avail(%struct.mempool* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @mp_grow_internal(%struct.mempool* %3, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
%struct.mempool = type { i32 }
define i8* @mp_expand(%struct.mempool* %0) {
%2 = tail call i64 @mp_avail(%struct.mempool* %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @mp_grow_internal(%struct.mempool* %0, i64 %3)
ret i8* %4
}
/* Variables and functions */
int range_decode_culshift(int);
int /*<<< orphan*/ range_decode_update(int, int);
unsigned char decode_byte(void) {
  int tmp = range_decode_culshift(8);
  range_decode_update(1, tmp);
  return tmp;
}


x86 assembly (clang, -O0):
<decode_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x8,%edi
call   1030 <range_decode_culshift@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1040 <range_decode_update@plt>
mov    -0x4(%rbp),%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_byte>:
push   %rbx
mov    $0x8,%edi
call   1030 <range_decode_culshift@plt>
mov    %eax,%ebx
mov    $0x1,%edi
mov    %eax,%esi
call   1040 <range_decode_update@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @decode_byte() {
%1 = alloca i32
%2 = call i32 @range_decode_culshift(i32 8)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @range_decode_update(i32 1, i32 %3)
%5 = load i32, i32* %1
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @decode_byte() {
%1 = tail call i32 @range_decode_culshift(i32 8)
%2 = tail call i32 @range_decode_update(i32 1, i32 %1)
%3 = trunc i32 %1 to i8
ret i8 %3
}
/* Variables and functions */
double atan(double);
double rand_norm();
double tan(double);
double lorentz(void) { return tan((atan(1.0) * 4.0) * (rand_norm() - 0.5)); }


x86 assembly (clang, -O0):
<lorentz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  0xed0(%rip),%xmm0
call   1040 <atan@plt>
movsd  0xebb(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand_norm@plt>
movaps %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  0xe93(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
call   1050 <tan@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lorentz>:
push   %rax
movsd  0xec7(%rip),%xmm0
call   1040 <atan@plt>
xor    %eax,%eax
call   1030 <rand_norm@plt>
addsd  0xebb(%rip),%xmm0
mulsd  0xebb(%rip),%xmm0
pop    %rax
jmp    1050 <tan@plt>

LLVM IR (-O0):
define double @lorentz() {
%1 = call double @atan(double 1.000000e+00)
%2 = fmul double %1, 4.000000e+00
%3 = call double (...) @rand_norm()
%4 = fsub double %3, 5.000000e-01
%5 = fmul double %2, %4
%6 = call double @tan(double %5)
ret double %6
}

LLVM IR (-O2):
define double @lorentz() {
%1 = tail call double @atan(double 1.000000e+00)
%2 = tail call double (...) @rand_norm()
%3 = fadd double %2, -5.000000e-01
%4 = fmul double %3, 0x400921FB54442D18
%5 = tail call double @tan(double %4)
ret double %5
}
int syscall3(int syscall, int arg0, int arg1, int arg2) {
  int ret;
  __asm__("movl %[syscall],%%eax\n\t"
          "movl %[arg0],%%ebx\n\t"
          "movl %[arg1],%%ecx\n\t"
          "movl %[arg2],%%edx\n\t"
          "int $0x80\n\t"
          "movl %%eax,%[ret]\n\t"
          : [ret] "=r"(ret)
          : [syscall] "m"(syscall), [arg0] "m"(arg0), [arg1] "m"(arg1),
            [arg2] "m"(arg2)
          : "eax", "ebx", "ecx", "edx");
  return ret;
}


x86 assembly (clang, -O0):
<syscall3>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ebx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%edx
int    $0x80
mov    %eax,%esi
mov    %esi,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall3>:
push   %rbx
mov    %edi,-0x4(%rsp)
mov    %esi,-0x8(%rsp)
mov    %edx,-0xc(%rsp)
mov    %ecx,-0x10(%rsp)
mov    -0x4(%rsp),%eax
mov    -0x8(%rsp),%ebx
mov    -0xc(%rsp),%ecx
mov    -0x10(%rsp),%edx
int    $0x80
mov    %eax,%esi
mov    %esi,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @syscall3(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = call i32 asm "movl $1,%eax\0A\09movl $2,%ebx\0A\09movl $3,%ecx\0A\09movl $4,%edx\0A\09int $$0x80\0A\09movl %eax,$0\0A\09", "=r,*m,*m,*m,*m,~{eax},~{ebx},~{ecx},~{edx},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %5, i32* elementtype(i32) %6, i32* elementtype(i32) %7, i32* elementtype(i32) %8)
store i32 %10, i32* %9
%11 = load i32, i32* %9
ret i32 %11
}

LLVM IR (-O2):
define i32 @syscall3(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = call i32 asm "movl $1,%eax\0A\09movl $2,%ebx\0A\09movl $3,%ecx\0A\09movl $4,%edx\0A\09int $$0x80\0A\09movl %eax,$0\0A\09", "=r,*m,*m,*m,*m,~{eax},~{ebx},~{ecx},~{edx},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %5, i32* elementtype(i32) %6, i32* elementtype(i32) %7, i32* elementtype(i32) %8)
ret i32 %9
}
void load_one_keycode(unsigned char *usb_kbd_keycode, int position,
                      unsigned char code) {
  usb_kbd_keycode[position] = code;
}


x86 assembly (clang, -O0):
<load_one_keycode>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_one_keycode>:
movslq %esi,%rax
mov    %dl,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @load_one_keycode(i8* %0, i32 %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = load i8, i8* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
store i8 %7, i8* %11
ret void
}

LLVM IR (-O2):
define void @load_one_keycode(i8* nocapture writeonly %0, i32 %1, i8 zeroext %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %2, i8* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cm_print_error(char *, char const *, int);
int /*<<< orphan*/ exit_test(int);
void exception_handler(int sig) {
  const char *sig_strerror = "";
  cm_print_error("Test failed with exception: %s(%d)", sig_strerror, sig);
  exit_test(1);
}


x86 assembly (clang, -O0):
<exception_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xef0(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%edx
lea    0xebc(%rip),%rdi
call   1040 <cm_print_error@plt>
mov    $0x1,%edi
call   1030 <exit_test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exception_handler>:
push   %rax
mov    %edi,%edx
lea    0xed6(%rip),%rdi
lea    0xef1(%rip),%rsi
call   1040 <cm_print_error@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <exit_test@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [35 x i8] c"Test failed with exception: %s(%d)\00"
define void @exception_handler(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %3
%5 = load i32, i32* %2
%6 = call i32 @cm_print_error(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %4, i32 %5)
%7 = call i32 @exit_test(i32 1)
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [35 x i8] c"Test failed with exception: %s(%d)\00"
define void @exception_handler(i32 %0) {
%2 = tail call i32 @cm_print_error(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @exit_test(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ erase();
int /*<<< orphan*/ final();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ mvprintw(int /*<<< orphan*/, int /*<<< orphan*/, char *);
int /*<<< orphan*/ refresh();
void error(char *msg) {
  erase();
  mvprintw(0, 0, msg);
  refresh();
  getch();
  final();
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <erase@plt>
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
mov    %esi,%edi
call   1070 <mvprintw@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
mov    $0x0,%al
call   1060 <getch@plt>
mov    $0x0,%al
call   1040 <final@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <erase@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %rbx,%rdx
call   1070 <mvprintw@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
xor    %eax,%eax
call   1060 <getch@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <final@plt>

LLVM IR (-O0):
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @erase()
%4 = load i8*, i8** %2
%5 = call i32 @mvprintw(i32 0, i32 0, i8* %4)
%6 = call i32 (...) @refresh()
%7 = call i32 (...) @getch()
%8 = call i32 (...) @final()
ret void
}

LLVM IR (-O2):
define void @error(i8* %0) {
%2 = tail call i32 (...) @erase()
%3 = tail call i32 @mvprintw(i32 0, i32 0, i8* %0)
%4 = tail call i32 (...) @refresh()
%5 = tail call i32 (...) @getch()
%6 = tail call i32 (...) @final()
ret void
}
int test_imm_9Buint32_mem(unsigned int *val) {
  return ((*val) & (0x9B << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_9Buint32_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, 155
%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_9Buint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 155
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rangeBitwiseAnd(int, int);
int main(int argc, char const *argv[]) {
  int m = 64, n = 106;
  printf("%d\n", rangeBitwiseAnd(m, n));
  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   $0x40,-0x14(%rbp)
movl   $0x6a,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1040 <rangeBitwiseAnd@plt>
mov    %eax,%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x40,%edi
mov    $0x6a,%esi
call   1040 <rangeBitwiseAnd@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @rangeBitwiseAnd(i32 64, i32 106)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ result;

/* Variables and functions */
int /*<<< orphan*/ sysctlbyname(char *, unsigned long long *, size_t *,
                                int /*<<< orphan*/ *, int /*<<< orphan*/);
unsigned long long int64FromSysctlByName(char *name) {
  unsigned long long result = 0;
  size_t length = sizeof(result);
  sysctlbyname(name, &result, &length, NULL, 0);
  return result;
}


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

x86 assembly (clang, -O2):
<int64FromSysctlByName>:
sub    $0x18,%rsp
movq   $0x0,0x8(%rsp)
movq   $0x8,0x10(%rsp)
lea    0x8(%rsp),%rsi
lea    0x10(%rsp),%rdx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <sysctlbyname@plt>
mov    0x8(%rsp),%rax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i64 @int64FromSysctlByName(i8* %0) {
%2 = alloca i64
%3 = alloca i64
%4 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%5 = bitcast i64* %3 to i8*
store i64 8, i64* %3
%6 = call i32 @sysctlbyname(i8* %0, i64* %2, i64* %3, i32* null, i32 0)
%7 = load i64, i64* %2
ret i64 %7
}
int __UV__CountLines(char *str) {
  int l = 0, i = 0;
  for (i = 0; str[i] != '\0'; i++) {
    if (str[i] == '\n') {
      l++;
    }
  }
  return l;
}


x86 assembly (clang, -O0):
<__UV__CountLines>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1163 <__UV__CountLines+0x63>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1150 <__UV__CountLines+0x50>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1155 <__UV__CountLines+0x55>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111d <__UV__CountLines+0x1d>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__UV__CountLines>:
xor    %eax,%eax
jmp    1117 <__UV__CountLines+0x17>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%eax
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0xa,%cl
je     1110 <__UV__CountLines+0x10>
test   %cl,%cl
jne    1113 <__UV__CountLines+0x13>
ret

LLVM IR (-O0):
define i32 @__UV__CountLines(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
store i32 0, i32* %4
br label %5
5: ; preds = %25, %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 %28
13: ; preds = %5
%14 = load i8*, i8** %2
%15 = load i32, i32* %4
%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 = icmp eq i32 %19, 10
br i1 %20, label %21, label %24
21: ; preds = %13
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %24
24: ; preds = %21, %13
br label %25
25: ; preds = %24
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
store i32 %27, i32* %4
br label %5
28: ; preds = %5
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @__UV__CountLines(i8* nocapture %0) {
br label %2
2: ; preds = %9, %1
%3 = phi i64 [ %11, %9 ], [ 0, %1 ]
%4 = phi i32 [ %10, %9 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 0, label %12
i8 10, label %7
]
7: ; preds = %2
%8 = add nsw i32 %4, 1
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ %8, %7 ], [ %4, %2 ]
%11 = add nuw i64 %3, 1
br label %2
12: ; preds = %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ RunAllTests();
int main(void) { RunAllTests(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @RunAllTests()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @RunAllTests()
ret i32 0
}
char *mystrcpy(char *s1, const char *s2) {
  int i;
  i = 0;
  while (s2[i] != '\0') {
    s1[i] = s2[i];
    i++;
  }
  s1[i] = '\0';
  return s1;
}


x86 assembly (clang, -O0):
<mystrcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114c <mystrcpy+0x4c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <mystrcpy+0x13>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1127 <mystrcpy+0x27>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rax,%rdx,1)
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <mystrcpy+0x10>
mov    %edx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret
xor    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @mystrcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = and i64 %9, 4294967295
br label %15
15: ; preds = %13, %2
%16 = phi i64 [ 0, %2 ], [ %14, %13 ]
%17 = getelementptr inbounds i8, i8* %0, i64 %16
store i8 0, i8* %17
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ifree(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<ifree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @ifree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int __int8_t_encoded_array_size(const int8_t *p, int elements) {
  (void)p;
  return sizeof(int8_t) * elements;
}


x86 assembly (clang, -O0):
<__int8_t_encoded_array_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__int8_t_encoded_array_size>:
lea    0x0(,%rsi,4),%eax
ret

LLVM IR (-O0):
define i32 @__int8_t_encoded_array_size(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 = sext i32 %6 to i64
%8 = mul i64 4, %7
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @__int8_t_encoded_array_size(i32* nocapture readnone %0, i32 %1) {
%3 = shl i32 %1, 2
ret i32 %3
}
/* Variables and functions */
scalar_t__ isalpha(char);
int isuscoreoralpha(char ch) { return ((ch == '_') || isalpha(ch)); }


x86 assembly (clang, -O0):
<isuscoreoralpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5f,%ecx
mov    %al,-0x2(%rbp)
je     1143 <isuscoreoralpha+0x33>
movsbl -0x1(%rbp),%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isuscoreoralpha>:
mov    $0x1,%eax
cmp    $0x5f,%dil
je     1134 <isuscoreoralpha+0x24>
push   %rax
movsbl %dil,%edi
call   1030 <isalpha@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @isuscoreoralpha(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, 95
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @isalpha(i8 signext %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isuscoreoralpha(i8 signext %0) {
%2 = icmp eq i8 %0, 95
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @isalpha(i8 signext %0)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
scalar_t__ readClock(char const *);
int /*<<< orphan*/ writeClock(char const *, scalar_t__);
void tickClock(const char *clockfile, double dt) {
  writeClock(clockfile, readClock(clockfile) + dt);
  return;
}


x86 assembly (clang, -O0):
<tickClock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <readClock@plt>
mov    -0x18(%rbp),%rdi
cvtsi2sd %rax,%xmm0
addsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%rsi
call   1030 <writeClock@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tickClock>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %rdi,%rbx
call   1040 <readClock@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x8(%rsp),%xmm0
cvttsd2si %xmm0,%rsi
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <writeClock@plt>

LLVM IR (-O0):
define void @tickClock(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
store i8* %0, i8** %3
store double %1, double* %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i64 @readClock(i8* %6)
%8 = sitofp i64 %7 to double
%9 = load double, double* %4
%10 = fadd double %8, %9
%11 = fptosi double %10 to i64
%12 = call i32 @writeClock(i8* %5, i64 %11)
ret void
}

LLVM IR (-O2):
define void @tickClock(i8* %0, double %1) {
%3 = tail call i64 @readClock(i8* %0)
%4 = sitofp i64 %3 to double
%5 = fadd double %4, %1
%6 = fptosi double %5 to i64
%7 = tail call i32 @writeClock(i8* %0, i64 %6)
ret void
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
int time_sec(time_t t) { return (t / 1000) % 60; }


x86 assembly (clang, -O0):
<time_sec>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_sec>:
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
sar    $0x6,%eax
add    %ecx,%eax
cltq
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x3c,%ecx,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @time_sec(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 1000
%5 = srem i32 %4, 60
ret i32 %5
}

LLVM IR (-O2):
define i32 @time_sec(i32 %0) {
%2 = sdiv i32 %0, 1000
%3 = srem i32 %2, 60
ret i32 %3
}
int c038(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c038() {
ret i32 0
}
/* Type definitions */
struct ac_buffer {
  int dummy;
};

/* Variables and functions */
int _buffer_read_array(struct ac_buffer *, int *, int *, int);
int buffer_read_int_array(struct ac_buffer *buffer, int *value, int *size) {
  return _buffer_read_array(buffer, value, size, sizeof(int));
}


x86 assembly (clang, -O0):
<buffer_read_int_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x4,%ecx
call   1030 <_buffer_read_array@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_read_int_array>:
mov    $0x4,%ecx
jmp    1030 <_buffer_read_array@plt>

LLVM IR (-O0):
%struct.ac_buffer = type { i32 }
define i32 @buffer_read_int_array(%struct.ac_buffer* %0, i32* %1, i32* %2) {
%4 = alloca %struct.ac_buffer*
%5 = alloca i32*
%6 = alloca i32*
store %struct.ac_buffer* %0, %struct.ac_buffer** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load %struct.ac_buffer*, %struct.ac_buffer** %4
%8 = load i32*, i32** %5
%9 = load i32*, i32** %6
%10 = call i32 @_buffer_read_array(%struct.ac_buffer* %7, i32* %8, i32* %9, i32 4)
ret i32 %10
}

LLVM IR (-O2):
%struct.ac_buffer = type { i32 }
define i32 @buffer_read_int_array(%struct.ac_buffer* %0, i32* %1, i32* %2) {
%4 = tail call i32 @_buffer_read_array(%struct.ac_buffer* %0, i32* %1, i32* %2, i32 4)
ret i32 %4
}
__attribute__((no, noclone)) short foo11(short arg) {
  short ret = 1;
  if (arg + 1 < ((!0) ? -(1L << (sizeof(char) * 8 - 1)) : 0) + 1 ||
      arg + 1 > ((!0) ? ((1L << (sizeof(char) * 8 - 1)) - 1)
                      : ((1L << (sizeof(char) * 8)) - 1)) -
                    1)
    return ret;
  arg = arg + 1;
  ret = (unsigned char)arg;
  return arg;
}


x86 assembly (clang, -O0):
<foo11>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movw   $0x1,-0x6(%rbp)
movswl -0x4(%rbp),%eax
add    $0x1,%eax
cltq
cmp    $0xffffffffffffff81,%rax
jl     1137 <foo11+0x37>
movswl -0x4(%rbp),%eax
add    $0x1,%eax
cltq
cmp    $0x7e,%rax
jle    1144 <foo11+0x44>
mov    -0x6(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    1162 <foo11+0x62>
movswl -0x4(%rbp),%eax
add    $0x1,%eax
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%ax
movzbl %al,%eax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo11>:
lea    0x1(%rdi),%ecx
add    $0xffffff82,%edi
movzwl %di,%eax
cmp    $0xff02,%eax
mov    $0x1,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define signext i16 @foo11(i16 signext %0) {
%2 = alloca i16
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = icmp slt i64 %8, -127
br i1 %9, label %16, label %10
10: ; preds = %1
%11 = load i16, i16* %3
%12 = sext i16 %11 to i32
%13 = add nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = icmp sgt i64 %14, 126
br i1 %15, label %16, label %18
16: ; preds = %10, %1
%17 = load i16, i16* %4
store i16 %17, i16* %2
br label %27
18: ; preds = %10
%19 = load i16, i16* %3
%20 = sext i16 %19 to i32
%21 = add nsw i32 %20, 1
%22 = trunc i32 %21 to i16
store i16 %22, i16* %3
%23 = load i16, i16* %3
%24 = trunc i16 %23 to i8
%25 = zext i8 %24 to i16
store i16 %25, i16* %4
%26 = load i16, i16* %3
store i16 %26, i16* %2
br label %27
27: ; preds = %18, %16
%28 = load i16, i16* %2
ret i16 %28
}

LLVM IR (-O2):
define signext i16 @foo11(i16 signext %0) {
%2 = add i16 %0, 1
%3 = add i16 %0, -126
%4 = icmp ult i16 %3, -254
%5 = select i1 %4, i16 1, i16 %2
ret i16 %5
}
/* Variables and functions */
int /*<<< orphan*/ mdelay(int);
unsigned int sleep(unsigned int secs) {
  while (secs--)
    mdelay(1000);
  return 0;
}


x86 assembly (clang, -O0):
<sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     113e <sleep+0x2e>
mov    $0x3e8,%edi
call   1030 <mdelay@plt>
jmp    111b <sleep+0xb>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep>:
push   %rbx
test   %edi,%edi
je     112f <sleep+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x3e8,%edi
call   1030 <mdelay@plt>
add    $0xffffffff,%ebx
jne    1120 <sleep+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add i32 %4, -1
store i32 %5, i32* %2
%6 = icmp ne i32 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 @mdelay(i32 1000)
br label %3
9: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @sleep(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add i32 %4, -1
%6 = tail call i32 @mdelay(i32 1000)
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int32_t WriteUint24Le(uint32_t value, void *out) {
  assert(out != NULL);
  uint8_t *buf = (uint8_t *)out;
  buf[0] = (uint8_t)(value >> 0);
  buf[1] = (uint8_t)(value >> 8);
  buf[2] = (uint8_t)(value >> 16);
  return 3;
}


x86 assembly (clang, -O0):
<WriteUint24Le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x0,%eax
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    $0x3,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteUint24Le>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %edi,%edi
test   %rsi,%rsi
setne  %dil
call   1030 <assert@plt>
movslq %ebp,%rax
mov    %rax,(%rbx)
mov    %eax,%ecx
sar    $0x8,%ecx
movslq %ecx,%rcx
mov    %rcx,0x8(%rbx)
sar    $0x10,%eax
cltq
mov    %rax,0x10(%rbx)
mov    $0x3,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @WriteUint24Le(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i64*
store i64* %11, i64** %5
%12 = load i32, i32* %3
%13 = ashr i32 %12, 0
%14 = sext i32 %13 to i64
%15 = load i64*, i64** %5
%16 = getelementptr inbounds i64, i64* %15, i64 0
store i64 %14, i64* %16
%17 = load i32, i32* %3
%18 = ashr i32 %17, 8
%19 = sext i32 %18 to i64
%20 = load i64*, i64** %5
%21 = getelementptr inbounds i64, i64* %20, i64 1
store i64 %19, i64* %21
%22 = load i32, i32* %3
%23 = ashr i32 %22, 16
%24 = sext i32 %23 to i64
%25 = load i64*, i64** %5
%26 = getelementptr inbounds i64, i64* %25, i64 2
store i64 %24, i64* %26
ret i32 3
}

LLVM IR (-O2):
define i32 @WriteUint24Le(i32 %0, i8* writeonly %1) {
%3 = icmp ne i8* %1, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = bitcast i8* %1 to i64*
%7 = sext i32 %0 to i64
store i64 %7, i64* %6
%8 = ashr i32 %0, 8
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %1, i64 8
%11 = bitcast i8* %10 to i64*
store i64 %9, i64* %11
%12 = ashr i32 %0, 16
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %1, i64 16
%15 = bitcast i8* %14 to i64*
store i64 %13, i64* %15
ret i32 3
}
int main() {
  unsigned int a[10] = {0xFFFFFFFF};
  __builtin_memset(&a, 0, sizeof(a));
  for (int i = 0; i < 10; i++) {
    if (a[i] != 0) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1030 <memset@plt>
movl   $0xffffffff,-0x30(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1030 <memset@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    1185 <main+0x75>
movslq -0x34(%rbp),%rax
cmpl   $0x0,-0x30(%rbp,%rax,4)
je     1172 <main+0x62>
movl   $0x1,-0x4(%rbp)
jmp    118c <main+0x7c>
jmp    1177 <main+0x67>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    114d <main+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double f;
  scanf("%lf", &f);
  printf("%.3lf\n", 5 * (f - 32) / 9);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm1
movsd  0xec4(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xeb0(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe9c(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
addsd  0xec3(%rip),%xmm0
mulsd  0xec3(%rip),%xmm0
divsd  0xec3(%rip),%xmm0
cvttsd2si %xmm0,%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [7 x i8] c"%.3lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%4 = load double, double* %2
%5 = fsub double %4, 3.200000e+01
%6 = fmul double 5.000000e+00, %5
%7 = fdiv double %6, 9.000000e+00
%8 = fptosi double %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [7 x i8] c"%.3lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fadd double %4, -3.200000e+01
%6 = fmul double %5, 5.000000e+00
%7 = fdiv double %6, 9.000000e+00
%8 = fptosi double %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
void sk_set(void) {}


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

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

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

LLVM IR (-O2):
define void @sk_set() {
ret void
}
int mystrlen(char *s) {
  int len = 0;
  while (*s) {
    len++;
    s++;
  }
  return len;
}


x86 assembly (clang, -O0):
<mystrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1136 <mystrlen+0x36>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <mystrlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrlen>:
cmpb   $0x0,(%rdi)
je     111c <mystrlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <mystrlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @mystrlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}