xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i = 0;
  printf("Please input a number: ");
  scanf("%d", &i);
  printf("The number your input is %d \n ", i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%esi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Please input a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [31 x i8] c"The number your input is %d \0A \00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Please input a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [31 x i8] c"The number your input is %d \0A \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ tick_timer_service_unsudirribe();
void timeModule_deinit() { tick_timer_service_unsudirribe(); }


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

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

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

LLVM IR (-O2):
define void @timeModule_deinit() {
%1 = tail call i32 (...) @tick_timer_service_unsudirribe()
ret void
}
void test_2(unsigned char *x, unsigned int *y) { y[0] = x[1] >> 3; }


x86 assembly (clang, -O0):
<test_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%ecx
sar    $0x3,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_2>:
movzbl 0x1(%rdi),%eax
shr    $0x3,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @test_2(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = ashr i32 %8, 3
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 %9, i32* %11
ret void
}

LLVM IR (-O2):
define void @test_2(i8* nocapture %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
%5 = lshr i8 %4, 3
%6 = zext i8 %5 to i32
store i32 %6, i32* %1
ret void
}
void gtk_toolbar_set_tooltips() {}


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

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

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

LLVM IR (-O2):
define void @gtk_toolbar_set_tooltips() {
ret void
}
int main(void) {
  int var = (int)5.912345;
  printf("var = %i \n", var);
  int *addr;
  addr = (int *)0x1234;
  printf("addr = %x \n", addr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1234,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
mov    $0x1234,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"var = %i \0A\00"
@.str.1 = [12 x i8] c"addr = %x \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32 5, i32* %2
%4 = load i32, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %4)
store i32* inttoptr (i64 4660 to i32*), i32** %3
%6 = load i32*, i32** %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"var = %i \0A\00"
@.str.1 = [12 x i8] c"addr = %x \0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 5)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32* inttoptr (i64 4660 to i32*))
ret i32 0
}
int db_changes() { return 0; }


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

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

LLVM IR (-O0):
define i32 @db_changes() {
ret i32 0
}

LLVM IR (-O2):
define i32 @db_changes() {
ret i32 0
}
int uStrLen(const char *str) {
  int len = 0;
  while (str[len] != '\0')
    len++;
  return len;
}


x86 assembly (clang, -O0):
<uStrLen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <uStrLen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <uStrLen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uStrLen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <uStrLen+0x10>
ret

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

LLVM IR (-O2):
define i32 @uStrLen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
void doNothingHandler(void) { ; }


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

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

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

LLVM IR (-O2):
define void @doNothingHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void MyError(const char *msg) {
  if (1)
    fprintf(stderr, "MyError: %s\n", msg);
  exit(0);
}


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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"MyError: %s\0A\00"
define void @MyError(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
double convert_to_metric(const int feet, const int inches) {
  const float INCH_TO_CENT_RATIO = 2.54;
  const int INCHES_IN_FOOT = 12;
  const int CENT_IN_METRE = 100;
  double centimetres = 0;
  centimetres = inches * INCH_TO_CENT_RATIO;
  centimetres += (feet * INCHES_IN_FOOT) * INCH_TO_CENT_RATIO;
  return centimetres / CENT_IN_METRE;
}


x86 assembly (clang, -O0):
<convert_to_metric>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  0xef6(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movl   $0xc,-0x10(%rbp)
movl   $0x64,-0x14(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
movss  0xece(%rip),%xmm1
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
imul   $0xc,-0x4(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  0xeb1(%rip),%xmm1
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xe8a(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_to_metric>:
shl    $0x2,%edi
lea    (%rdi,%rdi,2),%eax
movd   %eax,%xmm0
movd   %esi,%xmm1
punpckldq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm0
mulps  0xee4(%rip),%xmm0
cvtps2pd %xmm0,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
divsd  0xedd(%rip),%xmm0
ret

LLVM IR (-O0):
define double @convert_to_metric(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
store float 0x400451EB80000000, float* %5
store i32 12, i32* %6
store i32 100, i32* %7
store double 0.000000e+00, double* %8
%9 = load i32, i32* %4
%10 = sitofp i32 %9 to float
%11 = fmul float %10, 0x400451EB80000000
%12 = fpext float %11 to double
store double %12, double* %8
%13 = load i32, i32* %3
%14 = mul nsw i32 %13, 12
%15 = sitofp i32 %14 to float
%16 = fmul float %15, 0x400451EB80000000
%17 = fpext float %16 to double
%18 = load double, double* %8
%19 = fadd double %18, %17
store double %19, double* %8
%20 = load double, double* %8
%21 = fdiv double %20, 1.000000e+02
ret double %21
}

LLVM IR (-O2):
define double @convert_to_metric(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 12
%4 = insertelement <2 x i32> poison, i32 %1, i64 0
%5 = insertelement <2 x i32> %4, i32 %3, i64 1
%6 = sitofp <2 x i32> %5 to <2 x float>
%7 = fmul <2 x float> %6, <float 0x400451EB80000000, float 0x400451EB80000000>
%8 = fpext <2 x float> %7 to <2 x double>
%9 = shufflevector <2 x double> %8, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%10 = fadd <2 x double> %9, %8
%11 = extractelement <2 x double> %10, i64 0
%12 = fdiv double %11, 1.000000e+02
ret double %12
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int;
typedef int /*<<< orphan*/ cc_t;

/* Variables and functions */
u_int special_char_encode(cc_t c) { return c; }


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

x86 assembly (clang, -O2):
<special_char_encode>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @special_char_encode(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ KEY_RESIZE;
#define SIGINT 131
#define SIGQUIT 130
#define SIGTERM 129
#define SIGWINCH 128
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ ungetch(int /*<<< orphan*/);
void sighandler(int signo) {
  switch (signo) {
  case SIGINT:
  case SIGQUIT:
  case SIGTERM: {
    endwin();
    puts("Terminating!");
    exit(1);
  }
  case SIGWINCH: {
    ungetch(KEY_RESIZE);
    break;
  }
  default: {
  }
  }
}


x86 assembly (clang, -O0):
<sighandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x80,%eax
je     1194 <sighandler+0x54>
jmp    1161 <sighandler+0x21>
mov    -0x8(%rbp),%eax
add    $0xffffff7f,%eax
sub    $0x2,%eax
ja     11a7 <sighandler+0x67>
jmp    1177 <sighandler+0x37>
mov    $0x0,%al
call   1050 <endwin@plt>
lea    0xe7b(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
call   1040 <ungetch@plt>
jmp    11ac <sighandler+0x6c>
jmp    11ac <sighandler+0x6c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sighandler>:
push   %rax
cmp    $0x80,%edi
je     1156 <sighandler+0x16>
add    $0xffffff7f,%edi
cmp    $0x2,%edi
jbe    1165 <sighandler+0x25>
pop    %rax
ret
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <ungetch@plt>
xor    %eax,%eax
call   1050 <endwin@plt>
lea    0xe8d(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Terminating!\00"
@KEY_RESIZE = global i32 0
define void @sighandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %11 [
i32 131, label %4
i32 130, label %4
i32 129, label %4
i32 128, label %8
]
4: ; preds = %1, %1, %1
%5 = call i32 (...) @endwin()
%6 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %1
%9 = load i32, i32* @KEY_RESIZE
%10 = call i32 @ungetch(i32 %9)
br label %12
11: ; preds = %1
br label %12
12: ; preds = %11, %8
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Terminating!\00"
@KEY_RESIZE = global i32 0
define void @sighandler(i32 %0) {
switch i32 %0, label %9 [
i32 131, label %2
i32 130, label %2
i32 129, label %2
i32 128, label %6
]
2: ; preds = %1, %1, %1
%3 = tail call i32 (...) @endwin()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %1
%7 = load i32, i32* @KEY_RESIZE
%8 = tail call i32 @ungetch(i32 %7)
br label %9
9: ; preds = %1, %6
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_palindrome(char const *, int, int);
void test6(void) {
  const char a[] = {'m', 'a', 'd', 'a', 'm', 'I', 'a', 'm', 'a', 'd', 'a', 'm'};
  test_palindrome(a, sizeof(a), 1);
  test_palindrome(a, sizeof(a), 2);
  printf("\n");
}


x86 assembly (clang, -O0):
<test6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
mov    $0xc,%esi
mov    $0x1,%edx
call   1040 <test_palindrome@plt>
lea    -0xc(%rbp),%rdi
mov    $0xc,%esi
mov    $0x2,%edx
call   1040 <test_palindrome@plt>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test6>:
push   %rbx
sub    $0x10,%rsp
movabs $0x6d61496d6164616d,%rax
49 61 6d
mov    %rax,(%rsp)
movl   $0x6d616461,0x8(%rsp)
6d
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xc,%esi
mov    $0x1,%edx
call   1040 <test_palindrome@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
mov    $0x2,%edx
call   1040 <test_palindrome@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test6.a = [12 x i8] c"madamIamadam"
@.str = [2 x i8] c"\0A\00"
define void @test6() {
%1 = alloca [12 x i8]
%2 = bitcast [12 x i8]* %1 to i8*
%3 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%4 = call i32 @test_palindrome(i8* %3, i32 12, i32 1)
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%6 = call i32 @test_palindrome(i8* %5, i32 12, i32 2)
%7 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__const.test6.a = [12 x i8] c"madamIamadam"
define void @test6() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%3 = call i32 @test_palindrome(i8* %2, i32 12, i32 1)
%4 = call i32 @test_palindrome(i8* %2, i32 12, i32 2)
%5 = call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_PyThread_exit_thread(int /*<<< orphan*/);
void PyThread_exit_thread(void) { do_PyThread_exit_thread(0); }


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

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

LLVM IR (-O0):
define void @PyThread_exit_thread() {
%1 = call i32 @do_PyThread_exit_thread(i32 0)
ret void
}

LLVM IR (-O2):
define void @PyThread_exit_thread() {
%1 = tail call i32 @do_PyThread_exit_thread(i32 0)
ret void
}
int f4(void) {
  const int x = sizeof(int) / 3 - 1;
  return 1 / x;
}


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

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

LLVM IR (-O0):
define i32 @f4() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 poison
}

LLVM IR (-O2):
define i32 @f4() {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void print_usage(const char *file_name) {
  printf("Usage: %s -p \"<Virtual Server Path>\"\n", file_name);
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"Usage: %s -p \22<Virtual Server Path>\22\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"Usage: %s -p \22<Virtual Server Path>\22\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int is_leap_year(int y) { return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }


x86 assembly (clang, -O0):
<is_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1153 <is_leap_year+0x53>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    114d <is_leap_year+0x4d>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leap_year>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <is_leap_year+0x9>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x1,%eax
cmp    $0x28f5c28,%edx
ja     1108 <is_leap_year+0x8>
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @is_leap_year(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 4
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 100
%9 = icmp ne i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = srem i32 %11, 400
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %1
%17 = phi i1 [ false, %1 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @is_leap_year(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %10, %7 ]
ret i32 %12
}
void *hl_gc_alloc_noptr(int size) { return (char *)malloc(size); }


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

x86 assembly (clang, -O2):
<hl_gc_alloc_noptr>:
movslq %edi,%rdi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @hl_gc_alloc_noptr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = call i8* @malloc(i64 %4)
ret i8* %5
}

LLVM IR (-O2):
define noalias i8* @hl_gc_alloc_noptr(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call i8* @malloc(i64 %2)
ret i8* %3
}
void __fini_cpp(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @ERR_get_next_error_library() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;
typedef scalar_t__ int16_t;

/* Variables and functions */
int lwm2m_int64ToPlainText(int /*<<< orphan*/, char **);
int lwm2m_int16ToPlainText(int16_t data, char **bufferP) {
  return lwm2m_int64ToPlainText((int64_t)data, bufferP);
}


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

x86 assembly (clang, -O2):
<lwm2m_int16ToPlainText>:
jmp    1030 <lwm2m_int64ToPlainText@plt>

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

LLVM IR (-O2):
define i32 @lwm2m_int16ToPlainText(i64 %0, i8** %1) {
%3 = trunc i64 %0 to i32
%4 = tail call i32 @lwm2m_int64ToPlainText(i32 %3, i8** %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  float answer = (float)17 / 13;
  printf("answer is %f\n", answer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xed9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeec(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"answer is %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
store float 0x3FF4EC4EC0000000, float* %2
%3 = load float, float* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), float %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"answer is %f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), float 0x3FF4EC4EC0000000)
ret i32 0
}
/* Variables and functions */
int multiples(int, int);
int solve(int p) {
  return multiples(p, 3) + multiples(p, 5) - multiples(p, 15);
}


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

x86 assembly (clang, -O2):
<solve>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
mov    $0x3,%esi
call   1030 <multiples@plt>
mov    %eax,%r14d
mov    %ebx,%edi
mov    $0x5,%esi
call   1030 <multiples@plt>
mov    %eax,%ebp
add    %r14d,%ebp
mov    %ebx,%edi
mov    $0xf,%esi
call   1030 <multiples@plt>
sub    %eax,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @solve(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @multiples(i32 %3, i32 3)
%5 = load i32, i32* %2
%6 = call i32 @multiples(i32 %5, i32 5)
%7 = add nsw i32 %4, %6
%8 = load i32, i32* %2
%9 = call i32 @multiples(i32 %8, i32 15)
%10 = sub nsw i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @solve(i32 %0) {
%2 = tail call i32 @multiples(i32 %0, i32 3)
%3 = tail call i32 @multiples(i32 %0, i32 5)
%4 = add nsw i32 %3, %2
%5 = tail call i32 @multiples(i32 %0, i32 15)
%6 = sub i32 %4, %5
ret i32 %6
}
void expires_check(void) {}


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

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

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

LLVM IR (-O2):
define void @expires_check() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xe2() {
  Assert_real((ispunct(226) == 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_ispunct.c",
              1135, ("ispunct should be 0 for 0xe2"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0xe2>:
push   %rax
mov    $0xe2,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x46f,%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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xe2\00"
define void @t_ispunct_0xe2() {
%1 = call i64 @ispunct(i32 226)
%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 1135, i8* getelementptr inbounds ([29 x i8], [29 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xe2\00"
define void @t_ispunct_0xe2() {
%1 = tail call i64 @ispunct(i32 226)
%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 1135, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int ***malloc(int);
int (*f2(void))[5][10] {
  int(*p)[5][10];
  p = malloc(sizeof(int) * 5 * 10);
  (*p)[1][2] = 4321;
  return p;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x10e1,0x30(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rax
mov    $0xc8,%edi
call   1030 <malloc@plt>
movl   $0x10e1,0x30(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define [5 x [10 x i32]]* @f2() {
%1 = alloca [5 x [10 x i32]]*
%2 = call i32*** @malloc(i32 200)
%3 = bitcast i32*** %2 to [5 x [10 x i32]]*
store [5 x [10 x i32]]* %3, [5 x [10 x i32]]** %1
%4 = load [5 x [10 x i32]]*, [5 x [10 x i32]]** %1
%5 = getelementptr inbounds [5 x [10 x i32]], [5 x [10 x i32]]* %4, i64 0, i64 1
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 2
store i32 4321, i32* %6
%7 = load [5 x [10 x i32]]*, [5 x [10 x i32]]** %1
ret [5 x [10 x i32]]* %7
}

LLVM IR (-O2):
define noalias [5 x [10 x i32]]* @f2() {
%1 = tail call i32*** @malloc(i32 200)
%2 = bitcast i32*** %1 to [5 x [10 x i32]]*
%3 = getelementptr inbounds i32**, i32*** %1, i64 6
%4 = bitcast i32*** %3 to i32*
store i32 4321, i32* %4
ret [5 x [10 x i32]]* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
void dds_advance(uint32_t *phase_acc, int32_t phase_rate) {
  *phase_acc += phase_rate;
}


x86 assembly (clang, -O0):
<dds_advance>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
movslq (%rax),%rcx
add    %rdx,%rcx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dds_advance>:
add    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @dds_advance(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = sext i32 %7 to i64
%9 = add nsw i64 %8, %5
%10 = trunc i64 %9 to i32
store i32 %10, i32* %6
ret void
}

LLVM IR (-O2):
define void @dds_advance(i32* nocapture %0, i64 %1) {
%3 = load i32, i32* %0
%4 = trunc i64 %1 to i32
%5 = add i32 %3, %4
store i32 %5, i32* %0
ret void
}
int info_write(void *ptr, const char *buf, unsigned int size) { return 0; }


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

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

LLVM IR (-O0):
define i32 @info_write(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @info_write(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
size_t read_FD(int, void *, size_t);
int /*<<< orphan*/ reverse(void *, size_t);
size_t read_FD_BE(int fd, void *data, size_t size) {
  size_t count = read_FD(fd, data, size);
  reverse(data, size);
  return count;
}


x86 assembly (clang, -O0):
<read_FD_BE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <read_FD@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <reverse@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_FD_BE>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
call   1040 <read_FD@plt>
mov    %rax,%r15
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <reverse@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @read_FD_BE(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
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i64 @read_FD(i32 %8, i8* %9, i64 %10)
store i64 %11, i64* %7
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = call i32 @reverse(i8* %12, i64 %13)
%15 = load i64, i64* %7
ret i64 %15
}

LLVM IR (-O2):
define i64 @read_FD_BE(i32 %0, i8* %1, i64 %2) {
%4 = tail call i64 @read_FD(i32 %0, i8* %1, i64 %2)
%5 = tail call i32 @reverse(i8* %1, i64 %2)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ GeoFenceSettingsHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void GeoFenceSettingsRequestUpdate() {
  UAVObjRequestUpdate(GeoFenceSettingsHandle());
}


x86 assembly (clang, -O0):
<GeoFenceSettingsRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <GeoFenceSettingsHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GeoFenceSettingsRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <GeoFenceSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @GeoFenceSettingsRequestUpdate() {
%1 = call i32 (...) @GeoFenceSettingsHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @GeoFenceSettingsRequestUpdate() {
%1 = tail call i32 (...) @GeoFenceSettingsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
int test_imm_B5int8_reg(signed char val) {
  return ((val) & (-0xB5 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B5int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff4b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B5int8_reg>:
test   $0xffffff4b,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B5int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -181
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage(void) {
  fprintf(stderr, "Usage: input is the standard input, output is the standard "
                  "output. Use the\n"
                  "following arguments:\n"
                  "  -digi  Digitised audio mode (default)\n"
                  "  -pc    PC speaker mode\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [162 x i8] c"Usage: input is the standard input, output is the standard output. Use the\0Afollowing arguments:\0A -digi Digitised audio mode (default)\0A -pc PC speaker mode\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [162 x i8] c"Usage: input is the standard input, output is the standard output. Use the\0Afollowing arguments:\0A -digi Digitised audio mode (default)\0A -pc PC speaker mode\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned fib(unsigned n) {
  if (n == 0)
    return 0;
  if (n == 1)
    return 1;
  return fib(n - 1) + fib(n - 2);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <fib+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116a <fib+0x5a>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <fib+0x37>
movl   $0x1,-0x4(%rbp)
jmp    116a <fib+0x5a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%ebx
jb     1132 <fib+0x22>
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x2,%ebx
jae    1120 <fib+0x10>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ 0, %1 ], [ %10, %6 ]
%4 = phi i32 [ %0, %1 ], [ %9, %6 ]
%5 = icmp ult i32 %4, 2
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = add i32 %4, -1
%8 = tail call i32 @fib(i32 %7)
%9 = add i32 %4, -2
%10 = add i32 %8, %3
br label %2
11: ; preds = %2
%12 = add i32 %4, %3
ret i32 %12
}
/* Variables and functions */
float __nv_fast_cosf(float);
float __cosf(float __a) { return __nv_fast_cosf(__a); }


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

x86 assembly (clang, -O2):
<__cosf>:
jmp    1030 <__nv_fast_cosf@plt>

LLVM IR (-O0):
define float @__cosf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @__nv_fast_cosf(float %3)
ret float %4
}

LLVM IR (-O2):
define float @__cosf(float %0) {
%2 = tail call float @__nv_fast_cosf(float %0)
ret float %2
}
char *langRomTypeTc8566afTrFdc() { return "TC8566AF Turbo-R Disk Controller"; }


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"TC8566AF Turbo-R Disk Controller\00"
define i8* @langRomTypeTc8566afTrFdc() {
ret i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [33 x i8] c"TC8566AF Turbo-R Disk Controller\00"
define i8* @langRomTypeTc8566afTrFdc() {
ret i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0)
}
void retro_cheat_reset() {}


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

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

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

LLVM IR (-O2):
define void @retro_cheat_reset() {
ret void
}
/* Type definitions */
struct blastFile {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bfError(struct blastFile *, char *);
void bfSyntax(struct blastFile *bf) {
  bfError(bf, "Can't cope with BLAST output syntax");
}


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

x86 assembly (clang, -O2):
<bfSyntax>:
lea    0xee9(%rip),%rsi
jmp    1030 <bfError@plt>

LLVM IR (-O0):
%struct.blastFile = type { i32 }
@.str = [36 x i8] c"Can't cope with BLAST output syntax\00"
define void @bfSyntax(%struct.blastFile* %0) {
%2 = alloca %struct.blastFile*
store %struct.blastFile* %0, %struct.blastFile** %2
%3 = load %struct.blastFile*, %struct.blastFile** %2
%4 = call i32 @bfError(%struct.blastFile* %3, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.blastFile = type { i32 }
@.str = [36 x i8] c"Can't cope with BLAST output syntax\00"
define void @bfSyntax(%struct.blastFile* %0) {
%2 = tail call i32 @bfError(%struct.blastFile* %0, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}
int fun965() { return 965; }


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

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

LLVM IR (-O0):
define i32 @fun965() {
ret i32 965
}

LLVM IR (-O2):
define i32 @fun965() {
ret i32 965
}
int test_imm_22int64_highword_reg(long long val) {
  return ((val >> 32) & (0x22 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_22int64_highword_reg>:
movabs $0x2200000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_22int64_highword_reg(i64 %0) {
%2 = and i64 %0, 146028888064
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ prng_seed();
void pgr_srand(int x) { prng_seed(); }


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

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

LLVM IR (-O0):
define void @pgr_srand(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @prng_seed()
ret void
}

LLVM IR (-O2):
define void @pgr_srand(i32 %0) {
%2 = tail call i32 (...) @prng_seed()
ret void
}
double _testfunc_cbk_reg_double(double a, double b, double c, double d,
                                double e,
                                double (*func)(double, double, double, double,
                                               double)) {
  return func(a * a, b * b, c * c, d * d, e * e);
}


x86 assembly (clang, -O0):
<_testfunc_cbk_reg_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
mov    %rdi,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mulsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
mulsd  -0x20(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm4
mulsd  -0x28(%rbp),%xmm4
call   *%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_testfunc_cbk_reg_double>:
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
mulsd  %xmm2,%xmm2
mulsd  %xmm3,%xmm3
mulsd  %xmm4,%xmm4
jmp    *%rdi

LLVM IR (-O0):
define double @_testfunc_cbk_reg_double(double %0, double %1, double %2, double %3, double %4, double (double, double, double, double, double)* %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double (double, double, double, double, double)*
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double (double, double, double, double, double)* %5, double (double, double, double, double, double)** %12
%13 = load double (double, double, double, double, double)*, double (double, double, double, double, double)** %12
%14 = load double, double* %7
%15 = load double, double* %7
%16 = fmul double %14, %15
%17 = load double, double* %8
%18 = load double, double* %8
%19 = fmul double %17, %18
%20 = load double, double* %9
%21 = load double, double* %9
%22 = fmul double %20, %21
%23 = load double, double* %10
%24 = load double, double* %10
%25 = fmul double %23, %24
%26 = load double, double* %11
%27 = load double, double* %11
%28 = fmul double %26, %27
%29 = call double %13(double %16, double %19, double %22, double %25, double %28)
ret double %29
}

LLVM IR (-O2):
define double @_testfunc_cbk_reg_double(double %0, double %1, double %2, double %3, double %4, double (double, double, double, double, double)* nocapture %5) {
%7 = fmul double %0, %0
%8 = fmul double %1, %1
%9 = fmul double %2, %2
%10 = fmul double %3, %3
%11 = fmul double %4, %4
%12 = tail call double %5(double %7, double %8, double %9, double %10, double %11)
ret double %12
}
int gcd(int m, int n) {
  if (n == 0) {
    return m;
  } else {
    return gcd(n, m % n);
  }
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <gcd+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <gcd+0x37>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <gcd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}