xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ removefile_cancel(void *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stderr;
void *threadproc(void *state) {
  sleep(1);
  fprintf(stderr, "cancelling...\n");
  assert(removefile_cancel(state) == 0);
  return NULL;
}


x86 assembly (clang, -O0):
<threadproc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
lea    0xe9a(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1050 <removefile_cancel@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<threadproc>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xea2(%rip),%rsi
call   1040 <fprintf@plt>
mov    %rbx,%rdi
call   1050 <removefile_cancel@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"cancelling...\0A\00"
define i8* @threadproc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @sleep(i32 1)
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %2
%7 = call i64 @removefile_cancel(i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret i8* null
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"cancelling...\0A\00"
define noalias i8* @threadproc(i8* %0) {
%2 = tail call i32 @sleep(i32 1)
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = tail call i64 @removefile_cancel(i8* %0)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
ret i8* null
}
int os_system(const char *s, int *rc) { return -1; }


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

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

LLVM IR (-O0):
define i32 @os_system(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
ret i32 -1
}

LLVM IR (-O2):
define i32 @os_system(i8* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void _be_free_str(char *str) {
  if (str)
    free(str - sizeof(long long));
}


x86 assembly (clang, -O0):
<_be_free_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <_be_free_str+0x24>
mov    -0x8(%rbp),%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_be_free_str>:
test   %rdi,%rdi
je     111e <_be_free_str+0xe>
add    $0xfffffffffffffff8,%rdi
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @_be_free_str(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 -8
%5 = tail call i32 @free(i8* %4)
br label %6
6: ; preds = %3, %1
ret void
}
void av_image_copy_uc_from() {}


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

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

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

LLVM IR (-O2):
define void @av_image_copy_uc_from() {
ret void
}
void destroy_lock(void *lock) {}


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

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

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

LLVM IR (-O2):
define void @destroy_lock(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ state_finit();
void filler_stop(void) { state_finit(); }


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

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

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

LLVM IR (-O2):
define void @filler_stop() {
%1 = tail call i32 (...) @state_finit()
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int copy_dobldobl_container_to_start_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(254, a, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<copy_dobldobl_container_to_start_system>:
mov    $0xfe,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @copy_dobldobl_container_to_start_system() {
%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_c2phc4c(i32 254, 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_dobldobl_container_to_start_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 254, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
scalar_t__ HTTPWrapperIsAlpha(int);
scalar_t__ HTTPWrapperIsAscii(int);
int HTTPWrapperIsAlNum(int c) {
  if (HTTPWrapperIsAscii(c) > 0) {
    if (HTTPWrapperIsAlpha(c) > 0) {
      return c;
    }
    if (c >= 48 && c <= 57) {
      return c;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<HTTPWrapperIsAlNum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <HTTPWrapperIsAscii@plt>
cmp    $0x0,%rax
jle    117e <HTTPWrapperIsAlNum+0x5e>
mov    -0x8(%rbp),%edi
call   1030 <HTTPWrapperIsAlpha@plt>
cmp    $0x0,%rax
jle    115a <HTTPWrapperIsAlNum+0x3a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1185 <HTTPWrapperIsAlNum+0x65>
cmpl   $0x30,-0x8(%rbp)
jl     1179 <HTTPWrapperIsAlNum+0x59>
cmpl   $0x39,-0x8(%rbp)
jg     1179 <HTTPWrapperIsAlNum+0x59>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1185 <HTTPWrapperIsAlNum+0x65>
jmp    117e <HTTPWrapperIsAlNum+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HTTPWrapperIsAlNum>:
push   %rbx
mov    %edi,%ebx
call   1040 <HTTPWrapperIsAscii@plt>
test   %rax,%rax
jle    1141 <HTTPWrapperIsAlNum+0x21>
mov    %ebx,%edi
call   1030 <HTTPWrapperIsAlpha@plt>
lea    -0x30(%rbx),%ecx
cmp    $0xa,%ecx
jb     1143 <HTTPWrapperIsAlNum+0x23>
test   %rax,%rax
jg     1143 <HTTPWrapperIsAlNum+0x23>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @HTTPWrapperIsAlNum(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @HTTPWrapperIsAscii(i32 %4)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %22
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i64 @HTTPWrapperIsAlpha(i32 %8)
%10 = icmp sgt i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = load i32, i32* %3
store i32 %12, i32* %2
br label %23
13: ; preds = %7
%14 = load i32, i32* %3
%15 = icmp sge i32 %14, 48
br i1 %15, label %16, label %21
16: ; preds = %13
%17 = load i32, i32* %3
%18 = icmp sle i32 %17, 57
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = load i32, i32* %3
store i32 %20, i32* %2
br label %23
21: ; preds = %16, %13
br label %22
22: ; preds = %21, %1
store i32 0, i32* %2
br label %23
23: ; preds = %22, %19, %11
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @HTTPWrapperIsAlNum(i32 %0) {
%2 = tail call i64 @HTTPWrapperIsAscii(i32 %0)
%3 = icmp sgt i64 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = tail call i64 @HTTPWrapperIsAlpha(i32 %0)
%6 = icmp sgt i64 %5, 0
%7 = add i32 %0, -48
%8 = icmp ult i32 %7, 10
%9 = or i1 %8, %6
br i1 %9, label %11, label %10
10: ; preds = %4, %1
br label %11
11: ; preds = %4, %10
%12 = phi i32 [ 0, %10 ], [ %0, %4 ]
ret i32 %12
}
void GB_LXOR_f_FP64(double *z, const double *x, const double *y) {
  (*z) = (((*x) != 0) != ((*y) != 0));
}


x86 assembly (clang, -O0):
<GB_LXOR_f_FP64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
mov    -0x18(%rbp),%rcx
movsd  (%rcx),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setne  %cl
setp   %dl
or     %dl,%cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GB_LXOR_f_FP64>:
xorpd  %xmm0,%xmm0
ucomisd (%rsi),%xmm0
setp   %al
setne  %cl
or     %al,%cl
ucomisd (%rdx),%xmm0
setp   %al
setne  %dl
or     %al,%dl
xor    %cl,%dl
movzbl %dl,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @GB_LXOR_f_FP64(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %5
%8 = load double, double* %7
%9 = fcmp une double %8, 0.000000e+00
%10 = zext i1 %9 to i32
%11 = load double*, double** %6
%12 = load double, double* %11
%13 = fcmp une double %12, 0.000000e+00
%14 = zext i1 %13 to i32
%15 = icmp ne i32 %10, %14
%16 = zext i1 %15 to i32
%17 = sitofp i32 %16 to double
%18 = load double*, double** %4
store double %17, double* %18
ret void
}

LLVM IR (-O2):
define void @GB_LXOR_f_FP64(double* nocapture writeonly %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %1
%5 = fcmp une double %4, 0.000000e+00
%6 = load double, double* %2
%7 = fcmp une double %6, 0.000000e+00
%8 = xor i1 %5, %7
%9 = uitofp i1 %8 to double
store double %9, double* %0
ret void
}
void deassert_ptt() {
  *(volatile unsigned long *)((void *)0xfffff400 + 0x30) = (1 << (2));
}


x86 assembly (clang, -O0):
<deassert_ptt>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffff400,%eax
movq   $0x4,0x30(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<deassert_ptt>:
mov    $0xfffff430,%eax
movq   $0x4,(%rax)
ret

LLVM IR (-O0):
define void @deassert_ptt() {
store volatile i64 4, i64* bitcast (i8* getelementptr (i8, i8* inttoptr (i64 4294964224 to i8*), i64 48) to i64*)
ret void
}

LLVM IR (-O2):
define void @deassert_ptt() {
store volatile i64 4, i64* inttoptr (i64 4294964272 to i64*)
ret void
}
int test_imm_62int16_mem(short *val) {
  return ((*val) & (-0x62 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_62int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xffffff9e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_62int16_mem>:
movzwl (%rdi),%eax
test   $0xff9e,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_62int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -98
%7 = icmp ne i32 %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_62int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -98
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct operation {
  int dummy;
};
struct device {
  int dummy;
};
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
struct operation *nop(struct operation *op, struct device *dev, off_t off,
                      off_t max, size_t len) {
  do {
    printf("command not implemented\n");
    return NULL;
  } while (0);
}


x86 assembly (clang, -O0):
<nop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.operation = type { i32 }
%struct.device = type { i32 }
@.str = [25 x i8] c"command not implemented\0A\00"
define %struct.operation* @nop(%struct.operation* %0, %struct.device* %1, i32 %2, i32 %3, i64 %4) {
%6 = alloca %struct.operation*
%7 = alloca %struct.device*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i64
store %struct.operation* %0, %struct.operation** %6
store %struct.device* %1, %struct.device** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i64 %4, i64* %10
br label %11
11: ; preds = %5
%12 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11
ret %struct.operation* null
}

LLVM IR (-O2):
%struct.operation = type { i32 }
%struct.device = type { i32 }
@str = [24 x i8] c"command not implemented\00"
define noalias %struct.operation* @nop(%struct.operation* nocapture readnone %0, %struct.device* nocapture readnone %1, i32 %2, i32 %3, i64 %4) {
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret %struct.operation* null
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ epoll50(struct __test_metadata *);
void wrapper_epoll50(struct __test_metadata *_metadata,
                     struct __fixture_variant_metadata *variant) {
  epoll50(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_epoll50>:
jmp    1030 <epoll50@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll50(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @epoll50(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll50(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @epoll50(%struct.__test_metadata* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int hd_cust(FILE *f) {
  static int count = 0;
  if (!count++)
    printf("No header has been defined for the customer table\n");
  return (0);
}


x86 assembly (clang, -O0):
<hd_cust>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2f0a(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2eff(%rip)
cmp    $0x0,%eax
jne    1142 <hd_cust+0x32>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hd_cust>:
push   %rax
mov    0x2f15(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f0c(%rip)
test   %eax,%eax
jne    1130 <hd_cust+0x20>
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@hd_cust.count = internal global i32 0
@.str = [51 x i8] c"No header has been defined for the customer table\0A\00"
define i32 @hd_cust(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @hd_cust.count
%4 = add nsw i32 %3, 1
store i32 %4, i32* @hd_cust.count
%5 = icmp ne i32 %3, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret i32 0
}

LLVM IR (-O2):
@hd_cust.count = internal unnamed_addr global i32 0
@str = [50 x i8] c"No header has been defined for the customer table\00"
define i32 @hd_cust(i32* nocapture readnone %0) {
%2 = load i32, i32* @hd_cust.count
%3 = add nsw i32 %2, 1
store i32 %3, i32* @hd_cust.count
%4 = icmp eq i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ glCullFace(unsigned int);
void CullFace(unsigned int f) { glCullFace(f); }


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

x86 assembly (clang, -O2):
<CullFace>:
jmp    1030 <glCullFace@plt>

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

LLVM IR (-O2):
define void @CullFace(i32 %0) {
%2 = tail call i32 @glCullFace(i32 %0)
ret void
}
/* Variables and functions */
int task_flag_asserted(int, int);
int task_stopped_asserted(int id) { return task_flag_asserted(id, (1 << 5)); }


x86 assembly (clang, -O0):
<task_stopped_asserted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20,%esi
call   1030 <task_flag_asserted@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<task_stopped_asserted>:
mov    $0x20,%esi
jmp    1030 <task_flag_asserted@plt>

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

LLVM IR (-O2):
define i32 @task_stopped_asserted(i32 %0) {
%2 = tail call i32 @task_flag_asserted(i32 %0, i32 32)
ret i32 %2
}
/* Variables and functions */
int clear_entire_queue();
int /*<<< orphan*/ printf(char *);
void clear_task() {
  printf("Clearing the commit queue...\n");
  switch (clear_entire_queue()) {
  case 0:
    printf("  commit queue is now clear\n");
    break;
  default:
    printf("  ERR: clear failed\n");
  }
}


x86 assembly (clang, -O0):
<clear_task>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <clear_entire_queue@plt>
test   %eax,%eax
jne    1155 <clear_task+0x35>
jmp    1144 <clear_task+0x24>
lea    0xed3(%rip),%rdi
call   1040 <printf@plt>
jmp    1161 <clear_task+0x41>
lea    0xedf(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_task>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <clear_entire_queue@plt>
test   %eax,%eax
lea    0xef4(%rip),%rax
lea    0xed9(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Clearing the commit queue...\0A\00"
@.str.1 = [29 x i8] c" commit queue is now clear\0A\00"
@.str.2 = [21 x i8] c" ERR: clear failed\0A\00"
define void @clear_task() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @clear_entire_queue()
switch i32 %2, label %5 [
i32 0, label %3
]
3: ; preds = %0
%4 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
br label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c"Clearing the commit queue...\00"
@str.3 = [20 x i8] c" ERR: clear failed\00"
@str.4 = [28 x i8] c" commit queue is now clear\00"
define void @clear_task() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @clear_entire_queue()
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @str.3, i64 0, i64 0)
%5 = tail call i32 @puts(i8* dereferenceable(1) %4)
ret void
}
int func(int n) {
  int sum = 0, i;
  for (i = 1; i <= n; ++i) {
    sum += i;
  }
  return sum;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1138 <func+0x38>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <func+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
test   %edi,%edi
jle    1118 <func+0x18>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
shr    %rcx
lea    (%rcx,%rdi,2),%eax
add    $0xffffffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @func(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = shl nuw i32 %0, 1
%5 = add nsw i32 %0, -1
%6 = zext i32 %5 to i33
%7 = add nsw i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %4, %11
%13 = add i32 %12, -1
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}
double bspline_curve(unsigned int n, unsigned int p, const double t[n + 1],
                     const double v[n + 1 - p], double x) {
  return cox_deboor(n, p, t, v, x);
}


x86 assembly (clang, -O0):
<bspline_curve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
movsd  -0x20(%rbp),%xmm0
mov    $0x1,%al
call   1030 <cox_deboor@plt>
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bspline_curve>:
push   %rax
mov    $0x1,%al
call   1030 <cox_deboor@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @bspline_curve(i32 %0, i32 %1, double* %2, double* %3, double %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca double*
%9 = alloca double*
%10 = alloca double
store i32 %0, i32* %6
store i32 %1, i32* %7
store double* %2, double** %8
store double* %3, double** %9
store double %4, double* %10
%11 = load i32, i32* %6
%12 = add i32 %11, 1
%13 = zext i32 %12 to i64
%14 = load i32, i32* %6
%15 = add i32 %14, 1
%16 = load i32, i32* %7
%17 = sub i32 %15, %16
%18 = zext i32 %17 to i64
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = load double*, double** %8
%22 = load double*, double** %9
%23 = load double, double* %10
%24 = call i32 (i32, i32, double*, double*, double, ...) bitcast (i32 (...)* @cox_deboor to i32 (i32, i32, double*, double*, double, ...)*)(i32 %19, i32 %20, double* %21, double* %22, double %23)
%25 = sitofp i32 %24 to double
ret double %25
}

LLVM IR (-O2):
define double @bspline_curve(i32 %0, i32 %1, double* %2, double* %3, double %4) {
%6 = tail call i32 (i32, i32, double*, double*, double, ...) bitcast (i32 (...)* @cox_deboor to i32 (i32, i32, double*, double*, double, ...)*)(i32 %0, i32 %1, double* %2, double* %3, double %4)
%7 = sitofp i32 %6 to double
ret double %7
}
/* Type definitions */
typedef int /*<<< orphan*/ XKeyEvent;

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ malloc(int);
void *alloc_XKeyEvent(void) {
  XKeyEvent *_p = (XKeyEvent *)malloc(sizeof(XKeyEvent));
  if (_p == NULL)
    abort();
  return (void *)_p;
}


x86 assembly (clang, -O0):
<alloc_XKeyEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <alloc_XKeyEvent+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_XKeyEvent>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <alloc_XKeyEvent+0x12>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @alloc_XKeyEvent() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i32*, i32** %1
%10 = bitcast i32* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @alloc_XKeyEvent() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ adjust_heap_max(int *, int, int);
void build_heap_max(int matrix[], int length) {
  int i;
  for (i = length / 2 - 1; i >= 0; i--) {
    adjust_heap_max(matrix, i, length);
  }
}


x86 assembly (clang, -O0):
<build_heap_max>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1157 <build_heap_max+0x47>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <adjust_heap_max@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1130 <build_heap_max+0x20>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_heap_max>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     1145 <build_heap_max+0x35>
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%ebx
shr    %ebx
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
lea    -0x2(%rbx),%esi
mov    %r14,%rdi
mov    %ebp,%edx
call   1030 <adjust_heap_max@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <build_heap_max+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @build_heap_max(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* %4
%7 = sdiv i32 %6, 2
%8 = sub nsw i32 %7, 1
store i32 %8, i32* %5
br label %9
9: ; preds = %17, %2
%10 = load i32, i32* %5
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %9
%13 = load i32*, i32** %3
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = call i32 @adjust_heap_max(i32* %13, i32 %14, i32 %15)
br label %17
17: ; preds = %12
%18 = load i32, i32* %5
%19 = add nsw i32 %18, -1
store i32 %19, i32* %5
br label %9
20: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @build_heap_max(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = lshr i32 %1, 1
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ %8, %6 ], [ %5, %4 ]
%8 = add nsw i32 %7, -1
%9 = tail call i32 @adjust_heap_max(i32* %0, i32 %8, i32 %1)
%10 = icmp ugt i32 %7, 1
br i1 %10, label %6, label %11
11: ; preds = %6, %2
ret void
}
/* Variables and functions */
char *strtok(char *str, const char *delims) {
  (void)str;
  (void)delims;
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @strtok(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
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @strtok(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
/* Variables and functions */
int mt_genrand64_int64();
long long mt_genrand64_int63(void) {
  return (long long)(mt_genrand64_int64() >> 1);
}


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

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

LLVM IR (-O0):
define i64 @mt_genrand64_int63() {
%1 = call i32 (...) @mt_genrand64_int64()
%2 = ashr i32 %1, 1
%3 = sext i32 %2 to i64
ret i64 %3
}

LLVM IR (-O2):
define i64 @mt_genrand64_int63() {
%1 = tail call i32 (...) @mt_genrand64_int64()
%2 = ashr i32 %1, 1
%3 = sext i32 %2 to i64
ret i64 %3
}
void getpid() {}


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

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

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

LLVM IR (-O2):
define void @getpid() {
ret void
}
int int_to_array(int num, int *array, int len) {
  int i;
  for (i = (len - 1); i > 0; i--) {
    array[i] = num % 10;
    num /= 10;
    if (num == 0)
      break;
  }
}


x86 assembly (clang, -O0):
<int_to_array>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jle    1167 <int_to_array+0x67>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1154 <int_to_array+0x54>
jmp    1167 <int_to_array+0x67>
jmp    1159 <int_to_array+0x59>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    1117 <int_to_array+0x17>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_array>:
cmp    $0x2,%edx
jl     114f <int_to_array+0x4f>
mov    %edx,%r9d
nopl   0x0(%rax,%rax,1)
lea    -0x1(%r9),%rcx
mov    %ecx,%r8d
movslq %edi,%rdx
imul   $0x66666667,%rdx,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x22,%rdi
add    %eax,%edi
lea    (%rdi,%rdi,1),%eax
lea    (%rax,%rax,4),%r10d
mov    %edx,%eax
sub    %r10d,%eax
mov    %eax,(%rsi,%r8,4)
add    $0xfffffff6,%edx
cmp    $0xffffffec,%edx
ja     114f <int_to_array+0x4f>
cmp    $0x2,%r9
mov    %rcx,%r9
ja     1110 <int_to_array+0x10>
ret

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

LLVM IR (-O2):
define i32 @int_to_array(i32 %0, i32* nocapture writeonly %1, i32 %2) {
%4 = icmp sgt i32 %2, 1
br i1 %4, label %5, label %19
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %7, %5
%8 = phi i64 [ %6, %5 ], [ %10, %7 ]
%9 = phi i32 [ %0, %5 ], [ %16, %7 ]
%10 = add nsw i64 %8, -1
%11 = srem i32 %9, 10
%12 = and i64 %10, 4294967295
%13 = getelementptr inbounds i32, i32* %1, i64 %12
store i32 %11, i32* %13
%14 = add i32 %9, -10
%15 = icmp ult i32 %14, -19
%16 = sdiv i32 %9, 10
%17 = icmp ugt i64 %8, 2
%18 = select i1 %15, i1 %17, i1 false
br i1 %18, label %7, label %19
19: ; preds = %7, %3
ret i32 undef
}
int si_has_missing_return_3(int x) {
  if (x)
    return si_has_missing_return_3(x + 1);
}


x86 assembly (clang, -O0):
<si_has_missing_return_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1133 <si_has_missing_return_3+0x23>
mov    -0x8(%rbp),%edi
add    $0x1,%edi
call   1030 <si_has_missing_return_3@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @si_has_missing_return_3(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ trap_R_RegisterShaderNoMip(char *);
void UI_Challenges_Cache(void) {
  trap_R_RegisterShaderNoMip("menu/"
                             "art_blueish"
                             "/frame2_l");
  trap_R_RegisterShaderNoMip("menu/"
                             "art_blueish"
                             "/frame1_r");
  trap_R_RegisterShaderNoMip("menu/"
                             "art_blueish"
                             "/back_0");
  trap_R_RegisterShaderNoMip("menu/"
                             "art_blueish"
                             "/back_1");
}


x86 assembly (clang, -O0):
<UI_Challenges_Cache>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xef3(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xf01(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xf0d(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<UI_Challenges_Cache>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xef6(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xf04(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xf10(%rip),%rdi
pop    %rax
jmp    1030 <trap_R_RegisterShaderNoMip@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"menu/art_blueish/frame2_l\00"
@.str.1 = [26 x i8] c"menu/art_blueish/frame1_r\00"
@.str.2 = [24 x i8] c"menu/art_blueish/back_0\00"
@.str.3 = [24 x i8] c"menu/art_blueish/back_1\00"
define void @UI_Challenges_Cache() {
%1 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"menu/art_blueish/frame2_l\00"
@.str.1 = [26 x i8] c"menu/art_blueish/frame1_r\00"
@.str.2 = [24 x i8] c"menu/art_blueish/back_0\00"
@.str.3 = [24 x i8] c"menu/art_blueish/back_1\00"
define void @UI_Challenges_Cache() {
%1 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
ret void
}
void zomb_fill(void *arg) {}


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

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

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

LLVM IR (-O2):
define void @zomb_fill(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void lex_postag_delete(char *p) {
  if (p) {
    free(p);
  }
}


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

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

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

LLVM IR (-O2):
define void @lex_postag_delete(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
unsigned int splitmix32(const unsigned long seed) {
  unsigned long result = (seed ^ (seed >> 33)) * 0x62a9d9ed799705f5ul;
  result = (result ^ (result >> 28)) * 0xcb24d0a5c88c35b3ul;
  return (unsigned int)(result >> 32);
}


x86 assembly (clang, -O0):
<splitmix32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x21,%rcx
xor    %rcx,%rax
movabs $0x62a9d9ed799705f5,%rcx
d9 a9 62
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    $0x1c,%rcx
xor    %rcx,%rax
movabs $0xcb24d0a5c88c35b3,%rcx
d0 24 cb
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x20,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<splitmix32>:
mov    %rdi,%rax
shr    $0x21,%rax
xor    %rdi,%rax
movabs $0x62a9d9ed799705f5,%rcx
d9 a9 62
imul   %rax,%rcx
mov    %rcx,%rdx
shr    $0x1c,%rdx
xor    %rcx,%rdx
movabs $0xcb24d0a5c88c35b3,%rax
d0 24 cb
imul   %rdx,%rax
shr    $0x20,%rax
ret

LLVM IR (-O0):
define i32 @splitmix32(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = load i64, i64* %2
%6 = lshr i64 %5, 33
%7 = xor i64 %4, %6
%8 = mul i64 %7, 7109453100751455733
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = load i64, i64* %3
%11 = lshr i64 %10, 28
%12 = xor i64 %9, %11
%13 = mul i64 %12, -3808689974395783757
store i64 %13, i64* %3
%14 = load i64, i64* %3
%15 = lshr i64 %14, 32
%16 = trunc i64 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @splitmix32(i64 %0) {
%2 = lshr i64 %0, 33
%3 = xor i64 %2, %0
%4 = mul i64 %3, 7109453100751455733
%5 = lshr i64 %4, 28
%6 = xor i64 %5, %4
%7 = mul i64 %6, -3808689974395783757
%8 = lshr i64 %7, 32
%9 = trunc i64 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x69() {
  Assert_real((isdigit(105) == 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_isdigit.c",
              530, ("isdigit should be 0 for i"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for i\00"
define void @t_isdigit_0x69() {
%1 = tail call i64 @isdigit(i32 105)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 530, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int varCharIndex(char var) {
  switch (var) {
  case 'x':
    return 0;
  case 'y':
    return 1;
  case 'z':
    return 2;
  default:
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<varCharIndex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x78,%eax
je     1141 <varCharIndex+0x41>
jmp    111f <varCharIndex+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x79,%eax
je     114d <varCharIndex+0x4d>
jmp    1130 <varCharIndex+0x30>
mov    -0xc(%rbp),%eax
sub    $0x7a,%eax
je     1159 <varCharIndex+0x59>
jmp    1165 <varCharIndex+0x65>
movl   $0x0,-0x4(%rbp)
jmp    1171 <varCharIndex+0x71>
movl   $0x1,-0x4(%rbp)
jmp    1171 <varCharIndex+0x71>
movl   $0x2,-0x4(%rbp)
jmp    1171 <varCharIndex+0x71>
jmp    116a <varCharIndex+0x6a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<varCharIndex>:
xor    %ecx,%ecx
cmp    $0x79,%dil
sete   %cl
cmp    $0x7a,%dil
mov    $0x2,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @varCharIndex(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %9 [
i32 120, label %6
i32 121, label %7
i32 122, label %8
]
6: ; preds = %1
store i32 0, i32* %2
br label %11
7: ; preds = %1
store i32 1, i32* %2
br label %11
8: ; preds = %1
store i32 2, i32* %2
br label %11
9: ; preds = %1
br label %10
10: ; preds = %9
store i32 0, i32* %2
br label %11
11: ; preds = %10, %8, %7, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @varCharIndex(i8 signext %0) {
%2 = icmp eq i8 %0, 121
%3 = zext i1 %2 to i32
%4 = icmp eq i8 %0, 122
%5 = select i1 %4, i32 2, i32 %3
ret i32 %5
}
int clad_comparei(int one, int two) {
  if (one < two)
    return -1;
  if (one > two)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<clad_comparei>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1122 <clad_comparei+0x22>
movl   $0xffffffff,-0x4(%rbp)
jmp    1141 <clad_comparei+0x41>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113a <clad_comparei+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <clad_comparei+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clad_comparei>:
xor    %ecx,%ecx
cmp    %esi,%edi
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @clad_comparei(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = icmp sgt i32 %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ uart0_putchar(char const);
int write(int fd, const void *buf, size_t count) {
  size_t n;
  for (n = 0; n < count; n++)
    uart0_putchar(((const char *)buf)[n]);
  return count;
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    115b <write+0x4b>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <uart0_putchar@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112b <write+0x1b>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
test   %rdx,%rdx
je     1143 <write+0x33>
mov    %rsi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1030 <uart0_putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <write+0x20>
mov    %r15d,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @write(i32 %0, i8* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %12, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %10, %5 ], [ 0, %3 ]
%7 = getelementptr inbounds i8, i8* %1, i64 %6
%8 = load i8, i8* %7
%9 = tail call i32 @uart0_putchar(i8 signext %8)
%10 = add nuw i64 %6, 1
%11 = icmp eq i64 %10, %2
br i1 %11, label %12, label %5
12: ; preds = %5, %3
%13 = trunc i64 %2 to i32
ret i32 %13
}
int up_add_monitor(const char *name) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @up_add_monitor(i8* nocapture readnone %0) {
ret i32 0
}