xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char const *);
void add_to_string(char *string, const char *addition) {
  strcat(string, addition);
}


x86 assembly (clang, -O0):
<add_to_string>:
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 <strcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_to_string>:
jmp    1030 <strcat@plt>

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

LLVM IR (-O2):
define void @add_to_string(i8* %0, i8* %1) {
%3 = tail call i32 @strcat(i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int copy_quaddobl_target_system_to_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(261, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<copy_quaddobl_target_system_to_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x105,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_quaddobl_target_system_to_container>:
mov    $0x105,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @copy_quaddobl_target_system_to_container() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 261, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_quaddobl_target_system_to_container() {
%1 = tail call i32 @_ada_use_c2phc(i32 261, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_sdsapxsumpw(int, float, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  float v = stdlib_strided_sdsapxsumpw(N, 5.0f, x, stride);
  printf("sum: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%edx
movss  0xe8c(%rip),%xmm0
call   1040 <stdlib_strided_sdsapxsumpw@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
movss  0xebd(%rip),%xmm0
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_sdsapxsumpw@plt>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [9 x i8] c"sum: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [8 x float]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_sdsapxsumpw(i32 %6, float 5.000000e+00, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [9 x i8] c"sum: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_sdsapxsumpw(i32 4, float 5.000000e+00, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
void nocmnt(str) char *str;
{
  while (*str && (*str != ';'))
    str++;
  *str = '\0';
}


x86 assembly (clang, -O0):
<nocmnt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     112d <nocmnt+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3b,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <nocmnt+0x3d>
jmp    114e <nocmnt+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <nocmnt+0x8>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nocmnt>:
movzbl (%rdi),%eax
test   %al,%al
je     1111 <nocmnt+0x11>
cmp    $0x3b,%al
je     1111 <nocmnt+0x11>
add    $0x1,%rdi
jmp    1100 <nocmnt>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @nocmnt(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 59, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2
store i8 0, i8* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  unsigned int x = (unsigned)0 - 1;
  if ((x >= 0) == 0) {
    printf("Error %d\n", (int)1);
    exit(1);
  };
  if (((unsigned)0 - 1 >= 0) == 0) {
    printf("Error %d\n", (int)2);
    exit(2);
  };
  {
    printf("Success\n");
    exit(0);
  };
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setae  %al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
jne    1168 <main+0x48>
lea    0xeae(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [10 x i8] c"Error %d\0A\00"
@.str.1 = [9 x i8] c"Success\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %2
%3 = load i32, i32* %2
%4 = icmp uge i32 %3, 0
%5 = zext i1 %4 to i32
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [8 x i8] c"Success\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
__int128_t __attribute__((no)) shift_13_ll(long long data) {
  return (__int128_t)data << 13;
}


x86 assembly (clang, -O0):
<shift_13_ll>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    %rcx,%rax
sar    $0x3f,%rax
shld   $0xd,%rcx,%rax
shl    $0xd,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift_13_ll>:
mov    %rdi,%rax
mov    %rdi,%rdx
sar    $0x3f,%rdx
shld   $0xd,%rdi,%rdx
shl    $0xd,%rax
ret

LLVM IR (-O0):
define { i64, i64 } @shift_13_ll(i64 %0) {
%2 = alloca i128
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = sext i64 %4 to i128
%6 = shl i128 %5, 13
store i128 %6, i128* %2
%7 = bitcast i128* %2 to { i64, i64 }*
%8 = load { i64, i64 }, { i64, i64 }* %7
ret { i64, i64 } %8
}

LLVM IR (-O2):
define { i64, i64 } @shift_13_ll(i64 %0) {
%2 = sext i64 %0 to i128
%3 = shl nsw i128 %2, 13
%4 = trunc i128 %3 to i64
%5 = lshr i128 %3, 64
%6 = trunc i128 %5 to i64
%7 = insertvalue { i64, i64 } poison, i64 %4, 0
%8 = insertvalue { i64, i64 } %7, i64 %6, 1
ret { i64, i64 } %8
}
void genbltzl() {}


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

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

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

LLVM IR (-O2):
define void @genbltzl() {
ret void
}
unsigned long tobyte(double val) {
  if (val >= 1.0)
    return 0xff;
  if (val <= 0.0)
    return 0x00;
  return val * 255.0;
}


x86 assembly (clang, -O0):
<tobyte>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     112d <tobyte+0x2d>
movq   $0xff,-0x8(%rbp)
jmp    1183 <tobyte+0x83>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1148 <tobyte+0x48>
movq   $0x0,-0x8(%rbp)
jmp    1183 <tobyte+0x83>
movsd  -0x10(%rbp),%xmm0
movsd  0xeb3(%rip),%xmm1
mulsd  %xmm1,%xmm0
movaps %xmm0,%xmm1
cvttsd2si %xmm1,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
movsd  0xea0(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rcx
and    %rdx,%rcx
or     %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tobyte>:
mov    $0xff,%eax
ucomisd 0xef3(%rip),%xmm0
jae    1140 <tobyte+0x40>
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jae    1141 <tobyte+0x41>
mulsd  0xee7(%rip),%xmm0
cvttsd2si %xmm0,%rcx
mov    %rcx,%rdx
sar    $0x3f,%rdx
subsd  0xedb(%rip),%xmm0
cvttsd2si %xmm0,%rax
and    %rdx,%rax
or     %rcx,%rax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @tobyte(double %0) {
%2 = alloca i64
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oge double %4, 1.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 255, i64* %2
br label %15
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp ole double %8, 0.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %7
store i64 0, i64* %2
br label %15
11: ; preds = %7
%12 = load double, double* %3
%13 = fmul double %12, 2.550000e+02
%14 = fptoui double %13 to i64
store i64 %14, i64* %2
br label %15
15: ; preds = %11, %10, %6
%16 = load i64, i64* %2
ret i64 %16
}

LLVM IR (-O2):
define i64 @tobyte(double %0) {
%2 = fcmp ult double %0, 1.000000e+00
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = fcmp ugt double %0, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = fmul double %0, 2.550000e+02
%7 = fptoui double %6 to i64
br label %8
8: ; preds = %3, %1, %5
%9 = phi i64 [ %7, %5 ], [ 255, %1 ], [ 0, %3 ]
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void *worker(void *arg) {
  long i = (long)arg;
  usleep(100000);
}


x86 assembly (clang, -O0):
<worker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x186a0,%edi
call   1030 <usleep@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<worker>:
mov    $0x186a0,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define i8* @worker(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i64
store i64 %6, i64* %4
%7 = call i32 @usleep(i32 100000)
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
define noalias i8* @worker(i8* nocapture readnone %0) {
%2 = tail call i32 @usleep(i32 100000)
ret i8* undef
}
void *nopPtr5(void *a1, void *a2, void *a3, void *a4, void *a5) { return 0; }


x86 assembly (clang, -O0):
<nopPtr5>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @nopPtr5(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @nopPtr5(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i8* nocapture readnone %4) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void __attribute__((no)) foo(long x) {
  if (x >= 1024)
    abort();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x400,-0x8(%rbp)
jl     1131 <foo+0x21>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    $0x400,%rdi
jge    111a <foo+0xa>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @foo(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sge i64 %3, 1024
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @foo(i64 %0) {
%2 = icmp sgt i64 %0, 1023
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
ret void
}
int test_imm_00int32_reg(int val) { return ((val) & (0x00 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    $0xffffffd8,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_00int32_reg(i32 %0) {
ret i32 -40
}
/* Variables and functions */
int /*<<< orphan*/ utempter_remove_record(int);
void removeLineFromUtmp(__attribute__((unused)) const char *pty,
                        int master_fd) {
  (void)utempter_remove_record(master_fd);
}


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

x86 assembly (clang, -O2):
<removeLineFromUtmp>:
mov    %esi,%edi
jmp    1030 <utempter_remove_record@plt>

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

LLVM IR (-O2):
define void @removeLineFromUtmp(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @utempter_remove_record(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/, char const *,
                            int /*<<< orphan*/);
void vfail(const char *fmt, va_list args) {
  vfprintf(stderr, fmt, args);
  fflush(stderr);
  fflush(stdout);
  abort();
  while (1)
    ;
}


x86 assembly (clang, -O0):
<vfail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1050 <vfprintf@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<vfail>:
push   %rbx
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ea3(%rip),%rbx
mov    (%rbx),%edi
call   1050 <vfprintf@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@stdout = global i32 0
define void @vfail(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @vfprintf(i32 %5, i8* %6, i32 %7)
%9 = load i32, i32* @stderr
%10 = call i32 @fflush(i32 %9)
%11 = load i32, i32* @stdout
%12 = call i32 @fflush(i32 %11)
%13 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@stdout = global i32 0
define void @vfail(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @vfprintf(i32 %3, i8* %0, i32 %1)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fflush(i32 %5)
%7 = load i32, i32* @stdout
%8 = tail call i32 @fflush(i32 %7)
%9 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
struct rb_tree {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ rb_root(struct rb_tree *);
int rb_empty(struct rb_tree *tree) { return !rb_root(tree); }


x86 assembly (clang, -O0):
<rb_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rb_root@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rb_empty>:
push   %rax
call   1030 <rb_root@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.rb_tree = type { i32 }
define i32 @rb_empty(%struct.rb_tree* %0) {
%2 = alloca %struct.rb_tree*
store %struct.rb_tree* %0, %struct.rb_tree** %2
%3 = load %struct.rb_tree*, %struct.rb_tree** %2
%4 = call i32 @rb_root(%struct.rb_tree* %3)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.rb_tree = type { i32 }
define i32 @rb_empty(%struct.rb_tree* %0) {
%2 = tail call i32 @rb_root(%struct.rb_tree* %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int main() {
  int *test = malloc(sizeof(int) * 3);
  test[1] = 9;
  free(test);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xc,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x9,0x4(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xc,%edi
call   1040 <malloc@plt>
movl   $0x9,0x4(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @malloc(i32 12)
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 1
store i32 9, i32* %5
%6 = load i32*, i32** %2
%7 = call i32 @free(i32* %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 12)
%2 = getelementptr inbounds i32, i32* %1, i64 1
store i32 9, i32* %2
%3 = tail call i32 @free(i32* %1)
ret i32 0
}
void fc177(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    0;
  };
a : {
  typedef int(*f)[n];
  {
    typedef int(*g)[n];
    0;
  };
  goto a;
  {
    typedef int(*h)[n];
    0;
  };
  ;
  typedef int(*i)[n];
  0;
};
  ;
  typedef int(*j)[n];
  0;
}


x86 assembly (clang, -O0):
<fc177>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fc177+0x7>

x86 assembly (clang, -O2):
<fc177>:
jmp    1100 <fc177>

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

LLVM IR (-O2):
define void @fc177(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *prgname) {
  fprintf(stderr, "usage: %s [OPTIONS] <infile>\n", prgname);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"usage: %s [OPTIONS] <infile>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"usage: %s [OPTIONS] <infile>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int operate(int a, int b, int (*fptr)(int, int)) { return (*fptr)(a, b); }


x86 assembly (clang, -O0):
<operate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<operate>:
jmp    *%rdx

LLVM IR (-O0):
define i32 @operate(i32 %0, i32 %1, i32 (i32, i32)* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32 (i32, i32)*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 (i32, i32)* %2, i32 (i32, i32)** %6
%7 = load i32 (i32, i32)*, i32 (i32, i32)** %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = call i32 %7(i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @operate(i32 %0, i32 %1, i32 (i32, i32)* nocapture %2) {
%4 = tail call i32 %2(i32 %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ getseed(void *);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
void mkrand(void *buf, const int len) {
  srand(getseed(buf));
  int i = 0;
  unsigned char *p;
  p = buf;
  for (; i < len; i++) {
    *p++ = rand() & 0xff;
  }
}


x86 assembly (clang, -O0):
<mkrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getseed@plt>
mov    %eax,%edi
call   1040 <srand@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1197 <mkrand+0x67>
mov    $0x0,%al
call   1050 <rand@plt>
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    115e <mkrand+0x2e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkrand>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
call   1030 <getseed@plt>
mov    %eax,%edi
call   1040 <srand@plt>
test   %ebp,%ebp
jle    1163 <mkrand+0x33>
mov    %ebp,%ebp
xor    %ebx,%ebx
nopl   (%rax)
xor    %eax,%eax
call   1050 <rand@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %ebx,%ebp
jne    1150 <mkrand+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @mkrand(i8* %0, i32 %1) {
%3 = tail call i32 @getseed(i8* %0)
%4 = tail call i32 @srand(i32 %3)
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %14
6: ; preds = %2, %6
%7 = phi i8* [ %11, %6 ], [ %0, %2 ]
%8 = phi i32 [ %12, %6 ], [ 0, %2 ]
%9 = tail call i32 (...) @rand()
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %10, i8* %7
%12 = add nuw nsw i32 %8, 1
%13 = icmp eq i32 %12, %1
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ read_at_ble8(void const *, size_t);
uint8_t read_at_be8(const void *src, size_t offset) {
  return read_at_ble8(src, offset);
}


x86 assembly (clang, -O0):
<read_at_be8>:
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 <read_at_ble8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_at_be8>:
jmp    1030 <read_at_ble8@plt>

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

LLVM IR (-O2):
define i32 @read_at_be8(i8* %0, i64 %1) {
%3 = tail call i32 @read_at_ble8(i8* %0, i64 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
long long __udivmod32(int /*<<< orphan*/, int /*<<< orphan*/, int);
long long __lux_udiv32(uint32_t a, uint32_t b) { return __udivmod32(a, b, 1); }


x86 assembly (clang, -O0):
<__lux_udiv32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x1,%edx
call   1030 <__udivmod32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__lux_udiv32>:
mov    $0x1,%edx
jmp    1030 <__udivmod32@plt>

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

LLVM IR (-O2):
define i64 @__lux_udiv32(i32 %0, i32 %1) {
%3 = tail call i64 @__udivmod32(i32 %0, i32 %1, i32 1)
ret i64 %3
}
struct s3c24x0_interrupt *s3c24x0_get_base_interrupt(void) {
  return (struct s3c24x0_interrupt *)0x14400000;
}


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

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

LLVM IR (-O0):
%struct.s3c24x0_interrupt = type opaque
define %struct.s3c24x0_interrupt* @s3c24x0_get_base_interrupt() {
ret %struct.s3c24x0_interrupt* inttoptr (i64 339738624 to %struct.s3c24x0_interrupt*)
}

LLVM IR (-O2):
%struct.s3c24x0_interrupt = type opaque
define %struct.s3c24x0_interrupt* @s3c24x0_get_base_interrupt() {
ret %struct.s3c24x0_interrupt* inttoptr (i64 339738624 to %struct.s3c24x0_interrupt*)
}
/* Variables and functions */
int LOG_CONS;
int /*<<< orphan*/ LOG_NOTICE;
int LOG_PID;
int /*<<< orphan*/ LOG_USER;
int /*<<< orphan*/ closelog();
int /*<<< orphan*/ openlog(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
int write_syslog_() {
  openlog("newsyslog", LOG_CONS | LOG_PID, LOG_USER);
  syslog(LOG_NOTICE, "this is sample log!!");
  closelog();
  return 0;
}


x86 assembly (clang, -O0):
<write_syslog_>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
mov    0x2e94(%rip),%rax
or     (%rax),%esi
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
lea    0xeaa(%rip),%rdi
call   1050 <openlog@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
lea    0xe9f(%rip),%rsi
call   1040 <syslog@plt>
mov    $0x0,%al
call   1030 <closelog@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_syslog_>:
push   %rax
mov    0x2e98(%rip),%rax
mov    0x2e99(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e9e(%rip),%rax
mov    (%rax),%edx
lea    0xead(%rip),%rdi
call   1050 <openlog@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
lea    0xea2(%rip),%rsi
call   1040 <syslog@plt>
xor    %eax,%eax
call   1030 <closelog@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"newsyslog\00"
@LOG_CONS = global i32 0
@LOG_PID = global i32 0
@LOG_USER = global i32 0
@LOG_NOTICE = global i32 0
@.str.1 = [21 x i8] c"this is sample log!!\00"
define i32 @write_syslog_() {
%1 = load i32, i32* @LOG_CONS
%2 = load i32, i32* @LOG_PID
%3 = or i32 %1, %2
%4 = load i32, i32* @LOG_USER
%5 = call i32 @openlog(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = load i32, i32* @LOG_NOTICE
%7 = call i32 @syslog(i32 %6, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (...) @closelog()
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"newsyslog\00"
@LOG_CONS = global i32 0
@LOG_PID = global i32 0
@LOG_USER = global i32 0
@LOG_NOTICE = global i32 0
@.str.1 = [21 x i8] c"this is sample log!!\00"
define i32 @write_syslog_() {
%1 = load i32, i32* @LOG_CONS
%2 = load i32, i32* @LOG_PID
%3 = or i32 %2, %1
%4 = load i32, i32* @LOG_USER
%5 = tail call i32 @openlog(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = load i32, i32* @LOG_NOTICE
%7 = tail call i32 @syslog(i32 %6, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 (...) @closelog()
ret i32 0
}
int foo(void) {
  char s[2] = "";
  return 0 == s[1];
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x2(%rbp),%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <memset@plt>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca [2 x i8]
%2 = bitcast [2 x i8]* %1 to i8*
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 1
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 0, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ config_set(char const *, char const *, char *);
int config_set_boolean(const char *section, const char *name, int value) {
  char *s;
  if (value)
    s = "yes";
  else
    s = "no";
  config_set(section, name, s);
  return value;
}


x86 assembly (clang, -O0):
<config_set_boolean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     113d <config_set_boolean+0x2d>
lea    0xecc(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    1148 <config_set_boolean+0x38>
lea    0xec0(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <config_set@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_set_boolean>:
push   %rbx
mov    %edx,%ebx
test   %edx,%edx
lea    0xee8(%rip),%rax
lea    0xedd(%rip),%rdx
cmove  %rax,%rdx
call   1030 <config_set@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"yes\00"
@.str.1 = [3 x i8] c"no\00"
define i32 @config_set_boolean(i8* %0, i8* %1, i32 returned %2) {
%4 = icmp eq i32 %2, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
%6 = tail call i32 @config_set(i8* %0, i8* %1, i8* %5)
ret i32 %2
}
int eval(int x, int y) {
  int result;
  result = ((5 * 5) - (x * x)) * ((5 * 5) - (y * y));
  return result;
}


x86 assembly (clang, -O0):
<eval>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
imul   -0x4(%rbp),%ecx
mov    $0x19,%eax
sub    %ecx,%eax
mov    -0x8(%rbp),%edx
imul   -0x8(%rbp),%edx
mov    $0x19,%ecx
sub    %edx,%ecx
imul   %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval>:
imul   %edi,%edi
mov    $0x19,%eax
mov    $0x19,%ecx
sub    %edi,%ecx
imul   %esi,%esi
sub    %esi,%eax
imul   %ecx,%eax
ret

LLVM IR (-O0):
define i32 @eval(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %3
%8 = mul nsw i32 %6, %7
%9 = sub nsw i32 25, %8
%10 = load i32, i32* %4
%11 = load i32, i32* %4
%12 = mul nsw i32 %10, %11
%13 = sub nsw i32 25, %12
%14 = mul nsw i32 %9, %13
store i32 %14, i32* %5
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @eval(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, %0
%4 = sub nsw i32 25, %3
%5 = mul nsw i32 %1, %1
%6 = sub nsw i32 25, %5
%7 = mul nsw i32 %6, %4
ret i32 %7
}
void snd_info_free_entry(struct snd_info_entry *entry) { ; }


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

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

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

LLVM IR (-O2):
%struct.snd_info_entry = type opaque
define void @snd_info_free_entry(%struct.snd_info_entry* nocapture %0) {
ret void
}
int my_float_compare(const void *xv, const void *yv) {
  float *x, *y;
  x = (float *)xv;
  y = (float *)yv;
  if (*x == *y)
    return 0;
  else if (*x < *y)
    return -1;
  else
    return 1;
}


x86 assembly (clang, -O0):
<my_float_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomiss (%rax),%xmm0
jne    1143 <my_float_compare+0x43>
jp     1143 <my_float_compare+0x43>
movl   $0x0,-0x4(%rbp)
jmp    116f <my_float_compare+0x6f>
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
jbe    1168 <my_float_compare+0x68>
movl   $0xffffffff,-0x4(%rbp)
jmp    116f <my_float_compare+0x6f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_float_compare>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
setbe  %cl
xor    %eax,%eax
ucomiss %xmm1,%xmm0
lea    -0x1(%rcx,%rcx,1),%ecx
cmovne %ecx,%eax
cmovp  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @my_float_compare(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca float*
%7 = alloca float*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to float*
store float* %9, float** %6
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to float*
store float* %11, float** %7
%12 = load float*, float** %6
%13 = load float, float* %12
%14 = load float*, float** %7
%15 = load float, float* %14
%16 = fcmp oeq float %13, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 0, i32* %3
br label %26
18: ; preds = %2
%19 = load float*, float** %6
%20 = load float, float* %19
%21 = load float*, float** %7
%22 = load float, float* %21
%23 = fcmp olt float %20, %22
br i1 %23, label %24, label %25
24: ; preds = %18
store i32 -1, i32* %3
br label %26
25: ; preds = %18
store i32 1, i32* %3
br label %26
26: ; preds = %25, %24, %17
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @my_float_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = bitcast i8* %1 to float*
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp oeq float %5, %6
%8 = fcmp olt float %5, %6
%9 = select i1 %8, i32 -1, i32 1
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
/* Type definitions */
struct rlist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ rlist_add_tail(struct rlist *, struct rlist *);
int /*<<< orphan*/ rlist_del(struct rlist *);
void rlist_move_tail(struct rlist *to, struct rlist *item) {
  rlist_del(item);
  rlist_add_tail(to, item);
}


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

x86 assembly (clang, -O2):
<rlist_move_tail>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <rlist_del@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <rlist_add_tail@plt>

LLVM IR (-O0):
%struct.rlist = type { i32 }
define void @rlist_move_tail(%struct.rlist* %0, %struct.rlist* %1) {
%3 = alloca %struct.rlist*
%4 = alloca %struct.rlist*
store %struct.rlist* %0, %struct.rlist** %3
store %struct.rlist* %1, %struct.rlist** %4
%5 = load %struct.rlist*, %struct.rlist** %4
%6 = call i32 @rlist_del(%struct.rlist* %5)
%7 = load %struct.rlist*, %struct.rlist** %3
%8 = load %struct.rlist*, %struct.rlist** %4
%9 = call i32 @rlist_add_tail(%struct.rlist* %7, %struct.rlist* %8)
ret void
}

LLVM IR (-O2):
%struct.rlist = type { i32 }
define void @rlist_move_tail(%struct.rlist* %0, %struct.rlist* %1) {
%3 = tail call i32 @rlist_del(%struct.rlist* %1)
%4 = tail call i32 @rlist_add_tail(%struct.rlist* %0, %struct.rlist* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gNand(int, int);
int gNot(int /*<<< orphan*/);
int gAnd(int a, int b) { return gNot(gNand(a, b)); }


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

x86 assembly (clang, -O2):
<gAnd>:
push   %rax
call   1040 <gNand@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <gNot@plt>

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

LLVM IR (-O2):
define i32 @gAnd(i32 %0, i32 %1) {
%3 = tail call i32 @gNand(i32 %0, i32 %1)
%4 = tail call i32 @gNot(i32 %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint8_t *packer_uint16_pack(uint8_t *buffer, uint16_t value) {
  *buffer++ = (value >> 8) & 0xFF;
  *buffer++ = value & 0xFF;
  return buffer;
}


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

x86 assembly (clang, -O2):
<packer_uint16_pack>:
mov    %esi,%eax
movzbl %ah,%ecx
mov    %ecx,(%rdi)
movzbl %al,%eax
mov    %eax,0x4(%rdi)
lea    0x8(%rdi),%rax
ret

LLVM IR (-O0):
define i32* @packer_uint16_pack(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 8
%7 = and i32 %6, 255
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i32 1
store i32* %9, i32** %3
store i32 %7, i32* %8
%10 = load i32, i32* %4
%11 = and i32 %10, 255
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i32 1
store i32* %13, i32** %3
store i32 %11, i32* %12
%14 = load i32*, i32** %3
ret i32* %14
}

LLVM IR (-O2):
define i32* @packer_uint16_pack(i32* writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = and i32 %3, 255
%5 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %4, i32* %0
%6 = and i32 %1, 255
%7 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %6, i32* %5
ret i32* %7
}
/* Variables and functions */
int /*<<< orphan*/ myprint(char *, int);
int choose(int a, int b) {
  if (a >= b) {
    myprint("the 1st one \n", 13);
  } else {
    myprint("the 2nd one \n", 13);
  }
  return 0;
}


x86 assembly (clang, -O0):
<choose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1140 <choose+0x30>
lea    0xecf(%rip),%rdi
mov    $0xd,%esi
call   1030 <myprint@plt>
jmp    1151 <choose+0x41>
lea    0xec7(%rip),%rdi
mov    $0xd,%esi
call   1030 <myprint@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<choose>:
push   %rax
cmp    %esi,%edi
lea    0xef4(%rip),%rax
lea    0xedf(%rip),%rdi
cmovl  %rax,%rdi
mov    $0xd,%esi
call   1030 <myprint@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"the 1st one \0A\00"
@.str.1 = [14 x i8] c"the 2nd one \0A\00"
define i32 @choose(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sge i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @myprint(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
br label %12
10: ; preds = %2
%11 = call i32 @myprint(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 13)
br label %12
12: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"the 1st one \0A\00"
@.str.1 = [14 x i8] c"the 2nd one \0A\00"
define i32 @choose(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
%5 = tail call i32 @myprint(i8* %4, i32 13)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x15() {
  Assert_real((isxdigit(21) == 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_isxdigit.c",
              110, ("isxdigit should be 0 for 0x15"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x15>:
push   %rax
mov    $0x15,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x6e,%edx
pop    %rax
jmp    1040 <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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x15\00"
define void @t_isxdigit_0x15() {
%1 = call i64 @isxdigit(i32 21)
%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 110, 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x15\00"
define void @t_isxdigit_0x15() {
%1 = tail call i64 @isxdigit(i32 21)
%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 110, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void Mem_free(void *ptr, const char *file, int line) {
  if (ptr) {
    free(ptr);
  }
}


x86 assembly (clang, -O0):
<Mem_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1137 <Mem_free+0x27>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mem_free>:
test   %rdi,%rdi
je     111a <Mem_free+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @Mem_free(i8* %0, i8* nocapture readnone %1, i32 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @free(i8* %0)
br label %7
7: ; preds = %5, %3
ret void
}