xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *str_alloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
void swap_buffers(char *fst, char *snd) {
  char *tmp;
  if (fst == snd)
    return;
  tmp = str_alloc(strlen(fst) + 1);
  strcpy(tmp, fst);
  strcpy(fst, snd);
  strcpy(snd, tmp);
  free(tmp);
}


x86 assembly (clang, -O0):
<swap_buffers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1163 <swap_buffers+0x23>
jmp    11ac <swap_buffers+0x6c>
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1060 <str_alloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_buffers>:
cmp    %rsi,%rdi
je     118f <swap_buffers+0x4f>
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1050 <strlen@plt>
lea    0x1(%rax),%rdi
call   1060 <str_alloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <strcpy@plt>
mov    %r15,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @swap_buffers(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = icmp eq i8* %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
br label %26
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = call i64 @strlen(i8* %11)
%13 = add nsw i64 %12, 1
%14 = call i8* @str_alloc(i64 %13)
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = load i8*, i8** %3
%17 = call i32 @strcpy(i8* %15, i8* %16)
%18 = load i8*, i8** %3
%19 = load i8*, i8** %4
%20 = call i32 @strcpy(i8* %18, i8* %19)
%21 = load i8*, i8** %4
%22 = load i8*, i8** %5
%23 = call i32 @strcpy(i8* %21, i8* %22)
%24 = load i8*, i8** %5
%25 = call i32 @free(i8* %24)
br label %26
26: ; preds = %10, %9
ret void
}

LLVM IR (-O2):
define void @swap_buffers(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, %1
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%6 = add nsw i64 %5, 1
%7 = tail call i8* @str_alloc(i64 %6)
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
%9 = tail call i32 @strcpy(i8* %0, i8* %1)
%10 = tail call i32 @strcpy(i8* %1, i8* %7)
%11 = tail call i32 @free(i8* %7)
br label %12
12: ; preds = %2, %4
ret void
}
int verif_delim(char caract, char *delim) {
  int i;
  i = 0;
  while (delim[i] != '\0') {
    if (caract == delim[i])
      return (-1);
    ++i;
  }
  return (0);
}


x86 assembly (clang, -O0):
<verif_delim>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115c <verif_delim+0x5c>
movsbl -0x5(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    114e <verif_delim+0x4e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <verif_delim+0x63>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <verif_delim+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<verif_delim>:
mov    (%rsi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1120 <verif_delim+0x20>
add    $0x1,%rsi
nopl   0x0(%rax)
cmp    %dil,%cl
je     1121 <verif_delim+0x21>
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <verif_delim+0x10>
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @verif_delim(i8 signext %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i32
store i8 %0, i8* %4
store i8* %1, i8** %5
store i32 0, i32* %6
br label %7
7: ; preds = %26, %2
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %29
15: ; preds = %7
%16 = load i8, i8* %4
%17 = sext i8 %16 to i32
%18 = load i8*, i8** %5
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %17, %23
br i1 %24, label %25, label %26
25: ; preds = %15
store i32 -1, i32* %3
br label %30
26: ; preds = %15
%27 = load i32, i32* %6
%28 = add nsw i32 %27, 1
store i32 %28, i32* %6
br label %7
29: ; preds = %7
store i32 0, i32* %3
br label %30
30: ; preds = %29, %25
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
define i32 @verif_delim(i8 signext %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %9
5: ; preds = %9
%6 = getelementptr inbounds i8, i8* %1, i64 %13
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %2, %5
%10 = phi i64 [ %13, %5 ], [ 0, %2 ]
%11 = phi i8 [ %7, %5 ], [ %3, %2 ]
%12 = icmp eq i8 %11, %0
%13 = add nuw i64 %10, 1
br i1 %12, label %14, label %5
14: ; preds = %9, %5, %2
%15 = phi i32 [ 0, %2 ], [ 0, %5 ], [ -1, %9 ]
ret i32 %15
}
void assignment(int x) {
  int a = x > 4 || x < 10;
  int b = x < 2 && x > 5;
  int c = x != 1 || x != 3;
  int d = x == 1 && x == 2;
  int e = x < 1 || x != 0;
}


x86 assembly (clang, -O0):
<assignment>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x4,-0x4(%rbp)
mov    %al,-0x19(%rbp)
jg     1120 <assignment+0x20>
cmpl   $0xa,-0x4(%rbp)
setl   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x2,-0x4(%rbp)
mov    %al,-0x1a(%rbp)
jge    1144 <assignment+0x44>
cmpl   $0x5,-0x4(%rbp)
setg   %al
mov    %al,-0x1a(%rbp)
mov    -0x1a(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0x1,-0x4(%rbp)
mov    %al,-0x1b(%rbp)
jne    1168 <assignment+0x68>
cmpl   $0x3,-0x4(%rbp)
setne  %al
mov    %al,-0x1b(%rbp)
mov    -0x1b(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0x4(%rbp)
mov    %al,-0x1c(%rbp)
jne    118c <assignment+0x8c>
cmpl   $0x2,-0x4(%rbp)
sete   %al
mov    %al,-0x1c(%rbp)
mov    -0x1c(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    $0x1,%al
cmpl   $0x1,-0x4(%rbp)
mov    %al,-0x1d(%rbp)
jl     11b0 <assignment+0xb0>
cmpl   $0x0,-0x4(%rbp)
setne  %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @assignment(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %2
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 4
br i1 %9, label %13, label %10
10: ; preds = %1
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 10
br label %13
13: ; preds = %10, %1
%14 = phi i1 [ true, %1 ], [ %12, %10 ]
%15 = zext i1 %14 to i32
store i32 %15, i32* %3
%16 = load i32, i32* %2
%17 = icmp slt i32 %16, 2
br i1 %17, label %18, label %21
18: ; preds = %13
%19 = load i32, i32* %2
%20 = icmp sgt i32 %19, 5
br label %21
21: ; preds = %18, %13
%22 = phi i1 [ false, %13 ], [ %20, %18 ]
%23 = zext i1 %22 to i32
store i32 %23, i32* %4
%24 = load i32, i32* %2
%25 = icmp ne i32 %24, 1
br i1 %25, label %29, label %26
26: ; preds = %21
%27 = load i32, i32* %2
%28 = icmp ne i32 %27, 3
br label %29
29: ; preds = %26, %21
%30 = phi i1 [ true, %21 ], [ %28, %26 ]
%31 = zext i1 %30 to i32
store i32 %31, i32* %5
%32 = load i32, i32* %2
%33 = icmp eq i32 %32, 1
br i1 %33, label %34, label %37
34: ; preds = %29
%35 = load i32, i32* %2
%36 = icmp eq i32 %35, 2
br label %37
37: ; preds = %34, %29
%38 = phi i1 [ false, %29 ], [ %36, %34 ]
%39 = zext i1 %38 to i32
store i32 %39, i32* %6
%40 = load i32, i32* %2
%41 = icmp slt i32 %40, 1
br i1 %41, label %45, label %42
42: ; preds = %37
%43 = load i32, i32* %2
%44 = icmp ne i32 %43, 0
br label %45
45: ; preds = %42, %37
%46 = phi i1 [ true, %37 ], [ %44, %42 ]
%47 = zext i1 %46 to i32
store i32 %47, i32* %7
ret void
}

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


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

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

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

LLVM IR (-O2):
define void @MainGraphics() {
ret void
}
/* Variables and functions */
double fabs(double);
void abs_d(double *source, double *target) { *target = fabs(*source); }


x86 assembly (clang, -O0):
<abs_d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movaps 0xee5(%rip),%xmm1
pand   %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_d>:
movsd  (%rdi),%xmm0
andps  0xef5(%rip),%xmm0
movlps %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @abs_d(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 = call double @llvm.fabs.f64(double %6)
%8 = load double*, double** %4
store double %7, double* %8
ret void
}

LLVM IR (-O2):
define void @abs_d(double* nocapture %0, double* nocapture writeonly %1) {
%3 = load double, double* %0
%4 = tail call double @llvm.fabs.f64(double %3)
store double %4, double* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ chomp(char *);
int /*<<< orphan*/ front_chomp(char *);
scalar_t__ strlen(char *);
int is_blank_line(char *s) {
  chomp(s);
  front_chomp(s);
  if (strlen(s) == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_blank_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <chomp@plt>
mov    -0x10(%rbp),%rdi
call   1030 <front_chomp@plt>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
jne    116d <is_blank_line+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1174 <is_blank_line+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_blank_line>:
push   %rbx
mov    %rdi,%rbx
call   1040 <chomp@plt>
mov    %rbx,%rdi
call   1030 <front_chomp@plt>
xor    %eax,%eax
cmpb   $0x0,(%rbx)
sete   %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_blank_line(i8* %0) {
%2 = tail call i32 @chomp(i8* %0)
%3 = tail call i32 @front_chomp(i8* %0)
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ arg_ulong3(unsigned long, unsigned long, unsigned long);
void arg_ulong2(unsigned long a, unsigned long b) { arg_ulong3(a, b, b + 1); }


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

x86 assembly (clang, -O2):
<arg_ulong2>:
lea    0x1(%rsi),%rdx
jmp    1030 <arg_ulong3@plt>

LLVM IR (-O0):
define void @arg_ulong2(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
%6 = load i64, i64* %4
%7 = load i64, i64* %4
%8 = add i64 %7, 1
%9 = call i32 @arg_ulong3(i64 %5, i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @arg_ulong2(i64 %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i32 @arg_ulong3(i64 %0, i64 %1, i64 %3)
ret void
}
int __attribute__((no)) t(int a) { return a + 1; }


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

x86 assembly (clang, -O2):
<t>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @t(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
double fmax(double, double);
double random_uniform();
double random_ramp(void) {
  double x1 = random_uniform();
  double x2 = random_uniform();
  double y = fmax(x1, x2);
  return y;
}


x86 assembly (clang, -O0):
<random_ramp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1030 <random_uniform@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <random_uniform@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm3
movsd  -0x10(%rbp),%xmm2
movaps %xmm2,%xmm4
movaps %xmm3,%xmm0
cmpunordsd %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm4,%xmm1
maxsd  %xmm3,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_ramp>:
push   %rax
xor    %eax,%eax
call   1030 <random_uniform@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <random_uniform@plt>
movsd  (%rsp),%xmm3
movapd %xmm3,%xmm1
cmpunordsd %xmm3,%xmm1
movapd %xmm1,%xmm2
andpd  %xmm0,%xmm2
maxsd  %xmm3,%xmm0
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @random_ramp() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = call double (...) @random_uniform()
store double %4, double* %1
%5 = call double (...) @random_uniform()
store double %5, double* %2
%6 = load double, double* %1
%7 = load double, double* %2
%8 = call double @llvm.maxnum.f64(double %6, double %7)
store double %8, double* %3
%9 = load double, double* %3
ret double %9
}

LLVM IR (-O2):
define double @random_ramp() {
%1 = tail call double (...) @random_uniform()
%2 = tail call double (...) @random_uniform()
%3 = tail call double @llvm.maxnum.f64(double %1, double %2)
ret double %3
}
adr0regx1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if ((*((int *)10000000)) <= (p1[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adr0regx1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    $0x989680,%eax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
movslq -0x14(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jg     113c <adr0regx1+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1143 <adr0regx1+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0regx1>:
mov    0x989680,%edx
movslq %ecx,%rcx
xor    %eax,%eax
cmp    (%r9,%rcx,4),%edx
setle  %al
ret

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

LLVM IR (-O2):
define i32 @adr0regx1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture %5) {
%7 = load i32, i32* inttoptr (i64 10000000 to i32*)
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
%11 = icmp sle i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage:  jfs_ls <volumename>\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"Usage: jfs_ls <volumename>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"Usage: jfs_ls <volumename>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void seq_printf(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<seq_printf>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<seq_printf>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.seq_printf = [11 x i8] c"seq_printf\00"
define void @seq_printf() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.seq_printf, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.seq_printf = [11 x i8] c"seq_printf\00"
define void @seq_printf() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.seq_printf, i64 0, i64 0))
ret void
}
int f(int i) {
  switch (i) {
  case -1:
    __attribute__((fallthrough));
  default:
    __attribute__((fallthrough));
  case 1:
    return 6;
  case 2 ... 4:
    __attribute__((fallthrough));
  case 5:
    return 7;
  }
  return 0;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x6,%eax
ja     1135 <f+0x35>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    1135 <f+0x35>
jmp    113a <f+0x3a>
movl   $0x6,-0x4(%rbp)
jmp    1152 <f+0x52>
jmp    114b <f+0x4b>
movl   $0x7,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
add    $0xfffffffe,%edi
xor    %eax,%eax
cmp    $0x4,%edi
setb   %al
or     $0x6,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 -1, label %5
i32 1, label %7
i32 2, label %8
i32 3, label %8
i32 4, label %8
i32 5, label %9
]
5: ; preds = %1
br label %6
6: ; preds = %1, %5
br label %7
7: ; preds = %1, %6
store i32 6, i32* %2
br label %10
8: ; preds = %1, %1, %1
br label %9
9: ; preds = %1, %8
store i32 7, i32* %2
br label %10
10: ; preds = %9, %7
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = add i32 %0, -2
%3 = icmp ult i32 %2, 4
%4 = select i1 %3, i32 7, i32 6
ret i32 %4
}
double T(double P, double R, double Rho) { return P / (R * Rho); }


x86 assembly (clang, -O0):
<T>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<T>:
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @T(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fmul double %8, %9
%11 = fdiv double %7, %10
ret double %11
}

LLVM IR (-O2):
define double @T(double %0, double %1, double %2) {
%4 = fmul double %1, %2
%5 = fdiv double %0, %4
ret double %5
}
/* Type definitions */
struct MIDIMessageData {
  int dummy;
};

/* Variables and functions */
int _size_two_bytes(struct MIDIMessageData *data, size_t *size) {
  if (data == NULL || size == NULL)
    return 1;
  *size = 2;
  return 0;
}


x86 assembly (clang, -O0):
<_size_two_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1122 <_size_two_bytes+0x22>
cmpq   $0x0,-0x18(%rbp)
jne    112e <_size_two_bytes+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1140 <_size_two_bytes+0x40>
mov    -0x18(%rbp),%rax
movq   $0x2,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_size_two_bytes>:
mov    $0x1,%eax
test   %rdi,%rdi
je     1118 <_size_two_bytes+0x18>
test   %rsi,%rsi
je     1118 <_size_two_bytes+0x18>
movq   $0x2,(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.MIDIMessageData = type { i32 }
define i32 @_size_two_bytes(%struct.MIDIMessageData* %0, i64* %1) {
%3 = alloca i32
%4 = alloca %struct.MIDIMessageData*
%5 = alloca i64*
store %struct.MIDIMessageData* %0, %struct.MIDIMessageData** %4
store i64* %1, i64** %5
%6 = load %struct.MIDIMessageData*, %struct.MIDIMessageData** %4
%7 = icmp eq %struct.MIDIMessageData* %6, null
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i64*, i64** %5
%10 = icmp eq i64* %9, null
br i1 %10, label %11, label %12
11: ; preds = %8, %2
store i32 1, i32* %3
br label %14
12: ; preds = %8
%13 = load i64*, i64** %5
store i64 2, i64* %13
store i32 0, i32* %3
br label %14
14: ; preds = %12, %11
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
%struct.MIDIMessageData = type { i32 }
define i32 @_size_two_bytes(%struct.MIDIMessageData* readnone %0, i64* writeonly %1) {
%3 = icmp eq %struct.MIDIMessageData* %0, null
%4 = icmp eq i64* %1, null
%5 = or i1 %3, %4
br i1 %5, label %7, label %6
6: ; preds = %2
store i64 2, i64* %1
br label %7
7: ; preds = %2, %6
%8 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %8
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ serial;
};
struct TYPE_4__ {
  TYPE_1__ xany;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xany_serial(void *_p) {
  return (unsigned long)((XEvent *)_p)->xany.serial;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XEvent_xany_serial(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  char word[] = {'H', 'e', 'l', 'l', 'o', '!'};
  int i;
  for (i = 0; i < 6; ++i) {
    printf("%c", word[i]);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xed5(%rip),%ax
mov    %ax,-0x6(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x6,-0x10(%rbp)
jge    1169 <main+0x59>
movslq -0x10(%rbp),%rax
movsbl -0xa(%rbp,%rax,1),%esi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113a <main+0x2a>
lea    0xe99(%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
mov    $0x48,%edi
call   1030 <putchar@plt>
mov    $0x65,%edi
call   1030 <putchar@plt>
mov    $0x6c,%edi
call   1030 <putchar@plt>
mov    $0x6c,%edi
call   1030 <putchar@plt>
mov    $0x6f,%edi
call   1030 <putchar@plt>
mov    $0x21,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i32 72)
%2 = tail call i32 @putchar(i32 101)
%3 = tail call i32 @putchar(i32 108)
%4 = tail call i32 @putchar(i32 108)
%5 = tail call i32 @putchar(i32 111)
%6 = tail call i32 @putchar(i32 33)
%7 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void sig_thr_int(int signo) { printf("thread caught %d\n", signo); }


x86 assembly (clang, -O0):
<sig_thr_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_thr_int>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [18 x i8] c"thread caught %d\0A\00"
define void @sig_thr_int(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int x24_process_synack(struct mypacket *packet) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.mypacket = type opaque
define i32 @x24_process_synack(%struct.mypacket* nocapture readnone %0) {
ret i32 0
}
void cli_val_arm_attr_deinit(struct cli_val_arm_attr *a) {}


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

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

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

LLVM IR (-O2):
%struct.cli_val_arm_attr = type opaque
define void @cli_val_arm_attr_deinit(%struct.cli_val_arm_attr* nocapture %0) {
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *util_config_strip_quotes(char *string) {
  int length = (int)strlen(string);
  char *newString = malloc(length);
  strcpy(newString, string);
  char *strPtr = newString;
  strPtr += length - 1;
  *strPtr = 0x00;
  return newString + 1;
}


x86 assembly (clang, -O0):
<util_config_strip_quotes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_config_strip_quotes>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %rax,%r15
mov    %r15d,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
add    $0xffffffff,%r15d
movslq %r15d,%rax
movb   $0x0,(%rbx,%rax,1)
add    $0x1,%rbx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @util_config_strip_quotes(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i64 @strlen(i8* %6)
%8 = trunc i64 %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i8* @malloc(i32 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i8*, i8** %2
%13 = call i32 @strcpy(i8* %11, i8* %12)
%14 = load i8*, i8** %4
store i8* %14, i8** %5
%15 = load i32, i32* %3
%16 = sub nsw i32 %15, 1
%17 = load i8*, i8** %5
%18 = sext i32 %16 to i64
%19 = getelementptr inbounds i8, i8* %17, i64 %18
store i8* %19, i8** %5
%20 = load i8*, i8** %5
store i8 0, i8* %20
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i64 1
ret i8* %22
}

LLVM IR (-O2):
define i8* @util_config_strip_quotes(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
%6 = shl i64 %2, 32
%7 = add i64 %6, -4294967296
%8 = ashr exact i64 %7, 32
%9 = getelementptr inbounds i8, i8* %4, i64 %8
store i8 0, i8* %9
%10 = getelementptr inbounds i8, i8* %4, i64 1
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ emitln(char *, int);
void loadConst(int n) { emitln("mov\t$%d,%%eax", n); }


x86 assembly (clang, -O0):
<loadConst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <emitln@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loadConst>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <emitln@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"mov\09$%d,%%eax\00"
define void @loadConst(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @emitln(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"mov\09$%d,%%eax\00"
define void @loadConst(i32 %0) {
%2 = tail call i32 @emitln(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printResult(int *digits) {
  int i = 21 - 1;
  while (i >= 0) {
    if (*(digits + i) != 0)
      printf("%d", *(digits + i));
    i--;
  }
}


x86 assembly (clang, -O0):
<printResult>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1164 <printResult+0x54>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1156 <printResult+0x46>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <printResult+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printResult>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
mov    $0x14,%ebx
lea    0xedc(%rip),%r14
jmp    1136 <printResult+0x26>
cs nopw 0x0(%rax,%rax,1)
add    $0xffffffffffffffff,%rbx
jae    1148 <printResult+0x38>
mov    (%r15,%rbx,4),%esi
test   %esi,%esi
je     1130 <printResult+0x20>
mov    %r14,%rdi
call   1030 <printf@plt>
jmp    1130 <printResult+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @printResult(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 20, i32* %3
br label %4
4: ; preds = %21, %1
%5 = load i32, i32* %3
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %24
7: ; preds = %4
%8 = load i32*, i32** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %21
14: ; preds = %7
%15 = load i32*, i32** %2
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %14, %7
%22 = load i32, i32* %3
%23 = add nsw i32 %22, -1
store i32 %23, i32* %3
br label %4
24: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @printResult(i32* nocapture %0) {
br label %2
2: ; preds = %1, %9
%3 = phi i64 [ 20, %1 ], [ %10, %9 ]
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %9
9: ; preds = %7, %2
%10 = add nsw i64 %3, -1
%11 = icmp eq i64 %3, 0
br i1 %11, label %12, label %2
12: ; preds = %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *);
int strlen(char *);
scalar_t__ write(int, char *, int);
int message(int client, char *message) {
  int size = strlen(message);
  printf(message);
  if (write(client, message, size) < 0) {
    perror("Failed to write to the client\n");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
cmp    $0x0,%rax
jge    1195 <message+0x55>
lea    0xe7c(%rip),%rdi
call   1060 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    119c <message+0x5c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<message>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%r14d
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <printf@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1030 <write@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
js     1178 <message+0x38>
pop    %rbx
pop    %r14
pop    %rbp
ret
lea    0xe81(%rip),%rdi
call   1060 <perror@plt>
mov    $0xffffffff,%eax
jmp    1173 <message+0x33>

LLVM IR (-O0):
@.str = [31 x i8] c"Failed to write to the client\0A\00"
define i32 @message(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
%7 = load i8*, i8** %5
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %6
%9 = load i8*, i8** %5
%10 = call i32 @printf(i8* %9)
%11 = load i32, i32* %4
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = call i64 @write(i32 %11, i8* %12, i32 %13)
%15 = icmp slt i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = call i32 @perror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %19
18: ; preds = %2
store i32 0, i32* %3
br label %19
19: ; preds = %18, %16
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@.str = [31 x i8] c"Failed to write to the client\0A\00"
define i32 @message(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @printf(i8* dereferenceable(1) %1)
%5 = tail call i64 @write(i32 %0, i8* %1, i32 %3)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @perror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ -1, %7 ], [ 0, %2 ]
ret i32 %10
}
/* Variables and functions */
int rand();
void _randhk(char hk[4]) {
  int i;
  for (i = 0; i < 4; ++i) {
    hk[i] = rand() % 64 + 192;
  }
}


x86 assembly (clang, -O0):
<_randhk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    115b <_randhk+0x4b>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x40,%ecx
cltd
idiv   %ecx
add    $0xc0,%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <_randhk+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_randhk>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <rand@plt>
lea    0x3f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xc0,%ecx
sub    %ecx,%eax
add    $0xc0,%al
mov    %al,(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
lea    0x3f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xc0,%ecx
sub    %ecx,%eax
add    $0xc0,%al
mov    %al,0x1(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
lea    0x3f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xc0,%ecx
sub    %ecx,%eax
add    $0xc0,%al
mov    %al,0x2(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
lea    0x3f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xc0,%ecx
sub    %ecx,%eax
add    $0xc0,%al
mov    %al,0x3(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @_randhk(i8* nocapture writeonly %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, 64
%4 = trunc i32 %3 to i8
%5 = add nsw i8 %4, -64
store i8 %5, i8* %0
%6 = tail call i32 (...) @rand()
%7 = srem i32 %6, 64
%8 = trunc i32 %7 to i8
%9 = add nsw i8 %8, -64
%10 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %9, i8* %10
%11 = tail call i32 (...) @rand()
%12 = srem i32 %11, 64
%13 = trunc i32 %12 to i8
%14 = add nsw i8 %13, -64
%15 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %14, i8* %15
%16 = tail call i32 (...) @rand()
%17 = srem i32 %16, 64
%18 = trunc i32 %17 to i8
%19 = add nsw i8 %18, -64
%20 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %19, i8* %20
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char *, int /*<<< orphan*/);
int /*<<< orphan*/ test(void *, int);
void test_print(void *buf, int n) { print("%d\n", test(buf, n)); }


x86 assembly (clang, -O0):
<test_print>:
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   1040 <test@plt>
mov    %eax,%esi
lea    0xebc(%rip),%rdi
call   1030 <print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_print>:
push   %rax
call   1040 <test@plt>
lea    0xed3(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <print@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @test_print(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 @test(i8* %5, i32 %6)
%8 = call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @test_print(i8* %0, i32 %1) {
%3 = tail call i32 @test(i8* %0, i32 %1)
%4 = tail call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int64_t sumNumbers(int64_t *x) {
  int64_t k = 0;
  for (; *x; k += *x++)
    ;
  return k;
}


x86 assembly (clang, -O0):
<sumNumbers>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1142 <sumNumbers+0x42>
jmp    1123 <sumNumbers+0x23>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <sumNumbers+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumNumbers>:
mov    (%rdi),%rcx
test   %rcx,%rcx
je     1120 <sumNumbers+0x20>
add    $0x8,%rdi
xor    %eax,%eax
xchg   %ax,%ax
add    %rcx,%rax
mov    (%rdi),%rcx
add    $0x8,%rdi
test   %rcx,%rcx
jne    1110 <sumNumbers+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @sumNumbers(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = icmp eq i64 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %10, %4 ], [ %2, %1 ]
%6 = phi i64 [ %9, %4 ], [ 0, %1 ]
%7 = phi i64* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i64, i64* %7, i64 1
%9 = add nsw i64 %5, %6
%10 = load i64, i64* %8
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = phi i64 [ 0, %1 ], [ %9, %4 ]
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ empty_function();
int foo();
int main() {
  empty_function();
  return foo();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <empty_function@plt>
mov    $0x0,%al
call   1040 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @empty_function()
%3 = call i32 (...) @foo()
ret i32 %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @empty_function()
%2 = tail call i32 (...) @foo()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int distanceToBeTaken;
  scanf("%d", &distanceToBeTaken);
  printf("%d minutos\n", distanceToBeTaken * 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
shl    $0x1,%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
add    %esi,%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [12 x i8] c"%d minutos\0A\00"
define i32 @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 = shl nsw i32 %4, 1
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int ERR;
int getch();
int /*<<< orphan*/ ungetch(int);
int kbhit(void) {
  int ch = getch();
  if (ch != ERR) {
    ungetch(ch);
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<kbhit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getch@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2eac(%rip),%rcx
cmp    (%rcx),%eax
je     1158 <kbhit+0x38>
mov    -0x8(%rbp),%edi
call   1030 <ungetch@plt>
movl   $0x1,-0x4(%rbp)
jmp    115f <kbhit+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kbhit>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <getch@plt>
mov    0x2eb7(%rip),%rcx
cmp    (%rcx),%eax
je     1141 <kbhit+0x21>
mov    %eax,%edi
call   1030 <ungetch@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@ERR = global i32 0
define i32 @kbhit() {
%1 = tail call i32 (...) @getch()
%2 = load i32, i32* @ERR
%3 = icmp eq i32 %1, %2
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @ungetch(i32 %1)
br label %6
6: ; preds = %0, %4
%7 = phi i32 [ 1, %4 ], [ 0, %0 ]
ret i32 %7
}
unsigned i2target(int ms_bit_nr, unsigned bit) {
  if (ms_bit_nr)
    return ms_bit_nr - bit;
  else
    return bit;
}


x86 assembly (clang, -O0):
<i2target>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1122 <i2target+0x22>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1128 <i2target+0x28>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2target>:
mov    %edi,%eax
sub    %esi,%eax
test   %edi,%edi
cmove  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @i2target(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = sub i32 %0, %1
%5 = select i1 %3, i32 %1, i32 %4
ret i32 %5
}