xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i, horas, total = 0;
  for (i = 0; i < 30; i++) {
    scanf("%d", &horas);
    total += horas;
  }
  printf("%d\n", total);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1e,-0x8(%rbp)
jge    116e <main+0x4e>
lea    0xeb2(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
mov    -0x10(%rbp),%esi
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
mov    $0x1e,%ebp
lea    0xecb(%rip),%r14
lea    0x4(%rsp),%r15
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
add    0x4(%rsp),%ebx
add    $0xffffffff,%ebp
jne    1140 <main+0x20>
lea    0xea8(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %8, %3 ]
%5 = phi i32 [ 0, %0 ], [ %9, %3 ]
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = add nsw i32 %7, %4
%9 = add nuw nsw i32 %5, 1
%10 = icmp eq i32 %9, 30
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
double j0(double x) { return 0.0; }


x86 assembly (clang, -O0):
<j0>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<j0>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @j0(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @j0(double %0) {
ret double 0.000000e+00
}
int toascii(int c) { return c & 0x7f; }


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

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

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

LLVM IR (-O2):
define i32 @toascii(i32 %0) {
%2 = and i32 %0, 127
ret i32 %2
}
void superset_hash_item_liberator(struct rx_hash_item *it,
                                  struct rx_hash_rules *rules) {}


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

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

LLVM IR (-O0):
%struct.rx_hash_item = type opaque
%struct.rx_hash_rules = type opaque
define void @superset_hash_item_liberator(%struct.rx_hash_item* %0, %struct.rx_hash_rules* %1) {
%3 = alloca %struct.rx_hash_item*
%4 = alloca %struct.rx_hash_rules*
store %struct.rx_hash_item* %0, %struct.rx_hash_item** %3
store %struct.rx_hash_rules* %1, %struct.rx_hash_rules** %4
ret void
}

LLVM IR (-O2):
%struct.rx_hash_item = type opaque
%struct.rx_hash_rules = type opaque
define void @superset_hash_item_liberator(%struct.rx_hash_item* nocapture %0, %struct.rx_hash_rules* nocapture %1) {
ret void
}
void code(char *s) {
  while (*s) {
    (*s)++;
    s++;
  }
}


x86 assembly (clang, -O0):
<code>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1131 <code+0x31>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
add    $0x1,%cl
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <code+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<code>:
mov    (%rdi),%al
test   %al,%al
je     1120 <code+0x20>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
add    $0x1,%al
mov    %al,-0x1(%rdi)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <code+0x10>
ret

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

LLVM IR (-O2):
define void @code(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add i8 %5, 1
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
int square(int x) { return (x * x + 500) / 1000; }


x86 assembly (clang, -O0):
<square>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
add    $0x1f4,%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<square>:
imul   %edi,%edi
add    $0x1f4,%edi
imul   $0x10624dd3,%rdi,%rax
shr    $0x26,%rax
ret

LLVM IR (-O0):
define i32 @square(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
%6 = add nsw i32 %5, 500
%7 = sdiv i32 %6, 1000
ret i32 %7
}

LLVM IR (-O2):
define i32 @square(i32 %0) {
%2 = mul nsw i32 %0, %0
%3 = add nuw nsw i32 %2, 500
%4 = udiv i32 %3, 1000
ret i32 %4
}
double d_dim(double *a, double *b) { return (*a > *b ? *a - *b : 0); }


x86 assembly (clang, -O0):
<d_dim>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    113c <d_dim+0x3c>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1149 <d_dim+0x49>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1149 <d_dim+0x49>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_dim>:
movsd  (%rdi),%xmm1
movsd  (%rsi),%xmm0
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
cmpltsd %xmm1,%xmm0
andpd  %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define double @d_dim(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp ogt double %3, %4
%6 = fsub double %3, %4
%7 = select i1 %5, double %6, double 0.000000e+00
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
char *timlib_escape_character_array(char *, char *, char *);
char *timlib_escape_character_string(char *source_destination,
                                     char *character_string) {
  char buffer[131072];
  strcpy(buffer, source_destination);
  return timlib_escape_character_array(source_destination, buffer,
                                       character_string);
}


x86 assembly (clang, -O0):
<timlib_escape_character_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20010,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x20010(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
lea    -0x20010(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <timlib_escape_character_array@plt>
add    $0x20010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timlib_escape_character_string>:
push   %r15
push   %r14
push   %rbx
sub    $0x20000,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <timlib_escape_character_array@plt>
add    $0x20000,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @timlib_escape_character_string(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [131072 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [131072 x i8], [131072 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = call i32 @strcpy(i8* %6, i8* %7)
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [131072 x i8], [131072 x i8]* %5, i64 0, i64 0
%11 = load i8*, i8** %4
%12 = call i8* @timlib_escape_character_array(i8* %9, i8* %10, i8* %11)
ret i8* %12
}

LLVM IR (-O2):
define i8* @timlib_escape_character_string(i8* %0, i8* %1) {
%3 = alloca [131072 x i8]
%4 = getelementptr inbounds [131072 x i8], [131072 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* %0)
%6 = call i8* @timlib_escape_character_array(i8* %0, i8* %4, i8* %1)
ret i8* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int solve(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  char *a;
  a = argv[1];
  FILE *fp;
  fp = fopen(a, "r");
  int res = solve(fp);
  fclose(fp);
  return res;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xea3(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <solve@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    0x8(%rsi),%rdi
lea    0xec2(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <solve@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
store i8* %11, i8** %6
%12 = load i8*, i8** %6
%13 = call i32* @fopen(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %13, i32** %7
%14 = load i32*, i32** %7
%15 = call i32 @solve(i32* %14)
store i32 %15, i32* %8
%16 = load i32*, i32** %7
%17 = call i32 @fclose(i32* %16)
%18 = load i32, i32* %8
ret i32 %18
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @solve(i32* %5)
%7 = tail call i32 @fclose(i32* %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int accumulate(int a) {
  int ret;
  a = a * 2 + 2;
  printf("a = %d\n", a);
  if (a < 100)
    ret = accumulate(a);
  else {
    ret = a;
    printf("ret = %d\n", ret);
  }
  return ret;
}


x86 assembly (clang, -O0):
<accumulate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x64,-0x4(%rbp)
jge    1160 <accumulate+0x40>
mov    -0x4(%rbp),%edi
call   1040 <accumulate@plt>
mov    %eax,-0x8(%rbp)
jmp    1175 <accumulate+0x55>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<accumulate>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%ebx
lea    0xee2(%rip),%r14
xchg   %ax,%ax
mov    %ebx,%r15d
lea    (%r15,%r15,1),%ebx
add    $0x2,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
cmp    $0x31,%r15d
jl     1120 <accumulate+0x10>
lea    0xec7(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"a = %d\0A\00"
@.str.1 = [10 x i8] c"ret = %d\0A\00"
define i32 @accumulate(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %5, %2 ]
%4 = shl nsw i32 %3, 1
%5 = add nsw i32 %4, 2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = icmp slt i32 %3, 49
br i1 %7, label %2, label %8
8: ; preds = %2
%9 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ gc_mark(void *);
int gc_sweep();
int gc_pass(void *workspace) {
  gc_mark(workspace);
  return gc_sweep();
}


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

x86 assembly (clang, -O2):
<gc_pass>:
push   %rax
call   1030 <gc_mark@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <gc_sweep@plt>

LLVM IR (-O0):
define i32 @gc_pass(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @gc_mark(i8* %3)
%5 = call i32 (...) @gc_sweep()
ret i32 %5
}

LLVM IR (-O2):
define i32 @gc_pass(i8* %0) {
%2 = tail call i32 @gc_mark(i8* %0)
%3 = tail call i32 (...) @gc_sweep()
ret i32 %3
}
void g_signal_handlers_unblock_matched() {}


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

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

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

LLVM IR (-O2):
define void @g_signal_handlers_unblock_matched() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_56(int /*<<< orphan*/);
int gen_56() {
  handle_56(0);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @gen_56() {
%1 = call i32 @handle_56(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_56() {
%1 = tail call i32 @handle_56(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, char *);
void input(char *ID) { scanf("%s", ID); }


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

x86 assembly (clang, -O2):
<input>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <scanf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @input(i8* %0) {
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int int16_t;

/* Variables and functions */
void store2(uint8_t *buf, int16_t value) {
  buf[0] = value;
  buf[1] = value >> 8;
}


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

x86 assembly (clang, -O2):
<store2>:
mov    %esi,(%rdi)
sar    $0x8,%esi
mov    %esi,0x4(%rdi)
ret

LLVM IR (-O0):
define void @store2(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
store i32 %5, i32* %7
%8 = load i32, i32* %4
%9 = ashr i32 %8, 8
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 1
store i32 %9, i32* %11
ret void
}

LLVM IR (-O2):
define void @store2(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
%3 = ashr i32 %1, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %3, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int another();
int null_is_ptr_type();
main() {
  if (another() != 2)
    abort();
  return null_is_ptr_type();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <another@plt>
cmp    $0x2,%eax
je     1156 <main+0x26>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x0,%al
call   1050 <null_is_ptr_type@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <another@plt>
cmp    $0x2,%eax
jne    1145 <main+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1050 <null_is_ptr_type@plt>
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @another()
%2 = icmp eq i32 %1, 2
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 (...) @null_is_ptr_type()
ret i32 %6
}
void textbackground(int i) {}


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

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

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

LLVM IR (-O2):
define void @textbackground(i32 %0) {
ret void
}
void nbits2prec() {}


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

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

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

LLVM IR (-O2):
define void @nbits2prec() {
ret void
}
unsigned int hash(char *s0) {
  unsigned int h = 0;
  char *s;
  for (s = s0; *s; s++)
    h = h * 65599 + *s;
  return h;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1148 <hash+0x48>
imul   $0x1003f,-0xc(%rbp),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <hash+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <hash+0x27>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
imul   $0x1003f,%eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %11, %4 ], [ %0, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = mul i32 %7, 65599
%9 = sext i8 %5 to i32
%10 = add i32 %8, %9
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
/* Variables and functions */
int pipe(int *);
int c_pipe(int filedes[]) { return pipe(filedes); }


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

x86 assembly (clang, -O2):
<c_pipe>:
jmp    1030 <pipe@plt>

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

LLVM IR (-O2):
define i32 @c_pipe(i32* %0) {
%2 = tail call i32 @pipe(i32* %0)
ret i32 %2
}
__attribute__((always_)) __attribute__((no)) int fn3(int r) { return r & 8; }


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

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

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

LLVM IR (-O2):
define i32 @fn3(i32 %0) {
%2 = and i32 %0, 8
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ close(int /*<<< orphan*/);
void stdinout_cleanup() {
  assert(!close(STDIN_FILENO));
  assert(!close(STDOUT_FILENO));
}


x86 assembly (clang, -O0):
<stdinout_cleanup>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1030 <close@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1030 <close@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdinout_cleanup>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
call   1030 <close@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1030 <close@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
@STDOUT_FILENO = global i32 0
define void @stdinout_cleanup() {
%1 = load i32, i32* @STDIN_FILENO
%2 = call i32 @close(i32 %1)
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* @STDOUT_FILENO
%8 = call i32 @close(i32 %7)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
ret void
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
@STDOUT_FILENO = global i32 0
define void @stdinout_cleanup() {
%1 = load i32, i32* @STDIN_FILENO
%2 = tail call i32 @close(i32 %1)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = load i32, i32* @STDOUT_FILENO
%7 = tail call i32 @close(i32 %6)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
ret void
}
/* Variables and functions */
float sin(float);
float FastSin(float x) { return sin(x); }


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

x86 assembly (clang, -O2):
<FastSin>:
jmp    1030 <sin@plt>

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

LLVM IR (-O2):
define float @FastSin(float %0) {
%2 = tail call float @sin(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ ObjectSize0(char *);
void test13() {
  char c[10];
  unsigned i = 0;
  char *p = c;
  ObjectSize0(p);
  ObjectSize0(p + ++i);
  ObjectSize0(p + i++);
}


x86 assembly (clang, -O0):
<test13>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x10(%rbp)
lea    -0xa(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <ObjectSize0@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    %eax,%eax
add    %rax,%rdi
call   1030 <ObjectSize0@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x10(%rbp)
mov    %eax,%eax
add    %rax,%rdi
call   1030 <ObjectSize0@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test13>:
push   %rbx
sub    $0x10,%rsp
lea    0x6(%rsp),%rdi
call   1030 <ObjectSize0@plt>
lea    0x7(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <ObjectSize0@plt>
mov    %rbx,%rdi
call   1030 <ObjectSize0@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @test13() {
%1 = alloca [10 x i8]
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %2
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @ObjectSize0(i8* %5)
%7 = load i8*, i8** %3
%8 = load i32, i32* %2
%9 = add i32 %8, 1
store i32 %9, i32* %2
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %7, i64 %10
%12 = call i32 @ObjectSize0(i8* %11)
%13 = load i8*, i8** %3
%14 = load i32, i32* %2
%15 = add i32 %14, 1
store i32 %15, i32* %2
%16 = zext i32 %14 to i64
%17 = getelementptr inbounds i8, i8* %13, i64 %16
%18 = call i32 @ObjectSize0(i8* %17)
ret void
}

LLVM IR (-O2):
define void @test13() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @ObjectSize0(i8* %2)
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 1
%5 = call i32 @ObjectSize0(i8* %4)
%6 = call i32 @ObjectSize0(i8* %4)
ret void
}
/* Variables and functions */
char *k_strstr(char const *, char const *);
char *k_utf8chr(const char *s, const char *utf8ch) {
  return k_strstr(s, utf8ch);
}


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

x86 assembly (clang, -O2):
<k_utf8chr>:
jmp    1030 <k_strstr@plt>

LLVM IR (-O0):
define i8* @k_utf8chr(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 = load i8*, i8** %4
%7 = call i8* @k_strstr(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @k_utf8chr(i8* %0, i8* %1) {
%3 = tail call i8* @k_strstr(i8* %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ bar();
void baz(void) {
#pragma omp target
  bar();
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <bar@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @baz() {
%1 = call i32 (...) @bar()
ret void
}

LLVM IR (-O2):
define void @baz() {
%1 = tail call i32 (...) @bar()
ret void
}
/* Type definitions */
struct tagStorm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tagStormWriteAsFlatTabOrCsv(struct tagStorm *, char *,
                                               char *, int, int, int, char *,
                                               int /*<<< orphan*/, int);
void tagStormWriteAsFlatCsv(struct tagStorm *tagStorm, char *fileName,
                            char *idTag, int withParent, int maxDepth,
                            int leavesOnly, char *nullVal) {
  tagStormWriteAsFlatTabOrCsv(tagStorm, fileName, idTag, withParent, maxDepth,
                              leavesOnly, nullVal, 0, 1);
}


x86 assembly (clang, -O0):
<tagStormWriteAsFlatCsv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0x24(%rbp),%r9d
mov    0x10(%rbp),%rax
xor    %r10d,%r10d
mov    %rax,(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x1,0x10(%rsp)
call   1030 <tagStormWriteAsFlatTabOrCsv@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tagStormWriteAsFlatCsv>:
push   %rax
sub    $0x8,%rsp
push   $0x1
push   $0x0
push   0x28(%rsp)
call   1030 <tagStormWriteAsFlatTabOrCsv@plt>
add    $0x20,%rsp
pop    %rax
ret

LLVM IR (-O0):
%struct.tagStorm = type { i32 }
define void @tagStormWriteAsFlatCsv(%struct.tagStorm* %0, i8* %1, i8* %2, i32 %3, i32 %4, i32 %5, i8* %6) {
%8 = alloca %struct.tagStorm*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i8*
store %struct.tagStorm* %0, %struct.tagStorm** %8
store i8* %1, i8** %9
store i8* %2, i8** %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i8* %6, i8** %14
%15 = load %struct.tagStorm*, %struct.tagStorm** %8
%16 = load i8*, i8** %9
%17 = load i8*, i8** %10
%18 = load i32, i32* %11
%19 = load i32, i32* %12
%20 = load i32, i32* %13
%21 = load i8*, i8** %14
%22 = call i32 @tagStormWriteAsFlatTabOrCsv(%struct.tagStorm* %15, i8* %16, i8* %17, i32 %18, i32 %19, i32 %20, i8* %21, i32 0, i32 1)
ret void
}

LLVM IR (-O2):
%struct.tagStorm = type { i32 }
define void @tagStormWriteAsFlatCsv(%struct.tagStorm* %0, i8* %1, i8* %2, i32 %3, i32 %4, i32 %5, i8* %6) {
%8 = tail call i32 @tagStormWriteAsFlatTabOrCsv(%struct.tagStorm* %0, i8* %1, i8* %2, i32 %3, i32 %4, i32 %5, i8* %6, i32 0, i32 1)
ret void
}
extern void free_argv(char *argv[]) {
  int argc = argv_len(argv);
  for (int i = 0; i < argc; i++) {
    free(argv[i]);
  }
  free(argv);
}


x86 assembly (clang, -O0):
<free_argv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <argv_len@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116c <free_argv+0x4c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1141 <free_argv+0x21>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_argv>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <argv_len@plt>
test   %eax,%eax
jle    1152 <free_argv+0x32>
mov    %eax,%r15d
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <free_argv+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_argv(i8** %0) {
%2 = tail call i32 (i8**, ...) bitcast (i32 (...)* @argv_len to i32 (i8**, ...)*)(i8** %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %8
6: ; preds = %8, %1
%7 = bitcast i8** %0 to i8*
tail call void @free(i8* %7)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %12, %8 ]
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
tail call void @free(i8* %11)
%12 = add nuw nsw i64 %9, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %8
}
void dummy_gcode_start(void *user) {}


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

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

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

LLVM IR (-O2):
define void @dummy_gcode_start(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int getMinSteps(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number_to_one = 0;
  int steps_required = 0;
  printf("Enter the Number you feel to be analyzed\n");
  scanf("%d", &number_to_one);
  steps_required = getMinSteps(number_to_one);
  printf("The Minimum number of steps required are %d", steps_required);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1050 <getMinSteps@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
lea    0xecd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1060 <getMinSteps@plt>
lea    0xe8a(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"Enter the Number you feel to be analyzed\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [44 x i8] c"The Minimum number of steps required are %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = call i32 @getMinSteps(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [44 x i8] c"The Minimum number of steps required are %d\00"
@str = [41 x i8] c"Enter the Number you feel to be analyzed\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @getMinSteps(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
scalar_t__ runTest(char *);
int /*<<< orphan*/ system(char *);
int main(int argc, char **argv) {
  if (argc == 2) {
    system("rm -rf gvki-0");
    while (runTest(argv[1]) == 0)
      ;
  } else {
    printf("Usage: ./automate <binary path>\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    117d <main+0x4d>
lea    0xea9(%rip),%rdi
call   1030 <system@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <runTest@plt>
cmp    $0x0,%rax
jne    1178 <main+0x48>
jmp    115c <main+0x2c>
jmp    1189 <main+0x59>
lea    0xe8a(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
jne    1160 <main+0x30>
mov    %rsi,%rbx
lea    0xec0(%rip),%rdi
call   1040 <system@plt>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x8(%rbx),%rdi
call   1050 <runTest@plt>
test   %rax,%rax
je     1150 <main+0x20>
jmp    116c <main+0x3c>
lea    0xea7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"rm -rf gvki-0\00"
@.str.1 = [33 x i8] c"Usage: ./automate <binary path>\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %18
8: ; preds = %2
%9 = call i32 @system(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %16, %8
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i64 @runTest(i8* %13)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %10
br label %10
17: ; preds = %10
br label %20
18: ; preds = %2
%19 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
br label %20
20: ; preds = %18, %17
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"rm -rf gvki-0\00"
@str = [32 x i8] c"Usage: ./automate <binary path>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = tail call i32 @system(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds i8*, i8** %1, i64 1
br label %7
7: ; preds = %7, %4
%8 = load i8*, i8** %6
%9 = tail call i64 @runTest(i8* %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %7, label %13
11: ; preds = %2
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
br label %13
13: ; preds = %7, %11
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ d2xy(int, long, int *, int *);
void row_d2xy(int n, long d, int *x, int *y) {
  long nsq = (long)n * (long)n;
  long h = d % nsq;
  int block = d / nsq;
  d2xy(n, h, y, x);
  *y += block * n;
}


x86 assembly (clang, -O0):
<row_d2xy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movslq -0x4(%rbp),%rax
movslq -0x4(%rbp),%rcx
imul   %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
cqto
idivq  -0x28(%rbp)
mov    %rdx,-0x30(%rbp)
mov    -0x10(%rbp),%rax
cqto
idivq  -0x28(%rbp)
mov    %eax,-0x34(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x30(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <d2xy@plt>
mov    -0x34(%rbp),%ecx
imul   -0x4(%rbp),%ecx
mov    -0x20(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<row_d2xy>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%rcx
mov    %rsi,%rax
mov    %edi,%ebp
movslq %edi,%rsi
imul   %rsi,%rsi
mov    %rax,%rdx
or     %rsi,%rdx
shr    $0x20,%rdx
je     113c <row_d2xy+0x2c>
cqto
idiv   %rsi
mov    %rax,%rbx
jmp    1142 <row_d2xy+0x32>
xor    %edx,%edx
div    %esi
mov    %eax,%ebx
mov    %ebp,%edi
mov    %rdx,%rsi
mov    %r14,%rdx
call   1030 <d2xy@plt>
imul   %ebp,%ebx
add    %ebx,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @row_d2xy(i32 %0, i64 %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i64
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i64
%10 = alloca i64
%11 = alloca i32
store i32 %0, i32* %5
store i64 %1, i64* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = mul nsw i64 %13, %15
store i64 %16, i64* %9
%17 = load i64, i64* %6
%18 = load i64, i64* %9
%19 = srem i64 %17, %18
store i64 %19, i64* %10
%20 = load i64, i64* %6
%21 = load i64, i64* %9
%22 = sdiv i64 %20, %21
%23 = trunc i64 %22 to i32
store i32 %23, i32* %11
%24 = load i32, i32* %5
%25 = load i64, i64* %10
%26 = load i32*, i32** %8
%27 = load i32*, i32** %7
%28 = call i32 @d2xy(i32 %24, i64 %25, i32* %26, i32* %27)
%29 = load i32, i32* %11
%30 = load i32, i32* %5
%31 = mul nsw i32 %29, %30
%32 = load i32*, i32** %8
%33 = load i32, i32* %32
%34 = add nsw i32 %33, %31
store i32 %34, i32* %32
ret void
}

LLVM IR (-O2):
define void @row_d2xy(i32 %0, i64 %1, i32* %2, i32* %3) {
%5 = sext i32 %0 to i64
%6 = mul nsw i64 %5, %5
%7 = srem i64 %1, %6
%8 = sdiv i64 %1, %6
%9 = trunc i64 %8 to i32
%10 = tail call i32 @d2xy(i32 %0, i64 %7, i32* %3, i32* %2)
%11 = mul nsw i32 %9, %0
%12 = load i32, i32* %3
%13 = add nsw i32 %12, %11
store i32 %13, i32* %3
ret void
}
/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ printf(char *, long);
void sighup(int signo) {
  printf("SIGHUP received; pid = %ld\n", (long)getpid());
}


x86 assembly (clang, -O0):
<sighup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,%rsi
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sighup>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"SIGHUP received; pid = %ld\0A\00"
define void @sighup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 (...) @getpid()
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %3)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"SIGHUP received; pid = %ld\0A\00"
define void @sighup(i32 %0) {
%2 = tail call i64 (...) @getpid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %2)
ret void
}
/* Variables and functions */
double SE_intercept(double *, double *, int, double, double);
double qt(double, int);
double CI_intercept(double *x, double *y, int n, double slope, double intercept,
                    double prob) {
  return SE_intercept(x, y, n, slope, intercept) * qt(prob, n - 2);
}


x86 assembly (clang, -O0):
<CI_intercept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
movsd  %xmm2,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
call   1030 <SE_intercept@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
mov    -0x14(%rbp),%edi
sub    $0x2,%edi
call   1040 <qt@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CI_intercept>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm2,0x8(%rsp)
mov    %edx,%ebx
call   1030 <SE_intercept@plt>
movsd  %xmm0,(%rsp)
add    $0xfffffffe,%ebx
movsd  0x8(%rsp),%xmm0
mov    %ebx,%edi
call   1040 <qt@plt>
mulsd  (%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @CI_intercept(double* %0, double* %1, i32 %2, double %3, double %4, double %5) {
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double* %0, double** %7
store double* %1, double** %8
store i32 %2, i32* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double*, double** %7
%14 = load double*, double** %8
%15 = load i32, i32* %9
%16 = load double, double* %10
%17 = load double, double* %11
%18 = call double @SE_intercept(double* %13, double* %14, i32 %15, double %16, double %17)
%19 = load double, double* %12
%20 = load i32, i32* %9
%21 = sub nsw i32 %20, 2
%22 = call double @qt(double %19, i32 %21)
%23 = fmul double %18, %22
ret double %23
}

LLVM IR (-O2):
define double @CI_intercept(double* %0, double* %1, i32 %2, double %3, double %4, double %5) {
%7 = tail call double @SE_intercept(double* %0, double* %1, i32 %2, double %3, double %4)
%8 = add nsw i32 %2, -2
%9 = tail call double @qt(double %5, i32 %8)
%10 = fmul double %7, %9
ret double %10
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int getgroups(int size, gid_t list[]) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<getgroups>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebd(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getgroups>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @getgroups(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @getgroups(i32 %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}