xunge/DecIR huggingface dataset:
void t2() {
  int a, b, c[10];
#pragma acc update self(a)
#pragma acc parallel
#pragma acc loop if_present
  for (b = 1; b < 10; b++)
    ;
#pragma acc end parallel
#pragma acc kernels loop if_present
  for (b = 1; b < 10; b++)
    ;
#pragma acc parallel loop if_present
  for (b = 1; b < 10; b++)
    ;
}


x86 assembly (clang, -O0):
<t2>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1128 <t2+0x28>
jmp    111a <t2+0x1a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110b <t2+0xb>
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    114c <t2+0x4c>
jmp    113e <t2+0x3e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <t2+0x2f>
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1170 <t2+0x70>
jmp    1162 <t2+0x62>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1153 <t2+0x53>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @t2() {
ret void
}
void termop_setmode(struct ansiseq *s) {
  tnc_log_log(
      7, 4, -1,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/xterm.c",
      460, __func__, "unhandled");
  ansiseq_dump(s);
}


x86 assembly (clang, -O0):
<termop_setmode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x7,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
lea    0xebe(%rip),%rcx
mov    $0x1cc,%r8d
lea    0xf37(%rip),%r9
lea    0xf3f(%rip),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <tnc_log_log@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <ansiseq_dump@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<termop_setmode>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xf66(%rip),%rax
mov    %rax,(%rsp)
lea    0xec6(%rip),%rcx
lea    0xf45(%rip),%r9
mov    $0x7,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
mov    $0x1cc,%r8d
xor    %eax,%eax
call   1030 <tnc_log_log@plt>
mov    %rbx,%rdi
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <ansiseq_dump@plt>

LLVM IR (-O0):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/xterm.c\00"
@__func__.termop_setmode = [15 x i8] c"termop_setmode\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_setmode(%struct.ansiseq* %0) {
%2 = alloca %struct.ansiseq*
store %struct.ansiseq* %0, %struct.ansiseq** %2
%3 = call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 7, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 460, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.termop_setmode, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = load %struct.ansiseq*, %struct.ansiseq** %2
%5 = call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %4)
ret void
}

LLVM IR (-O2):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/xterm.c\00"
@__func__.termop_setmode = [15 x i8] c"termop_setmode\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_setmode(%struct.ansiseq* %0) {
%2 = tail call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 7, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 460, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.termop_setmode, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %0)
ret void
}
/* Variables and functions */
int exact_square(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int a, rez;
  scanf("%d", &a);
  rez = exact_square(a);
  printf("%d", rez);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exact_square@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @exact_square(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
struct device_node *of_get_next_available_child(const struct device_node *node,
                                                struct device_node *prev) {
  return ((void *)0);
}


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

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

LLVM IR (-O0):
%struct.device_node = type opaque
define %struct.device_node* @of_get_next_available_child(%struct.device_node* %0, %struct.device_node* %1) {
%3 = alloca %struct.device_node*
%4 = alloca %struct.device_node*
store %struct.device_node* %0, %struct.device_node** %3
store %struct.device_node* %1, %struct.device_node** %4
ret %struct.device_node* null
}

LLVM IR (-O2):
%struct.device_node = type opaque
define noalias %struct.device_node* @of_get_next_available_child(%struct.device_node* nocapture readnone %0, %struct.device_node* nocapture readnone %1) {
ret %struct.device_node* null
}
int f_gt_cr2(float a1) { return !(((100) > (a1))); }


x86 assembly (clang, -O0):
<f_gt_cr2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
seta   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_gt_cr2>:
movss  0xef8(%rip),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setbe  %al
ret

LLVM IR (-O0):
define i32 @f_gt_cr2(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp ogt float 1.000000e+02, %3
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @f_gt_cr2(float %0) {
%2 = fcmp uge float %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ lookNarray(char *, unsigned int);
void lookinteger8array(long int *x, int n) {
  lookNarray((char *)x, (unsigned int)(n * 8));
}


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

x86 assembly (clang, -O2):
<lookinteger8array>:
shl    $0x3,%esi
jmp    1030 <lookNarray@plt>

LLVM IR (-O0):
define void @lookinteger8array(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%5 = load i64*, i64** %3
%6 = bitcast i64* %5 to i8*
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 8
%9 = call i32 @lookNarray(i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
define void @lookinteger8array(i64* %0, i32 %1) {
%3 = bitcast i64* %0 to i8*
%4 = shl nsw i32 %1, 3
%5 = tail call i32 @lookNarray(i8* %3, i32 %4)
ret void
}
void Hal_hook_wr_sgnfrec(void) {}


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

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

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

LLVM IR (-O2):
define void @Hal_hook_wr_sgnfrec() {
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t rotate64(uint64_t v, int shift) {
  return ((v >> shift) | (v << (64 - shift)));
}


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

x86 assembly (clang, -O2):
<rotate64>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
neg    %cl
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rotate64(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 = ashr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 64, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rotate64(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
%4 = sub nsw i32 64, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
size_t strlen(char *);
size_t rstrip(char *str) {
  size_t len = strlen(str);
  if (len > 0 && str[len - 1] == '\n') {
    str[len - 1] = '\0';
    --len;
  }
  return len;
}


x86 assembly (clang, -O0):
<rstrip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jbe    1169 <rstrip+0x59>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1169 <rstrip+0x59>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rstrip>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %rax,%rax
je     112f <rstrip+0x1f>
cmpb   $0xa,-0x1(%rbx,%rax,1)
jne    112d <rstrip+0x1d>
add    $0xffffffffffffffff,%rax
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @rstrip(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = icmp ugt i64 %6, 0
br i1 %7, label %8, label %23
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = load i64, i64* %3
%11 = sub i64 %10, 1
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 10
br i1 %15, label %16, label %23
16: ; preds = %8
%17 = load i8*, i8** %2
%18 = load i64, i64* %3
%19 = sub i64 %18, 1
%20 = getelementptr inbounds i8, i8* %17, i64 %19
store i8 0, i8* %20
%21 = load i64, i64* %3
%22 = add i64 %21, -1
store i64 %22, i64* %3
br label %23
23: ; preds = %16, %8, %1
%24 = load i64, i64* %3
ret i64 %24
}

LLVM IR (-O2):
define i64 @rstrip(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = add i64 %2, -1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 10
br i1 %8, label %9, label %10
9: ; preds = %4
store i8 0, i8* %6
br label %10
10: ; preds = %9, %4, %1
%11 = phi i64 [ %5, %9 ], [ %2, %4 ], [ 0, %1 ]
ret i64 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ sem_t;

/* Variables and functions */
int /*<<< orphan*/ *malloc(int);
int /*<<< orphan*/ sem_init(int /*<<< orphan*/ *, int /*<<< orphan*/,
                            int /*<<< orphan*/);
sem_t *create_semaphore(const char *const name) {
  sem_t *p = malloc(sizeof(*p));
  if (p)
    sem_init(p, 0, 0);
  return p;
}


x86 assembly (clang, -O0):
<create_semaphore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1152 <create_semaphore+0x32>
mov    -0x10(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1040 <sem_init@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_semaphore>:
push   %rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113f <create_semaphore+0x1f>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <sem_init@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @create_semaphore(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = call i32* @malloc(i32 4)
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32*, i32** %3
%9 = call i32 @sem_init(i32* %8, i32 0, i32 0)
br label %10
10: ; preds = %7, %1
%11 = load i32*, i32** %3
ret i32* %11
}

LLVM IR (-O2):
define i32* @create_semaphore(i8* nocapture readnone %0) {
%2 = tail call i32* @malloc(i32 4)
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @sem_init(i32* %2, i32 0, i32 0)
br label %6
6: ; preds = %4, %1
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M93_f(char *s) {
  debug("M93_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M93_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M93_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"M93_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M93_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"M93_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M93_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
int min3(int a, int b, int c) {
  int ab = ((a) < (b) ? (a) : (b));
  return ((ab) < (c) ? (ab) : (c));
}


x86 assembly (clang, -O0):
<min3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1124 <min3+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    112a <min3+0x2a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1147 <min3+0x47>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    114d <min3+0x4d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min3>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
cmp    %edx,%eax
cmovge %edx,%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* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load i32, i32* %4
br label %15
13: ; preds = %3
%14 = load i32, i32* %5
br label %15
15: ; preds = %13, %11
%16 = phi i32 [ %12, %11 ], [ %14, %13 ]
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = load i32, i32* %6
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %22
20: ; preds = %15
%21 = load i32, i32* %7
br label %24
22: ; preds = %15
%23 = load i32, i32* %6
br label %24
24: ; preds = %22, %20
%25 = phi i32 [ %21, %20 ], [ %23, %22 ]
ret i32 %25
}

LLVM IR (-O2):
define i32 @min3(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = select i1 %4, i32 %0, i32 %1
%6 = icmp slt i32 %5, %2
%7 = select i1 %6, i32 %5, i32 %2
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *);
int main() {
  char str[] = "prashant chikhalkar";
  reverse(str);
  printf("%s\n", str);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x72616b,0x10(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <reverse@plt>
lea    0xeca(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@__const.main.str = [20 x i8] c"prashant chikhalkar\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @reverse(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
void sv_frame_update() {}


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

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

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

LLVM IR (-O2):
define void @sv_frame_update() {
ret void
}
int xdr_void() { return (1); }


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

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

LLVM IR (-O0):
define i32 @xdr_void() {
ret i32 1
}

LLVM IR (-O2):
define i32 @xdr_void() {
ret i32 1
}
extern __attribute__((gnu_)) int isspace(int __c) {
  return __c == ' ' || __c == '\n' || __c == '\t' || __c == '\r';
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <isspace+0x3e>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <isspace+0x3e>
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <isspace+0x3e>
cmpl   $0xd,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
cmp    $0x20,%edi
ja     111d <isspace+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100000600,%rdx
bt     %rcx,%rdx
jae    111d <isspace+0x1d>
ret
xor    %eax,%eax
cmp    $0xd,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %5
i32 10, label %5
i32 9, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 13
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t c_ret_u64() { return 0xffffffffffffffff; }


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

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

LLVM IR (-O0):
define i32 @c_ret_u64() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @c_ret_u64() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void mul_reg64(unsigned int reg64) {
  put8(0x48);
  put8(0xF7);
  put8(0xE0 + reg64);
}


x86 assembly (clang, -O0):
<mul_reg64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x48,%edi
call   1030 <put8@plt>
mov    $0xf7,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
add    $0xe0,%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul_reg64>:
push   %rbx
mov    %edi,%ebx
mov    $0x48,%edi
call   1030 <put8@plt>
mov    $0xf7,%edi
call   1030 <put8@plt>
add    $0xe0,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @mul_reg64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put8(i32 72)
%4 = call i32 @put8(i32 247)
%5 = load i32, i32* %2
%6 = add i32 224, %5
%7 = call i32 @put8(i32 %6)
ret void
}

LLVM IR (-O2):
define void @mul_reg64(i32 %0) {
%2 = tail call i32 @put8(i32 72)
%3 = tail call i32 @put8(i32 247)
%4 = add i32 %0, 224
%5 = tail call i32 @put8(i32 %4)
ret void
}
int test3(int arg) {}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test3(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
void captura(int sennal) {
  printf("He conseguido capturar SIGALRM\n");
  fflush(NULL);
  return;
}


x86 assembly (clang, -O0):
<captura>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<captura>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"He conseguido capturar SIGALRM\0A\00"
define void @captura(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @fflush(i32* null)
ret void
}

LLVM IR (-O2):
@str = [31 x i8] c"He conseguido capturar SIGALRM\00"
define void @captura(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @fflush(i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, int);
int system(char *);
int start_game_server(int port) {
  char static start[200];
  sprintf(start, "%s %d", "./game_server", port);
  return system(start);
}


x86 assembly (clang, -O0):
<start_game_server>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
lea    0x2f0b(%rip),%rdi
lea    0xec4(%rip),%rsi
lea    0xec3(%rip),%rdx
call   1040 <sprintf@plt>
lea    0x2ef1(%rip),%rdi
call   1030 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_game_server>:
push   %rbx
mov    %edi,%ecx
lea    0x2f16(%rip),%rbx
lea    0xecf(%rip),%rsi
lea    0xece(%rip),%rdx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <system@plt>

LLVM IR (-O0):
@start_game_server.start = internal global [200 x i8] zeroinitializer
@.str = [6 x i8] c"%s %d\00"
@.str.1 = [14 x i8] c"./game_server\00"
define i32 @start_game_server(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @start_game_server.start, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = call i32 @system(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @start_game_server.start, i64 0, i64 0))
ret i32 %5
}

LLVM IR (-O2):
@start_game_server.start = internal global [200 x i8] zeroinitializer
@.str = [6 x i8] c"%s %d\00"
@.str.1 = [14 x i8] c"./game_server\00"
define i32 @start_game_server(i32 %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([200 x i8], [200 x i8]* @start_game_server.start, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%3 = tail call i32 @system(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @start_game_server.start, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage(void) {
  printf("Usage: mf RULE_OPTIONS..\n"
         "MiniFirewall implements an exact match algorithm, where "
         "unspecified options are ignored.\n"
         "-i --in             input\n"
         "-o --out            output\n"
         "-s --s_ip IPADDR    source ip address\n"
         "-m --s_mask MASK    source mask\n"
         "-p --s_port PORT    source port\n"
         "-d --d_ip IPADDR    destination ip address\n"
         "-n --d_mask MASK    destination mask\n"
         "-q --d_port PORT    destination port\n"
         "-c --proto PROTO    protocol\n"
         "-a --add            add a rule\n"
         "-r --remove         remove a rule\n"
         "-v --view           view rules\n"
         "-h --help           this usage\n");
}


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

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

LLVM IR (-O0):
@.str = [543 x i8] c"Usage: mf RULE_OPTIONS..\0AMiniFirewall implements an exact match algorithm, where unspecified options are ignored.\0A-i --in input\0A-o --out output\0A-s --s_ip IPADDR source ip address\0A-m --s_mask MASK source mask\0A-p --s_port PORT source port\0A-d --d_ip IPADDR destination ip address\0A-n --d_mask MASK destination mask\0A-q --d_port PORT destination port\0A-c --proto PROTO protocol\0A-a --add add a rule\0A-r --remove remove a rule\0A-v --view view rules\0A-h --help this usage\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([543 x i8], [543 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [542 x i8] c"Usage: mf RULE_OPTIONS..\0AMiniFirewall implements an exact match algorithm, where unspecified options are ignored.\0A-i --in input\0A-o --out output\0A-s --s_ip IPADDR source ip address\0A-m --s_mask MASK source mask\0A-p --s_port PORT source port\0A-d --d_ip IPADDR destination ip address\0A-n --d_mask MASK destination mask\0A-q --d_port PORT destination port\0A-c --proto PROTO protocol\0A-a --add add a rule\0A-r --remove remove a rule\0A-v --view view rules\0A-h --help this usage\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([542 x i8], [542 x i8]* @str, i64 0, i64 0))
ret void
}
void usage(char *exec) {
  printf("Usage: %s [-c,--calendar \"<date>\"]\n", exec);
  printf("%*s [-s,--stardate <stardate>]\n", (int)strlen(exec) + 7, " ");
}


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   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
add    $0x7,%esi
lea    0xed1(%rip),%rdi
lea    0xeea(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0x7(%rax),%esi
lea    0xedd(%rip),%rdi
lea    0xef6(%rip),%rdx
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Usage: %s [-c,--calendar \22<date>\22]\0A\00"
@.str.1 = [32 x i8] c"%*s [-s,--stardate <stardate>]\0A\00"
@.str.2 = [2 x i8] c" \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 ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
%7 = trunc i64 %6 to i32
%8 = add nsw i32 %7, 7
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"Usage: %s [-c,--calendar \22<date>\22]\0A\00"
@.str.1 = [32 x i8] c"%*s [-s,--stardate <stardate>]\0A\00"
@.str.2 = [2 x i8] c" \00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = trunc i64 %3 to i32
%5 = add nsw i32 %4, 7
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void load_cur(void) { printf("\033[u"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"\1B[u\00"
define void @load_cur() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
int redisApi_lset(void *inst, char *key, char *val) { return -1; }


x86 assembly (clang, -O0):
<redisApi_lset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @redisApi_lset(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret i32 -1
}

LLVM IR (-O2):
define i32 @redisApi_lset(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 -1
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ ft_printf_fd(int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ *sys_errlist;
int ft_perror(void) {
  if (errno > 106)
    errno = 0;
  ft_printf_fd(2, "Error : %s.\n", sys_errlist[errno]);
  return (0);
}


x86 assembly (clang, -O0):
<ft_perror>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
cmpl   $0x6a,(%rax)
jle    1131 <ft_perror+0x21>
mov    0x2ead(%rip),%rax
movl   $0x0,(%rax)
mov    0x2ec0(%rip),%rax
mov    (%rax),%rax
mov    0x2e96(%rip),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,4),%edx
mov    $0x2,%edi
lea    0xeac(%rip),%rsi
call   1030 <ft_printf_fd@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_perror>:
push   %rax
mov    0x2ec0(%rip),%rcx
mov    (%rcx),%eax
cmp    $0x6b,%eax
jl     1127 <ft_perror+0x17>
movl   $0x0,(%rcx)
xor    %eax,%eax
mov    0x2eca(%rip),%rcx
mov    (%rcx),%rcx
cltq
mov    (%rcx,%rax,4),%edx
lea    0xec3(%rip),%rsi
mov    $0x2,%edi
call   1030 <ft_printf_fd@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
@.str = [13 x i8] c"Error : %s.\0A\00"
@sys_errlist = global i32* null
define i32 @ft_perror() {
%1 = load i32, i32* @errno
%2 = icmp sgt i32 %1, 106
br i1 %2, label %3, label %4
3: ; preds = %0
store i32 0, i32* @errno
br label %4
4: ; preds = %3, %0
%5 = load i32*, i32** @sys_errlist
%6 = load i32, i32* @errno
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
%10 = call i32 @ft_printf_fd(i32 2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@errno = global i32 0
@.str = [13 x i8] c"Error : %s.\0A\00"
@sys_errlist = global i32* null
define i32 @ft_perror() {
%1 = load i32, i32* @errno
%2 = icmp sgt i32 %1, 106
br i1 %2, label %3, label %4
3: ; preds = %0
store i32 0, i32* @errno
br label %4
4: ; preds = %3, %0
%5 = phi i32 [ 0, %3 ], [ %1, %0 ]
%6 = load i32*, i32** @sys_errlist
%7 = sext i32 %5 to i64
%8 = getelementptr inbounds i32, i32* %6, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @ft_printf_fd(i32 2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
double RAND_MAX;
int log(int);
scalar_t__ rand_r(unsigned int *);
int random_level(unsigned int *seedp) {
  const double P = 0.5;
  int lvl = (int)(log(((double)rand_r(seedp) / RAND_MAX)) / log(1. - P));
  return lvl < (32 - 1) ? lvl : (32 - 1);
}


x86 assembly (clang, -O0):
<random_level>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  0xecc(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rand_r@plt>
cvtsi2sd %rax,%xmm0
mov    0x2e9a(%rip),%rax
divsd  (%rax),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <log@plt>
mov    %eax,-0x18(%rbp)
xor    %edi,%edi
call   1040 <log@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
cmpl   $0x1f,-0x14(%rbp)
jge    1185 <random_level+0x65>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1192 <random_level+0x72>
mov    $0x1f,%eax
mov    %eax,-0x1c(%rbp)
jmp    1192 <random_level+0x72>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_level>:
push   %rbx
call   1030 <rand_r@plt>
cvtsi2sd %rax,%xmm0
mov    0x2eb6(%rip),%rax
divsd  (%rax),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <log@plt>
mov    %eax,%ebx
xor    %edi,%edi
call   1040 <log@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
cmp    $0x1f,%eax
mov    $0x1f,%ecx
cmovge %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i32 @random_level(i32* %0) {
%2 = alloca i32*
%3 = alloca double
%4 = alloca i32
store i32* %0, i32** %2
store double 5.000000e-01, double* %3
%5 = load i32*, i32** %2
%6 = call i64 @rand_r(i32* %5)
%7 = sitofp i64 %6 to double
%8 = load double, double* @RAND_MAX
%9 = fdiv double %7, %8
%10 = fptosi double %9 to i32
%11 = call i32 @log(i32 %10)
%12 = call i32 @log(i32 0)
%13 = sdiv i32 %11, %12
store i32 %13, i32* %4
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 31
br i1 %15, label %16, label %18
16: ; preds = %1
%17 = load i32, i32* %4
br label %19
18: ; preds = %1
br label %19
19: ; preds = %18, %16
%20 = phi i32 [ %17, %16 ], [ 31, %18 ]
ret i32 %20
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i32 @random_level(i32* %0) {
%2 = tail call i64 @rand_r(i32* %0)
%3 = sitofp i64 %2 to double
%4 = load double, double* @RAND_MAX
%5 = fdiv double %3, %4
%6 = fptosi double %5 to i32
%7 = tail call i32 @log(i32 %6)
%8 = tail call i32 @log(i32 0)
%9 = sdiv i32 %7, %8
%10 = icmp slt i32 %9, 31
%11 = select i1 %10, i32 %9, i32 31
ret i32 %11
}
int ISOCT(int ch) { return '0' <= ch && ch <= '7'; }


x86 assembly (clang, -O0):
<ISOCT>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    $0x30,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jg     1124 <ISOCT+0x24>
cmpl   $0x37,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ISOCT>:
and    $0xfffffff8,%edi
xor    %eax,%eax
cmp    $0x30,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @ISOCT(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 48, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 55
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ISOCT(i32 %0) {
%2 = and i32 %0, -8
%3 = icmp eq i32 %2, 48
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ imp();
int /*<<< orphan*/ textcolor(int);
ln2() {
  textcolor(7);
  imp();
}


x86 assembly (clang, -O0):
<ln2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x7,%edi
call   1040 <textcolor@plt>
mov    $0x0,%al
call   1030 <imp@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln2>:
push   %rax
mov    $0x7,%edi
call   1040 <textcolor@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <imp@plt>

LLVM IR (-O0):
define i32 @ln2() {
%1 = alloca i32
%2 = call i32 @textcolor(i32 7)
%3 = call i32 (...) @imp()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @ln2() {
%1 = tail call i32 @textcolor(i32 7)
%2 = tail call i32 (...) @imp()
ret i32 undef
}
unsigned long long
unsignedlonglong_ignoring_unsignedlonglongint(unsigned long long x,
                                              unsigned long long int y) {
  return x;
}


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

x86 assembly (clang, -O2):
<unsignedlonglong_ignoring_unsignedlonglongint>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @unsignedlonglong_ignoring_unsignedlonglongint(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Variables and functions */
int getchar();
scalar_t__ gui_kbhit();
int gui_getk() {
  int result;
  result = 0;
  if (gui_kbhit()) {
    result = getchar();
  }
  return result;
}


x86 assembly (clang, -O0):
<gui_getk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <gui_kbhit@plt>
cmp    $0x0,%rax
je     114a <gui_getk+0x2a>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_getk>:
push   %rax
xor    %eax,%eax
call   1040 <gui_kbhit@plt>
test   %rax,%rax
je     1135 <gui_getk+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1030 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @gui_getk() {
%1 = tail call i64 (...) @gui_kbhit()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @getchar()
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ %4, %3 ], [ 0, %0 ]
ret i32 %6
}
/* Variables and functions */
int palindrom1(char const *, int);
int palindrome(const char *word, int length) {
  return palindrom1(word, length);
}


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

x86 assembly (clang, -O2):
<palindrome>:
jmp    1030 <palindrom1@plt>

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

LLVM IR (-O2):
define i32 @palindrome(i8* %0, i32 %1) {
%3 = tail call i32 @palindrom1(i8* %0, i32 %1)
ret i32 %3
}
int set_video_mode_Nala(struct pwc_device *pdev, int size, int frames) {
  return -1;
}


x86 assembly (clang, -O0):
<set_video_mode_Nala>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.pwc_device = type opaque
define i32 @set_video_mode_Nala(%struct.pwc_device* %0, i32 %1, i32 %2) {
%4 = alloca %struct.pwc_device*
%5 = alloca i32
%6 = alloca i32
store %struct.pwc_device* %0, %struct.pwc_device** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 -1
}

LLVM IR (-O2):
%struct.pwc_device = type opaque
define i32 @set_video_mode_Nala(%struct.pwc_device* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 -1
}
/* Variables and functions */
int fn_sq_ch_41(char const *);
int fn_al_sq_ch_41(const char *text) {
  int pos = 0;
  pos = fn_sq_ch_41(text);
  if (pos != -1)
    return pos;
  return -1;
}


x86 assembly (clang, -O0):
<fn_al_sq_ch_41>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fn_sq_ch_41@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     1144 <fn_al_sq_ch_41+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <fn_al_sq_ch_41+0x3b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_al_sq_ch_41>:
jmp    1030 <fn_sq_ch_41@plt>

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

LLVM IR (-O2):
define i32 @fn_al_sq_ch_41(i8* %0) {
%2 = tail call i32 @fn_sq_ch_41(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(unsigned int *);
unsigned int *malloc(int);
int /*<<< orphan*/ sleep(int);
void main(void) {
  unsigned int *p1, *p2;
  while (1) {
    p1 = malloc(4096 * 3);
    p1[0] = 0;
    p1[1024] = 1;
    p1[1024 * 2] = 2;
    p2 = malloc(1024);
    p2[0] = 1;
    free(p2);
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3000,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0x1000(%rax)
mov    -0x8(%rbp),%rax
movl   $0x2,0x2000(%rax)
mov    $0x400,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1138 <main+0x8>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x3000,%edi
call   1040 <malloc@plt>
movl   $0x0,(%rax)
movl   $0x1,0x1000(%rax)
movl   $0x2,0x2000(%rax)
mov    $0x400,%edi
call   1040 <malloc@plt>
movl   $0x1,(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32*
%2 = alloca i32*
br label %3
3: ; preds = %0, %3
%4 = call i32* @malloc(i32 12288)
store i32* %4, i32** %1
%5 = load i32*, i32** %1
%6 = getelementptr inbounds i32, i32* %5, i64 0
store i32 0, i32* %6
%7 = load i32*, i32** %1
%8 = getelementptr inbounds i32, i32* %7, i64 1024
store i32 1, i32* %8
%9 = load i32*, i32** %1
%10 = getelementptr inbounds i32, i32* %9, i64 2048
store i32 2, i32* %10
%11 = call i32* @malloc(i32 1024)
store i32* %11, i32** %2
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 0
store i32 1, i32* %13
%14 = load i32*, i32** %2
%15 = call i32 @free(i32* %14)
%16 = call i32 @sleep(i32 1)
br label %3
}

LLVM IR (-O2):
define void @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32* @malloc(i32 12288)
store i32 0, i32* %2
%3 = getelementptr inbounds i32, i32* %2, i64 1024
store i32 1, i32* %3
%4 = getelementptr inbounds i32, i32* %2, i64 2048
store i32 2, i32* %4
%5 = tail call i32* @malloc(i32 1024)
store i32 1, i32* %5
%6 = tail call i32 @free(i32* %5)
%7 = tail call i32 @sleep(i32 1)
br label %1
}