xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *dsc_malloc(size_t size) {
  void *blk = malloc(size);
  if (blk == 0) {
    fprintf(stderr, "Unable to allocate object; giving up.\n");
    exit(255);
  }
  return blk;
}


x86 assembly (clang, -O0):
<dsc_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <dsc_malloc+0x43>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xff,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dsc_malloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <dsc_malloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"Unable to allocate object; giving up.\0A\00"
define i8* @dsc_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 255)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"Unable to allocate object; giving up.\0A\00"
define noalias i8* @dsc_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 255)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Variables and functions */
double M_PI;
double sin(double);
double Q_w_gradp(double L, double a_pz, double p_z, double z) {
  return -M_PI * a_pz * p_z * sin(M_PI * a_pz * z / L) / L;
}


x86 assembly (clang, -O0):
<Q_w_gradp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    0x2eb5(%rip),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    0x2e84(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
divsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_w_gradp>:
sub    $0x28,%rsp
movapd %xmm0,%xmm4
movsd  %xmm0,0x8(%rsp)
mov    0x2ec3(%rip),%rax
movsd  (%rax),%xmm0
movapd 0xecf(%rip),%xmm5
xorpd  %xmm0,%xmm5
mulsd  %xmm1,%xmm5
mulsd  %xmm2,%xmm5
movapd %xmm5,0x10(%rsp)
mulsd  %xmm1,%xmm0
mulsd  %xmm3,%xmm0
divsd  %xmm4,%xmm0
call   1030 <sin@plt>
mulsd  0x10(%rsp),%xmm0
divsd  0x8(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @Q_w_gradp(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* @M_PI
%10 = fneg double %9
%11 = load double, double* %6
%12 = fmul double %10, %11
%13 = load double, double* %7
%14 = fmul double %12, %13
%15 = load double, double* @M_PI
%16 = load double, double* %6
%17 = fmul double %15, %16
%18 = load double, double* %8
%19 = fmul double %17, %18
%20 = load double, double* %5
%21 = fdiv double %19, %20
%22 = call double @sin(double %21)
%23 = fmul double %14, %22
%24 = load double, double* %5
%25 = fdiv double %23, %24
ret double %25
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @Q_w_gradp(double %0, double %1, double %2, double %3) {
%5 = load double, double* @M_PI
%6 = fneg double %5
%7 = fmul double %6, %1
%8 = fmul double %7, %2
%9 = fmul double %5, %1
%10 = fmul double %9, %3
%11 = fdiv double %10, %0
%12 = tail call double @sin(double %11)
%13 = fmul double %12, %8
%14 = fdiv double %13, %0
ret double %14
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *stdout;
FILE *__ghdl_get_stdout(void) { return stdout; }


x86 assembly (clang, -O0):
<__ghdl_get_stdout>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ghdl_get_stdout>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
@stdout = global i32* null
define i32* @__ghdl_get_stdout() {
%1 = load i32*, i32** @stdout
ret i32* %1
}

LLVM IR (-O2):
@stdout = global i32* null
define i32* @__ghdl_get_stdout() {
%1 = load i32*, i32** @stdout
ret i32* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double A, R;
  scanf("%lf", &R);
  A = 3.14159 * R * R;
  printf("A=%.4lf\n", A);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
movsd  0xeb9(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm1
movsd  0xec3(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [9 x i8] c"A=%.4lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%5 = load double, double* %3
%6 = fmul double 3.141590e+00, %5
%7 = load double, double* %3
%8 = fmul double %6, %7
store double %8, double* %2
%9 = load double, double* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), double %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [9 x i8] c"A=%.4lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fmul double %4, 3.141590e+00
%6 = fmul double %4, %5
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), double %6)
ret i32 0
}
int isNumber(const char *str) {
  while (*str != '\0') {
    if (*str < '0' || *str > '9')
      return 0;
    str++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1155 <isNumber+0x55>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jl     1138 <isNumber+0x38>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jle    1144 <isNumber+0x44>
movl   $0x0,-0x4(%rbp)
jmp    115c <isNumber+0x5c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <isNumber+0x8>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNumber>:
mov    (%rdi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1123 <isNumber+0x23>
add    $0x1,%rdi
nop
add    $0xc6,%cl
cmp    $0xf5,%cl
jbe    1124 <isNumber+0x24>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <isNumber+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isNumber(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = add i8 %8, -58
%11 = icmp ult i8 %10, -10
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int counter;
  printf("if Conditional Example 1\n\n");
  printf("Enter a number: ");
  scanf("%d", &counter);
  if (counter > 100)
    printf("The number is > 100.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x64,-0x8(%rbp)
jle    116d <main+0x4d>
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x65,0x4(%rsp)
jl     116d <main+0x3d>
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"if Conditional Example 1\0A\0A\00"
@.str.1 = [17 x i8] c"Enter a number: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [22 x i8] c"The number is > 100.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 100
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
br label %10
10: ; preds = %8, %0
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [17 x i8] c"Enter a number: \00"
@.str.2 = [3 x i8] c"%d\00"
@str = [26 x i8] c"if Conditional Example 1\0A\00"
@str.4 = [21 x i8] c"The number is > 100.\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 100
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.4, i64 0, i64 0))
br label %10
10: ; preds = %8, %0
ret i32 0
}
/* Type definitions */
struct re_registers {
  int dummy;
};
struct re_pattern_buffer {
  int dummy;
};

/* Variables and functions */
int re_search_2(struct re_pattern_buffer *, int /*<<< orphan*/,
                int /*<<< orphan*/, char const *, int, int, int,
                struct re_registers *, int);
int re_search(struct re_pattern_buffer *bufp, const char *string, int size,
              int startpos, int range, struct re_registers *regs) {
  return re_search_2(bufp, 0, 0, string, size, startpos, range, regs, size);
}


x86 assembly (clang, -O0):
<re_search>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    -0x1c(%rbp),%r11d
mov    -0x28(%rbp),%r10
mov    -0x14(%rbp),%eax
xor    %edx,%edx
mov    %edx,%esi
mov    %r11d,(%rsp)
mov    %r10,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1030 <re_search_2@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<re_search>:
push   %rax
mov    %r9,%rax
mov    %r8d,%r10d
mov    %ecx,%r9d
mov    %edx,%r8d
mov    %rsi,%rcx
sub    $0x8,%rsp
xor    %esi,%esi
xor    %edx,%edx
push   %r8
push   %rax
push   %r10
call   1030 <re_search_2@plt>
add    $0x20,%rsp
pop    %rcx
ret

LLVM IR (-O0):
%struct.re_pattern_buffer = type { i32 }
%struct.re_registers = type { i32 }
define i32 @re_search(%struct.re_pattern_buffer* %0, i8* %1, i32 %2, i32 %3, i32 %4, %struct.re_registers* %5) {
%7 = alloca %struct.re_pattern_buffer*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca %struct.re_registers*
store %struct.re_pattern_buffer* %0, %struct.re_pattern_buffer** %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store %struct.re_registers* %5, %struct.re_registers** %12
%13 = load %struct.re_pattern_buffer*, %struct.re_pattern_buffer** %7
%14 = load i8*, i8** %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = load i32, i32* %11
%18 = load %struct.re_registers*, %struct.re_registers** %12
%19 = load i32, i32* %9
%20 = call i32 @re_search_2(%struct.re_pattern_buffer* %13, i32 0, i32 0, i8* %14, i32 %15, i32 %16, i32 %17, %struct.re_registers* %18, i32 %19)
ret i32 %20
}

LLVM IR (-O2):
%struct.re_pattern_buffer = type { i32 }
%struct.re_registers = type { i32 }
define i32 @re_search(%struct.re_pattern_buffer* %0, i8* %1, i32 %2, i32 %3, i32 %4, %struct.re_registers* %5) {
%7 = tail call i32 @re_search_2(%struct.re_pattern_buffer* %0, i32 0, i32 0, i8* %1, i32 %2, i32 %3, i32 %4, %struct.re_registers* %5, i32 %2)
ret i32 %7
}
/* Variables and functions */
scalar_t__ analyze(int /*<<< orphan*/, int /*<<< orphan*/ *, unsigned int *);
int /*<<< orphan*/ mkslice(char const *);
int recount(const char *re) {
  unsigned ncap = 0;
  return analyze(mkslice(re), NULL, &ncap) < 0 ? -1 : (int)(ncap + 1);
}


x86 assembly (clang, -O0):
<recount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <mkslice@plt>
mov    %eax,%edi
xor    %eax,%eax
mov    %eax,%esi
lea    -0xc(%rbp),%rdx
call   1030 <analyze@plt>
cmp    $0x0,%rax
jge    1162 <recount+0x42>
mov    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    116b <recount+0x4b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recount>:
push   %rax
movl   $0x0,0x4(%rsp)
call   1040 <mkslice@plt>
lea    0x4(%rsp),%rdx
mov    %eax,%edi
xor    %esi,%esi
call   1030 <analyze@plt>
mov    0x4(%rsp),%ecx
add    $0x1,%ecx
test   %rax,%rax
mov    $0xffffffff,%eax
cmovns %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @recount(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = call i32 @mkslice(i8* %4)
%6 = call i64 @analyze(i32 %5, i32* null, i32* %3)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
br label %12
9: ; preds = %1
%10 = load i32, i32* %3
%11 = add i32 %10, 1
br label %12
12: ; preds = %9, %8
%13 = phi i32 [ -1, %8 ], [ %11, %9 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @recount(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = tail call i32 @mkslice(i8* %0)
%5 = call i64 @analyze(i32 %4, i32* null, i32* %2)
%6 = icmp slt i64 %5, 0
%7 = load i32, i32* %2
%8 = add i32 %7, 1
%9 = select i1 %6, i32 -1, i32 %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t n) {
  void *p = (void *)malloc(n);
  if (p == NULL) {
    fprintf(stderr, "memory exhausted!\n");
    exit(-1);
  }
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <xmalloc+0x43>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"memory exhausted!\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 -1)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"memory exhausted!\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %1
%9 = inttoptr i64 %2 to i8*
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ abort();
unsigned alarm(unsigned seconds) {
  abort();
  return 0;
}


x86 assembly (clang, -O0):
<alarm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<alarm>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @alarm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @alarm(i32 %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
int is_syscall_error(long res) {
  if (res < 0 && res > -4096)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_syscall_error>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    112d <is_syscall_error+0x2d>
cmpq   $0xfffffffffffff000,-0x10(%rbp)
ff
jle    112d <is_syscall_error+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1134 <is_syscall_error+0x34>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_syscall_error>:
xor    %eax,%eax
cmp    $0xfffffffffffff001,%rdi
setae  %al
ret

LLVM IR (-O0):
define i32 @is_syscall_error(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i64, i64* %3
%8 = icmp sgt i64 %7, -4096
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_syscall_error(i64 %0) {
%2 = icmp ugt i64 %0, -4096
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ write(int, char *, int);
fatal() {
  write(2, "FATAL ERROR\n", 12);
  exit(1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
lea    0xed0(%rip),%rsi
mov    $0xc,%edx
call   1030 <write@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x2,%edi
mov    $0xc,%edx
call   1030 <write@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"FATAL ERROR\0A\00"
define i32 @fatal() {
%1 = call i32 @write(i32 2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 12)
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [13 x i8] c"FATAL ERROR\0A\00"
define i32 @fatal() {
%1 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 12)
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct drand48_data {
  int /*<<< orphan*/ __x;
};

/* Variables and functions */
int __nrand48_r(int /*<<< orphan*/, struct drand48_data *, long *);
int lrand48_r(struct drand48_data *buffer, long int *result) {
  if (buffer == NULL)
    return -1;
  return __nrand48_r(buffer->__x, buffer, result);
}


x86 assembly (clang, -O0):
<lrand48_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1137 <lrand48_r+0x27>
movl   $0xffffffff,-0x4(%rbp)
jmp    114d <lrand48_r+0x3d>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <__nrand48_r@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lrand48_r>:
test   %rdi,%rdi
je     1122 <lrand48_r+0x12>
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    (%rdi),%edi
jmp    1030 <__nrand48_r@plt>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
%struct.drand48_data = type { i32 }
define i32 @lrand48_r(%struct.drand48_data* %0, i64* %1) {
%3 = icmp eq %struct.drand48_data* %0, null
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = getelementptr inbounds %struct.drand48_data, %struct.drand48_data* %0, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i32 @__nrand48_r(i32 %6, %struct.drand48_data* %0, i64* %1)
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ -1, %2 ]
ret i32 %9
}
main() {
  f();
  int i = f;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <f@plt>
mov    0x2eca(%rip),%rax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ e_asl();
int /*<<< orphan*/ e_writeback();
int /*<<< orphan*/ e_zpx();
void e_asl_zpx() {
  e_zpx();
  e_asl();
  e_writeback();
}


x86 assembly (clang, -O0):
<e_asl_zpx>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <e_zpx@plt>
mov    $0x0,%al
call   1050 <e_asl@plt>
mov    $0x0,%al
call   1030 <e_writeback@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_asl_zpx>:
push   %rax
xor    %eax,%eax
call   1040 <e_zpx@plt>
xor    %eax,%eax
call   1050 <e_asl@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <e_writeback@plt>

LLVM IR (-O0):
define void @e_asl_zpx() {
%1 = call i32 (...) @e_zpx()
%2 = call i32 (...) @e_asl()
%3 = call i32 (...) @e_writeback()
ret void
}

LLVM IR (-O2):
define void @e_asl_zpx() {
%1 = tail call i32 (...) @e_zpx()
%2 = tail call i32 (...) @e_asl()
%3 = tail call i32 (...) @e_writeback()
ret void
}
/* Variables and functions */
int accept(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int acceptConnection(int sock) { return accept(sock, NULL, NULL); }


x86 assembly (clang, -O0):
<acceptConnection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1030 <accept@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acceptConnection>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <accept@plt>

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

LLVM IR (-O2):
define i32 @acceptConnection(i32 %0) {
%2 = tail call i32 @accept(i32 %0, i32* null, i32* null)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int twister_genrand64_int64();
int64_t twister_genrand64_int63(void) {
  return (int64_t)(twister_genrand64_int64() >> 1);
}


x86 assembly (clang, -O0):
<twister_genrand64_int63>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <twister_genrand64_int64@plt>
sar    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<twister_genrand64_int63>:
push   %rax
xor    %eax,%eax
call   1030 <twister_genrand64_int64@plt>
sar    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @twister_genrand64_int63() {
%1 = call i32 (...) @twister_genrand64_int64()
%2 = ashr i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
define i32 @twister_genrand64_int63() {
%1 = tail call i32 (...) @twister_genrand64_int64()
%2 = ashr i32 %1, 1
ret i32 %2
}
double K(double phi) { return (phi * phi * phi); }


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

x86 assembly (clang, -O2):
<K>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @K(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = load double, double* %2
%7 = fmul double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @K(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %2, %0
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ drawArc(int, int, int, int, int /*<<< orphan*/, int);
int /*<<< orphan*/ drawRect(int, int, int, int);
int main(void) {
  drawArc(30, 30, 100, 100, 0, 360);
  drawRect(45, 45, 70, 70);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1e,%esi
mov    $0x64,%ecx
xor    %r8d,%r8d
mov    $0x168,%r9d
mov    %esi,%edi
mov    %ecx,%edx
call   1040 <drawArc@plt>
mov    $0x2d,%esi
mov    $0x46,%ecx
mov    %esi,%edi
mov    %ecx,%edx
call   1030 <drawRect@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1e,%edi
mov    $0x1e,%esi
mov    $0x64,%edx
mov    $0x64,%ecx
xor    %r8d,%r8d
mov    $0x168,%r9d
call   1040 <drawArc@plt>
mov    $0x2d,%edi
mov    $0x2d,%esi
mov    $0x46,%edx
mov    $0x46,%ecx
call   1030 <drawRect@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @drawArc(i32 30, i32 30, i32 100, i32 100, i32 0, i32 360)
%3 = call i32 @drawRect(i32 45, i32 45, i32 70, i32 70)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @drawArc(i32 30, i32 30, i32 100, i32 100, i32 0, i32 360)
%2 = tail call i32 @drawRect(i32 45, i32 45, i32 70, i32 70)
ret i32 0
}
int somatorio(int x) {
  if (x == 0) {
    return x;
  } else {
    return x + somatorio(x - 1);
  }
}


x86 assembly (clang, -O0):
<somatorio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1130 <somatorio+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <somatorio+0x3b>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <somatorio@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<somatorio>:
test   %edi,%edi
je     1119 <somatorio+0x19>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
imul   %eax,%eax
shr    %rcx
add    %edi,%eax
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @somatorio(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = mul i32 %4, %4
%6 = zext i32 %4 to i33
%7 = add i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %5, %0
%13 = sub i32 %12, %11
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}
void YUY2ToYRow_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @YUY2ToYRow_Any_NEON() {
ret void
}
/* Variables and functions */
int fastReadGpio(int);
int lineRead() {
  int line = 0;
  if (fastReadGpio(0) == 1)
    line += 1;
  if (fastReadGpio(2) == 1)
    line += 100;
  if (fastReadGpio(1) == 1)
    line += 10;
  return line;
}


x86 assembly (clang, -O0):
<lineRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <fastReadGpio@plt>
cmp    $0x1,%eax
jne    1138 <lineRead+0x28>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    $0x2,%edi
call   1030 <fastReadGpio@plt>
cmp    $0x1,%eax
jne    1154 <lineRead+0x44>
mov    -0x4(%rbp),%eax
add    $0x64,%eax
mov    %eax,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <fastReadGpio@plt>
cmp    $0x1,%eax
jne    1170 <lineRead+0x60>
mov    -0x4(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lineRead>:
push   %r14
push   %rbx
push   %rax
xor    %edi,%edi
call   1030 <fastReadGpio@plt>
xor    %r14d,%r14d
cmp    $0x1,%eax
sete   %r14b
mov    $0x2,%edi
call   1030 <fastReadGpio@plt>
lea    0x64(%r14),%ebx
cmp    $0x1,%eax
cmovne %r14d,%ebx
mov    $0x1,%edi
call   1030 <fastReadGpio@plt>
lea    0xa(%rbx),%ecx
cmp    $0x1,%eax
cmovne %ebx,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @lineRead() {
%1 = tail call i32 @fastReadGpio(i32 0)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @fastReadGpio(i32 2)
%5 = icmp eq i32 %4, 1
%6 = or i32 %3, 100
%7 = select i1 %5, i32 %6, i32 %3
%8 = tail call i32 @fastReadGpio(i32 1)
%9 = icmp eq i32 %8, 1
%10 = or i32 %7, 10
%11 = select i1 %9, i32 %10, i32 %7
ret i32 %11
}
void __attribute((always_)) spin_lock(unsigned char volatile *lock) {
  while (__sync_lock_test_and_set(lock, 0x01)) {
  }
}


x86 assembly (clang, -O0):
<spin_lock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%al
xchg   %al,(%rcx)
cmp    $0x0,%al
je     111d <spin_lock+0x1d>
jmp    1108 <spin_lock+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<spin_lock>:
mov    $0x1,%al
xchg   %al,(%rdi)
test   %al,%al
jne    1100 <spin_lock>
ret

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

LLVM IR (-O2):
define void @spin_lock(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = atomicrmw xchg i8* %0, i8 1 seq_cst
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %2
5: ; preds = %2
ret void
}
/* Variables and functions */
int sumDivisbleBy(int, int);
int getSumDiv() {
  return (sumDivisbleBy(3, 999) + sumDivisbleBy(5, 999) -
          sumDivisbleBy(15, 999));
}


x86 assembly (clang, -O0):
<getSumDiv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
mov    $0x3e7,%esi
call   1030 <sumDivisbleBy@plt>
mov    %eax,-0x8(%rbp)
mov    $0x5,%edi
mov    $0x3e7,%esi
call   1030 <sumDivisbleBy@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    $0xf,%edi
mov    $0x3e7,%esi
call   1030 <sumDivisbleBy@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSumDiv>:
push   %rbp
push   %rbx
push   %rax
mov    $0x3,%edi
mov    $0x3e7,%esi
call   1030 <sumDivisbleBy@plt>
mov    %eax,%ebx
mov    $0x5,%edi
mov    $0x3e7,%esi
call   1030 <sumDivisbleBy@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    $0xf,%edi
mov    $0x3e7,%esi
call   1030 <sumDivisbleBy@plt>
sub    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getSumDiv() {
%1 = call i32 @sumDivisbleBy(i32 3, i32 999)
%2 = call i32 @sumDivisbleBy(i32 5, i32 999)
%3 = add nsw i32 %1, %2
%4 = call i32 @sumDivisbleBy(i32 15, i32 999)
%5 = sub nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @getSumDiv() {
%1 = tail call i32 @sumDivisbleBy(i32 3, i32 999)
%2 = tail call i32 @sumDivisbleBy(i32 5, i32 999)
%3 = add nsw i32 %2, %1
%4 = tail call i32 @sumDivisbleBy(i32 15, i32 999)
%5 = sub i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int printf(char const *, char const *, char const *);
int asm_setflag(const char *flagname) {
  static const char asm_flagdef[] = "   IFND %s\n%-15s EQU     1\n   ENDC\n";
  return printf(asm_flagdef, flagname, flagname);
}


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

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

LLVM IR (-O0):
@asm_setflag.asm_flagdef = internal constant [36 x i8] c" IFND %s\0A%-15s EQU 1\0A ENDC\0A\00"
define i32 @asm_setflag(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @asm_setflag.asm_flagdef, i64 0, i64 0), i8* %3, i8* %4)
ret i32 %5
}

LLVM IR (-O2):
@asm_setflag.asm_flagdef = internal constant [36 x i8] c" IFND %s\0A%-15s EQU 1\0A ENDC\0A\00"
define i32 @asm_setflag(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @asm_setflag.asm_flagdef, i64 0, i64 0), i8* %0, i8* %0)
ret i32 %2
}
void view_makeAnArrayFromStack(void) {}


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

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

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

LLVM IR (-O2):
define void @view_makeAnArrayFromStack() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
void ft_ech_ndl(char **arg, void (*f)(const char *)) {
  while (*(1 + arg)) {
    (void)f(*arg++);
    (void)ft_putchar(' ');
  }
  (void)f(*arg++);
  return;
}


x86 assembly (clang, -O0):
<ft_ech_ndl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     1156 <ft_ech_ndl+0x46>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x8,%rdx
mov    %rdx,-0x8(%rbp)
mov    (%rcx),%rdi
call   *%rax
mov    $0x20,%edi
call   1030 <ft_putchar@plt>
jmp    1120 <ft_ech_ndl+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x8,%rdx
mov    %rdx,-0x8(%rbp)
mov    (%rcx),%rdi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_ech_ndl>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
cmpq   $0x0,0x8(%rdi)
je     1145 <ft_ech_ndl+0x35>
xchg   %ax,%ax
mov    (%rbx),%rdi
mov    %rsi,%r14
call   *%rsi
mov    $0x20,%edi
call   1030 <ft_putchar@plt>
mov    %r14,%rsi
lea    0x8(%rbx),%rax
cmpq   $0x0,0x10(%rbx)
mov    %rax,%rbx
jne    1120 <ft_ech_ndl+0x10>
jmp    1148 <ft_ech_ndl+0x38>
mov    %rbx,%rax
mov    (%rax),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    *%rsi

LLVM IR (-O0):
define void @ft_ech_ndl(i8** %0, void (i8*)* %1) {
%3 = alloca i8**
%4 = alloca void (i8*)*
store i8** %0, i8*** %3
store void (i8*)* %1, void (i8*)** %4
br label %5
5: ; preds = %10, %2
%6 = load i8**, i8*** %3
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %16
10: ; preds = %5
%11 = load void (i8*)*, void (i8*)** %4
%12 = load i8**, i8*** %3
%13 = getelementptr inbounds i8*, i8** %12, i32 1
store i8** %13, i8*** %3
%14 = load i8*, i8** %12
%15 = call i32 @ft_putchar(i8 signext 32)
br label %5
16: ; preds = %5
%17 = load void (i8*)*, void (i8*)** %4
%18 = load i8**, i8*** %3
%19 = getelementptr inbounds i8*, i8** %18, i32 1
store i8** %19, i8*** %3
%20 = load i8*, i8** %18
ret void
}

LLVM IR (-O2):
define void @ft_ech_ndl(i8** nocapture %0, void (i8*)* nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %0, i64 1
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %14, label %6
6: ; preds = %2, %6
%7 = phi i8** [ %11, %6 ], [ %3, %2 ]
%8 = phi i8** [ %7, %6 ], [ %0, %2 ]
%9 = load i8*, i8** %8
tail call void %1(i8* %9)
%10 = tail call i32 @ft_putchar(i8 signext 32)
%11 = getelementptr inbounds i8*, i8** %7, i64 1
%12 = load i8*, i8** %11
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = phi i8** [ %0, %2 ], [ %7, %6 ]
%16 = load i8*, i8** %15
tail call void %1(i8* %16)
ret void
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
scalar_t__ test_threads();
int main(void) {
  if (test_threads() != 0)
    return EXIT_FAILURE;
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_threads@plt>
cmp    $0x0,%rax
je     1141 <main+0x31>
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    114d <main+0x3d>
mov    0x2e90(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_threads@plt>
test   %rax,%rax
jne    1126 <main+0x16>
mov    0x2eb4(%rip),%rax
jmp    112d <main+0x1d>
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i64 (...) @test_threads()
%2 = icmp eq i64 %1, 0
%3 = load i32, i32* @EXIT_SUCCESS
%4 = load i32, i32* @EXIT_FAILURE
%5 = select i1 %2, i32 %3, i32 %4
ret i32 %5
}
const char *__malidrv_build_info(void) {
  return "malidrv:  API_VERSION=600 REPO_URL=heads/lollipop_portland "
         "REVISION=r5p0-01rel0 CHANGED_REVISION=2caf7de CHANGE_DATE=2014-11-11 "
         "08:46:20 -0500 BUILD_DATE=Fri Nov 14 11:06:37 CST 2014 BUILD=debug "
         "TARGET_PLATFORM=balong MALI_PLATFORM= KDIR= "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING= "
         "USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=0 USING_DVFS=n "
         "MALI_UPPER_HALF_SCHEDULING=1";
}


x86 assembly (clang, -O0):
<__malidrv_build_info>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__malidrv_build_info>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [386 x i8] c"malidrv: API_VERSION=600 REPO_URL=heads/lollipop_portland REVISION=r5p0-01rel0 CHANGED_REVISION=2caf7de CHANGE_DATE=2014-11-11 08:46:20 -0500 BUILD_DATE=Fri Nov 14 11:06:37 CST 2014 BUILD=debug TARGET_PLATFORM=balong MALI_PLATFORM= KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=0 USING_DVFS=n MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([386 x i8], [386 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [386 x i8] c"malidrv: API_VERSION=600 REPO_URL=heads/lollipop_portland REVISION=r5p0-01rel0 CHANGED_REVISION=2caf7de CHANGE_DATE=2014-11-11 08:46:20 -0500 BUILD_DATE=Fri Nov 14 11:06:37 CST 2014 BUILD=debug TARGET_PLATFORM=balong MALI_PLATFORM= KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=0 USING_DVFS=n MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([386 x i8], [386 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x51() {
  Assert_real((isspace(81) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              410, ("isspace should be 0 for Q"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x51>:
push   %rax
mov    $0x51,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x19a,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for Q\00"
define void @t_isspace_0x51() {
%1 = call i64 @isspace(i32 81)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 410, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for Q\00"
define void @t_isspace_0x51() {
%1 = tail call i64 @isspace(i32 81)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 410, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ linha();
int /*<<< orphan*/ printf(char *);
void menuplayer() {
  linha();
  printf("Selecione sua ação:\n\n");
  printf("0--Fazer uma jogada\n");
  printf("1--Descartar uma carta\n");
}


x86 assembly (clang, -O0):
<menuplayer>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <linha@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<menuplayer>:
push   %rax
xor    %eax,%eax
call   1040 <linha@plt>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
lea    0xee4(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Selecione sua a\C3\A7\C3\A3o:\0A\0A\00"
@.str.1 = [21 x i8] c"0--Fazer uma jogada\0A\00"
@.str.2 = [24 x i8] c"1--Descartar uma carta\0A\00"
define void @menuplayer() {
%1 = call i32 (...) @linha()
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [23 x i8] c"Selecione sua a\C3\A7\C3\A3o:\0A\00"
@str.3 = [20 x i8] c"0--Fazer uma jogada\00"
@str.4 = [23 x i8] c"1--Descartar uma carta\00"
define void @menuplayer() {
%1 = tail call i32 (...) @linha()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void element_table_closing_output(FILE *output_file) {
  fprintf(output_file, "</table></td>\n");
}


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

x86 assembly (clang, -O2):
<element_table_closing_output>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0xe,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"</table></td>\0A\00"
define void @element_table_closing_output(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"</table></td>\0A\00"
define void @element_table_closing_output(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i64 14, i64 1, i32* %0)
ret void
}