xunge/DecIR huggingface dataset:
void test2(void) {
  int *p = __builtin_malloc(sizeof(int) * 4);
  if (p == (void *)0)
    __builtin_abort();
  __builtin_free(p);
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x10,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1156 <test2+0x26>
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test2() {
%1 = alloca i32*
%2 = call i8* @malloc(i64 16)
%3 = bitcast i8* %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %7
6: ; preds = %0
unreachable
7: ; preds = %0
%8 = load i32*, i32** %1
%9 = bitcast i32* %8 to i8*
ret void
}

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


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

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

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

LLVM IR (-O2):
define void @EMR3SetExecutionPolicy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_quiet(void) { printf("\nOpenSHMEM Analyzer\n"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_quiet() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_quiet() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ draw_symbol(int, char);
void draw_bottom_line(int spaces_count, int bottom_line_length) {
  draw_symbol(spaces_count, ' ');
  draw_symbol(bottom_line_length, '*');
  draw_symbol(spaces_count, ' ');
}


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

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

LLVM IR (-O0):
define void @draw_bottom_line(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 @draw_symbol(i32 %5, i8 signext 32)
%7 = load i32, i32* %4
%8 = call i32 @draw_symbol(i32 %7, i8 signext 42)
%9 = load i32, i32* %3
%10 = call i32 @draw_symbol(i32 %9, i8 signext 32)
ret void
}

LLVM IR (-O2):
define void @draw_bottom_line(i32 %0, i32 %1) {
%3 = tail call i32 @draw_symbol(i32 %0, i8 signext 32)
%4 = tail call i32 @draw_symbol(i32 %1, i8 signext 42)
%5 = tail call i32 @draw_symbol(i32 %0, i8 signext 32)
ret void
}
unsigned long b_get_timercounter(void) {
  unsigned long tlong;
  asm volatile("call 0x00100158" : "=a"(tlong));
  return tlong;
}


x86 assembly (clang, -O0):
<b_get_timercounter>:
push   %rbp
mov    %rsp,%rbp
call   100158 <completed.0+0xfc138>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_get_timercounter>:
call   100158 <completed.0+0xfc138>
ret

LLVM IR (-O0):
define i64 @b_get_timercounter() {
%1 = alloca i64
%2 = call i64 asm sideeffect "call 0x00100158", "={ax},~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @b_get_timercounter() {
%1 = tail call i64 asm sideeffect "call 0x00100158", "={ax},~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ write(int, int *, int);
int main(int argc, char const *argv[]) {
  int contador = 1;
  int pipe[2];
  int bufferP[10];
  do {
    printf("%d\n", contador);
    write(pipe[1], bufferP, 10);
    contador = ++contador;
  } while (1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%edi
lea    -0x50(%rbp),%rsi
mov    $0xa,%edx
call   1030 <write@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    %eax,-0x14(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    113d <main+0x1d>
jmp    1178 <main+0x58>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    $0x1,%ebx
lea    0xecb(%rip),%r14
mov    %rsp,%r15
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
mov    %r15,%rsi
mov    $0xa,%edx
call   1030 <write@plt>
add    $0x1,%ebx
jmp    1140 <main+0x20>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [10 x i32]
%4 = bitcast [10 x i32]* %3 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
br label %6
6: ; preds = %6, %2
%7 = phi i32 [ 1, %2 ], [ %10, %6 ]
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @write(i32 undef, i32* %5, i32 10)
%10 = add nuw nsw i32 %7, 1
br label %6
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int y;
};
struct TYPE_4__ {
  TYPE_1__ xgravity;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xgravity_y(void *_p, int _v) {
  ((XEvent *)_p)->xgravity.y = (int)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XEvent_xgravity_y(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
struct passwd {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int putpwent(struct passwd const *, int /*<<< orphan*/ *);
int passwd_put(const void *ent, FILE *file) {
  const struct passwd *pw = ent;
  return (putpwent(pw, file) == -1) ? -1 : 0;
}


x86 assembly (clang, -O0):
<passwd_put>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <putpwent@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0xffffffff,%edx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<passwd_put>:
push   %rax
call   1030 <putpwent@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.passwd = type { i32 }
define i32 @passwd_put(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca %struct.passwd*
store i8* %0, i8** %3
store i32* %1, i32** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.passwd*
store %struct.passwd* %7, %struct.passwd** %5
%8 = load %struct.passwd*, %struct.passwd** %5
%9 = load i32*, i32** %4
%10 = call i32 @putpwent(%struct.passwd* %8, i32* %9)
%11 = icmp eq i32 %10, -1
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 -1, i32 0
ret i32 %13
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
define i32 @passwd_put(i8* %0, i32* %1) {
%3 = bitcast i8* %0 to %struct.passwd*
%4 = tail call i32 @putpwent(%struct.passwd* %3, i32* %1)
%5 = icmp eq i32 %4, -1
%6 = sext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int signbit(float);
int main() {
  float f = -1.0;
  int i = signbit(f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xed9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <signbit@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
store i32 0, i32* %1
store float -1.000000e+00, float* %2
%4 = load float, float* %2
%5 = call i32 @signbit(float %4)
store i32 %5, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @signbit(float -1.000000e+00)
ret i32 0
}
int is_port(int port) {
  if (port > 0 && port < 65535) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_port>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    112a <is_port+0x2a>
cmpl   $0xffff,-0x8(%rbp)
jge    112a <is_port+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1131 <is_port+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_port>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0xfffe,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @is_port(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 65535
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %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 @is_port(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 65534
%4 = zext i1 %3 to i32
ret i32 %4
}
void clear_buf_t(char buf[], int size) {
  int i;
  i = 0;
  for (i = 0; i < size; i++) {
    buf[i] = 0;
  }
}


x86 assembly (clang, -O0):
<clear_buf_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113f <clear_buf_t+0x3f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1119 <clear_buf_t+0x19>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_buf_t>:
test   %esi,%esi
jle    1122 <clear_buf_t+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @clear_buf_t(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int pow(int, int);
double ExponentialEaseOut(double p) {
  return (p == 1.0) ? p : 1 - pow(2, -10 * p);
}


x86 assembly (clang, -O0):
<ExponentialEaseOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1149 <ExponentialEaseOut+0x39>
jp     1149 <ExponentialEaseOut+0x39>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1176 <ExponentialEaseOut+0x66>
movsd  0xeb7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%esi
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExponentialEaseOut>:
push   %rax
movsd  0xee7(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1121 <ExponentialEaseOut+0x11>
jnp    1145 <ExponentialEaseOut+0x35>
mulsd  0xedf(%rip),%xmm0
cvttsd2si %xmm0,%esi
mov    $0x2,%edi
call   1030 <pow@plt>
mov    $0x1,%ecx
sub    %eax,%ecx
xorps  %xmm1,%xmm1
cvtsi2sd %ecx,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ExponentialEaseOut(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 %5, label %7
5: ; preds = %1
%6 = load double, double* %2
br label %14
7: ; preds = %1
%8 = load double, double* %2
%9 = fmul double -1.000000e+01, %8
%10 = fptosi double %9 to i32
%11 = call i32 @pow(i32 2, i32 %10)
%12 = sub nsw i32 1, %11
%13 = sitofp i32 %12 to double
br label %14
14: ; preds = %7, %5
%15 = phi double [ %6, %5 ], [ %13, %7 ]
ret double %15
}

LLVM IR (-O2):
define double @ExponentialEaseOut(double %0) {
%2 = fcmp oeq double %0, 1.000000e+00
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = fmul double %0, -1.000000e+01
%5 = fptosi double %4 to i32
%6 = tail call i32 @pow(i32 2, i32 %5)
%7 = sub nsw i32 1, %6
%8 = sitofp i32 %7 to double
br label %9
9: ; preds = %1, %3
%10 = phi double [ %8, %3 ], [ 1.000000e+00, %1 ]
ret double %10
}
long platform_executable_directory(char *destination, long destination_size) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i64 @platform_executable_directory(i8* nocapture readnone %0, i64 %1) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", '0' / (('0' + '0') / '0'));
  printf("%d\n", '0' >> '0' / '0' + 0);
  printf("%d\n", -~-~-~-~-~-~0 - ~-~-~-~-~-~0 - ~-~-~-~-~-~0 - ~-~-~-~-~-~0);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 24)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 24)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 24)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 24)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 24)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 24)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void flush() { fflush(stdout); }


x86 assembly (clang, -O0):
<flush>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @flush() {
%1 = load i32, i32* @stdout
%2 = call i32 @fflush(i32 %1)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @flush() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
ret void
}
void(CONSUME2)() {}


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

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

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

LLVM IR (-O2):
define void @CONSUME2() {
ret void
}
/* Variables and functions */
int numDecodings(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char const *argv[]) {
  char s[] = "27";
  printf("%d\n", numDecodings(s));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%ax
mov    %ax,-0x13(%rbp)
mov    0xebb(%rip),%al
mov    %al,-0x11(%rbp)
lea    -0x13(%rbp),%rdi
call   1040 <numDecodings@plt>
mov    %eax,%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x0,0x6(%rsp)
movw   $0x3732,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <numDecodings@plt>
lea    0xec5(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@__const.main.s = [3 x i8] c"27\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [3 x i8]
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%5 = call i32 @numDecodings(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
scalar_t__ pow(double, int);
int sqrt(scalar_t__);
double gpf(double x) { return (sqrt(10 - pow(x, 3)) * 1 / 2); }


x86 assembly (clang, -O0):
<gpf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x3,%edi
call   1030 <pow@plt>
mov    $0xa,%edi
sub    %rax,%rdi
call   1040 <sqrt@plt>
shl    $0x0,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpf>:
push   %rax
mov    $0x3,%edi
call   1030 <pow@plt>
mov    $0xa,%edi
sub    %rax,%rdi
call   1040 <sqrt@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @gpf(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @pow(double %3, i32 3)
%5 = sub nsw i64 10, %4
%6 = call i32 @sqrt(i64 %5)
%7 = mul nsw i32 %6, 1
%8 = sdiv i32 %7, 2
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @gpf(double %0) {
%2 = tail call i64 @pow(double %0, i32 3)
%3 = sub nsw i64 10, %2
%4 = tail call i32 @sqrt(i64 %3)
%5 = sdiv i32 %4, 2
%6 = sitofp i32 %5 to double
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ assert(char *);
char *malloc(unsigned int);
char *strings_alloc(unsigned int size) {
  char *ret = malloc(size * sizeof(char));
  assert(ret);
  return ret;
}


x86 assembly (clang, -O0):
<strings_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strings_alloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @strings_alloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = mul i64 %5, 1
%7 = trunc i64 %6 to i32
%8 = call i8* @malloc(i32 %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = call i32 @assert(i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @strings_alloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = tail call i32 @assert(i8* %2)
ret i8* %2
}
/* Type definitions */
typedef unsigned long uint16_t;

/* Variables and functions */
int test_bit_u16(int nr, const uint16_t *addr) {
  return ((1UL << (nr & 15)) & (addr[nr >> 4])) != 0;
}


x86 assembly (clang, -O0):
<test_bit_u16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
mov    -0x10(%rbp),%rcx
mov    -0x4(%rbp),%edx
sar    $0x4,%edx
movslq %edx,%rdx
and    (%rcx,%rdx,8),%rax
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bit_u16>:
mov    %edi,%eax
and    $0xf,%al
sar    $0x4,%edi
movslq %edi,%rcx
mov    (%rsi,%rcx,8),%ecx
movzbl %al,%edx
xor    %eax,%eax
bt     %edx,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @test_bit_u16(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 = and i32 %5, 15
%7 = zext i32 %6 to i64
%8 = shl i64 1, %7
%9 = load i64*, i64** %4
%10 = load i32, i32* %3
%11 = ashr i32 %10, 4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i64, i64* %9, i64 %12
%14 = load i64, i64* %13
%15 = and i64 %8, %14
%16 = icmp ne i64 %15, 0
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @test_bit_u16(i32 %0, i64* nocapture %1) {
%3 = and i32 %0, 15
%4 = zext i32 %3 to i64
%5 = shl nuw nsw i64 1, %4
%6 = ashr i32 %0, 4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i64, i64* %1, i64 %7
%9 = load i64, i64* %8
%10 = and i64 %9, %5
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}
int fits_bits(int x, int n) {
  int w = sizeof(int) << 3;
  int s = ~((1 << (n - 1)) - 1);
  x &= s;
  return !x || x == s;
}


x86 assembly (clang, -O0):
<fits_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x20,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x11(%rbp)
je     114b <fits_bits+0x4b>
mov    -0x4(%rbp),%eax
cmp    -0x10(%rbp),%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fits_bits>:
lea    -0x1(%rsi),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
and    %eax,%edi
sete   %cl
cmp    %eax,%edi
sete   %al
or     %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @fits_bits(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 32, i32* %5
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
%9 = shl i32 1, %8
%10 = sub nsw i32 %9, 1
%11 = xor i32 %10, -1
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = load i32, i32* %3
%14 = and i32 %13, %12
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %2
%18 = load i32, i32* %3
%19 = load i32, i32* %6
%20 = icmp eq i32 %18, %19
br label %21
21: ; preds = %17, %2
%22 = phi i1 [ true, %2 ], [ %20, %17 ]
%23 = zext i1 %22 to i32
ret i32 %23
}

LLVM IR (-O2):
define i32 @fits_bits(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = shl nsw i32 -1, %3
%5 = and i32 %4, %0
%6 = icmp eq i32 %5, 0
%7 = icmp eq i32 %5, %4
%8 = or i1 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *name) {
  fprintf(stderr, "Usage: %s [options]\n", name);
  fprintf(stderr, "For more information type: %s -h\n\n", name);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ec2(%rip),%r14
mov    (%r14),%edi
lea    0xed8(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xedb(%rip),%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"Usage: %s [options]\0A\00"
@.str.1 = [35 x i8] c"For more information type: %s -h\0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"Usage: %s [options]\0A\00"
@.str.1 = [35 x i8] c"For more information type: %s -h\0A\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ writeidew(int, int);
void writeidel(int ide_board, uint32_t val) {
  writeidew(ide_board, val);
  writeidew(ide_board, val >> 16);
}


x86 assembly (clang, -O0):
<writeidel>:
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 <writeidew@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
sar    $0x10,%esi
call   1030 <writeidew@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @writeidel(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 @writeidew(i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = ashr i32 %9, 16
%11 = call i32 @writeidew(i32 %8, i32 %10)
ret void
}

LLVM IR (-O2):
define void @writeidel(i32 %0, i32 %1) {
%3 = tail call i32 @writeidew(i32 %0, i32 %1)
%4 = ashr i32 %1, 16
%5 = tail call i32 @writeidew(i32 %0, i32 %4)
ret void
}
/* Type definitions */
typedef int uid_t;

/* Variables and functions */
int geteuid();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ system(char *);
int main() {
  uid_t euid = geteuid();
  printf("euid is %d\n", euid);
  system("ls");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <geteuid@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
lea    0xead(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <geteuid@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0xebf(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"euid is %d\0A\00"
@.str.1 = [3 x i8] c"ls\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @geteuid()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @system(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"euid is %d\0A\00"
@.str.1 = [3 x i8] c"ls\00"
define i32 @main() {
%1 = tail call i32 (...) @geteuid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @system(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int execl(name, arg0)
char *name, *arg0;
{
  if (forkv(name, &arg0) == -1)
    return -1;
  exit(0);
}


x86 assembly (clang, -O0):
<execl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <forkv@plt>
cmp    $0xffffffff,%eax
jne    1153 <execl+0x33>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<execl>:
push   %rax
mov    %rsi,(%rsp)
mov    %rsp,%rsi
xor    %eax,%eax
call   1030 <forkv@plt>
cmp    $0xffffffff,%eax
jne    113b <execl+0x1b>
mov    $0xffffffff,%eax
pop    %rcx
ret
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @execl(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 = call i32 (i8*, i8**, ...) bitcast (i32 (...)* @forkv to i32 (i8*, i8**, ...)*)(i8* %5, i8** %4)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %9
8: ; preds = %2
ret i32 -1
9: ; preds = %2
unreachable
}

LLVM IR (-O2):
define i32 @execl(i8* %0, i8* %1) {
%3 = alloca i8*
store i8* %1, i8** %3
%4 = call i32 (i8*, i8**, ...) bitcast (i32 (...)* @forkv to i32 (i8*, i8**, ...)*)(i8* %0, i8** %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %7
6: ; preds = %2
ret i32 -1
7: ; preds = %2
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ IABatailleNavaleDifficile(char *);
int /*<<< orphan*/ IABatailleNavaleFacile(char *);
int hasard(int, int);
int IABatailleNavaleNormal(char position[10]) {
  int aleatoire;
  aleatoire = hasard(1, 2);
  if (aleatoire == 1)
    IABatailleNavaleFacile(position);
  else if (aleatoire == 2)
    IABatailleNavaleDifficile(position);
}


x86 assembly (clang, -O0):
<IABatailleNavaleNormal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <hasard@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1166 <IABatailleNavaleNormal+0x36>
mov    -0x10(%rbp),%rdi
call   1040 <IABatailleNavaleFacile@plt>
jmp    117e <IABatailleNavaleNormal+0x4e>
cmpl   $0x2,-0x14(%rbp)
jne    1179 <IABatailleNavaleNormal+0x49>
mov    -0x10(%rbp),%rdi
call   1050 <IABatailleNavaleDifficile@plt>
jmp    117e <IABatailleNavaleNormal+0x4e>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IABatailleNavaleNormal>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <hasard@plt>
cmp    $0x2,%eax
je     1157 <IABatailleNavaleNormal+0x27>
cmp    $0x1,%eax
jne    115f <IABatailleNavaleNormal+0x2f>
mov    %rbx,%rdi
call   1040 <IABatailleNavaleFacile@plt>
pop    %rbx
ret
mov    %rbx,%rdi
call   1050 <IABatailleNavaleDifficile@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @IABatailleNavaleNormal(i8* %0) {
%2 = tail call i32 @hasard(i32 1, i32 2)
switch i32 %2, label %7 [
i32 1, label %3
i32 2, label %5
]
3: ; preds = %1
%4 = tail call i32 @IABatailleNavaleFacile(i8* %0)
br label %7
5: ; preds = %1
%6 = tail call i32 @IABatailleNavaleDifficile(i8* %0)
br label %7
7: ; preds = %1, %5, %3
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ nums;

/* Variables and functions */
int /*<<< orphan*/ counting_sort(int *, int);
int /*<<< orphan*/ print(int *, int);
int main() {
  int nums[] = {2, 10, 3, 14, 15, 6, 3, 9};
  int n = sizeof(nums) / sizeof(nums[0]);
  counting_sort(nums, n);
  print(nums, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x8,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1030 <counting_sort@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1040 <print@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <counting_sort@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <print@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.nums = [8 x i32] [i32 2, i32 10, i32 3, i32 14, i32 15, i32 6, i32 3, i32 9]
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [8 x i32]* %2 to i8*
store i32 8, i32* %3
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @counting_sort(i32* %5, i32 %6)
%8 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %3
%10 = call i32 @print(i32* %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.nums = [8 x i32] [i32 2, i32 10, i32 3, i32 14, i32 15, i32 6, i32 3, i32 9]
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @counting_sort(i32* %3, i32 8)
%5 = call i32 @print(i32* %3, i32 8)
ret i32 0
}
/* Variables and functions */
void *memset(void *, int /*<<< orphan*/, size_t);
void *memzero(void *trg, size_t num) { return memset(trg, 0, num); }


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

x86 assembly (clang, -O2):
<memzero>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define i8* @memzero(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
ret i8* %5
}

LLVM IR (-O2):
define i8* @memzero(i8* returned writeonly %0, i64 %1) {
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 %1, i1 false)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ unselect();
void cmd_unselect(const char *pf, char **args) { unselect(); }


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

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

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

LLVM IR (-O2):
define void @cmd_unselect(i8* nocapture readnone %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @unselect()
ret void
}
int main() {
  int x;
  if (x)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1121 <main+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1128 <main+0x28>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int strLen(char *stringIn) {
  int length = 0, i = 0;
  while (stringIn[i] != '\0') {
    length++;
    i++;
  }
  return length;
}


x86 assembly (clang, -O0):
<strLen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1142 <strLen+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <strLen+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

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


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

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

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

LLVM IR (-O2):
%struct.address_space = type opaque
define void @ub_io_writeback_inc(%struct.address_space* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ read_u32(int /*<<< orphan*/ *);
int32_t read_32(FILE *stream) { return read_u32(stream); }


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

x86 assembly (clang, -O2):
<read_32>:
jmp    1030 <read_u32@plt>

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

LLVM IR (-O2):
define i32 @read_32(i32* %0) {
%2 = tail call i32 @read_u32(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x1d() {
  Assert_real((islower(29) == 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_islower.c",
              150, ("islower should be 0 for 0x1d"));
}


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

x86 assembly (clang, -O2):
<t_islower_0x1d>:
push   %rax
mov    $0x1d,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x96,%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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x1d\00"
define void @t_islower_0x1d() {
%1 = call i64 @islower(i32 29)
%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 150, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x1d\00"
define void @t_islower_0x1d() {
%1 = tail call i64 @islower(i32 29)
%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 150, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int __byte_encode_array(void *, int /*<<< orphan*/, int /*<<< orphan*/,
                        int /*<<< orphan*/ const *, int /*<<< orphan*/);
int __byte_encode_little_endian_array(void *_buf, uint32_t offset,
                                      uint32_t maxlen, const uint8_t *p,
                                      uint32_t elements) {
  return __byte_encode_array(_buf, offset, maxlen, p, elements);
}


x86 assembly (clang, -O0):
<__byte_encode_little_endian_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
call   1030 <__byte_encode_array@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__byte_encode_little_endian_array>:
jmp    1030 <__byte_encode_array@plt>

LLVM IR (-O0):
define i32 @__byte_encode_little_endian_array(i8* %0, i32 %1, i32 %2, i32* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32* %3, i32** %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32*, i32** %9
%15 = load i32, i32* %10
%16 = call i32 @__byte_encode_array(i8* %11, i32 %12, i32 %13, i32* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @__byte_encode_little_endian_array(i8* %0, i32 %1, i32 %2, i32* %3, i32 %4) {
%6 = tail call i32 @__byte_encode_array(i8* %0, i32 %1, i32 %2, i32* %3, i32 %4)
ret i32 %6
}
/* Variables and functions */
int nvidia_mcp_gpio_set(int, int);
int nvidia_mcp_gpio3b_raise(void) { return nvidia_mcp_gpio_set(0x3b, 1); }


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

x86 assembly (clang, -O2):
<nvidia_mcp_gpio3b_raise>:
mov    $0x3b,%edi
mov    $0x1,%esi
jmp    1030 <nvidia_mcp_gpio_set@plt>

LLVM IR (-O0):
define i32 @nvidia_mcp_gpio3b_raise() {
%1 = call i32 @nvidia_mcp_gpio_set(i32 59, i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @nvidia_mcp_gpio3b_raise() {
%1 = tail call i32 @nvidia_mcp_gpio_set(i32 59, i32 1)
ret i32 %1
}