xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ diary();
int /*<<< orphan*/ help();
scalar_t__ strcasecmp(char *, char *);
int main(int argc, char **argv) {
  if (argc == 2) {
    if (strcasecmp(argv[1], "--help") == 0) {
      help();
    }
  }
  diary();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    117a <main+0x4a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xea1(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1175 <main+0x45>
mov    $0x0,%al
call   1050 <help@plt>
jmp    117a <main+0x4a>
mov    $0x0,%al
call   1040 <diary@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1152 <main+0x22>
mov    0x8(%rsi),%rdi
lea    0xebf(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
jne    1152 <main+0x22>
xor    %eax,%eax
call   1050 <help@plt>
xor    %eax,%eax
call   1040 <diary@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"--help\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @strcasecmp(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 (...) @help()
br label %11
11: ; preds = %4, %9, %2
%12 = tail call i32 (...) @diary()
ret i32 0
}
/* 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__ xnoexpose;
};
typedef TYPE_2__ XEvent;

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


x86 assembly (clang, -O0):
<get_XEvent_xnoexpose_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_xnoexpose_serial>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i64 @get_XEvent_xnoexpose_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_xnoexpose_serial(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
void *get_yuv422buffer(int /*<<< orphan*/);
void *get_lcd_422_buf() { return get_yuv422buffer(0); }


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

x86 assembly (clang, -O2):
<get_lcd_422_buf>:
xor    %edi,%edi
jmp    1030 <get_yuv422buffer@plt>

LLVM IR (-O0):
define i8* @get_lcd_422_buf() {
%1 = call i8* @get_yuv422buffer(i32 0)
ret i8* %1
}

LLVM IR (-O2):
define i8* @get_lcd_422_buf() {
%1 = tail call i8* @get_yuv422buffer(i32 0)
ret i8* %1
}
void foo29() {}


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

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

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

LLVM IR (-O2):
define void @foo29() {
ret void
}
/* Variables and functions */
double fmin(double const, float);
int max_chroma(double, double);
int sqrt(double);
double to_saturation(double l, double u, double v, double h) {
  const double saturation = (100 * 1) * sqrt(u * u + v * v) / max_chroma(l, h);
  return fmin(saturation, 100.0f);
}


x86 assembly (clang, -O0):
<to_saturation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
imul   $0x64,%eax,%eax
mov    %eax,-0x2c(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1030 <max_chroma@plt>
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movss  0xe60(%rip),%xmm1
call   1040 <fmin@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_saturation>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm3,0x8(%rsp)
movsd  %xmm0,(%rsp)
mulsd  %xmm2,%xmm2
mulsd  %xmm1,%xmm1
addsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
call   1050 <sqrt@plt>
imul   $0x64,%eax,%ebx
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1030 <max_chroma@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movss  0xe82(%rip),%xmm1
add    $0x10,%rsp
pop    %rbx
jmp    1040 <fmin@plt>

LLVM IR (-O0):
define double @to_saturation(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%10 = load double, double* %6
%11 = load double, double* %6
%12 = load double, double* %7
%13 = load double, double* %7
%14 = fmul double %12, %13
%15 = call double @llvm.fmuladd.f64(double %10, double %11, double %14)
%16 = call i32 @sqrt(double %15)
%17 = mul nsw i32 100, %16
%18 = load double, double* %5
%19 = load double, double* %8
%20 = call i32 @max_chroma(double %18, double %19)
%21 = sdiv i32 %17, %20
%22 = sitofp i32 %21 to double
store double %22, double* %9
%23 = load double, double* %9
%24 = call double @fmin(double %23, float 1.000000e+02)
ret double %24
}

LLVM IR (-O2):
define double @to_saturation(double %0, double %1, double %2, double %3) {
%5 = fmul double %2, %2
%6 = tail call double @llvm.fmuladd.f64(double %1, double %1, double %5)
%7 = tail call i32 @sqrt(double %6)
%8 = mul nsw i32 %7, 100
%9 = tail call i32 @max_chroma(double %0, double %3)
%10 = sdiv i32 %8, %9
%11 = sitofp i32 %10 to double
%12 = tail call double @fmin(double %11, float 1.000000e+02)
ret double %12
}
/* Variables and functions */
scalar_t__ COND_NE();
int /*<<< orphan*/ EA_AY_IX_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_sne_8_ix(void) {
  m68ki_write_8(EA_AY_IX_8(), COND_NE() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_sne_8_ix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_AY_IX_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_NE@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_sne_8_ix>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_AY_IX_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_NE@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_sne_8_ix() {
%1 = call i32 (...) @EA_AY_IX_8()
%2 = call i64 (...) @COND_NE()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_sne_8_ix() {
%1 = tail call i32 (...) @EA_AY_IX_8()
%2 = tail call i64 (...) @COND_NE()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
void t92() {
  char c[(int)(sizeof(typeof((0 ? (_Complex double)2.0f : 2.0f))) -
               sizeof(_Complex double))];
  (0 ? (_Complex double)2.0f : 2.0f);
}


x86 assembly (clang, -O0):
<t92>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
test   $0x1,%al
jne    1113 <t92+0x13>
jmp    1118 <t92+0x18>
jmp    111d <t92+0x1d>
jmp    111d <t92+0x1d>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @t92() {
%1 = alloca [0 x i8]
br i1 false, label %2, label %3
2: ; preds = %0
br label %4
3: ; preds = %0
br label %4
4: ; preds = %3, %2
%5 = phi double [ 2.000000e+00, %2 ], [ 2.000000e+00, %3 ]
%6 = phi double [ 0.000000e+00, %2 ], [ 0.000000e+00, %3 ]
ret void
}

LLVM IR (-O2):
define void @t92() {
ret void
}
initplot() {}


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

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

LLVM IR (-O0):
define i32 @initplot() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @initplot() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/
cwrapper_q_sortrev_float_with_indices(float *, int *, int /*<<< orphan*/, int);
void quicksortrev_float_with_indices_(float numbers[], int indices[],
                                      int *array_size) {
  cwrapper_q_sortrev_float_with_indices(numbers, indices, 0, (*array_size) - 1);
}


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

x86 assembly (clang, -O2):
<quicksortrev_float_with_indices_>:
mov    (%rdx),%ecx
add    $0xffffffff,%ecx
xor    %edx,%edx
jmp    1030 <cwrapper_q_sortrev_float_with_indices@plt>

LLVM IR (-O0):
define void @quicksortrev_float_with_indices_(float* %0, i32* %1, i32* %2) {
%4 = alloca float*
%5 = alloca i32*
%6 = alloca i32*
store float* %0, float** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load float*, float** %4
%8 = load i32*, i32** %5
%9 = load i32*, i32** %6
%10 = load i32, i32* %9
%11 = sub nsw i32 %10, 1
%12 = call i32 @cwrapper_q_sortrev_float_with_indices(float* %7, i32* %8, i32 0, i32 %11)
ret void
}

LLVM IR (-O2):
define void @quicksortrev_float_with_indices_(float* %0, i32* %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
%6 = tail call i32 @cwrapper_q_sortrev_float_with_indices(float* %0, i32* %1, i32 0, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void badusage(void) {
  fprintf(stderr, "Usage: nfadeterminize [-s] [-op d/s] [-silent] [-v] [-l/-h] "
                  "[filename]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<badusage>:
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):
<badusage>:
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 = [72 x i8] c"Usage: nfadeterminize [-s] [-op d/s] [-silent] [-v] [-l/-h] [filename]\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [72 x i8] c"Usage: nfadeterminize [-s] [-op d/s] [-silent] [-v] [-l/-h] [filename]\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void f151(void) {
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
  ({
    ({ 0; });
    ({
      goto a;
      0;
    });
  a:
    0;
  });
  0;
}


x86 assembly (clang, -O0):
<f151>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f151() {
ret void
}
void add(int *arrs, int val) {
  while (*arrs != -1) {
    ++arrs;
  }
  *arrs = val;
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0xffffffff,(%rax)
je     1129 <add+0x29>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    110b <add+0xb>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
cmpl   $0xffffffff,(%rdi)
lea    0x4(%rdi),%rdi
jne    1100 <add>
mov    %esi,-0x4(%rdi)
ret

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

LLVM IR (-O2):
define void @add(i32* nocapture %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32* [ %0, %2 ], [ %7, %3 ]
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, -1
%7 = getelementptr inbounds i32, i32* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
store i32 %1, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __blast_assert();
void check_error(int b) { ((b) ? (0) : __blast_assert()); }


x86 assembly (clang, -O0):
<check_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112a <check_error+0x1a>
jmp    1131 <check_error+0x21>
mov    $0x0,%al
call   1030 <__blast_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_error>:
test   %edi,%edi
je     1115 <check_error+0x5>
ret
xor    %eax,%eax
jmp    1030 <__blast_assert@plt>

LLVM IR (-O0):
define void @check_error(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %8
6: ; preds = %1
%7 = call i32 (...) @__blast_assert()
br label %8
8: ; preds = %6, %5
%9 = phi i32 [ 0, %5 ], [ %7, %6 ]
ret void
}

LLVM IR (-O2):
define void @check_error(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @__blast_assert()
br label %5
5: ; preds = %1, %3
ret void
}
unsigned int getNumMemoryBlocks(unsigned int length) {
  const int NUCLEOTIDES_PER_BLOCK = 32;
  unsigned int blocks;
  blocks = length / NUCLEOTIDES_PER_BLOCK;
  if (length % NUCLEOTIDES_PER_BLOCK > 0) {
    blocks++;
  }
  return blocks;
}


x86 assembly (clang, -O0):
<getNumMemoryBlocks>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x20,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x5,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1f,%eax
cmp    $0x0,%eax
jbe    112f <getNumMemoryBlocks+0x2f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNumMemoryBlocks>:
mov    %edi,%eax
shr    $0x5,%eax
and    $0x1f,%edi
cmp    $0x1,%edi
sbb    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @getNumMemoryBlocks(i32 %0) {
%2 = lshr i32 %0, 5
%3 = and i32 %0, 31
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = add nuw nsw i32 %2, %5
ret i32 %6
}
/* Type definitions */
struct noacq_workspace {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int stop_acq(struct noacq_workspace *ws) {
  printf("noacq_stop_acq\n");
  return 1;
}


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

x86 assembly (clang, -O2):
<stop_acq>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.noacq_workspace = type { i32 }
@.str = [16 x i8] c"noacq_stop_acq\0A\00"
define i32 @stop_acq(%struct.noacq_workspace* %0) {
%2 = alloca %struct.noacq_workspace*
store %struct.noacq_workspace* %0, %struct.noacq_workspace** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
%struct.noacq_workspace = type { i32 }
@str = [15 x i8] c"noacq_stop_acq\00"
define i32 @stop_acq(%struct.noacq_workspace* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int get_mdterm();
void md_draw_point(int x, int y) {
  switch (get_mdterm()) {}
}


x86 assembly (clang, -O0):
<md_draw_point>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
call   1030 <get_mdterm@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @md_draw_point(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @get_mdterm()
switch i32 %5, label %6 [
]
6: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @md_draw_point(i32 %0, i32 %1) {
%3 = tail call i32 (...) @get_mdterm()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
int execv(const char *path, char *const argv[]) {
  fprintf(stderr, "ERROR: execv is unsupported!\n");
  fprintf(stderr, "Tried to execute '%s' with arg0 '%s'\n", path, *argv);
  abort();
}


x86 assembly (clang, -O0):
<execv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
lea    0xebc(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<execv>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    0x2eae(%rip),%r15
mov    (%r15),%edi
lea    0xec4(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r15),%edi
mov    (%rbx),%rcx
lea    0xece(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"ERROR: execv is unsupported!\0A\00"
@.str.1 = [38 x i8] c"Tried to execute '%s' with arg0 '%s'\0A\00"
define i32 @execv(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i32, i32* @stderr
%6 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %3
%9 = load i8**, i8*** %4
%10 = load i8*, i8** %9
%11 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %8, i8* %10)
%12 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"ERROR: execv is unsupported!\0A\00"
@.str.1 = [38 x i8] c"Tried to execute '%s' with arg0 '%s'\0A\00"
define i32 @execv(i8* %0, i8** nocapture %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %6)
%8 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
struct qcc_stream_node {
  int dummy;
};
struct qcc_stream_data {
  int dummy;
};
struct qcc_list_node {
  int dummy;
};
struct qcc_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ qcc_list_push_front(struct qcc_list *,
                                       struct qcc_list_node *);
void qcc_stream_data_push_front(struct qcc_stream_data *list,
                                struct qcc_stream_node *node) {
  qcc_list_push_front((struct qcc_list *)list, (struct qcc_list_node *)node);
}


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

x86 assembly (clang, -O2):
<qcc_stream_data_push_front>:
jmp    1030 <qcc_list_push_front@plt>

LLVM IR (-O0):
%struct.qcc_stream_data = type { i32 }
%struct.qcc_stream_node = type { i32 }
%struct.qcc_list = type { i32 }
%struct.qcc_list_node = type { i32 }
define void @qcc_stream_data_push_front(%struct.qcc_stream_data* %0, %struct.qcc_stream_node* %1) {
%3 = alloca %struct.qcc_stream_data*
%4 = alloca %struct.qcc_stream_node*
store %struct.qcc_stream_data* %0, %struct.qcc_stream_data** %3
store %struct.qcc_stream_node* %1, %struct.qcc_stream_node** %4
%5 = load %struct.qcc_stream_data*, %struct.qcc_stream_data** %3
%6 = bitcast %struct.qcc_stream_data* %5 to %struct.qcc_list*
%7 = load %struct.qcc_stream_node*, %struct.qcc_stream_node** %4
%8 = bitcast %struct.qcc_stream_node* %7 to %struct.qcc_list_node*
%9 = call i32 @qcc_list_push_front(%struct.qcc_list* %6, %struct.qcc_list_node* %8)
ret void
}

LLVM IR (-O2):
%struct.qcc_stream_data = type { i32 }
%struct.qcc_stream_node = type { i32 }
%struct.qcc_list = type { i32 }
%struct.qcc_list_node = type { i32 }
define void @qcc_stream_data_push_front(%struct.qcc_stream_data* %0, %struct.qcc_stream_node* %1) {
%3 = bitcast %struct.qcc_stream_data* %0 to %struct.qcc_list*
%4 = bitcast %struct.qcc_stream_node* %1 to %struct.qcc_list_node*
%5 = tail call i32 @qcc_list_push_front(%struct.qcc_list* %3, %struct.qcc_list_node* %4)
ret void
}
/* Variables and functions */
unsigned int assign_sizeg(size_t, unsigned int);
unsigned int test_assigner(size_t size, unsigned int max) {
  return assign_sizeg(size, max);
}


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

x86 assembly (clang, -O2):
<test_assigner>:
jmp    1030 <assign_sizeg@plt>

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

LLVM IR (-O2):
define i32 @test_assigner(i64 %0, i32 %1) {
%3 = tail call i32 @assign_sizeg(i64 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xd5() {
  Assert_real((isodigit(213) == 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_isodigit.c",
              1070, ("isodigit should be 0 for 0xd5"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0xd5>:
push   %rax
mov    $0xd5,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x42e,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xd5\00"
define void @t_isodigit_0xd5() {
%1 = call i64 @isodigit(i32 213)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1070, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xd5\00"
define void @t_isodigit_0xd5() {
%1 = tail call i64 @isodigit(i32 213)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1070, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void foo141(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo141(i32 %0) {
ret void
}
int rsock_family_to_int(const char *str, long len, int *valp) {
  switch (len) {
  case 2:
    return -1;
  case 3:
    return -1;
  case 4:
    return -1;
  case 5:
    return -1;
  case 6:
    return -1;
  case 7:
    return -1;
  case 8:
    return -1;
  case 9:
    return -1;
  case 10:
    return -1;
  case 11:
    return -1;
  case 12:
    return -1;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<rsock_family_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0xfffffffffffffffe,%rax
mov    %rax,-0x28(%rbp)
sub    $0xa,%rax
ja     11be <rsock_family_to_int+0xbe>
mov    -0x28(%rbp),%rax
lea    0xecf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0xffffffff,-0x4(%rbp)
jmp    11c5 <rsock_family_to_int+0xc5>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c5 <rsock_family_to_int+0xc5>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c5 <rsock_family_to_int+0xc5>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c5 <rsock_family_to_int+0xc5>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c5 <rsock_family_to_int+0xc5>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c5 <rsock_family_to_int+0xc5>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c5 <rsock_family_to_int+0xc5>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c5 <rsock_family_to_int+0xc5>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c5 <rsock_family_to_int+0xc5>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c5 <rsock_family_to_int+0xc5>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c5 <rsock_family_to_int+0xc5>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @rsock_family_to_int(i8* %0, i64 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i32* %2, i32** %7
%8 = load i64, i64* %6
switch i64 %8, label %20 [
i64 2, label %9
i64 3, label %10
i64 4, label %11
i64 5, label %12
i64 6, label %13
i64 7, label %14
i64 8, label %15
i64 9, label %16
i64 10, label %17
i64 11, label %18
i64 12, label %19
]
9: ; preds = %3
store i32 -1, i32* %4
br label %21
10: ; preds = %3
store i32 -1, i32* %4
br label %21
11: ; preds = %3
store i32 -1, i32* %4
br label %21
12: ; preds = %3
store i32 -1, i32* %4
br label %21
13: ; preds = %3
store i32 -1, i32* %4
br label %21
14: ; preds = %3
store i32 -1, i32* %4
br label %21
15: ; preds = %3
store i32 -1, i32* %4
br label %21
16: ; preds = %3
store i32 -1, i32* %4
br label %21
17: ; preds = %3
store i32 -1, i32* %4
br label %21
18: ; preds = %3
store i32 -1, i32* %4
br label %21
19: ; preds = %3
store i32 -1, i32* %4
br label %21
20: ; preds = %3
store i32 -1, i32* %4
br label %21
21: ; preds = %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
define i32 @rsock_family_to_int(i8* nocapture readnone %0, i64 %1, i32* nocapture readnone %2) {
ret i32 -1
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
scalar_t__ isalpha(char);
int is_first_ident_char(uint8_t ch) { return isalpha(ch) || ch == '_'; }


x86 assembly (clang, -O0):
<is_first_ident_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1146 <is_first_ident_char+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_first_ident_char>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalpha@plt>
test   %rax,%rax
setne  %al
cmp    $0x5f,%bl
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_first_ident_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isalpha(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 95
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_first_ident_char(i8 signext %0) {
%2 = tail call i64 @isalpha(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i8 %0, 95
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
int misc_Max(int a, int b) {
  if (a > b)
    return a;
  else
    return b;
}


x86 assembly (clang, -O0):
<misc_Max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <misc_Max+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <misc_Max+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<misc_Max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @misc_Max(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 = load i32, i32* %5
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @misc_Max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int,
                           char const *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void cake_carp(const char *file, int line, const char *msg) {
  fprintf(stderr, "\n carp at %s:%d\n%s\n\n", file, line, msg);
  fflush(stderr);
  fflush(stdout);
  abort();
}


x86 assembly (clang, -O0):
<cake_carp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
lea    0xea2(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<cake_carp>:
push   %rbx
mov    %rdx,%r8
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2ea0(%rip),%rbx
mov    (%rbx),%edi
lea    0xeb7(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"\0A carp at %s:%d\0A%s\0A\0A\00"
@stdout = global i32 0
define void @cake_carp(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9, i8* %10)
%12 = load i32, i32* @stderr
%13 = call i32 @fflush(i32 %12)
%14 = load i32, i32* @stdout
%15 = call i32 @fflush(i32 %14)
%16 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"\0A carp at %s:%d\0A%s\0A\0A\00"
@stdout = global i32 0
define void @cake_carp(i8* %0, i32 %1, i8* %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fflush(i32 %6)
%8 = load i32, i32* @stdout
%9 = tail call i32 @fflush(i32 %8)
%10 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int SIGINT;
int SIGTERM;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ killem();
void signal_handler(int signum) {
  if (signum == SIGTERM || signum == SIGINT) {
    killem();
    exit(0);
  }
}


x86 assembly (clang, -O0):
<signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eab(%rip),%rcx
cmp    (%rcx),%eax
je     114f <signal_handler+0x2f>
mov    -0x4(%rbp),%eax
mov    0x2ea1(%rip),%rcx
cmp    (%rcx),%eax
jne    115d <signal_handler+0x3d>
mov    $0x0,%al
call   1040 <killem@plt>
xor    %edi,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_handler>:
push   %rax
mov    0x2eb8(%rip),%rax
cmp    %edi,(%rax)
je     1139 <signal_handler+0x19>
mov    0x2eb5(%rip),%rax
cmp    %edi,(%rax)
je     1139 <signal_handler+0x19>
pop    %rax
ret
xor    %eax,%eax
call   1040 <killem@plt>
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@SIGTERM = global i32 0
@SIGINT = global i32 0
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGTERM
%5 = icmp eq i32 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = load i32, i32* @SIGINT
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %13
10: ; preds = %6, %1
%11 = call i32 (...) @killem()
%12 = call i32 @exit(i32 0)
unreachable
13: ; preds = %6
ret void
}

LLVM IR (-O2):
@SIGTERM = global i32 0
@SIGINT = global i32 0
define void @signal_handler(i32 %0) {
%2 = load i32, i32* @SIGTERM
%3 = icmp eq i32 %2, %0
%4 = load i32, i32* @SIGINT
%5 = icmp eq i32 %4, %0
%6 = select i1 %3, i1 true, i1 %5
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = tail call i32 (...) @killem()
%9 = tail call i32 @exit(i32 0)
unreachable
10: ; preds = %1
ret void
}
void flush_buffer(char *buf, int size) {
  int i = 0;
  for (i = 0; i < size; i++)
    buf[i] = '\0';
}


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

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

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

LLVM IR (-O2):
define void @flush_buffer(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int scan(char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  if (argc > 1) {
    return scan(argv[1]);
  } else {
    fprintf(stderr, "%s <expr>\n", argv[0]);
    return 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1155 <main+0x35>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <scan@plt>
mov    %eax,-0x4(%rbp)
jmp    1178 <main+0x58>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jl     1130 <main+0x10>
mov    0x8(%rsi),%rdi
pop    %rax
jmp    1040 <scan@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"%s <expr>\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @scan(i8* %11)
store i32 %12, i32* %3
br label %19
13: ; preds = %2
%14 = load i32, i32* @stderr
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 0
%17 = load i8*, i8** %16
%18 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %17)
store i32 1, i32* %3
br label %19
19: ; preds = %13, %8
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"%s <expr>\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @scan(i8* %6)
br label %12
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %1
%11 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %8, %4
%13 = phi i32 [ %7, %4 ], [ 1, %8 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ x;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main(int i) {
  float x[] = {0.1, 0.2, 0.3};
  int y;
  y = sizeof(x) / sizeof(float);
  printf("size array = %d\n", y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x3,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x3,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@__const.main.x = [3 x float] [float 0x3FB99999A0000000, float 0x3FC99999A0000000, float 0x3FD3333340000000]
@.str = [17 x i8] c"size array = %d\0A\00"
define void @main(i32 %0) {
%2 = alloca i32
%3 = alloca [3 x float]
%4 = alloca i32
store i32 %0, i32* %2
%5 = bitcast [3 x float]* %3 to i8*
store i32 3, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"size array = %d\0A\00"
define void @main(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 3)
ret void
}
int test_imm_1Dint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x1D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Dint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0x1d,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_1Dint64_highword_mem>:
testb  $0x1d,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_1Dint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 29
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_1Dint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 124554051584
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
scalar_t__ strncmp(char const *, char const *, int /*<<< orphan*/);
int startswith(const char *a, const char *b) {
  return (strncmp(a, b, strlen(b)) == 0);
}


x86 assembly (clang, -O0):
<startswith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startswith>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @startswith(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @strncmp(i8* %5, i8* %6, i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @startswith(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
main(argc, argv) int argc;
char **argv;
{
  int i = 1;
  while (i < argc)
    printf("%s\n", argv[i++]);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1172 <main+0x52>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    113d <main+0x1d>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     1152 <main+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
add    $0x1,%rbx
call   1030 <puts@plt>
cmp    %rbx,%r15
jne    1140 <main+0x20>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %8, %6 ]
%8 = add nuw nsw i64 %7, 1
%9 = getelementptr inbounds i8*, i8** %1, i64 %7
%10 = load i8*, i8** %9
%11 = tail call i32 @puts(i8* dereferenceable(1) %10)
%12 = icmp eq i64 %8, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
tail call void @exit(i32 0)
unreachable
}