xunge/DecIR huggingface dataset:
/* Type definitions */
struct l_class_OC_Dummy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _ZN5DummyC2Ev(struct l_class_OC_Dummy *);
void _ZN5DummyC1Ev(struct l_class_OC_Dummy *llvm_cbe_this) {
  struct l_class_OC_Dummy *llvm_cbe_this_2e_addr;
  struct l_class_OC_Dummy *llvm_cbe_this1;
  *(&llvm_cbe_this_2e_addr) = llvm_cbe_this;
  llvm_cbe_this1 = *(&llvm_cbe_this_2e_addr);
  _ZN5DummyC2Ev(llvm_cbe_this1);
  return;
}


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

x86 assembly (clang, -O2):
<_ZN5DummyC1Ev>:
jmp    1030 <_ZN5DummyC2Ev@plt>

LLVM IR (-O0):
%struct.l_class_OC_Dummy = type { i32 }
define void @_ZN5DummyC1Ev(%struct.l_class_OC_Dummy* %0) {
%2 = alloca %struct.l_class_OC_Dummy*
%3 = alloca %struct.l_class_OC_Dummy*
%4 = alloca %struct.l_class_OC_Dummy*
store %struct.l_class_OC_Dummy* %0, %struct.l_class_OC_Dummy** %2
%5 = load %struct.l_class_OC_Dummy*, %struct.l_class_OC_Dummy** %2
store %struct.l_class_OC_Dummy* %5, %struct.l_class_OC_Dummy** %3
%6 = load %struct.l_class_OC_Dummy*, %struct.l_class_OC_Dummy** %3
store %struct.l_class_OC_Dummy* %6, %struct.l_class_OC_Dummy** %4
%7 = load %struct.l_class_OC_Dummy*, %struct.l_class_OC_Dummy** %4
%8 = call i32 @_ZN5DummyC2Ev(%struct.l_class_OC_Dummy* %7)
ret void
}

LLVM IR (-O2):
%struct.l_class_OC_Dummy = type { i32 }
define void @_ZN5DummyC1Ev(%struct.l_class_OC_Dummy* %0) {
%2 = tail call i32 @_ZN5DummyC2Ev(%struct.l_class_OC_Dummy* %0)
ret void
}
unsigned get_apic_id(unsigned long x) { return (((x) >> 24) & 0xF); }


x86 assembly (clang, -O0):
<get_apic_id>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x18,%rax
and    $0xf,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_apic_id>:
mov    %rdi,%rax
shr    $0x18,%eax
and    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @get_apic_id(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 24
%5 = and i64 %4, 15
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @get_apic_id(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = lshr i32 %2, 24
%4 = and i32 %3, 15
ret i32 %4
}
/* Type definitions */
struct _tuple12 {
  int dummy;
};
struct Cyc_Lexing_lexbuf {
  int dummy;
};

/* Variables and functions */
struct _tuple12 *Cyc_token_rec(struct Cyc_Lexing_lexbuf *, int /*<<< orphan*/);
struct _tuple12 *Cyc_token(struct Cyc_Lexing_lexbuf *lexbuf) {
  struct _tuple12 *_T0;
  _T0 = Cyc_token_rec(lexbuf, 0);
  return _T0;
}


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

x86 assembly (clang, -O2):
<Cyc_token>:
xor    %esi,%esi
jmp    1030 <Cyc_token_rec@plt>

LLVM IR (-O0):
%struct._tuple12 = type { i32 }
%struct.Cyc_Lexing_lexbuf = type { i32 }
define %struct._tuple12* @Cyc_token(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = alloca %struct.Cyc_Lexing_lexbuf*
%3 = alloca %struct._tuple12*
store %struct.Cyc_Lexing_lexbuf* %0, %struct.Cyc_Lexing_lexbuf** %2
%4 = load %struct.Cyc_Lexing_lexbuf*, %struct.Cyc_Lexing_lexbuf** %2
%5 = call %struct._tuple12* @Cyc_token_rec(%struct.Cyc_Lexing_lexbuf* %4, i32 0)
store %struct._tuple12* %5, %struct._tuple12** %3
%6 = load %struct._tuple12*, %struct._tuple12** %3
ret %struct._tuple12* %6
}

LLVM IR (-O2):
%struct._tuple12 = type { i32 }
%struct.Cyc_Lexing_lexbuf = type { i32 }
define %struct._tuple12* @Cyc_token(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = tail call %struct._tuple12* @Cyc_token_rec(%struct.Cyc_Lexing_lexbuf* %0, i32 0)
ret %struct._tuple12* %2
}
/* Variables and functions */
float sinf(float);
float cosf(float x) { return sinf(x + 1.57079632679489661923); }


x86 assembly (clang, -O0):
<cosf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed2(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <sinf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cosf>:
cvtss2sd %xmm0,%xmm0
addsd  0xee4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
jmp    1030 <sinf@plt>

LLVM IR (-O0):
define float @cosf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fadd double %4, 0x3FF921FB54442D18
%6 = fptrunc double %5 to float
%7 = call float @sinf(float %6)
ret float %7
}

LLVM IR (-O2):
define float @cosf(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, 0x3FF921FB54442D18
%4 = fptrunc double %3 to float
%5 = tail call float @sinf(float %4)
ret float %5
}
double factorial(double n) {
  return (n == 1 || n == 0) ? 1 : factorial(n - 1) * n;
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    113f <factorial+0x2f>
jp     113f <factorial+0x2f>
jmp    1157 <factorial+0x47>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1169 <factorial+0x59>
jp     1169 <factorial+0x59>
movsd  0xea1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1189 <factorial+0x79>
movsd  -0x8(%rbp),%xmm0
movsd  0xe8a(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <factorial@plt>
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
push   %rax
movapd %xmm0,%xmm2
movsd  0xee3(%rip),%xmm0
ucomisd %xmm0,%xmm2
jne    1125 <factorial+0x15>
jnp    114c <factorial+0x3c>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm2
jne    1131 <factorial+0x21>
jnp    114c <factorial+0x3c>
movsd  0xecf(%rip),%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm2,(%rsp)
call   1030 <factorial@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @factorial(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oeq double %3, 1.000000e+00
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load double, double* %2
%7 = fcmp oeq double %6, 0.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %5, %1
br label %15
9: ; preds = %5
%10 = load double, double* %2
%11 = fsub double %10, 1.000000e+00
%12 = call double @factorial(double %11)
%13 = load double, double* %2
%14 = fmul double %12, %13
br label %15
15: ; preds = %9, %8
%16 = phi double [ 1.000000e+00, %8 ], [ %14, %9 ]
ret double %16
}

LLVM IR (-O2):
define double @factorial(double %0) {
%2 = fcmp oeq double %0, 1.000000e+00
%3 = fcmp oeq double %0, 0.000000e+00
%4 = or i1 %2, %3
br i1 %4, label %5, label %7
5: ; preds = %1, %7
%6 = phi double [ %10, %7 ], [ 1.000000e+00, %1 ]
ret double %6
7: ; preds = %1
%8 = fadd double %0, -1.000000e+00
%9 = tail call double @factorial(double %8)
%10 = fmul double %9, %0
br label %5
}
/* Variables and functions */
int abs(int);
int euclid_mod(int a, int b) {
  a = abs(a);
  b = abs(b);
  while (b != 0) {
    int temp = b;
    b = a % b;
    a = temp;
  }
  return a;
}


x86 assembly (clang, -O0):
<euclid_mod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1159 <euclid_mod+0x49>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1134 <euclid_mod+0x24>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<euclid_mod>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
test   %esi,%esi
je     112d <euclid_mod+0x2d>
mov    %esi,%edx
neg    %edx
cmovs  %esi,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1120 <euclid_mod+0x20>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @euclid_mod(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%4 = icmp eq i32 %1, 0
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = tail call i32 @llvm.abs.i32(i32 %1, i1 true)
br label %7
7: ; preds = %5, %7
%8 = phi i32 [ %9, %7 ], [ %3, %5 ]
%9 = phi i32 [ %10, %7 ], [ %6, %5 ]
%10 = srem i32 %8, %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %7
12: ; preds = %7, %2
%13 = phi i32 [ %3, %2 ], [ %9, %7 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ mat_smthr_smooth(void *);
void *parallelSmoothHelper(void *param) {
  mat_smthr_smooth(param);
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @parallelSmoothHelper(i8* %0) {
%2 = tail call i32 @mat_smthr_smooth(i8* %0)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
void func5() { print("func"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"func\00"
define void @func5() {
%1 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"func\00"
define void @func5() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *itoa(int, int);
int /*<<< orphan*/ printf(char *, char *);
void vga_terminal_putint(int i) {
  char *s = itoa(i, 10);
  printf("%s\n", s);
  free(s);
}


x86 assembly (clang, -O0):
<vga_terminal_putint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xa,%esi
call   1050 <itoa@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vga_terminal_putint>:
push   %rbx
mov    $0xa,%esi
call   1050 <itoa@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @vga_terminal_putint(i32 %0) {
%2 = tail call i8* @itoa(i32 %0, i32 10)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int digitalread(int);
int sensordigital(int valor) {
  int temp = 0;
  temp = digitalread(valor);
  if (temp == 0) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<sensordigital>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <digitalread@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1143 <sensordigital+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <sensordigital+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @sensordigital(i32 %0) {
%2 = tail call i32 @digitalread(i32 %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int gw_main(int, char **);
int main(int argc, char **argv) { return gw_main(argc, argv); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <gw_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <gw_main@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gw_main(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ isprint(int);
void uninitvar_isprint(void) {
  int i;
  (void)isprint(i);
}


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

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

LLVM IR (-O0):
define void @uninitvar_isprint() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @isprint(i32 %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_isprint() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GyroSensorHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void GyroSensorRequestUpdate() { UAVObjRequestUpdate(GyroSensorHandle()); }


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

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

LLVM IR (-O0):
define void @GyroSensorRequestUpdate() {
%1 = call i32 (...) @GyroSensorHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @GyroSensorRequestUpdate() {
%1 = tail call i32 (...) @GyroSensorHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
main() {
  int a[] = {1};
  return *a == 1 ? 0 : 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeef(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.a = [1 x i32] [i32 1]
define i32 @main() {
%1 = alloca i32
%2 = alloca [1 x i32]
store i32 0, i32* %1
%3 = bitcast [1 x i32]* %2 to i8*
%4 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 0, i32 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int RAND_MAX;
int rand();
int strlen(char *);
char rndchr(char *map) {
  return *(map + 0 + rand() / (RAND_MAX / (strlen(map) - 0)));
}


x86 assembly (clang, -O0):
<rndchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,-0x14(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
sub    $0x0,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rndchr>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <rand@plt>
mov    %eax,%r14d
mov    0x2eb0(%rip),%rax
mov    (%rax),%ebp
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
mov    %eax,%ecx
mov    %r14d,%eax
cltd
idiv   %ecx
cltq
mov    (%rbx,%rax,1),%al
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define signext i8 @rndchr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = call i32 (...) @rand()
%6 = load i32, i32* @RAND_MAX
%7 = load i8*, i8** %2
%8 = call i32 @strlen(i8* %7)
%9 = sub nsw i32 %8, 0
%10 = sdiv i32 %6, %9
%11 = sdiv i32 %5, %10
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %4, i64 %12
%14 = load i8, i8* %13
ret i8 %14
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define signext i8 @rndchr(i8* %0) {
%2 = tail call i32 (...) @rand()
%3 = load i32, i32* @RAND_MAX
%4 = tail call i32 @strlen(i8* %0)
%5 = sdiv i32 %3, %4
%6 = sdiv i32 %2, %5
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
ret i8 %9
}
int clamp255sg(int i) { return ((i < -255) ? -255 : ((i > 255) ? 255 : i)); }


x86 assembly (clang, -O0):
<clamp255sg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffff01,-0x4(%rbp)
jge    1121 <clamp255sg+0x21>
mov    $0xffffff01,%eax
mov    %eax,-0x8(%rbp)
jmp    1147 <clamp255sg+0x47>
cmpl   $0xff,-0x4(%rbp)
jle    113b <clamp255sg+0x3b>
mov    $0xff,%eax
mov    %eax,-0xc(%rbp)
jmp    1141 <clamp255sg+0x41>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp255sg>:
cmp    $0xff,%edi
mov    $0xff,%ecx
cmovl  %edi,%ecx
cmp    $0xffffff02,%ecx
mov    $0xffffff01,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @clamp255sg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, -255
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 255
br i1 %8, label %9, label %10
9: ; preds = %6
br label %12
10: ; preds = %6
%11 = load i32, i32* %2
br label %12
12: ; preds = %10, %9
%13 = phi i32 [ 255, %9 ], [ %11, %10 ]
br label %14
14: ; preds = %12, %5
%15 = phi i32 [ -255, %5 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @clamp255sg(i32 %0) {
%2 = icmp slt i32 %0, 255
%3 = select i1 %2, i32 %0, i32 255
%4 = icmp sgt i32 %3, -255
%5 = select i1 %4, i32 %3, i32 -255
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xed() {
  Assert_real((isxdigit(237) == 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_isxdigit.c",
              1190, ("isxdigit should be 0 for 0xed"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0xed>:
push   %rax
mov    $0xed,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x4a6,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xed\00"
define void @t_isxdigit_0xed() {
%1 = call i64 @isxdigit(i32 237)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1190, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xed\00"
define void @t_isxdigit_0xed() {
%1 = tail call i64 @isxdigit(i32 237)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1190, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ setViewSize(int, int);
void newViewSize(int width) {
  assert(width > 1 && width <= 20);
  setViewSize(width * 16, (int)(width * 16 * (.5F)));
}


x86 assembly (clang, -O0):
<newViewSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1144 <newViewSize+0x24>
cmpl   $0x14,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%edi
shl    $0x4,%edi
mov    -0x4(%rbp),%eax
shl    $0x4,%eax
cvtsi2ss %eax,%xmm0
movss  0xe97(%rip),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%esi
call   1040 <setViewSize@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newViewSize>:
push   %rbx
mov    %edi,%ebx
lea    -0x2(%rbx),%eax
xor    %edi,%edi
cmp    $0x13,%eax
setb   %dil
call   1030 <assert@plt>
shl    $0x4,%ebx
cvtsi2ss %ebx,%xmm0
mulss  0xebd(%rip),%xmm0
cvttss2si %xmm0,%esi
mov    %ebx,%edi
pop    %rbx
jmp    1040 <setViewSize@plt>

LLVM IR (-O0):
define void @newViewSize(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 20
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %2
%13 = mul nsw i32 %12, 16
%14 = load i32, i32* %2
%15 = mul nsw i32 %14, 16
%16 = sitofp i32 %15 to float
%17 = fmul float %16, 5.000000e-01
%18 = fptosi float %17 to i32
%19 = call i32 @setViewSize(i32 %13, i32 %18)
ret void
}

LLVM IR (-O2):
define void @newViewSize(i32 %0) {
%2 = add i32 %0, -2
%3 = icmp ult i32 %2, 19
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = shl nsw i32 %0, 4
%7 = sitofp i32 %6 to float
%8 = fmul float %7, 5.000000e-01
%9 = fptosi float %8 to i32
%10 = tail call i32 @setViewSize(i32 %6, i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ japi_setstate(int, int);
void j_setstate(int arg0, int arg1) { japi_setstate(arg0, arg1); }


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

x86 assembly (clang, -O2):
<j_setstate>:
jmp    1030 <japi_setstate@plt>

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

LLVM IR (-O2):
define void @j_setstate(i32 %0, i32 %1) {
%3 = tail call i32 @japi_setstate(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int sol_network_init();
int sol_comms_init(void) {
  int ret;
  ret = sol_network_init();
  if (ret != 0)
    return -1;
  return 0;
  return -1;
}


x86 assembly (clang, -O0):
<sol_comms_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <sol_network_init@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1138 <sol_comms_init+0x28>
movl   $0xffffffff,-0x4(%rbp)
jmp    113f <sol_comms_init+0x2f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sol_comms_init>:
push   %rax
xor    %eax,%eax
call   1030 <sol_network_init@plt>
neg    %eax
sbb    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @sol_comms_init() {
%1 = tail call i32 (...) @sol_network_init()
%2 = icmp ne i32 %1, 0
%3 = sext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct section_hash {
  int dummy;
};
struct genhash {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genhash_clear(struct genhash *);
void section_hash_clear(struct section_hash *tthis) {
  genhash_clear((struct genhash *)tthis);
}


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

x86 assembly (clang, -O2):
<section_hash_clear>:
jmp    1030 <genhash_clear@plt>

LLVM IR (-O0):
%struct.section_hash = type { i32 }
%struct.genhash = type { i32 }
define void @section_hash_clear(%struct.section_hash* %0) {
%2 = alloca %struct.section_hash*
store %struct.section_hash* %0, %struct.section_hash** %2
%3 = load %struct.section_hash*, %struct.section_hash** %2
%4 = bitcast %struct.section_hash* %3 to %struct.genhash*
%5 = call i32 @genhash_clear(%struct.genhash* %4)
ret void
}

LLVM IR (-O2):
%struct.section_hash = type { i32 }
%struct.genhash = type { i32 }
define void @section_hash_clear(%struct.section_hash* %0) {
%2 = bitcast %struct.section_hash* %0 to %struct.genhash*
%3 = tail call i32 @genhash_clear(%struct.genhash* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ptrdiff_t;

/* Variables and functions */
int /*<<< orphan*/ hash_1d(int /*<<< orphan*/);
ptrdiff_t hash_3d(ptrdiff_t x, ptrdiff_t y, ptrdiff_t z) {
  return hash_1d(x + hash_1d(y + hash_1d(z)));
}


x86 assembly (clang, -O0):
<hash_3d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <hash_1d@plt>
mov    -0x14(%rbp),%edi
add    %eax,%edi
call   1030 <hash_1d@plt>
mov    -0x10(%rbp),%edi
add    %eax,%edi
call   1030 <hash_1d@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_3d>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edx,%edi
call   1030 <hash_1d@plt>
add    %eax,%ebx
mov    %ebx,%edi
call   1030 <hash_1d@plt>
add    %eax,%ebp
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <hash_1d@plt>

LLVM IR (-O0):
define i32 @hash_3d(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 @hash_1d(i32 %9)
%11 = add nsw i32 %8, %10
%12 = call i32 @hash_1d(i32 %11)
%13 = add nsw i32 %7, %12
%14 = call i32 @hash_1d(i32 %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @hash_3d(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @hash_1d(i32 %2)
%5 = add nsw i32 %4, %1
%6 = tail call i32 @hash_1d(i32 %5)
%7 = add nsw i32 %6, %0
%8 = tail call i32 @hash_1d(i32 %7)
ret i32 %8
}
char ASCIItoUpperCase(char base) {
  switch (base) {
  case 'A':
  case 'a':
    return ('A');
  case 'C':
  case 'c':
    return ('C');
  case 'G':
  case 'g':
    return ('G');
  case 'T':
  case 't':
    return ('T');
  default:
    return ('A');
  }
}


x86 assembly (clang, -O0):
<ASCIItoUpperCase>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x33,%eax
ja     1158 <ASCIItoUpperCase+0x58>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x41,-0x1(%rbp)
jmp    115c <ASCIItoUpperCase+0x5c>
movb   $0x43,-0x1(%rbp)
jmp    115c <ASCIItoUpperCase+0x5c>
movb   $0x47,-0x1(%rbp)
jmp    115c <ASCIItoUpperCase+0x5c>
movb   $0x54,-0x1(%rbp)
jmp    115c <ASCIItoUpperCase+0x5c>
movb   $0x41,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASCIItoUpperCase>:
mov    $0x41,%al
add    $0xffffffbd,%edi
cmp    $0x31,%edi
ja     1142 <ASCIItoUpperCase+0x42>
movabs $0x100000001,%rcx
bt     %rdi,%rcx
jb     113d <ASCIItoUpperCase+0x3d>
movabs $0x1000000010,%rcx
bt     %rdi,%rcx
jb     1140 <ASCIItoUpperCase+0x40>
movabs $0x2000000020000,%rcx
bt     %rdi,%rcx
jae    1142 <ASCIItoUpperCase+0x42>
mov    $0x54,%al
ret
mov    $0x43,%al
ret
mov    $0x47,%al
ret

LLVM IR (-O0):
define signext i8 @ASCIItoUpperCase(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %10 [
i32 65, label %6
i32 97, label %6
i32 67, label %7
i32 99, label %7
i32 71, label %8
i32 103, label %8
i32 84, label %9
i32 116, label %9
]
6: ; preds = %1, %1
store i8 65, i8* %2
br label %11
7: ; preds = %1, %1
store i8 67, i8* %2
br label %11
8: ; preds = %1, %1
store i8 71, i8* %2
br label %11
9: ; preds = %1, %1
store i8 84, i8* %2
br label %11
10: ; preds = %1
store i8 65, i8* %2
br label %11
11: ; preds = %10, %9, %8, %7, %6
%12 = load i8, i8* %2
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @ASCIItoUpperCase(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %6 [
i32 116, label %5
i32 84, label %5
i32 67, label %3
i32 99, label %3
i32 71, label %4
i32 103, label %4
]
3: ; preds = %1, %1
br label %6
4: ; preds = %1, %1
br label %6
5: ; preds = %1, %1
br label %6
6: ; preds = %1, %5, %4, %3
%7 = phi i8 [ 84, %5 ], [ 71, %4 ], [ 67, %3 ], [ 65, %1 ]
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ writefull(int, char *, int /*<<< orphan*/);
void mustsend(int fd, char *s) {
  writefull(fd, s, strlen(s));
  printf(">%d %s", fd, s);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<mustsend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1050 <writefull@plt>
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xe7e(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e52(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mustsend>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <writefull@plt>
lea    0xe9d(%rip),%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
call   1040 <printf@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <fflush@plt>

LLVM IR (-O0):
@.str = [7 x i8] c">%d %s\00"
@stdout = global i32 0
define void @mustsend(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @writefull(i32 %5, i8* %6, i32 %8)
%10 = load i32, i32* %3
%11 = load i8*, i8** %4
%12 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %11)
%13 = load i32, i32* @stdout
%14 = call i32 @fflush(i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c">%d %s\00"
@stdout = global i32 0
define void @mustsend(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @writefull(i32 %0, i8* %1, i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
%6 = load i32, i32* @stdout
%7 = tail call i32 @fflush(i32 %6)
ret void
}
double test5(double a, double b) { return __builtin_copysign(a, b); }


x86 assembly (clang, -O0):
<test5>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movaps 0xee1(%rip),%xmm2
pand   %xmm2,%xmm1
movaps 0xee6(%rip),%xmm2
pand   %xmm2,%xmm0
por    %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<test5>:
andps  0xef9(%rip),%xmm1
andps  0xf02(%rip),%xmm0
orps   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @test5(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @llvm.copysign.f64(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @test5(double %0, double %1) {
%3 = tail call double @llvm.copysign.f64(double %0, double %1)
ret double %3
}
char *resturn_char_string() {
  char buffer[] = "this is a string";
  return buffer;
}


x86 assembly (clang, -O0):
<resturn_char_string>:
push   %rbp
mov    %rsp,%rbp
mov    0xef5(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xef2(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xef0(%rip),%al
mov    %al,-0x10(%rbp)
lea    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<resturn_char_string>:
lea    -0x18(%rsp),%rax
ret

LLVM IR (-O0):
@__const.resturn_char_string.buffer = [17 x i8] c"this is a string\00"
define i8* @resturn_char_string() {
%1 = alloca [17 x i8]
%2 = bitcast [17 x i8]* %1 to i8*
%3 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
ret i8* %3
}

LLVM IR (-O2):
define noalias i8* @resturn_char_string() {
%1 = alloca [17 x i8]
%2 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char input[6];
  scanf("%5s", input);
  printf("Your input : %s", input);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x6(%rbp),%rsi
lea    0xecd(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x6(%rbp),%rsi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
lea    0xa(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xec4(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%5s\00"
@.str.1 = [16 x i8] c"Your input : %s\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%5s\00"
@.str.1 = [16 x i8] c"Your input : %s\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int print_html_head(void) {
  printf("Content-type: text/html\n\n");
  printf("<html><head><title>CGI File</title></head><body>\n");
  printf("<H2>CGI File</H2>\n\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<print_html_head>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef5(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1a(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Content-type: text/html\0A\0A\00"
@.str.1 = [50 x i8] c"<html><head><title>CGI File</title></head><body>\0A\00"
@.str.2 = [20 x i8] c"<H2>CGI File</H2>\0A\0A\00"
define i32 @print_html_head() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"Content-type: text/html\0A\00"
@str.3 = [49 x i8] c"<html><head><title>CGI File</title></head><body>\00"
@str.4 = [19 x i8] c"<H2>CGI File</H2>\0A\00"
define i32 @print_html_head() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mock_push(int /*<<< orphan*/);
int /*<<< orphan*/ pack_glXGetVisualConfigs(int /*<<< orphan*/ *);
void glXGetVisualConfigs() {
  { mock_push(pack_glXGetVisualConfigs(NULL)); };
}


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

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

LLVM IR (-O0):
define void @glXGetVisualConfigs() {
%1 = call i32 @pack_glXGetVisualConfigs(i32* null)
%2 = call i32 @mock_push(i32 %1)
ret void
}

LLVM IR (-O2):
define void @glXGetVisualConfigs() {
%1 = tail call i32 @pack_glXGetVisualConfigs(i32* null)
%2 = tail call i32 @mock_push(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void xm_receive_xmodem() { printf("RX XMODEM"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"RX XMODEM\00"
define void @xm_receive_xmodem() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"RX XMODEM\00"
define void @xm_receive_xmodem() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
int __test() {
  double x = 0.5;
  double y = 0.25;
  return x > y;
}


x86 assembly (clang, -O0):
<__test>:
push   %rbp
mov    %rsp,%rbp
movsd  0xefc(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xee7(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__test() {
%1 = alloca double
%2 = alloca double
store double 5.000000e-01, double* %1
store double 2.500000e-01, double* %2
%3 = load double, double* %1
%4 = load double, double* %2
%5 = fcmp ogt double %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @__test() {
ret i32 1
}
unsigned hh(unsigned a) { return a & 0xffff000u; }


x86 assembly (clang, -O0):
<hh>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff000,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hh>:
mov    %edi,%eax
and    $0xffff000,%eax
ret

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

LLVM IR (-O2):
define i32 @hh(i32 %0) {
%2 = and i32 %0, 268431360
ret i32 %2
}
void fun(a) {
  if (a <= 0) {
    fun2(a);
    return;
  }
  printf("%d ", a);
  fun(a - 5);
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     1154 <fun+0x24>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <fun2@plt>
jmp    1170 <fun+0x40>
mov    -0x4(%rbp),%esi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x4(%rbp),%edi
sub    $0x5,%edi
call   1040 <fun@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
test   %edi,%edi
jle    1158 <fun+0x38>
lea    0xecf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    -0x5(%rbx),%edi
cmp    $0x6,%ebx
mov    %edi,%ebx
jae    1140 <fun+0x20>
jmp    115a <fun+0x3a>
mov    %ebx,%edi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fun2@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define void @fun(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 (i32, ...) bitcast (i32 (...)* @fun2 to i32 (i32, ...)*)(i32 %6)
br label %13
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %2
%12 = sub nsw i32 %11, 5
br label %13
13: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @fun(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %3, label %6
3: ; preds = %6, %1
%4 = phi i32 [ %0, %1 ], [ %9, %6 ]
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @fun2 to i32 (i32, ...)*)(i32 %4)
ret void
6: ; preds = %1, %6
%7 = phi i32 [ %9, %6 ], [ %0, %1 ]
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = add nsw i32 %7, -5
%10 = icmp ult i32 %7, 6
br i1 %10, label %3, label %6
}
/* Type definitions */
struct MCTStatStruc {
  int dummy;
};
struct DCTStatStruc {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mct_ClrWbEnhWsbDis_D(struct MCTStatStruc *,
                                        struct DCTStatStruc *);
void mct_FinalMCT_D(struct MCTStatStruc *pMCTstat,
                    struct DCTStatStruc *pDCTstat) {
  mct_ClrWbEnhWsbDis_D(pMCTstat, pDCTstat);
}


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

x86 assembly (clang, -O2):
<mct_FinalMCT_D>:
jmp    1030 <mct_ClrWbEnhWsbDis_D@plt>

LLVM IR (-O0):
%struct.MCTStatStruc = type { i32 }
%struct.DCTStatStruc = type { i32 }
define void @mct_FinalMCT_D(%struct.MCTStatStruc* %0, %struct.DCTStatStruc* %1) {
%3 = alloca %struct.MCTStatStruc*
%4 = alloca %struct.DCTStatStruc*
store %struct.MCTStatStruc* %0, %struct.MCTStatStruc** %3
store %struct.DCTStatStruc* %1, %struct.DCTStatStruc** %4
%5 = load %struct.MCTStatStruc*, %struct.MCTStatStruc** %3
%6 = load %struct.DCTStatStruc*, %struct.DCTStatStruc** %4
%7 = call i32 @mct_ClrWbEnhWsbDis_D(%struct.MCTStatStruc* %5, %struct.DCTStatStruc* %6)
ret void
}

LLVM IR (-O2):
%struct.MCTStatStruc = type { i32 }
%struct.DCTStatStruc = type { i32 }
define void @mct_FinalMCT_D(%struct.MCTStatStruc* %0, %struct.DCTStatStruc* %1) {
%3 = tail call i32 @mct_ClrWbEnhWsbDis_D(%struct.MCTStatStruc* %0, %struct.DCTStatStruc* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void alarm_handler(int foo) {
  fprintf(stderr, "Error: Failed to complete after 10 seconds. Something's "
                  "wrong, or your system is terribly slow.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<alarm_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<alarm_handler>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [97 x i8] c"Error: Failed to complete after 10 seconds. Something's wrong, or your system is terribly slow.\0A\00"
define void @alarm_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [97 x i8] c"Error: Failed to complete after 10 seconds. Something's wrong, or your system is terribly slow.\0A\00"
define void @alarm_handler(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}