xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char const *);
int PrintError(char *buffer, const char *message) {
  strcat(buffer, "\nError: ");
  strcat(buffer, message);
  strcat(buffer, "\n");
  return 1;
}


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

x86 assembly (clang, -O2):
<PrintError>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xedf(%rip),%rsi
call   1030 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcat@plt>
lea    0xed1(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcat@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"\0AError: \00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @PrintError(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 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @strcat(i8* %7, i8* %8)
%10 = load i8*, i8** %3
%11 = call i32 @strcat(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [9 x i8] c"\0AError: \00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @PrintError(i8* %0, i8* %1) {
%3 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @strcat(i8* %0, i8* %1)
%5 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}
/* Type definitions */
struct tms {
  int tms_utime;
  int tms_stime;
  int tms_cutime;
  int tms_cstime;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void printTimes(struct tms strucTimes) {
  printf("USER: %d, SYS: %d\n", strucTimes.tms_utime, strucTimes.tms_stime);
  printf("CUSER: %d, CSYS: %d\n", strucTimes.tms_cutime, strucTimes.tms_cstime);
}


x86 assembly (clang, -O0):
<printTimes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printTimes>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rsi
mov    %rdi,%rdx
shr    $0x20,%rdx
mov    %r14,%rbx
shr    $0x20,%rbx
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
mov    %r14d,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.tms = type { i32, i32, i32, i32 }
@.str = [19 x i8] c"USER: %d, SYS: %d\0A\00"
@.str.1 = [21 x i8] c"CUSER: %d, CSYS: %d\0A\00"
define void @printTimes(i64 %0, i64 %1) {
%3 = alloca %struct.tms
%4 = bitcast %struct.tms* %3 to { i64, i64 }*
%5 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %4, i32 0, i32 0
store i64 %0, i64* %5
%6 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %4, i32 0, i32 1
store i64 %1, i64* %6
%7 = getelementptr inbounds %struct.tms, %struct.tms* %3, i32 0, i32 0
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.tms, %struct.tms* %3, i32 0, i32 1
%10 = load i32, i32* %9
%11 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %10)
%12 = getelementptr inbounds %struct.tms, %struct.tms* %3, i32 0, i32 2
%13 = load i32, i32* %12
%14 = getelementptr inbounds %struct.tms, %struct.tms* %3, i32 0, i32 3
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"USER: %d, SYS: %d\0A\00"
@.str.1 = [21 x i8] c"CUSER: %d, CSYS: %d\0A\00"
define void @printTimes(i64 %0, i64 %1) {
%3 = trunc i64 %0 to i32
%4 = lshr i64 %0, 32
%5 = trunc i64 %4 to i32
%6 = trunc i64 %1 to i32
%7 = lshr i64 %1, 32
%8 = trunc i64 %7 to i32
%9 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %8)
ret void
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double get_time(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec + tv.tv_usec / 1000000.0;
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xec9(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  0x10(%rsp),%xmm0
divsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @get_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load double, double* %5
%7 = fdiv double %6, 1.000000e+06
%8 = fadd double %4, %7
ret double %8
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @get_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load double, double* %6
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %5, %8
ret double %9
}
void __clear_cache(void *start, void *end) {}


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

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

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

LLVM IR (-O2):
define void @__clear_cache(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
struct memorycontainer {
  int dummy;
};

/* Variables and functions */
struct memorycontainer *
createUnaryGeneralMathsExpression(struct memorycontainer *, int);
struct memorycontainer *
createACosExpression(struct memorycontainer *expression) {
  return createUnaryGeneralMathsExpression(expression, 0x0005);
}


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

x86 assembly (clang, -O2):
<createACosExpression>:
mov    $0x5,%esi
jmp    1030 <createUnaryGeneralMathsExpression@plt>

LLVM IR (-O0):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createACosExpression(%struct.memorycontainer* %0) {
%2 = alloca %struct.memorycontainer*
store %struct.memorycontainer* %0, %struct.memorycontainer** %2
%3 = load %struct.memorycontainer*, %struct.memorycontainer** %2
%4 = call %struct.memorycontainer* @createUnaryGeneralMathsExpression(%struct.memorycontainer* %3, i32 5)
ret %struct.memorycontainer* %4
}

LLVM IR (-O2):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createACosExpression(%struct.memorycontainer* %0) {
%2 = tail call %struct.memorycontainer* @createUnaryGeneralMathsExpression(%struct.memorycontainer* %0, i32 5)
ret %struct.memorycontainer* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void bar() { printf("hello\n"); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"hello\0A\00"
define void @bar() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
define void @bar() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ call(char *);
uge() { call("ccuge"); }


x86 assembly (clang, -O0):
<uge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <call@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uge>:
lea    0xee9(%rip),%rdi
jmp    1030 <call@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"ccuge\00"
define i32 @uge() {
%1 = alloca i32
%2 = call i32 @call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [6 x i8] c"ccuge\00"
define i32 @uge() {
%1 = tail call i32 @call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
void exit(const int status) { _Exit(status); }


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

x86 assembly (clang, -O2):
<exit>:
push   %rax
call   1030 <_Exit@plt>

LLVM IR (-O0):
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
unreachable
}

LLVM IR (-O2):
define void @exit(i32 %0) {
tail call void @_Exit(i32 %0)
unreachable
}
/* Type definitions */
struct cd_grid {
  int dummy;
};

/* Variables and functions */
int cd_grid_double_dt_sqeuc(struct cd_grid **, struct cd_grid *);
int cd_grid_double_sedt(struct cd_grid **gp_dt, struct cd_grid *g_func) {
  return cd_grid_double_dt_sqeuc(gp_dt, g_func);
}


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

x86 assembly (clang, -O2):
<cd_grid_double_sedt>:
jmp    1030 <cd_grid_double_dt_sqeuc@plt>

LLVM IR (-O0):
%struct.cd_grid = type { i32 }
define i32 @cd_grid_double_sedt(%struct.cd_grid** %0, %struct.cd_grid* %1) {
%3 = alloca %struct.cd_grid**
%4 = alloca %struct.cd_grid*
store %struct.cd_grid** %0, %struct.cd_grid*** %3
store %struct.cd_grid* %1, %struct.cd_grid** %4
%5 = load %struct.cd_grid**, %struct.cd_grid*** %3
%6 = load %struct.cd_grid*, %struct.cd_grid** %4
%7 = call i32 @cd_grid_double_dt_sqeuc(%struct.cd_grid** %5, %struct.cd_grid* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.cd_grid = type { i32 }
define i32 @cd_grid_double_sedt(%struct.cd_grid** %0, %struct.cd_grid* %1) {
%3 = tail call i32 @cd_grid_double_dt_sqeuc(%struct.cd_grid** %0, %struct.cd_grid* %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_srli_epi32(int /*<<< orphan*/, int);
__m128i test_mm_srli_epi32(__m128i A) { return _mm_srli_epi32(A, 1); }


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

x86 assembly (clang, -O2):
<test_mm_srli_epi32>:
mov    $0x1,%esi
jmp    1030 <_mm_srli_epi32@plt>

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

LLVM IR (-O2):
define i32 @test_mm_srli_epi32(i32 %0) {
%2 = tail call i32 @_mm_srli_epi32(i32 %0, i32 1)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_mutex_unlock(int /*<<< orphan*/ *);
void _jobqueue_fetch_cleanup(void *arg) {
  pthread_mutex_t *mutex = (pthread_mutex_t *)arg;
  pthread_mutex_unlock(mutex);
}


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

x86 assembly (clang, -O2):
<_jobqueue_fetch_cleanup>:
jmp    1030 <pthread_mutex_unlock@plt>

LLVM IR (-O0):
define void @_jobqueue_fetch_cleanup(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @pthread_mutex_unlock(i32* %6)
ret void
}

LLVM IR (-O2):
define void @_jobqueue_fetch_cleanup(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @pthread_mutex_unlock(i32* %2)
ret void
}
int foo(int v __attribute__((annotate("param_ann_0")))
        __attribute__((annotate("param_ann_1")))) {
  return v + 1;
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"param_ann_0\00", section "llvm.metadata"
@.str.1 = [62 x i8] c"/home/jiang/dataset/exebench/tmp/tmpkzsp6p6h/formatted_code.c\00", section "llvm.metadata"
@.str.2 = [12 x i8] c"param_ann_1\00", section "llvm.metadata"
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = bitcast i32* %2 to i8*
%4 = bitcast i32* %2 to i8*
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
@.str = [12 x i8] c"param_ann_0\00", section "llvm.metadata"
@.str.1 = [62 x i8] c"/home/jiang/dataset/exebench/tmp/tmpkzsp6p6h/formatted_code.c\00", section "llvm.metadata"
@.str.2 = [12 x i8] c"param_ann_1\00", section "llvm.metadata"
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = add nsw i32 %0, 1
ret i32 %4
}
int test_imm_46uint16_mem(unsigned short *val) {
  return ((*val) & (-0x46 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_46uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -70
%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_46uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -70
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int mod255(int x) {
  while (x >= 255) {
    x -= 255;
    x = (x >> 8) + (x & 255);
  }
  return (x);
}


x86 assembly (clang, -O0):
<mod255>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xff,-0x4(%rbp)
jl     1138 <mod255+0x38>
mov    -0x4(%rbp),%eax
sub    $0xff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1107 <mod255+0x7>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod255>:
mov    %edi,%eax
cmp    $0xff,%edi
jl     1126 <mod255+0x26>
nopw   0x0(%rax,%rax,1)
add    $0xffffff01,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
movzbl %al,%eax
add    %ecx,%eax
cmp    $0xfe,%eax
ja     1110 <mod255+0x10>
ret

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

LLVM IR (-O2):
define i32 @mod255(i32 %0) {
%2 = icmp sgt i32 %0, 254
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -255
%6 = lshr i32 %5, 8
%7 = and i32 %5, 255
%8 = add nuw nsw i32 %6, %7
%9 = icmp ugt i32 %8, 254
br i1 %9, label %3, label %10
10: ; preds = %3, %1
%11 = phi i32 [ %0, %1 ], [ %8, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void exit_with_help() {
  printf("Usage: predict [options] test_file model_file output_file\n"
         "options:\n"
         "-b probability_estimates: whether to output probability estimates, 0 "
         "or 1 (default 0); currently for logistic regression only\n"
         "-q : quiet mode (no outputs)\n");
  exit(1);
}


x86 assembly (clang, -O0):
<exit_with_help>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [223 x i8] c"Usage: predict [options] test_file model_file output_file\0Aoptions:\0A-b probability_estimates: whether to output probability estimates, 0 or 1 (default 0); currently for logistic regression only\0A-q : quiet mode (no outputs)\0A\00"
define void @exit_with_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([223 x i8], [223 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [222 x i8] c"Usage: predict [options] test_file model_file output_file\0Aoptions:\0A-b probability_estimates: whether to output probability estimates, 0 or 1 (default 0); currently for logistic regression only\0A-q : quiet mode (no outputs)\00"
define void @exit_with_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([222 x i8], [222 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ out_char(char);
void out_char_int(int i) { out_char((char)i); }


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

x86 assembly (clang, -O2):
<out_char_int>:
movsbl %dil,%edi
jmp    1030 <out_char@plt>

LLVM IR (-O0):
define void @out_char_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = call i32 @out_char(i8 signext %4)
ret void
}

LLVM IR (-O2):
define void @out_char_int(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = tail call i32 @out_char(i8 signext %2)
ret void
}
unsigned long long ms_to_ns(unsigned long long _ms) { return _ms * 1000000L; }


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

x86 assembly (clang, -O2):
<ms_to_ns>:
imul   $0xf4240,%rdi,%rax
ret

LLVM IR (-O0):
define i64 @ms_to_ns(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 1000000
ret i64 %4
}

LLVM IR (-O2):
define i64 @ms_to_ns(i64 %0) {
%2 = mul i64 %0, 1000000
ret i64 %2
}
int H264_GetFPS(unsigned int FrPay) {
  int fps = 0;
  unsigned short frH = (FrPay & 0xFF000000) >> 16;
  unsigned short frL = (FrPay & 0x00FF0000) >> 16;
  unsigned short fr = (frH | frL);
  fps = ((unsigned int)10000000 / fr) >> 8;
  return fps;
}


x86 assembly (clang, -O0):
<H264_GetFPS>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff000000,%eax
shr    $0x10,%eax
mov    %ax,-0xa(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff0000,%eax
shr    $0x10,%eax
mov    %ax,-0xc(%rbp)
movzwl -0xa(%rbp),%eax
movzwl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %ax,-0xe(%rbp)
movzwl -0xe(%rbp),%ecx
mov    $0x989680,%eax
xor    %edx,%edx
div    %ecx
shr    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<H264_GetFPS>:
shr    $0x10,%edi
mov    $0x989680,%eax
xor    %edx,%edx
div    %edi
shr    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @H264_GetFPS(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
store i32 %0, i32* %2
store i32 0, i32* %3
%7 = load i32, i32* %2
%8 = and i32 %7, -16777216
%9 = lshr i32 %8, 16
%10 = trunc i32 %9 to i16
store i16 %10, i16* %4
%11 = load i32, i32* %2
%12 = and i32 %11, 16711680
%13 = lshr i32 %12, 16
%14 = trunc i32 %13 to i16
store i16 %14, i16* %5
%15 = load i16, i16* %4
%16 = zext i16 %15 to i32
%17 = load i16, i16* %5
%18 = zext i16 %17 to i32
%19 = or i32 %16, %18
%20 = trunc i32 %19 to i16
store i16 %20, i16* %6
%21 = load i16, i16* %6
%22 = zext i16 %21 to i32
%23 = udiv i32 10000000, %22
%24 = lshr i32 %23, 8
store i32 %24, i32* %3
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @H264_GetFPS(i32 %0) {
%2 = lshr i32 %0, 16
%3 = udiv i32 10000000, %2
%4 = lshr i32 %3, 8
ret i32 %4
}
__attribute__((noipa)) void bar(void) {
  volatile int v = 1;
  if (v)
    __builtin_abort();
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    $0x0,%eax
je     1130 <bar+0x20>
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
movl   $0x1,0x4(%rsp)
cmpl   $0x0,0x4(%rsp)
jne    1122 <bar+0x12>
pop    %rax
ret
call   1030 <abort@plt>

LLVM IR (-O0):
define void @bar() {
%1 = alloca i32
store volatile i32 1, i32* %1
%2 = load volatile i32, i32* %1
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
unreachable
5: ; preds = %0
ret void
}

LLVM IR (-O2):
define void @bar() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 1, i32* %1
%3 = load volatile i32, i32* %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %0
tail call void @abort()
unreachable
6: ; preds = %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void die(char *msg) {
  fprintf(stderr, "%s\n", msg);
  exit(0);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @die(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 ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ DisableListing();
int /*<<< orphan*/ EnableListing();
int /*<<< orphan*/ SetBoolOption(unsigned char *);
void DoList(void) {
  unsigned char List = 0;
  SetBoolOption(&List);
  if (List) {
    EnableListing();
  } else {
    DisableListing();
  }
}


x86 assembly (clang, -O0):
<DoList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
lea    -0x1(%rbp),%rdi
call   1030 <SetBoolOption@plt>
cmpb   $0x0,-0x1(%rbp)
je     115b <DoList+0x2b>
mov    $0x0,%al
call   1050 <EnableListing@plt>
jmp    1162 <DoList+0x32>
mov    $0x0,%al
call   1040 <DisableListing@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoList>:
push   %rax
movb   $0x0,0x7(%rsp)
lea    0x7(%rsp),%rdi
call   1030 <SetBoolOption@plt>
cmpb   $0x0,0x7(%rsp)
je     1150 <DoList+0x20>
xor    %eax,%eax
call   1050 <EnableListing@plt>
pop    %rax
ret
xor    %eax,%eax
call   1040 <DisableListing@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @DoList() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 @SetBoolOption(i8* %1)
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 (...) @EnableListing()
br label %9
7: ; preds = %0
%8 = call i32 (...) @DisableListing()
br label %9
9: ; preds = %7, %5
ret void
}
/* Variables and functions */
int inb(short);
int /*<<< orphan*/ outb(short, char);
void serial_txint(short combase, char c) {
  c = (c && c) << 1;
  c = c | (inb(combase + 1) & ~0x02);
  outb(combase + 1, c);
}


x86 assembly (clang, -O0):
<serial_txint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movsbl -0x3(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x4(%rbp)
je     1154 <serial_txint+0x34>
movsbl -0x3(%rbp),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x4(%rbp)
mov    -0x4(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
shl    $0x1,%eax
mov    %al,-0x3(%rbp)
movsbl -0x3(%rbp),%eax
mov    %eax,-0x8(%rbp)
movswl -0x2(%rbp),%eax
add    $0x1,%eax
movswl %ax,%edi
call   1040 <inb@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
and    $0xfffffffd,%ecx
or     %ecx,%eax
mov    %al,-0x3(%rbp)
movswl -0x2(%rbp),%eax
add    $0x1,%eax
movswl %ax,%edi
movsbl -0x3(%rbp),%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_txint>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
test   %sil,%sil
setne  %bl
add    $0x1,%edi
movswl %di,%ebp
mov    %ebp,%edi
call   1040 <inb@plt>
and    $0xfd,%eax
lea    (%rax,%rbx,2),%eax
movsbl %al,%esi
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @serial_txint(i16 signext %0, i8 signext %1) {
%3 = alloca i16
%4 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8, i8* %4
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br label %12
12: ; preds = %8, %2
%13 = phi i1 [ false, %2 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
%15 = shl i32 %14, 1
%16 = trunc i32 %15 to i8
store i8 %16, i8* %4
%17 = load i8, i8* %4
%18 = sext i8 %17 to i32
%19 = load i16, i16* %3
%20 = sext i16 %19 to i32
%21 = add nsw i32 %20, 1
%22 = trunc i32 %21 to i16
%23 = call i32 @inb(i16 signext %22)
%24 = and i32 %23, -3
%25 = or i32 %18, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %4
%27 = load i16, i16* %3
%28 = sext i16 %27 to i32
%29 = add nsw i32 %28, 1
%30 = trunc i32 %29 to i16
%31 = load i8, i8* %4
%32 = call i32 @outb(i16 signext %30, i8 signext %31)
ret void
}

LLVM IR (-O2):
define void @serial_txint(i16 signext %0, i8 signext %1) {
%3 = icmp eq i8 %1, 0
%4 = select i1 %3, i32 0, i32 2
%5 = add i16 %0, 1
%6 = tail call i32 @inb(i16 signext %5)
%7 = and i32 %6, 253
%8 = or i32 %7, %4
%9 = trunc i32 %8 to i8
%10 = tail call i32 @outb(i16 signext %5, i8 signext %9)
ret void
}
/* Variables and functions */
int M_PI_2;
float pow(int, int);
float sin(int);
float ElasticEaseIn(float p) {
  return sin(13 * M_PI_2 * p) * pow(2, 10 * (p - 1));
}


x86 assembly (clang, -O0):
<ElasticEaseIn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    0x2eb4(%rip),%rax
imul   $0xd,(%rax),%eax
cvtsi2ss %eax,%xmm0
mulss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <sin@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  0xea9(%rip),%xmm0
subss  %xmm0,%xmm1
movss  0xe99(%rip),%xmm0
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%esi
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ElasticEaseIn>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%eax
lea    (%rax,%rax,2),%ecx
lea    (%rax,%rcx,4),%eax
cvtsi2ss %eax,%xmm1
movss  %xmm0,(%rsp)
mulss  %xmm0,%xmm1
cvttss2si %xmm1,%edi
call   1030 <sin@plt>
movss  %xmm0,0x4(%rsp)
movss  (%rsp),%xmm0
addss  0xea7(%rip),%xmm0
mulss  0xea3(%rip),%xmm0
cvttss2si %xmm0,%esi
mov    $0x2,%edi
call   1040 <pow@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI_2 = global i32 0
define float @ElasticEaseIn(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load i32, i32* @M_PI_2
%4 = mul nsw i32 13, %3
%5 = sitofp i32 %4 to float
%6 = load float, float* %2
%7 = fmul float %5, %6
%8 = fptosi float %7 to i32
%9 = call float @sin(i32 %8)
%10 = load float, float* %2
%11 = fsub float %10, 1.000000e+00
%12 = fmul float 1.000000e+01, %11
%13 = fptosi float %12 to i32
%14 = call float @pow(i32 2, i32 %13)
%15 = fmul float %9, %14
ret float %15
}

LLVM IR (-O2):
@M_PI_2 = global i32 0
define float @ElasticEaseIn(float %0) {
%2 = load i32, i32* @M_PI_2
%3 = mul nsw i32 %2, 13
%4 = sitofp i32 %3 to float
%5 = fmul float %4, %0
%6 = fptosi float %5 to i32
%7 = tail call float @sin(i32 %6)
%8 = fadd float %0, -1.000000e+00
%9 = fmul float %8, 1.000000e+01
%10 = fptosi float %9 to i32
%11 = tail call float @pow(i32 2, i32 %10)
%12 = fmul float %7, %11
ret float %12
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_7490() {
  Assert_real((isqrt(7490) == 86),
              "/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/stdlib/isqrt.c",
              1430, ("Integer square root of 7490 should be 86"));
}


x86 assembly (clang, -O0):
<t_sqrt_7490>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1d42,%edi
call   1030 <isqrt@plt>
cmp    $0x56,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x596,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_7490>:
push   %rax
mov    $0x1d42,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x56,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x596,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [41 x i8] c"Integer square root of 7490 should be 86\00"
define void @t_sqrt_7490() {
%1 = call i32 @isqrt(i32 7490)
%2 = icmp eq i32 %1, 86
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1430, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [41 x i8] c"Integer square root of 7490 should be 86\00"
define void @t_sqrt_7490() {
%1 = tail call i32 @isqrt(i32 7490)
%2 = icmp eq i32 %1, 86
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1430, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__9__GeneralIO__makeOutput();
void LedsP__Led2__makeOutput(void) { Msp430GpioC__9__GeneralIO__makeOutput(); }


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

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

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

LLVM IR (-O2):
define void @LedsP__Led2__makeOutput() {
%1 = tail call i32 (...) @Msp430GpioC__9__GeneralIO__makeOutput()
ret void
}
int main() {
  char s[100];
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void menuControls(void) {}


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

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

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

LLVM IR (-O2):
define void @menuControls() {
ret void
}
float get_min_angle(int min) { return min * 6; }


x86 assembly (clang, -O0):
<get_min_angle>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x6,-0x4(%rbp),%eax
cvtsi2ss %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_min_angle>:
add    %edi,%edi
lea    (%rdi,%rdi,2),%eax
cvtsi2ss %eax,%xmm0
ret

LLVM IR (-O0):
define float @get_min_angle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 6
%5 = sitofp i32 %4 to float
ret float %5
}

LLVM IR (-O2):
define float @get_min_angle(i32 %0) {
%2 = mul nsw i32 %0, 6
%3 = sitofp i32 %2 to float
ret float %3
}
/* Variables and functions */
void pthread_exit(void *);
void sirius_pthread_exit(void *retval) { return pthread_exit(retval); }


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

x86 assembly (clang, -O2):
<sirius_pthread_exit>:
jmp    1030 <pthread_exit@plt>

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

LLVM IR (-O2):
define void @sirius_pthread_exit(i8* %0) {
tail call void @pthread_exit(i8* %0)
ret void
}
/* Type definitions */
typedef unsigned char const uint32_t;

/* Variables and functions */
uint32_t read_le32(const char *buf) {
  const unsigned char *b = (const unsigned char *)buf;
  return b[0] | (b[1] << 8) | (b[2] << 16) | (b[3] << 24);
}


x86 assembly (clang, -O0):
<read_le32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_le32>:
mov    (%rdi),%al
ret

LLVM IR (-O0):
define zeroext i8 @read_le32(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = or i32 %8, %13
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 2
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 16
%20 = or i32 %14, %19
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 3
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = shl i32 %24, 24
%26 = or i32 %20, %25
%27 = trunc i32 %26 to i8
ret i8 %27
}

LLVM IR (-O2):
define zeroext i8 @read_le32(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void kr_free(void *ptr) {
  if (ptr)
    free(ptr);
}


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

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

LLVM IR (-O0):
define void @kr_free(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 @kr_free(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
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void write_lines(char *pointer_array[], int line_count) {
  while (line_count-- > 0)
    printf("%s\n", *pointer_array++);
}


x86 assembly (clang, -O0):
<write_lines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jle    1158 <write_lines+0x48>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%rax
mov    %eax,%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
jmp    111f <write_lines+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_lines>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1146 <write_lines+0x36>
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%ebp
lea    0xed9(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%esi
add    $0x8,%rbx
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1130 <write_lines+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @write_lines(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i8** [ %8, %4 ], [ %0, %2 ]
%7 = add nsw i32 %5, -1
%8 = getelementptr inbounds i8*, i8** %6, i64 1
%9 = load i8*, i8** %6
%10 = ptrtoint i8* %9 to i64
%11 = trunc i64 %10 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = icmp ugt i32 %5, 1
br i1 %13, label %4, label %14
14: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_tab(int n) {
  while (n--)
    printf("    ");
}


x86 assembly (clang, -O0):
<print_tab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1140 <print_tab+0x30>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
jmp    111b <print_tab+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_tab>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
je     113d <print_tab+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <print_tab+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c" \00"
define void @print_tab(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
store i32 %5, i32* %2
%6 = icmp ne i32 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c" \00"
define void @print_tab(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void greenLEDOff(void) { (*((volatile uint32_t *)0x40025020)) &= ~0x08; }


x86 assembly (clang, -O0):
<greenLEDOff>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40025020,%eax
mov    (%rax),%ecx
and    $0xfffffff7,%ecx
mov    $0x40025020,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<greenLEDOff>:
andl   $0xfffffff7,0x40025020
f7
ret

LLVM IR (-O0):
define void @greenLEDOff() {
%1 = load volatile i32, i32* inttoptr (i64 1073893408 to i32*)
%2 = and i32 %1, -9
store volatile i32 %2, i32* inttoptr (i64 1073893408 to i32*)
ret void
}

LLVM IR (-O2):
define void @greenLEDOff() {
%1 = load volatile i32, i32* inttoptr (i64 1073893408 to i32*)
%2 = and i32 %1, -9
store volatile i32 %2, i32* inttoptr (i64 1073893408 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xlfail(char *);
void checkfneg(double farg) {
  if (farg < 0.0)
    xlfail("square root of a negative number");
}


x86 assembly (clang, -O0):
<checkfneg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1137 <checkfneg+0x27>
lea    0xece(%rip),%rdi
call   1030 <xlfail@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkfneg>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    1126 <checkfneg+0x16>
lea    0xedf(%rip),%rdi
jmp    1030 <xlfail@plt>
ret

LLVM IR (-O0):
@.str = [33 x i8] c"square root of a negative number\00"
define void @checkfneg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @xlfail(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"square root of a negative number\00"
define void @checkfneg(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @xlfail(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
void sample(void) {
  int i = 0;
  i += 1;
  int j = 0;
  j += 1;
}


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

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

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

LLVM IR (-O2):
define void @sample() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void USBHostRequestStatus(uint32_t ui32Base) {
  ;
  (*((volatile unsigned char *)(ui32Base + 0x00000102))) =
      0x00000020 | 0x00000040;
}


x86 assembly (clang, -O0):
<USBHostRequestStatus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x60,0x102(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostRequestStatus>:
movb   $0x60,0x102(%rdi)
ret

LLVM IR (-O0):
define void @USBHostRequestStatus(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 258
%5 = inttoptr i64 %4 to i8*
store volatile i8 96, i8* %5
ret void
}

LLVM IR (-O2):
define void @USBHostRequestStatus(i64 %0) {
%2 = add nsw i64 %0, 258
%3 = inttoptr i64 %2 to i8*
store volatile i8 96, i8* %3
ret void
}
void *defaultCopy(void *data) { return data; }


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

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

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

LLVM IR (-O2):
define i8* @defaultCopy(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int mkdir(char *, int);
int p_CreateDirectory(char *p) {
  int rv;
  rv = mkdir(p, 0775);
  return (rv == 0);
}


x86 assembly (clang, -O0):
<p_CreateDirectory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1fd,%esi
call   1030 <mkdir@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p_CreateDirectory>:
push   %rax
mov    $0x1fd,%esi
call   1030 <mkdir@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @p_CreateDirectory(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @mkdir(i8* %4, i32 509)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @p_CreateDirectory(i8* nocapture %0) {
%2 = tail call i32 @mkdir(i8* %0, i32 509)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void ARGBGrayRow_SSSE3() {}


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

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

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

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