xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xcc() {
  Assert_real((isdigit(204) == 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_isdigit.c",
              1025, ("isdigit should be 0 for 0xcc"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0xcc>:
push   %rax
mov    $0xcc,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x401,%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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xcc\00"
define void @t_isdigit_0xcc() {
%1 = call i64 @isdigit(i32 204)
%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 1025, 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xcc\00"
define void @t_isdigit_0xcc() {
%1 = tail call i64 @isdigit(i32 204)
%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 1025, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f0(int);
void t0(void) { f0(1); }


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

x86 assembly (clang, -O2):
<t0>:
mov    $0x1,%edi
jmp    1030 <f0@plt>

LLVM IR (-O0):
define void @t0() {
%1 = call i32 @f0(i32 1)
ret void
}

LLVM IR (-O2):
define void @t0() {
%1 = tail call i32 @f0(i32 1)
ret void
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
unsigned long proc_cache_hash_pid(const pid_t pid) {
  unsigned long h = (unsigned long)pid;
  return h % (503);
}


x86 assembly (clang, -O0):
<proc_cache_hash_pid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x1f7,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<proc_cache_hash_pid>:
movabs $0x824a4e60b3262bc5,%rcx
4e 4a 82
mov    %rdi,%rax
mul    %rcx
shr    $0x8,%rdx
imul   $0x1f7,%rdx,%rax
sub    %rax,%rdi
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @proc_cache_hash_pid(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
store i64 %4, i64* %3
%5 = load i64, i64* %3
%6 = urem i64 %5, 503
ret i64 %6
}

LLVM IR (-O2):
define i64 @proc_cache_hash_pid(i64 %0) {
%2 = urem i64 %0, 503
ret i64 %2
}
/* Variables and functions */
int random();
int ranf(int max) {
  if (max <= 0)
    return (0);
  return (random() % max);
}


x86 assembly (clang, -O0):
<ranf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1131 <ranf+0x21>
movl   $0x0,-0x4(%rbp)
jmp    113f <ranf+0x2f>
mov    $0x0,%al
call   1030 <random@plt>
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ranf>:
test   %edi,%edi
jle    1125 <ranf+0x15>
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <random@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ranf(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 (...) @random()
%5 = srem i32 %4, %0
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ emitln(char *);
void expression() { emitln("<expression> #result is in %%eax"); }


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"<expression> #result is in %%eax\00"
define void @expression() {
%1 = call i32 @emitln(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"<expression> #result is in %%eax\00"
define void @expression() {
%1 = tail call i32 @emitln(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}
void sched_cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @sched_cleanup() {
ret void
}
int xtensa_uimm12x8(v)
int v;
{ return (v & 7) == 0 && (v >= 0 && v <= 32760); }


x86 assembly (clang, -O0):
<xtensa_uimm12x8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x7,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    113d <xtensa_uimm12x8+0x3d>
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1137 <xtensa_uimm12x8+0x37>
cmpl   $0x7ff8,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xtensa_uimm12x8>:
test   $0x7,%dil
sete   %al
cmp    $0x7ff9,%edi
setb   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @xtensa_uimm12x8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 7
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp sle i32 %10, 32760
br label %12
12: ; preds = %9, %6
%13 = phi i1 [ false, %6 ], [ %11, %9 ]
br label %14
14: ; preds = %12, %1
%15 = phi i1 [ false, %1 ], [ %13, %12 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @xtensa_uimm12x8(i32 %0) {
%2 = and i32 %0, 7
%3 = icmp eq i32 %2, 0
%4 = icmp ult i32 %0, 32761
%5 = and i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ scopy(int const *, float const *, int const *, float *,
                         int const *);
void c_scopy(const int N, const float *X, const int strideX, float *Y,
             const int strideY) {
  scopy(&N, X, &strideX, Y, &strideY);
}


x86 assembly (clang, -O0):
<c_scopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rcx
lea    -0x4(%rbp),%rdi
lea    -0x14(%rbp),%rdx
lea    -0x24(%rbp),%r8
call   1030 <scopy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_scopy>:
sub    $0x18,%rsp
mov    %edi,0x14(%rsp)
mov    %edx,0x10(%rsp)
mov    %r8d,0xc(%rsp)
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%r8
call   1030 <scopy@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @c_scopy(i32 %0, float* %1, i32 %2, float* %3, i32 %4) {
%6 = alloca i32
%7 = alloca float*
%8 = alloca i32
%9 = alloca float*
%10 = alloca i32
store i32 %0, i32* %6
store float* %1, float** %7
store i32 %2, i32* %8
store float* %3, float** %9
store i32 %4, i32* %10
%11 = load float*, float** %7
%12 = load float*, float** %9
%13 = call i32 @scopy(i32* %6, float* %11, i32* %8, float* %12, i32* %10)
ret void
}

LLVM IR (-O2):
define void @c_scopy(i32 %0, float* %1, i32 %2, float* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %6
store i32 %2, i32* %7
store i32 %4, i32* %8
%9 = call i32 @scopy(i32* %6, float* %1, i32* %7, float* %3, i32* %8)
ret void
}
/* Variables and functions */
scalar_t__ genrand_int32();
double genrand_real1(void) {
  return ((double)genrand_int32()) * (1.0 / 4294967295.0);
}


x86 assembly (clang, -O0):
<genrand_real1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <genrand_int32@plt>
cvtsi2sd %rax,%xmm0
movsd  0xed8(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<genrand_real1>:
push   %rax
xor    %eax,%eax
call   1030 <genrand_int32@plt>
cvtsi2sd %rax,%xmm0
mulsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @genrand_real1() {
%1 = call i64 (...) @genrand_int32()
%2 = sitofp i64 %1 to double
%3 = fmul double %2, 0x3DF0000000100000
ret double %3
}

LLVM IR (-O2):
define double @genrand_real1() {
%1 = tail call i64 (...) @genrand_int32()
%2 = sitofp i64 %1 to double
%3 = fmul double %2, 0x3DF0000000100000
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ write(int, int /*<<< orphan*/ ***, int);
void output(uint8_t frame[8][80][3], int size) { write(1, frame, size); }


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

x86 assembly (clang, -O2):
<output>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @output([80 x [3 x i32]]* %0, i32 %1) {
%3 = alloca [80 x [3 x i32]]*
%4 = alloca i32
store [80 x [3 x i32]]* %0, [80 x [3 x i32]]** %3
store i32 %1, i32* %4
%5 = load [80 x [3 x i32]]*, [80 x [3 x i32]]** %3
%6 = bitcast [80 x [3 x i32]]* %5 to i32***
%7 = load i32, i32* %4
%8 = call i32 @write(i32 1, i32*** %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @output([80 x [3 x i32]]* nocapture %0, i32 %1) {
%3 = bitcast [80 x [3 x i32]]* %0 to i32***
%4 = tail call i32 @write(i32 1, i32*** %3, i32 %1)
ret void
}
void _acc_log_lock() {}


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

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

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

LLVM IR (-O2):
define void @_acc_log_lock() {
ret void
}
/* Variables and functions */
char toupper(char);
char *Str_ToUpper(char *pString) {
  char *str = pString;
  while (*str) {
    *str = toupper(*str);
    str++;
  }
  return pString;
}


x86 assembly (clang, -O0):
<Str_ToUpper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <Str_ToUpper+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <Str_ToUpper+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Str_ToUpper>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <Str_ToUpper+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <Str_ToUpper+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @Str_ToUpper(i8* returned %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 i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @toupper(i8 signext %5)
store i8 %7, i8* %6
%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
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void println(int arr[], int len) {
  int i;
  for (i = 0; i < len; i++)
    printf("%d, ", arr[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<println>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <println+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <println+0x16>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<println>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <println+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <println+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%d, \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @println(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d, \00"
define void @println(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void gen_nick(char nick[10]) {
  srand(time(NULL));
  snprintf(nick, 10, "et%d", rand() % 10000000);
}


x86 assembly (clang, -O0):
<gen_nick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x989680,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0xa,%esi
lea    0xe7b(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_nick>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1060 <rand@plt>
movslq %eax,%rcx
imul   $0x6b5fca6b,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x36,%rax
add    %edx,%eax
imul   $0x989680,%eax,%eax
sub    %eax,%ecx
lea    0xe81(%rip),%rdx
mov    %rbx,%rdi
mov    $0xa,%esi
pop    %rbx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"et%d\00"
define void @gen_nick(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
%5 = load i8*, i8** %2
%6 = call i32 (...) @rand()
%7 = srem i32 %6, 10000000
%8 = call i32 @snprintf(i8* %5, i32 10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"et%d\00"
define void @gen_nick(i8* %0) {
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, 10000000
%6 = tail call i32 @snprintf(i8* %0, i32 10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void krash(void) {
  fprintf(stderr,
          "starcode has crashed, please contact guillaume.filion@gmail.com "
          "for support with this issue.\n");
  abort();
}


x86 assembly (clang, -O0):
<krash>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<krash>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [94 x i8] c"starcode has crashed, please contact guillaume.filion@gmail.com for support with this issue.\0A\00"
define void @krash() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [94 x i8] c"starcode has crashed, please contact guillaume.filion@gmail.com for support with this issue.\0A\00"
define void @krash() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int O_CREAT;
int O_RDWR;
int /*<<< orphan*/ assert(int);
scalar_t__ chdir(int /*<<< orphan*/);
int /*<<< orphan*/ ctdir();
int open(char *, int, int);
void cttesttmpdir() {
  assert(chdir(ctdir()) == 0);
  assert(open("x", O_CREAT | O_RDWR, 0777));
}


x86 assembly (clang, -O0):
<cttesttmpdir>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <ctdir@plt>
mov    %eax,%edi
call   1030 <chdir@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
mov    0x2e6d(%rip),%rax
or     (%rax),%esi
lea    0xe84(%rip),%rdi
mov    $0x1ff,%edx
call   1060 <open@plt>
mov    %eax,%edi
call   1040 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cttesttmpdir>:
push   %rax
xor    %eax,%eax
call   1050 <ctdir@plt>
mov    %eax,%edi
call   1030 <chdir@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
mov    0x2e94(%rip),%rax
mov    0x2e75(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xe8a(%rip),%rdi
mov    $0x1ff,%edx
call   1060 <open@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"x\00"
@O_CREAT = global i32 0
@O_RDWR = global i32 0
define void @cttesttmpdir() {
%1 = call i32 (...) @ctdir()
%2 = call i64 @chdir(i32 %1)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = load i32, i32* @O_CREAT
%7 = load i32, i32* @O_RDWR
%8 = or i32 %6, %7
%9 = call i32 @open(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %8, i32 511)
%10 = call i32 @assert(i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"x\00"
@O_CREAT = global i32 0
@O_RDWR = global i32 0
define void @cttesttmpdir() {
%1 = tail call i32 (...) @ctdir()
%2 = tail call i64 @chdir(i32 %1)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = load i32, i32* @O_CREAT
%7 = load i32, i32* @O_RDWR
%8 = or i32 %7, %6
%9 = tail call i32 @open(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %8, i32 511)
%10 = tail call i32 @assert(i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ enter(char *);
int /*<<< orphan*/ error(int);
int /*<<< orphan*/ out();
char symbol();
ppast() {
  enter("ppast");
  if (symbol() != '*')
    error(5);
  out();
}


x86 assembly (clang, -O0):
<ppast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <enter@plt>
mov    $0x0,%al
call   1060 <symbol@plt>
movsbl %al,%eax
cmp    $0x2a,%eax
je     1171 <ppast+0x31>
mov    $0x5,%edi
call   1040 <error@plt>
mov    $0x0,%al
call   1050 <out@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ppast>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <enter@plt>
xor    %eax,%eax
call   1060 <symbol@plt>
cmp    $0x2a,%al
je     1162 <ppast+0x22>
mov    $0x5,%edi
call   1040 <error@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <out@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"ppast\00"
define i32 @ppast() {
%1 = alloca i32
%2 = call i32 @enter(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = call signext i8 (...) @symbol()
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 42
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @error(i32 5)
br label %8
8: ; preds = %6, %0
%9 = call i32 (...) @out()
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [6 x i8] c"ppast\00"
define i32 @ppast() {
%1 = tail call i32 @enter(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call signext i8 (...) @symbol()
%3 = icmp eq i8 %2, 42
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @error(i32 5)
br label %6
6: ; preds = %4, %0
%7 = tail call i32 (...) @out()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ PrintErrorCode();
int dxl_read_byte(int, int);
int /*<<< orphan*/ printf(char *, int);
void getD(int ID) {
  int dVal;
  dVal = dxl_read_byte(ID, 28);
  if (0)
    printf("dynamixel dVal %d\n", dVal);
  PrintErrorCode();
}


x86 assembly (clang, -O0):
<getD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1c,%esi
call   1040 <dxl_read_byte@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <PrintErrorCode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getD>:
push   %rax
mov    $0x1c,%esi
call   1040 <dxl_read_byte@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <PrintErrorCode@plt>

LLVM IR (-O0):
define void @getD(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @dxl_read_byte(i32 %4, i32 28)
store i32 %5, i32* %3
%6 = call i32 (...) @PrintErrorCode()
ret void
}

LLVM IR (-O2):
define void @getD(i32 %0) {
%2 = tail call i32 @dxl_read_byte(i32 %0, i32 28)
%3 = tail call i32 (...) @PrintErrorCode()
ret void
}
/* Variables and functions */
scalar_t__ fs_remove_directory_content(char const *);
int rmdir(char const *);
int fs_remove_directory(const char *path, int force) {
  if (force && fs_remove_directory_content(path))
    return -1;
  return rmdir(path);
}


x86 assembly (clang, -O0):
<fs_remove_directory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1158 <fs_remove_directory+0x38>
mov    -0x10(%rbp),%rdi
call   1040 <fs_remove_directory_content@plt>
cmp    $0x0,%rax
je     1158 <fs_remove_directory+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    1164 <fs_remove_directory+0x44>
mov    -0x10(%rbp),%rdi
call   1030 <rmdir@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_remove_directory>:
push   %rbx
mov    %rdi,%rbx
test   %esi,%esi
je     113c <fs_remove_directory+0x1c>
mov    %rbx,%rdi
call   1040 <fs_remove_directory_content@plt>
test   %rax,%rax
je     113c <fs_remove_directory+0x1c>
mov    $0xffffffff,%eax
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <rmdir@plt>

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

LLVM IR (-O2):
define i32 @fs_remove_directory(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i64 @fs_remove_directory_content(i8* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4, %2
%8 = tail call i32 @rmdir(i8* %0)
br label %9
9: ; preds = %4, %7
%10 = phi i32 [ %8, %7 ], [ -1, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int, int, int);
void C67_CMPEQ(int s1, int s2, int dst) { C67_asm("CMPEQ.L1", s1, s2, dst); }


x86 assembly (clang, -O0):
<C67_CMPEQ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xecf(%rip),%rdi
call   1030 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_CMPEQ>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xee3(%rip),%rdi
jmp    1030 <C67_asm@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"CMPEQ.L1\00"
define void @C67_CMPEQ(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 @C67_asm(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"CMPEQ.L1\00"
define void @C67_CMPEQ(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @C67_asm(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SubjectModel_removeSubject(char *);
void Controller_removeSubject(char subjectName[]) {
  SubjectModel_removeSubject(subjectName);
  return;
}


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

x86 assembly (clang, -O2):
<Controller_removeSubject>:
jmp    1030 <SubjectModel_removeSubject@plt>

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

LLVM IR (-O2):
define void @Controller_removeSubject(i8* %0) {
%2 = tail call i32 @SubjectModel_removeSubject(i8* %0)
ret void
}
int test_imm_D8uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xD8 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_D8uint64_lowword_reg>:
test   $0xd8,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_D8uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 216
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, int);
void fprint_mov_direct_to_direct(FILE *stream, uint8_t direct_src,
                                 uint8_t direct_dst) {
  fprintf(stream,
          "MOV   "
          "0x%02X"
          ", "
          "0x%02X"
          "                ",
          direct_dst, direct_src);
}


x86 assembly (clang, -O0):
<fprint_mov_direct_to_direct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprint_mov_direct_to_direct>:
mov    %esi,%ecx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"MOV 0x%02X, 0x%02X \00"
define void @fprint_mov_direct_to_direct(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* %6
%9 = load i32, i32* %5
%10 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"MOV 0x%02X, 0x%02X \00"
define void @fprint_mov_direct_to_direct(i32* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %1)
ret void
}
double degToRad(double x) { return x / 57.295779513; }


x86 assembly (clang, -O0):
<degToRad>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<degToRad>:
divsd  0xef8(%rip),%xmm0
ret

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

LLVM IR (-O2):
define double @degToRad(double %0) {
%2 = fdiv double %0, 0x404CA5DC1A6394B6
ret double %2
}
/* Variables and functions */
float __ocml_copysign_f32(float, float);
float copysignf(float x, float y) { return __ocml_copysign_f32(x, y); }


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

x86 assembly (clang, -O2):
<copysignf>:
jmp    1030 <__ocml_copysign_f32@plt>

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

LLVM IR (-O2):
define float @copysignf(float %0, float %1) {
%3 = tail call float @__ocml_copysign_f32(float %0, float %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void fftwf_kernel_free(void *p) { free(p); }


x86 assembly (clang, -O0):
<fftwf_kernel_free>:
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):
<fftwf_kernel_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @fftwf_kernel_free(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 @fftwf_kernel_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int Signal_getSignalCount() { return 34; }


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

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

LLVM IR (-O0):
define i32 @Signal_getSignalCount() {
ret i32 34
}

LLVM IR (-O2):
define i32 @Signal_getSignalCount() {
ret i32 34
}
void to_uns_short_store_4(__float128 a, unsigned short *p) {
  p[4] = (unsigned short)a;
}


x86 assembly (clang, -O0):
<to_uns_short_store_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movaps %xmm0,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movaps -0x10(%rbp),%xmm0
call   1130 <__fixtfsi>
mov    %ax,%cx
mov    -0x18(%rbp),%rax
mov    %cx,0x8(%rax)
add    $0x20,%rsp
pop    %rbp
ret
nopw   0x0(%rax,%rax,1)

x86 assembly (clang, -O2):
<to_uns_short_store_4>:
push   %rbx
mov    %rdi,%rbx
call   1110 <__fixtfsi>
mov    %ax,0x8(%rbx)
pop    %rbx
ret
nop

LLVM IR (-O0):
define void @to_uns_short_store_4(fp128 %0, i16* %1) {
%3 = alloca fp128
%4 = alloca i16*
store fp128 %0, fp128* %3
store i16* %1, i16** %4
%5 = load fp128, fp128* %3
%6 = fptoui fp128 %5 to i16
%7 = load i16*, i16** %4
%8 = getelementptr inbounds i16, i16* %7, i64 4
store i16 %6, i16* %8
ret void
}

LLVM IR (-O2):
define void @to_uns_short_store_4(fp128 %0, i16* nocapture writeonly %1) {
%3 = fptoui fp128 %0 to i16
%4 = getelementptr inbounds i16, i16* %1, i64 4
store i16 %3, i16* %4
ret void
}
char *ckitoa(n)
int n;
{
  long nn;
  nn = n;
  return (ckltoa(nn));
}


x86 assembly (clang, -O0):
<ckitoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <ckltoa@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ckitoa>:
push   %rax
movslq %edi,%rdi
xor    %eax,%eax
call   1030 <ckltoa@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @ckitoa(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = call i32 (i64, ...) bitcast (i32 (...)* @ckltoa to i32 (i64, ...)*)(i64 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
define i8* @ckitoa(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call i32 (i64, ...) bitcast (i32 (...)* @ckltoa to i32 (i64, ...)*)(i64 %2)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Type definitions */
struct genlist {
  int dummy;
};
struct entry_list {
  int dummy;
};
struct entry {
  int dummy;
};

/* Variables and functions */
scalar_t__ genlist_get(struct genlist const *, int);
struct entry *entry_list_get(const struct entry_list *tthis, int index) {
  return ((struct entry *)genlist_get((const struct genlist *)tthis, index));
}


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

x86 assembly (clang, -O2):
<entry_list_get>:
jmp    1030 <genlist_get@plt>

LLVM IR (-O0):
%struct.entry = type { i32 }
%struct.entry_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.entry* @entry_list_get(%struct.entry_list* %0, i32 %1) {
%3 = alloca %struct.entry_list*
%4 = alloca i32
store %struct.entry_list* %0, %struct.entry_list** %3
store i32 %1, i32* %4
%5 = load %struct.entry_list*, %struct.entry_list** %3
%6 = bitcast %struct.entry_list* %5 to %struct.genlist*
%7 = load i32, i32* %4
%8 = call i64 @genlist_get(%struct.genlist* %6, i32 %7)
%9 = inttoptr i64 %8 to %struct.entry*
ret %struct.entry* %9
}

LLVM IR (-O2):
%struct.entry = type { i32 }
%struct.entry_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.entry* @entry_list_get(%struct.entry_list* %0, i32 %1) {
%3 = bitcast %struct.entry_list* %0 to %struct.genlist*
%4 = tail call i64 @genlist_get(%struct.genlist* %3, i32 %1)
%5 = inttoptr i64 %4 to %struct.entry*
ret %struct.entry* %5
}
void strtolower(char *str) {
  for (char *c = str; *c; c++) {
    if (*c >= 'A' && *c <= 'Z') {
      *c |= 32;
    }
  }
}


x86 assembly (clang, -O0):
<strtolower>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115f <strtolower+0x5f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     1149 <strtolower+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     1149 <strtolower+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
or     $0x20,%ecx
mov    %cl,(%rax)
jmp    114e <strtolower+0x4e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strtolower+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtolower>:
mov    (%rdi),%al
test   %al,%al
je     112a <strtolower+0x2a>
add    $0x1,%rdi
jmp    111b <strtolower+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     112a <strtolower+0x2a>
lea    -0x41(%rax),%ecx
cmp    $0x19,%cl
ja     1110 <strtolower+0x10>
or     $0x20,%al
mov    %al,-0x1(%rdi)
jmp    1110 <strtolower+0x10>
ret

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

LLVM IR (-O2):
define void @strtolower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %12, %1
ret void
5: ; preds = %1, %12
%6 = phi i8 [ %14, %12 ], [ %2, %1 ]
%7 = phi i8* [ %13, %12 ], [ %0, %1 ]
%8 = add i8 %6, -65
%9 = icmp ult i8 %8, 26
br i1 %9, label %10, label %12
10: ; preds = %5
%11 = or i8 %6, 32
store i8 %11, i8* %7
br label %12
12: ; preds = %5, %10
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %4, label %5
}
__attribute__((no, noclone)) unsigned __int128 t145_4sub(signed __int128 x) {
  unsigned __int128 y = (0);
  unsigned __int128 r;
  if (__builtin_sub_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t145_4sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    %rcx,%r9
sar    $0x3f,%r9
mov    -0x40(%rbp),%rsi
mov    -0x38(%rbp),%rax
sub    %rsi,%rdx
sbb    %rax,%rcx
mov    %r9,%r8
sbb    $0x0,%r8
sbb    $0x0,%r9
mov    %r8d,%eax
and    $0x1,%eax
mov    %eax,%esi
mov    %rsi,%rax
neg    %rax
mov    %rax,%rdi
xor    %r9,%rdi
xor    %r8,%rax
or     %rdi,%rax
or     %rsi,%rax
setne  %al
mov    %rdx,-0x50(%rbp)
mov    %rcx,-0x48(%rbp)
test   $0x1,%al
jne    119d <t145_4sub+0x8d>
jmp    11a4 <t145_4sub+0x94>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x50(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t145_4sub>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rax
sar    $0x3f,%rax
je     112a <t145_4sub+0x1a>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %r14,%rax
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t145_4sub(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = alloca i128
%8 = bitcast i128* %4 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %0, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
%11 = load i128, i128* %4
store i128 %11, i128* %5
store i128 0, i128* %6
%12 = load i128, i128* %5
%13 = load i128, i128* %6
%14 = sext i128 %12 to i129
%15 = zext i128 %13 to i129
%16 = call { i129, i1 } @llvm.ssub.with.overflow.i129(i129 %14, i129 %15)
%17 = extractvalue { i129, i1 } %16, 1
%18 = extractvalue { i129, i1 } %16, 0
%19 = trunc i129 %18 to i128
%20 = zext i128 %19 to i129
%21 = icmp ne i129 %18, %20
%22 = or i1 %17, %21
store i128 %19, i128* %7
br i1 %22, label %23, label %25
23: ; preds = %2
%24 = call i32 (...) @bar()
br label %25
25: ; preds = %23, %2
%26 = load i128, i128* %7
store i128 %26, i128* %3
%27 = bitcast i128* %3 to { i64, i64 }*
%28 = load { i64, i64 }, { i64, i64 }* %27
ret { i64, i64 } %28
}

LLVM IR (-O2):
define { i64, i64 } @t145_4sub(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = sext i128 %6 to i129
%8 = zext i128 %6 to i129
%9 = icmp eq i129 %7, %8
br i1 %9, label %12, label %10
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = insertvalue { i64, i64 } poison, i64 %0, 0
%14 = insertvalue { i64, i64 } %13, i64 %1, 1
ret { i64, i64 } %14
}
void g_type_add_interface_dynamic() {}


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

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

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

LLVM IR (-O2):
define void @g_type_add_interface_dynamic() {
ret void
}
/* Variables and functions */
int ftruncate(int, int);
int rawfalloc(int fd, int len) { return ftruncate(fd, len); }


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

x86 assembly (clang, -O2):
<rawfalloc>:
jmp    1030 <ftruncate@plt>

LLVM IR (-O0):
define i32 @rawfalloc(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 @ftruncate(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @rawfalloc(i32 %0, i32 %1) {
%3 = tail call i32 @ftruncate(i32 %0, i32 %1)
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int y_root;
};
typedef TYPE_1__ XKeyEvent;

/* Variables and functions */
void set_XKeyEvent_y_root(void *_p, int _v) {
  ((XKeyEvent *)_p)->y_root = (int)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XKeyEvent_y_root(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void notYetImplemented() {
  printf("\nNot yet implemented\n");
  exit(2);
}


x86 assembly (clang, -O0):
<notYetImplemented>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<notYetImplemented>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"\0ANot yet implemented\0A\00"
define void @notYetImplemented() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@str = [21 x i8] c"\0ANot yet implemented\00"
define void @notYetImplemented() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
char *GetConfigVar(char *);
char *my_GetTFTPdir(void) { return (GetConfigVar("tftp-dir")); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"tftp-dir\00"
define i8* @my_GetTFTPdir() {
%1 = call i8* @GetConfigVar(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [9 x i8] c"tftp-dir\00"
define i8* @my_GetTFTPdir() {
%1 = tail call i8* @GetConfigVar(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int helper(int *, int /*<<< orphan*/, int, int);
int mybsearch_2(int a[], int size, int value) {
  return helper(a, 0, size - 1, value);
}


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

x86 assembly (clang, -O2):
<mybsearch_2>:
mov    %edx,%ecx
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <helper@plt>

LLVM IR (-O0):
define i32 @mybsearch_2(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 = sub nsw i32 %8, 1
%10 = load i32, i32* %6
%11 = call i32 @helper(i32* %7, i32 0, i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @mybsearch_2(i32* %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, -1
%5 = tail call i32 @helper(i32* %0, i32 0, i32 %4, i32 %2)
ret i32 %5
}
void XtOverrideTranslations() {}


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

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

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

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