xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void shouldbe(int val, int shouldbe) {
  if (val != shouldbe) {
    fprintf(stderr, "*error* !! this isnt right ^^ \n");
  }
}


x86 assembly (clang, -O0):
<shouldbe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     113f <shouldbe+0x2f>
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shouldbe>:
cmp    %esi,%edi
jne    1115 <shouldbe+0x5>
ret
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
lea    0xedb(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"*error* !! this isnt right ^^ \0A\00"
define void @shouldbe(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 = icmp ne i32 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"*error* !! this isnt right ^^ \0A\00"
define void @shouldbe(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F(int *, int);
void F_r(int *a, int r) { F(a, 1); }


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

x86 assembly (clang, -O2):
<F_r>:
mov    $0x1,%esi
jmp    1030 <F@plt>

LLVM IR (-O0):
define void @F_r(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 = call i32 @F(i32* %5, i32 1)
ret void
}

LLVM IR (-O2):
define void @F_r(i32* %0, i32 %1) {
%3 = tail call i32 @F(i32* %0, i32 1)
ret void
}
void cord_event_bumper_unknown() {}


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

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

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

LLVM IR (-O2):
define void @cord_event_bumper_unknown() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *gmtime_r(int /*<<< orphan*/ const *, struct tm *);
struct tm *gmtime(const time_t *timep) {
  static struct tm shared;
  return gmtime_r(timep, &shared);
}


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

x86 assembly (clang, -O2):
<gmtime>:
lea    0x2f15(%rip),%rsi
jmp    1030 <gmtime_r@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
@gmtime.shared = internal global %struct.tm zeroinitializer
define %struct.tm* @gmtime(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call %struct.tm* @gmtime_r(i32* %3, %struct.tm* @gmtime.shared)
ret %struct.tm* %4
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@gmtime.shared = internal global %struct.tm zeroinitializer
define %struct.tm* @gmtime(i32* %0) {
%2 = tail call %struct.tm* @gmtime_r(i32* %0, %struct.tm* @gmtime.shared)
ret %struct.tm* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int pthread_join(int /*<<< orphan*/, int /*<<< orphan*/ *);
int thread_join(pthread_t id) { return pthread_join(id, NULL); }


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

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

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

LLVM IR (-O2):
define i32 @thread_join(i32 %0) {
%2 = tail call i32 @pthread_join(i32 %0, i32* null)
ret i32 %2
}
int bit_set(int n, unsigned int pos_zb) { return (n |= 1 << pos_zb); }


x86 assembly (clang, -O0):
<bit_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_set>:
mov    %edi,%eax
bts    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @bit_set(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = or i32 %3, %0
ret i32 %4
}
void efx_fini_debugfs_port(struct efx_nic *efx) {}


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

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

LLVM IR (-O0):
%struct.efx_nic = type opaque
define void @efx_fini_debugfs_port(%struct.efx_nic* %0) {
%2 = alloca %struct.efx_nic*
store %struct.efx_nic* %0, %struct.efx_nic** %2
ret void
}

LLVM IR (-O2):
%struct.efx_nic = type opaque
define void @efx_fini_debugfs_port(%struct.efx_nic* nocapture %0) {
ret void
}
long test(long x, long y) {
  long val = 8 * x;
  if (y > 0) {
    if (x < y)
      val = y - x;
    else
      val = x & y;
  } else if (y <= -2)
    val = x + y;
  return val;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x3,%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    1153 <test+0x53>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1142 <test+0x42>
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    114e <test+0x4e>
mov    -0x8(%rbp),%rax
and    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    116f <test+0x6f>
cmpq   $0xfffffffffffffffe,-0x10(%rbp)
jg     116a <test+0x6a>
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    116f <test+0x6f>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
test   %rsi,%rsi
jle    1114 <test+0x14>
mov    %rsi,%rax
sub    %rdi,%rax
jg     1127 <test+0x27>
and    %rdi,%rsi
mov    %rsi,%rax
ret
lea    (%rsi,%rdi,1),%rax
shl    $0x3,%rdi
cmp    $0xffffffffffffffff,%rsi
cmovl  %rax,%rdi
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @test(i64 %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = icmp sgt i64 %1, %0
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = sub nsw i64 %1, %0
br label %15
8: ; preds = %4
%9 = and i64 %1, %0
br label %15
10: ; preds = %2
%11 = shl nsw i64 %0, 3
%12 = icmp slt i64 %1, -1
%13 = add nsw i64 %1, %0
%14 = select i1 %12, i64 %13, i64 %11
br label %15
15: ; preds = %10, %6, %8
%16 = phi i64 [ %7, %6 ], [ %9, %8 ], [ %14, %10 ]
ret i64 %16
}
void tcp_end(void) {}


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

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

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

LLVM IR (-O2):
define void @tcp_end() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ toto(int *);
int bar(int a, int b, int c, int d, int e, int f, int g, int h) {
  int res;
  toto(&res);
  return h;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
lea    -0x1c(%rbp),%rdi
call   1030 <toto@plt>
mov    0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbx
sub    $0x10,%rsp
mov    0x28(%rsp),%ebx
lea    0xc(%rsp),%rdi
call   1030 <toto@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @bar(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
store i32 %0, i32* %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store i32 %7, i32* %16
%18 = call i32 @toto(i32* %17)
%19 = load i32, i32* %16
ret i32 %19
}

LLVM IR (-O2):
define i32 @bar(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 returned %7) {
%9 = alloca i32
%10 = bitcast i32* %9 to i8*
%11 = call i32 @toto(i32* %9)
ret i32 %7
}
int tmrm_hash_memory_close(void *context) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @tmrm_hash_memory_close(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  float a;
  int b = 3229;
  a = (float)(b) / 1000;
  printf("%f\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xc9d,-0xc(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
movss  0xecd(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeec(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
store i32 0, i32* %1
store i32 3229, i32* %3
%4 = load i32, i32* %3
%5 = sitofp i32 %4 to float
%6 = fdiv float %5, 1.000000e+03
store float %6, float* %2
%7 = load float, float* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 0x4009D4FE00000000)
ret i32 0
}
/* Variables and functions */
bool _calc_tokenThreshold(char c1, char c2) {
  if ((c1 == '_' || (c1 >= '0' && c1 <= '9')) && (c2 >= '0' && c2 <= '9'))
    return false;
  return true;
}


x86 assembly (clang, -O0):
<_calc_tokenThreshold>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x5f,%eax
je     1137 <_calc_tokenThreshold+0x37>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     115d <_calc_tokenThreshold+0x5d>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     115d <_calc_tokenThreshold+0x5d>
movsbl -0x6(%rbp),%eax
cmp    $0x30,%eax
jl     115d <_calc_tokenThreshold+0x5d>
movsbl -0x6(%rbp),%eax
cmp    $0x39,%eax
jg     115d <_calc_tokenThreshold+0x5d>
movl   $0x0,-0x4(%rbp)
jmp    1164 <_calc_tokenThreshold+0x64>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_calc_tokenThreshold>:
cmp    $0x5f,%dil
je     1110 <_calc_tokenThreshold+0x10>
add    $0xd0,%dil
cmp    $0x9,%dil
ja     111d <_calc_tokenThreshold+0x1d>
add    $0xd0,%sil
xor    %eax,%eax
cmp    $0xa,%sil
jae    111d <_calc_tokenThreshold+0x1d>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @_calc_tokenThreshold(i8 signext %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 95
br i1 %8, label %17, label %9
9: ; preds = %2
%10 = load i8, i8* %4
%11 = sext i8 %10 to i32
%12 = icmp sge i32 %11, 48
br i1 %12, label %13, label %26
13: ; preds = %9
%14 = load i8, i8* %4
%15 = sext i8 %14 to i32
%16 = icmp sle i32 %15, 57
br i1 %16, label %17, label %26
17: ; preds = %13, %2
%18 = load i8, i8* %5
%19 = sext i8 %18 to i32
%20 = icmp sge i32 %19, 48
br i1 %20, label %21, label %26
21: ; preds = %17
%22 = load i8, i8* %5
%23 = sext i8 %22 to i32
%24 = icmp sle i32 %23, 57
br i1 %24, label %25, label %26
25: ; preds = %21
store i32 0, i32* %3
br label %27
26: ; preds = %21, %17, %13, %9
store i32 1, i32* %3
br label %27
27: ; preds = %26, %25
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @_calc_tokenThreshold(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %0, 95
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = add i8 %0, -48
%6 = icmp ult i8 %5, 10
%7 = add i8 %1, -48
%8 = icmp ult i8 %7, 10
%9 = and i1 %6, %8
br i1 %9, label %14, label %13
10: ; preds = %2
%11 = add i8 %1, -48
%12 = icmp ult i8 %11, 10
br i1 %12, label %14, label %13
13: ; preds = %10, %4
br label %14
14: ; preds = %4, %10, %13
%15 = phi i32 [ 1, %13 ], [ 0, %10 ], [ 0, %4 ]
ret i32 %15
}
double calcRadius(double axis, double ec) { return axis * (1 + ec); }


x86 assembly (clang, -O0):
<calcRadius>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee5(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcRadius>:
addsd  0xef8(%rip),%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @calcRadius(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 = fadd double 1.000000e+00, %6
%8 = fmul double %5, %7
ret double %8
}

LLVM IR (-O2):
define double @calcRadius(double %0, double %1) {
%3 = fadd double %1, 1.000000e+00
%4 = fmul double %3, %0
ret double %4
}
void rop3_253_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~*D;
  stk2 = S | stk3;
  stk1 = T | stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_253_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_253_0_0>:
mov    (%rdi),%al
not    %al
or     %edx,%esi
or     %al,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_253_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = xor i32 %12, -1
%14 = trunc i32 %13 to i8
store i8 %14, i8* %9
%15 = load i8, i8* %5
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = or i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %6
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = or i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = load i8*, i8** %4
store i8 %27, i8* %28
ret void
}

LLVM IR (-O2):
define void @rop3_253_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, -1
%6 = or i8 %2, %1
%7 = or i8 %6, %5
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void usage(char *arg0) {
  printf("Usage: %s size commonname\n", arg0);
  printf("\tsize: 256 or 384, for P-256 or P-384\n");
  printf("\tcommonname: common name for certificate, either a hostname or "
         "email\n\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Usage: %s size commonname\0A\00"
@.str.1 = [39 x i8] c"\09size: 256 or 384, for P-256 or P-384\0A\00"
@.str.2 = [71 x i8] c"\09commonname: common name for certificate, either a hostname or email\0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [27 x i8] c"Usage: %s size commonname\0A\00"
@str = [38 x i8] c"\09size: 256 or 384, for P-256 or P-384\00"
@str.3 = [70 x i8] c"\09commonname: common name for certificate, either a hostname or email\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @str.3, i64 0, i64 0))
%5 = tail call i32 @exit(i32 -1)
unreachable
}
const char *bool(int val) { return val ? "true" : "false"; }


x86 assembly (clang, -O0):
<bool>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xef4(%rip),%rax
lea    0xee8(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bool>:
test   %edi,%edi
lea    0xefc(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"true\00"
@.str.1 = [6 x i8] c"false\00"
define i8* @bool(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
ret i8* %6
}

LLVM IR (-O2):
@.str = [5 x i8] c"true\00"
@.str.1 = [6 x i8] c"false\00"
define i8* @bool(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
__typeof__(isgraph((void *)1)) test_isgraph_33(void) {
  return isgraph((void *)1);
}


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

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

LLVM IR (-O0):
define i32 @test_isgraph_33() {
%1 = call i32 @isgraph(i32 ptrtoint (i8* inttoptr (i64 1 to i8*) to i32))
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_isgraph_33() {
%1 = tail call i32 @isgraph(i32 1)
ret i32 %1
}
char base_complement(char c) {
  switch (c) {
  case 'A':
  case 'a':
    return 'T';
  case 'T':
  case 't':
    return 'A';
  case 'G':
  case 'g':
    return 'C';
  case 'C':
  case 'c':
    return 'G';
  default:
    return 'N';
  }
}


x86 assembly (clang, -O0):
<base_complement>:
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 <base_complement+0x58>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x54,-0x1(%rbp)
jmp    115c <base_complement+0x5c>
movb   $0x41,-0x1(%rbp)
jmp    115c <base_complement+0x5c>
movb   $0x43,-0x1(%rbp)
jmp    115c <base_complement+0x5c>
movb   $0x47,-0x1(%rbp)
jmp    115c <base_complement+0x5c>
movb   $0x4e,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base_complement>:
add    $0xffffffbf,%edi
cmp    $0x33,%edi
ja     1123 <base_complement+0x23>
mov    $0x54,%al
lea    0xeef(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x47,%al
ret
mov    $0x43,%al
ret
mov    $0x41,%al
ret
mov    $0x4e,%al
ret

LLVM IR (-O0):
define signext i8 @base_complement(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 84, label %7
i32 116, label %7
i32 71, label %8
i32 103, label %8
i32 67, label %9
i32 99, label %9
]
6: ; preds = %1, %1
store i8 84, i8* %2
br label %11
7: ; preds = %1, %1
store i8 65, i8* %2
br label %11
8: ; preds = %1, %1
store i8 67, i8* %2
br label %11
9: ; preds = %1, %1
store i8 71, i8* %2
br label %11
10: ; preds = %1
store i8 78, 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 @base_complement(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %6 [
i32 65, label %7
i32 97, label %7
i32 84, label %3
i32 116, label %3
i32 71, label %4
i32 103, label %4
i32 67, label %5
i32 99, label %5
]
3: ; preds = %1, %1
br label %7
4: ; preds = %1, %1
br label %7
5: ; preds = %1, %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %1, %6, %5, %4, %3
%8 = phi i8 [ 78, %6 ], [ 71, %5 ], [ 67, %4 ], [ 65, %3 ], [ 84, %1 ], [ 84, %1 ]
ret i8 %8
}
/* Type definitions */
struct t_hook {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ hook_fd_realloc_pollfd();
void hook_fd_remove_cb(struct t_hook *hook) {
  (void)hook;
  hook_fd_realloc_pollfd();
}


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

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

LLVM IR (-O0):
%struct.t_hook = type { i32 }
define void @hook_fd_remove_cb(%struct.t_hook* %0) {
%2 = alloca %struct.t_hook*
store %struct.t_hook* %0, %struct.t_hook** %2
%3 = load %struct.t_hook*, %struct.t_hook** %2
%4 = call i32 (...) @hook_fd_realloc_pollfd()
ret void
}

LLVM IR (-O2):
%struct.t_hook = type { i32 }
define void @hook_fd_remove_cb(%struct.t_hook* nocapture readnone %0) {
%2 = tail call i32 (...) @hook_fd_realloc_pollfd()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(void) {
  char *ptr = NULL;
  fprintf(stderr, "Avant écriture\n");
  ptr[1] = 0;
  fprintf(stderr, "Après écriture\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
movb   $0x0,0x1
mov    (%rbx),%edi
lea    0xeda(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"Avant \C3\A9criture\0A\00"
@.str.1 = [18 x i8] c"Apr\C3\A8s \C3\A9criture\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* null, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8 0, i8* %6
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"Avant \C3\A9criture\0A\00"
@.str.1 = [18 x i8] c"Apr\C3\A8s \C3\A9criture\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i8 0, i8* inttoptr (i64 1 to i8*)
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ posix_error(int, char *);
int pthread_cancel(int /*<<< orphan*/);
void Pthread_cancel(pthread_t tid) {
  int rc;
  if ((rc = pthread_cancel(tid)) != 0)
    posix_error(rc, "Pthread_cancel error");
}


x86 assembly (clang, -O0):
<Pthread_cancel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <pthread_cancel@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     114e <Pthread_cancel+0x2e>
mov    -0x8(%rbp),%edi
lea    0xeb7(%rip),%rsi
call   1030 <posix_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pthread_cancel>:
push   %rax
call   1040 <pthread_cancel@plt>
test   %eax,%eax
je     1139 <Pthread_cancel+0x19>
lea    0xecf(%rip),%rsi
mov    %eax,%edi
pop    %rax
jmp    1030 <posix_error@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Pthread_cancel error\00"
define void @Pthread_cancel(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @pthread_cancel(i32 %4)
store i32 %5, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @posix_error(i32 %8, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Pthread_cancel error\00"
define void @Pthread_cancel(i32 %0) {
%2 = tail call i32 @pthread_cancel(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @posix_error(i32 %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bounce_east();
int /*<<< orphan*/ bounce_south();
scalar_t__ get_north_penetration();
scalar_t__ get_west_penetration();
void do_north_west(void) {
  if (get_north_penetration() < get_west_penetration())
    bounce_south();
  else
    bounce_east();
}


x86 assembly (clang, -O0):
<do_north_west>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <get_north_penetration@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <get_west_penetration@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
cmp    %rcx,%rax
jge    1176 <do_north_west+0x36>
mov    $0x0,%al
call   1030 <bounce_south@plt>
jmp    117d <do_north_west+0x3d>
mov    $0x0,%al
call   1050 <bounce_east@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_north_west>:
push   %rbx
xor    %eax,%eax
call   1060 <get_north_penetration@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <get_west_penetration@plt>
cmp    %rax,%rbx
jge    115f <do_north_west+0x1f>
xor    %eax,%eax
pop    %rbx
jmp    1030 <bounce_south@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <bounce_east@plt>

LLVM IR (-O0):
define void @do_north_west() {
%1 = call i64 (...) @get_north_penetration()
%2 = call i64 (...) @get_west_penetration()
%3 = icmp slt i64 %1, %2
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @bounce_south()
br label %8
6: ; preds = %0
%7 = call i32 (...) @bounce_east()
br label %8
8: ; preds = %6, %4
ret void
}

LLVM IR (-O2):
define void @do_north_west() {
%1 = tail call i64 (...) @get_north_penetration()
%2 = tail call i64 (...) @get_west_penetration()
%3 = icmp slt i64 %1, %2
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 (...) @bounce_south()
br label %8
6: ; preds = %0
%7 = tail call i32 (...) @bounce_east()
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int strcmp(char *const, char *const);
int strcmp_asc(const void *a, const void *b) {
  return strcmp(*((char *const *)a), *((char *const *)b));
}


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

x86 assembly (clang, -O2):
<strcmp_asc>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @strcmp_asc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @strcmp_asc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
int getInfo(char *buf, int bufLen) {
  static const char *INFO = "info { name=IFS }";
  int reqLen = strlen(INFO) + 1;
  if (buf != 0 && reqLen <= bufLen) {
    memcpy(buf, INFO, reqLen);
  }
  return reqLen;
}


x86 assembly (clang, -O0):
<getInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2efa(%rip),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116b <getInfo+0x4b>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     116b <getInfo+0x4b>
mov    -0x8(%rbp),%rdi
mov    0x2ecd(%rip),%rsi
mov    -0x10(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getInfo>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%ebp
test   %rbx,%rbx
je     1154 <getInfo+0x34>
cmp    %r14d,%eax
jge    1154 <getInfo+0x34>
lea    0xeb6(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
call   1040 <memcpy@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@getInfo.INFO = internal global i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i32 0, i32 0)
@.str = [18 x i8] c"info { name=IFS }\00"
define i32 @getInfo(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** @getInfo.INFO
%7 = call i32 @strlen(i8* %6)
%8 = add nsw i32 %7, 1
store i32 %8, i32* %5
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %20
11: ; preds = %2
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = load i8*, i8** %3
%17 = load i8*, i8** @getInfo.INFO
%18 = load i32, i32* %5
%19 = call i32 @memcpy(i8* %16, i8* %17, i32 %18)
br label %20
20: ; preds = %15, %11, %2
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
@.str = [18 x i8] c"info { name=IFS }\00"
define i32 @getInfo(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = add nsw i32 %3, 1
%5 = icmp ne i8* %0, null
%6 = icmp slt i32 %3, %1
%7 = select i1 %5, i1 %6, i1 false
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @memcpy(i8* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %10
10: ; preds = %8, %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
void PanicWithBadChar(int c) {
  if (c >= 32 && c <= 126) {
    printf("Unexpected character '%c'\n", c);
  } else {
    printf("Unexpected character #%d\n", (unsigned char)c);
  }
}


x86 assembly (clang, -O0):
<PanicWithBadChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jl     1146 <PanicWithBadChar+0x36>
cmpl   $0x7e,-0x4(%rbp)
jg     1146 <PanicWithBadChar+0x36>
mov    -0x4(%rbp),%eax
lea    0xec7(%rip),%rdi
movzbl %al,%esi
call   1030 <printf@plt>
jmp    1158 <PanicWithBadChar+0x48>
mov    -0x4(%rbp),%eax
lea    0xecb(%rip),%rdi
movzbl %al,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PanicWithBadChar>:
lea    -0x20(%rdi),%eax
cmp    $0x5f,%eax
lea    0xee3(%rip),%rcx
lea    0xef7(%rip),%rax
cmovb  %rcx,%rax
movzbl %dil,%esi
mov    %rax,%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Unexpected character '%c'\0A\00"
@.str.1 = [26 x i8] c"Unexpected character #%d\0A\00"
define void @PanicWithBadChar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 32
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 126
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32, i32* %2
%10 = trunc i32 %9 to i8
%11 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8 zeroext %10)
br label %16
12: ; preds = %5, %1
%13 = load i32, i32* %2
%14 = trunc i32 %13 to i8
%15 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8 zeroext %14)
br label %16
16: ; preds = %12, %8
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"Unexpected character '%c'\0A\00"
@.str.1 = [26 x i8] c"Unexpected character #%d\0A\00"
define void @PanicWithBadChar(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = trunc i32 %0 to i8
%5 = select i1 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 @printf(i8* %5, i8 zeroext %4)
ret void
}
void pendfunc1(void) {}


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

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

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

LLVM IR (-O2):
define void @pendfunc1() {
ret void
}
/* Variables and functions */
scalar_t__ _getspeed();
int CG_GetSpeed(void *parameter) { return (int)_getspeed(); }


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

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

LLVM IR (-O0):
define i32 @CG_GetSpeed(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i64 (...) @_getspeed()
%4 = trunc i64 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @CG_GetSpeed(i8* nocapture readnone %0) {
%2 = tail call i64 (...) @_getspeed()
%3 = trunc i64 %2 to i32
ret i32 %3
}
int min3(int a, int b, int c) {
  if (a < b) {
    if (a < c) {
      return a;
    } else {
      return c;
    }
  } else {
    if (b < c) {
      return b;
    } else {
      return c;
    }
  }
}


x86 assembly (clang, -O0):
<min3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <min3+0x3b>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1130 <min3+0x30>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <min3+0x58>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <min3+0x58>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1152 <min3+0x52>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <min3+0x58>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min3>:
mov    %edx,%eax
cmp    %edx,%edi
cmovl  %edi,%eax
cmp    %esi,%eax
cmovge %esi,%eax
ret

LLVM IR (-O0):
define i32 @min3(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %19
11: ; preds = %3
%12 = load i32, i32* %5
%13 = load i32, i32* %7
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = load i32, i32* %5
store i32 %16, i32* %4
br label %27
17: ; preds = %11
%18 = load i32, i32* %7
store i32 %18, i32* %4
br label %27
19: ; preds = %3
%20 = load i32, i32* %6
%21 = load i32, i32* %7
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = load i32, i32* %6
store i32 %24, i32* %4
br label %27
25: ; preds = %19
%26 = load i32, i32* %7
store i32 %26, i32* %4
br label %27
27: ; preds = %25, %23, %17, %15
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @min3(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %2
%5 = select i1 %4, i32 %0, i32 %2
%6 = icmp slt i32 %5, %1
%7 = select i1 %6, i32 %5, i32 %1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ output_line(char *);
void gen_divide_by_two(void) {
  output_line("srl h");
  output_line("rr l");
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"srl h\00"
@.str.1 = [5 x i8] c"rr l\00"
define void @gen_divide_by_two() {
%1 = call i32 @output_line(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @output_line(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"srl h\00"
@.str.1 = [5 x i8] c"rr l\00"
define void @gen_divide_by_two() {
%1 = tail call i32 @output_line(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @output_line(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int ioctl(int, unsigned long, int);
int ioctl_int(int fd, unsigned long request, int arg) {
  return ioctl(fd, request, arg);
}


x86 assembly (clang, -O0):
<ioctl_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <ioctl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ioctl_int>:
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
define i32 @ioctl_int(i32 %0, i64 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i64, i64* %5
%9 = load i32, i32* %6
%10 = call i32 @ioctl(i32 %7, i64 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @ioctl_int(i32 %0, i64 %1, i32 %2) {
%4 = tail call i32 @ioctl(i32 %0, i64 %1, i32 %2)
ret i32 %4
}
void marca_pacman(char maze[23][30], int pacman[3]) {
  maze[pacman[0]][pacman[1]] = 'P';
}


x86 assembly (clang, -O0):
<marca_pacman>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
imul   $0x1e,%rcx,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
movslq 0x4(%rcx),%rcx
movb   $0x50,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<marca_pacman>:
movslq (%rsi),%rax
movslq 0x4(%rsi),%rcx
mov    %rax,%rdx
shl    $0x5,%rdx
sub    %rax,%rdx
sub    %rax,%rdx
add    %rdi,%rdx
movb   $0x50,(%rcx,%rdx,1)
ret

LLVM IR (-O0):
define void @marca_pacman([30 x i8]* %0, i32* %1) {
%3 = alloca [30 x i8]*
%4 = alloca i32*
store [30 x i8]* %0, [30 x i8]** %3
store i32* %1, i32** %4
%5 = load [30 x i8]*, [30 x i8]** %3
%6 = load i32*, i32** %4
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [30 x i8], [30 x i8]* %5, i64 %9
%11 = load i32*, i32** %4
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32, i32* %12
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [30 x i8], [30 x i8]* %10, i64 0, i64 %14
store i8 80, i8* %15
ret void
}

LLVM IR (-O2):
define void @marca_pacman([30 x i8]* nocapture writeonly %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %1, i64 1
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [30 x i8], [30 x i8]* %0, i64 %4, i64 %7
store i8 80, i8* %8
ret void
}
void _M2_RTint_finish(__attribute__((unused)) int argc,
                      __attribute__((unused)) char *argv[]) {}


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

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

LLVM IR (-O0):
define void @_M2_RTint_finish(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
ret void
}

LLVM IR (-O2):
define void @_M2_RTint_finish(i32 %0, i8** nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x77() {
  Assert_real((isupper(119) == 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_isupper.c",
              600, ("isupper should be 0 for w"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0x77>:
push   %rax
mov    $0x77,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x258,%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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for w\00"
define void @t_isupper_0x77() {
%1 = call i64 @isupper(i32 119)
%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 600, i8* getelementptr inbounds ([26 x i8], [26 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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for w\00"
define void @t_isupper_0x77() {
%1 = tail call i64 @isupper(i32 119)
%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 600, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double f4_sum_pre_int_long(int v0, long v) {
  return (double)v0 + ((double)(v));
}


x86 assembly (clang, -O0):
<f4_sum_pre_int_long>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_pre_int_long>:
cvtsi2sd %edi,%xmm1
cvtsi2sd %rsi,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f4_sum_pre_int_long(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = sitofp i32 %5 to double
%7 = load i64, i64* %4
%8 = sitofp i64 %7 to double
%9 = fadd double %6, %8
ret double %9
}

LLVM IR (-O2):
define double @f4_sum_pre_int_long(i32 %0, i64 %1) {
%3 = sitofp i32 %0 to double
%4 = sitofp i64 %1 to double
%5 = fadd double %3, %4
ret double %5
}
void spca561_setcolors(struct usb_spca50x *spca50x) {}


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

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

LLVM IR (-O0):
%struct.usb_spca50x = type opaque
define void @spca561_setcolors(%struct.usb_spca50x* %0) {
%2 = alloca %struct.usb_spca50x*
store %struct.usb_spca50x* %0, %struct.usb_spca50x** %2
ret void
}

LLVM IR (-O2):
%struct.usb_spca50x = type opaque
define void @spca561_setcolors(%struct.usb_spca50x* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ machdep_Sleep(unsigned long);
void McSrv_Sleep(unsigned long dSleepTime) { machdep_Sleep(dSleepTime); }


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

x86 assembly (clang, -O2):
<McSrv_Sleep>:
jmp    1030 <machdep_Sleep@plt>

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

LLVM IR (-O2):
define void @McSrv_Sleep(i64 %0) {
%2 = tail call i32 @machdep_Sleep(i64 %0)
ret void
}
void gtk_ui_manager_insert_action_group() {}


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

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

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

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