xunge/DecIR huggingface dataset:
double Atan(double x) {
  if ((x >= 1) || (x <= 1))
    return (x / (1 + 0.28 * x * x));
  else
    return (3.1415926535897932384626433832795 / 2 - Atan(1 / x));
}


x86 assembly (clang, -O0):
<Atan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jae    1147 <Atan+0x37>
movsd  0xec4(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     117c <Atan+0x6c>
movsd  -0x10(%rbp),%xmm0
movsd  0xebc(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe96(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11a2 <Atan+0x92>
movsd  0xe7c(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <Atan@plt>
movaps %xmm0,%xmm1
movsd  0xe6f(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Atan>:
push   %rax
ucomisd %xmm0,%xmm0
jp     1135 <Atan+0x25>
movsd  0xef1(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
addsd  0xed1(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret
movsd  0xec3(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <Atan@plt>
movapd %xmm0,%xmm1
movsd  0xeb2(%rip),%xmm0
subsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @Atan(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oge double %4, 1.000000e+00
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load double, double* %3
%8 = fcmp ole double %7, 1.000000e+00
br i1 %8, label %9, label %16
9: ; preds = %6, %1
%10 = load double, double* %3
%11 = load double, double* %3
%12 = fmul double 2.800000e-01, %11
%13 = load double, double* %3
%14 = call double @llvm.fmuladd.f64(double %12, double %13, double 1.000000e+00)
%15 = fdiv double %10, %14
store double %15, double* %2
br label %21
16: ; preds = %6
%17 = load double, double* %3
%18 = fdiv double 1.000000e+00, %17
%19 = call double @Atan(double %18)
%20 = fsub double 0x3FF921FB54442D18, %19
store double %20, double* %2
br label %21
21: ; preds = %16, %9
%22 = load double, double* %2
ret double %22
}

LLVM IR (-O2):
define double @Atan(double %0) {
%2 = fcmp ord double %0, 0.000000e+00
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = fmul double %0, 2.800000e-01
%5 = tail call double @llvm.fmuladd.f64(double %4, double %0, double 1.000000e+00)
%6 = fdiv double %0, %5
br label %7
7: ; preds = %3, %9
%8 = phi double [ %12, %9 ], [ %6, %3 ]
ret double %8
9: ; preds = %1
%10 = fdiv double 1.000000e+00, %0
%11 = tail call double @Atan(double %10)
%12 = fsub double 0x3FF921FB54442D18, %11
br label %7
}
int lwwire_read(void *v, int i) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @lwwire_read(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
double map_val(double ratio, double min, double max) {
  return min + ratio * (max - min);
}


x86 assembly (clang, -O0):
<map_val>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_val>:
subsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @map_val(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = load double, double* %4
%9 = load double, double* %6
%10 = load double, double* %5
%11 = fsub double %9, %10
%12 = call double @llvm.fmuladd.f64(double %8, double %11, double %7)
ret double %12
}

LLVM IR (-O2):
define double @map_val(double %0, double %1, double %2) {
%4 = fsub double %2, %1
%5 = tail call double @llvm.fmuladd.f64(double %0, double %4, double %1)
ret double %5
}
/* Variables and functions */
scalar_t__ isupper(int);
int tolower(int c) {
  if (isupper(c))
    return c ^= 0x20;
  else
    return c;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     113e <tolower+0x2e>
mov    -0x8(%rbp),%eax
xor    $0x20,%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
jmp    1144 <tolower+0x34>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <isupper@plt>
mov    %ebx,%ecx
xor    $0x20,%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = xor i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ cls();
char getchar();
int /*<<< orphan*/ printf(char *);
void pressToContinue() {
  printf("Press enter to continue!\n");
  while (getchar() != '\n')
    ;
  cls();
}


x86 assembly (clang, -O0):
<pressToContinue>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1158 <pressToContinue+0x28>
jmp    1140 <pressToContinue+0x10>
mov    $0x0,%al
call   1050 <cls@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pressToContinue>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
nopl   (%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%al
jne    1140 <pressToContinue+0x10>
xor    %eax,%eax
pop    %rcx
jmp    1050 <cls@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Press enter to continue!\0A\00"
define void @pressToContinue() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %6, %0
%3 = call signext i8 (...) @getchar()
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 10
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
%8 = call i32 (...) @cls()
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"Press enter to continue!\00"
define void @pressToContinue() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
%3 = tail call signext i8 (...) @getchar()
%4 = icmp eq i8 %3, 10
br i1 %4, label %5, label %2
5: ; preds = %2
%6 = tail call i32 (...) @cls()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *);
void get_number_of_rev(char *rev_path, int *rev) {
  FILE *rev_file;
  rev_file = fopen(rev_path, "r");
  fscanf(rev_file, "%d", rev);
  fclose(rev_file);
}


x86 assembly (clang, -O0):
<get_number_of_rev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe9f(%rip),%rsi
call   1040 <fscanf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_number_of_rev>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
lea    0xec2(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
lea    0xeb5(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   1040 <fscanf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [3 x i8] c"%d\00"
define void @get_number_of_rev(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%6 = load i8*, i8** %3
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = load i32*, i32** %4
%10 = call i32 @fscanf(i32* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%11 = load i32*, i32** %5
%12 = call i32 @fclose(i32* %11)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [3 x i8] c"%d\00"
define void @get_number_of_rev(i8* nocapture %0, i32* %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = tail call i32 @fclose(i32* %3)
ret void
}
/* Variables and functions */
int EOF;
int getc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int hitenter() {
  int ch = 0;
  while ((ch = getc(stdin)) != EOF && ch != '\n')
    continue;
  return EOF == ch;
}


x86 assembly (clang, -O0):
<hitenter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <getc@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
xor    %eax,%eax
mov    0x2ea5(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x5(%rbp)
je     1150 <hitenter+0x40>
cmpl   $0xa,-0x4(%rbp)
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1160 <hitenter+0x50>
jmp    1165 <hitenter+0x55>
jmp    111f <hitenter+0xf>
mov    0x2e74(%rip),%rax
mov    (%rax),%eax
cmp    -0x4(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hitenter>:
push   %r14
push   %rbx
push   %rax
mov    0x2ecd(%rip),%r14
mov    0x2ebe(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14),%edi
call   1030 <getc@plt>
mov    (%rbx),%edx
cmp    $0xa,%eax
je     1143 <hitenter+0x33>
cmp    %edx,%eax
jne    1130 <hitenter+0x20>
xor    %ecx,%ecx
cmp    %eax,%edx
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@stdin = global i32 0
@EOF = global i32 0
define i32 @hitenter() {
br label %1
1: ; preds = %1, %0
%2 = load i32, i32* @stdin
%3 = tail call i32 @getc(i32 %2)
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %3, %4
%6 = icmp ne i32 %3, 10
%7 = and i1 %6, %5
br i1 %7, label %1, label %8
8: ; preds = %1
%9 = icmp eq i32 %4, %3
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t full_mod31(uint8_t a) {
  uint8_t r = a;
  r = (r >> 5) + (r & 0x1f);
  r = (r >> 5) + (r & 0x1f);
  return r;
}


x86 assembly (clang, -O0):
<full_mod31>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x5,%eax
mov    -0x8(%rbp),%ecx
and    $0x1f,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x5,%eax
mov    -0x8(%rbp),%ecx
and    $0x1f,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<full_mod31>:
mov    %edi,%eax
sar    $0x5,%eax
and    $0x1f,%edi
add    %edi,%eax
mov    %eax,%ecx
sar    $0x5,%ecx
and    $0x1f,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @full_mod31(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = ashr i32 %5, 5
%7 = load i32, i32* %3
%8 = and i32 %7, 31
%9 = add nsw i32 %6, %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = ashr i32 %10, 5
%12 = load i32, i32* %3
%13 = and i32 %12, 31
%14 = add nsw i32 %11, %13
store i32 %14, i32* %3
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @full_mod31(i32 %0) {
%2 = ashr i32 %0, 5
%3 = and i32 %0, 31
%4 = add nsw i32 %2, %3
%5 = ashr i32 %4, 5
%6 = and i32 %4, 31
%7 = add nsw i32 %5, %6
ret i32 %7
}
int do_385() { return 385; }


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

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

LLVM IR (-O0):
define i32 @do_385() {
ret i32 385
}

LLVM IR (-O2):
define i32 @do_385() {
ret i32 385
}
/* Variables and functions */
int /*<<< orphan*/ driveInit();
int /*<<< orphan*/ hangInit();
int /*<<< orphan*/ liftInit();
void initialize() {
  liftInit();
  driveInit();
  hangInit();
}


x86 assembly (clang, -O0):
<initialize>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <liftInit@plt>
mov    $0x0,%al
call   1030 <driveInit@plt>
mov    $0x0,%al
call   1050 <hangInit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize>:
push   %rax
xor    %eax,%eax
call   1040 <liftInit@plt>
xor    %eax,%eax
call   1030 <driveInit@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <hangInit@plt>

LLVM IR (-O0):
define void @initialize() {
%1 = call i32 (...) @liftInit()
%2 = call i32 (...) @driveInit()
%3 = call i32 (...) @hangInit()
ret void
}

LLVM IR (-O2):
define void @initialize() {
%1 = tail call i32 (...) @liftInit()
%2 = tail call i32 (...) @driveInit()
%3 = tail call i32 (...) @hangInit()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void file_read_error(char *filename) {
  fprintf(stderr, "\n couldn't open file '%s' for reading, exiting.\n\n",
          filename);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<file_read_error>:
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>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [50 x i8] c"\0A couldn't open file '%s' for reading, exiting.\0A\0A\00"
@EXIT_FAILURE = global i32 0
define void @file_read_error(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 ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [50 x i8] c"\0A couldn't open file '%s' for reading, exiting.\0A\0A\00"
@EXIT_FAILURE = global i32 0
define void @file_read_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int lookslikemapcode(char const *, int /*<<< orphan*/);
int lookslike_mapcode(const char *s) { return lookslikemapcode(s, 0); }


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

x86 assembly (clang, -O2):
<lookslike_mapcode>:
xor    %esi,%esi
jmp    1030 <lookslikemapcode@plt>

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

LLVM IR (-O2):
define i32 @lookslike_mapcode(i8* %0) {
%2 = tail call i32 @lookslikemapcode(i8* %0, i32 0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pidbuf;

/* Variables and functions */
int cg_write(char const *, char *, char *);
int getpid();
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int cg_enter_current(const char *cgroup) {
  char pidbuf[64];
  snprintf(pidbuf, sizeof(pidbuf), "%d", getpid());
  return cg_write(cgroup, "cgroup.procs", pidbuf);
}


x86 assembly (clang, -O0):
<cg_enter_current>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x58(%rbp),%rdi
mov    %eax,%ecx
mov    $0x40,%esi
lea    0xea3(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x50(%rbp),%rdx
lea    0xe92(%rip),%rsi
call   1050 <cg_write@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cg_enter_current>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeb8(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x40,%esi
mov    %eax,%ecx
call   1040 <snprintf@plt>
lea    0xea2(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1050 <cg_write@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [13 x i8] c"cgroup.procs\00"
define i32 @cg_enter_current(i8* %0) {
%2 = alloca i8*
%3 = alloca [64 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = call i32 (...) @getpid()
%6 = call i32 @snprintf(i8* %4, i32 64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %2
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%9 = call i32 @cg_write(i8* %7, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [13 x i8] c"cgroup.procs\00"
define i32 @cg_enter_current(i8* %0) {
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = tail call i32 (...) @getpid()
%5 = call i32 @snprintf(i8* %3, i32 64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @cg_write(i8* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int _mm_cvtsi128_si32(int /*<<< orphan*/);
int /*<<< orphan*/ _mm_min_epi32(int /*<<< orphan*/, int /*<<< orphan*/);
__attribute__((target("sse4.1"))) int sse4_1_min(__m128i a, __m128i b) {
  return _mm_cvtsi128_si32(_mm_min_epi32(a, b));
}


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

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

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

LLVM IR (-O2):
define i32 @sse4_1_min(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_min_epi32(i32 %0, i32 %1)
%4 = tail call i32 @_mm_cvtsi128_si32(i32 %3)
ret i32 %4
}
/* Variables and functions */
void *malloc(int);
void *int_add1(void *i) {
  void *ret = malloc(sizeof(int));
  *((int *)ret) = *((int *)i) + 1;
  return ret;
}


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

x86 assembly (clang, -O2):
<int_add1>:
push   %rbx
mov    %rdi,%rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    (%rbx),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i8* @int_add1(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* @malloc(i32 4)
store i8* %4, i8** %3
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = add nsw i32 %7, 1
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to i32*
store i32 %8, i32* %10
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @int_add1(i8* nocapture %0) {
%2 = tail call dereferenceable_or_null(4) i8* @malloc(i32 4)
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 1
%6 = bitcast i8* %2 to i32*
store i32 %5, i32* %6
ret i8* %2
}
int test_imm_3Eint32_mem(int *val) {
  return ((*val) & (0x3E << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_3Eint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 62
%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_3Eint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 62
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void pwm_stop(void) { (*((volatile unsigned long *)0x7F006008)) &= ~(1 << 0); }


x86 assembly (clang, -O0):
<pwm_stop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f006008,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffffe,%rcx
mov    $0x7f006008,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwm_stop>:
andq   $0xfffffffffffffffe,0x7f006008
7f fe
ret

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

LLVM IR (-O2):
define void @pwm_stop() {
%1 = load volatile i64, i64* inttoptr (i64 2130731016 to i64*)
%2 = and i64 %1, -2
store volatile i64 %2, i64* inttoptr (i64 2130731016 to i64*)
ret void
}
/* Variables and functions */
char const *makeVsNetCompatName(char const *);
scalar_t__ prj_is_buildaction(char *);
int /*<<< orphan*/ prj_select_file(char const *);
const char *listLinkedFiles(const char *name) {
  prj_select_file(name);
  if (prj_is_buildaction("LinkedResource"))
    return makeVsNetCompatName(name);
  else
    return NULL;
}


x86 assembly (clang, -O0):
<listLinkedFiles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <prj_select_file@plt>
lea    0xeb4(%rip),%rdi
call   1050 <prj_is_buildaction@plt>
cmp    $0x0,%rax
je     116d <listLinkedFiles+0x3d>
mov    -0x10(%rbp),%rdi
call   1040 <makeVsNetCompatName@plt>
mov    %rax,-0x8(%rbp)
jmp    1175 <listLinkedFiles+0x45>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<listLinkedFiles>:
push   %rbx
mov    %rdi,%rbx
call   1030 <prj_select_file@plt>
lea    0xec0(%rip),%rdi
call   1050 <prj_is_buildaction@plt>
test   %rax,%rax
je     1153 <listLinkedFiles+0x23>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <makeVsNetCompatName@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"LinkedResource\00"
define i8* @listLinkedFiles(i8* %0) {
%2 = tail call i32 @prj_select_file(i8* %0)
%3 = tail call i64 @prj_is_buildaction(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i8* @makeVsNetCompatName(i8* %0)
br label %7
7: ; preds = %1, %5
%8 = phi i8* [ %6, %5 ], [ null, %1 ]
ret i8* %8
}
/* Variables and functions */
int snprintf(char *, int, char *, void *);
int default_key_printer(char *buffer, void *key) {
  return snprintf(buffer, (256), "%p", key);
}


x86 assembly (clang, -O0):
<default_key_printer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x100,%esi
lea    0xecc(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_key_printer>:
mov    %rsi,%rcx
lea    0xee6(%rip),%rdx
mov    $0x100,%esi
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%p\00"
define i32 @default_key_printer(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @snprintf(i8* %5, i32 256, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [3 x i8] c"%p\00"
define i32 @default_key_printer(i8* %0, i8* %1) {
%3 = tail call i32 @snprintf(i8* %0, i32 256, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 %3
}
void insl(int port, void *addr, int cnt) {}


x86 assembly (clang, -O0):
<insl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @insl(i32 %0, i8* nocapture %1, i32 %2) {
ret void
}
char *xmalloc(bytes)
int bytes;
{
  char *temp = (char *)malloc(bytes);
  if (!temp)
    memory_error_and_abort();
  return (temp);
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114a <xmalloc+0x2a>
mov    $0x0,%al
call   1030 <memory_error_and_abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
movslq %edi,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1138 <xmalloc+0x18>
xor    %eax,%eax
call   1030 <memory_error_and_abort@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @xmalloc(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call i8* @malloc(i64 %2)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @memory_error_and_abort()
br label %7
7: ; preds = %5, %1
ret i8* %3
}
/* Variables and functions */
int close(int);
int beep_fd_close(int fd) { return close(fd); }


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

x86 assembly (clang, -O2):
<beep_fd_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @beep_fd_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
void clearKeyTable(unsigned char *table) {
  int i;
  for (i = 0; i < 128; i++) {
    table[i] = 255;
  }
}


x86 assembly (clang, -O0):
<clearKeyTable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x80,-0xc(%rbp)
jge    1136 <clearKeyTable+0x36>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0xff,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <clearKeyTable+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearKeyTable>:
pcmpeqd %xmm0,%xmm0
movdqu %xmm0,0x70(%rdi)
movdqu %xmm0,0x60(%rdi)
movdqu %xmm0,0x50(%rdi)
movdqu %xmm0,0x40(%rdi)
movdqu %xmm0,0x30(%rdi)
movdqu %xmm0,0x20(%rdi)
movdqu %xmm0,0x10(%rdi)
movdqu %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @clearKeyTable(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 i32, i32* %3
%6 = icmp slt i32 %5, 128
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i8*, i8** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
store i8 -1, i8* %11
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @clearKeyTable(i8* nocapture writeonly %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gotoxy(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void clrscr(void) {
  printf("\033[2J");
  gotoxy(0, 0);
}


x86 assembly (clang, -O0):
<clrscr>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1040 <gotoxy@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clrscr>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <gotoxy@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[2J\00"
define void @clrscr() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @gotoxy(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2J\00"
define void @clrscr() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @gotoxy(i32 0, i32 0)
ret void
}
void SPIDisble(unsigned long ulBase) {

  ;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) &= ~0x00000040;
}


x86 assembly (clang, -O0):
<SPIDisble>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
and    $0xffffffffffffffbf,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPIDisble>:
andq   $0xffffffffffffffbf,(%rdi)
ret

LLVM IR (-O0):
define void @SPIDisble(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 0
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -65
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @SPIDisble(i64 %0) {
%2 = inttoptr i64 %0 to i64*
%3 = load volatile i64, i64* %2
%4 = and i64 %3, -65
store volatile i64 %4, i64* %2
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t get_jump_address(int32_t instruction, int32_t pc) {
  instruction = (pc & 0xf0000000) | ((instruction & 0x03ffffff) << 2);
  return instruction;
}


x86 assembly (clang, -O0):
<get_jump_address>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xf0000000,%eax
mov    -0x4(%rbp),%ecx
and    $0x3ffffff,%ecx
shl    $0x2,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_jump_address>:
and    $0xf0000000,%esi
and    $0x3ffffff,%edi
lea    (%rsi,%rdi,4),%eax
ret

LLVM IR (-O0):
define i32 @get_jump_address(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, -268435456
%7 = load i32, i32* %3
%8 = and i32 %7, 67108863
%9 = shl i32 %8, 2
%10 = or i32 %6, %9
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @get_jump_address(i32 %0, i32 %1) {
%3 = and i32 %1, -268435456
%4 = shl i32 %0, 2
%5 = and i32 %4, 268435452
%6 = or i32 %3, %5
ret i32 %6
}
/* Variables and functions */
void Reserved_Handler1(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<Reserved_Handler1>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Reserved_Handler1+0x9>
jmp    1109 <Reserved_Handler1+0x9>

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

LLVM IR (-O0):
define void @Reserved_Handler1() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @Reserved_Handler1() {
br label %1
1: ; preds = %0, %1
br label %1
}
int len(char *s) {
  int i = 0;
  while (s[i] != 0)
    i++;
  return i;
}


x86 assembly (clang, -O0):
<len>:
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 <len+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <len+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @len(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 @len(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
}
long long int fact_pow(long long int n, long long int p) {
  long long int r = 0;
  while (n >= p) {
    r = r + n / p;
    n = n / p;
  }
  return r;
}


x86 assembly (clang, -O0):
<fact_pow>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jl     1155 <fact_pow+0x55>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rax,-0x8(%rbp)
jmp    1114 <fact_pow+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fact_pow>:
xor    %ecx,%ecx
cmp    %rsi,%rdi
jge    110b <fact_pow+0xb>
mov    %rcx,%rax
ret
mov    %rdi,%rax
jmp    111d <fact_pow+0x1d>
cqto
idiv   %rsi
add    %rax,%rcx
cmp    %rsi,%rax
jl     1107 <fact_pow+0x7>
mov    %rax,%rdx
or     %rsi,%rdx
shr    $0x20,%rdx
jne    1110 <fact_pow+0x10>
xor    %edx,%edx
div    %esi
jmp    1115 <fact_pow+0x15>

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

LLVM IR (-O2):
define i64 @fact_pow(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
br i1 %3, label %10, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %8, %4 ], [ 0, %2 ]
%6 = phi i64 [ %7, %4 ], [ %0, %2 ]
%7 = sdiv i64 %6, %1
%8 = add nsw i64 %7, %5
%9 = icmp slt i64 %7, %1
br i1 %9, label %10, label %4
10: ; preds = %4, %2
%11 = phi i64 [ 0, %2 ], [ %8, %4 ]
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
void *malloc(size_t);
void *xmalloc(size_t sz) {
  void *r = malloc(sz);
  if (!r)
    err(1, "malloc()");
  return r;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1155 <xmalloc+0x35>
mov    $0x1,%edi
lea    0xeb0(%rip),%rsi
call   1030 <err@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <xmalloc+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x1,%edi
call   1030 <err@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"malloc()\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x1c() {
  Assert_real((isalnum(28) == 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_isalnum.c",
              145, ("isalnum should be 0 for 0x1c"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0x1c>:
push   %rax
mov    $0x1c,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x91,%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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x1c\00"
define void @t_isalnum_0x1c() {
%1 = call i64 @isalnum(i32 28)
%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 145, 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x1c\00"
define void @t_isalnum_0x1c() {
%1 = tail call i64 @isalnum(i32 28)
%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 145, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t vlan_tci2cfi(uint16_t tci) { return (tci & 0x1000) >> 12; }


x86 assembly (clang, -O0):
<vlan_tci2cfi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1000,%eax
sar    $0xc,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vlan_tci2cfi>:
mov    %edi,%eax
shr    $0xc,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @vlan_tci2cfi(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 4096
%5 = ashr i32 %4, 12
ret i32 %5
}

LLVM IR (-O2):
define i32 @vlan_tci2cfi(i32 %0) {
%2 = lshr i32 %0, 12
%3 = and i32 %2, 1
ret i32 %3
}
double mismatch_pear(double p, double q, void *data) {
  (void)data;
  return (1 - p) * q / 3 + (1 - q) * p / 3 + p * q / 2;
}


x86 assembly (clang, -O0):
<mismatch_pear>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  0xef6(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xedc(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xed8(%rip),%xmm1
subsd  -0x10(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xebe(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xe9c(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mismatch_pear>:
movapd %xmm0,%xmm2
unpcklpd %xmm1,%xmm2
movapd 0xef0(%rip),%xmm3
subpd  %xmm2,%xmm3
movapd %xmm1,%xmm2
unpcklpd %xmm0,%xmm2
mulpd  %xmm3,%xmm2
divpd  0xee8(%rip),%xmm2
movapd %xmm2,%xmm3
unpckhpd %xmm2,%xmm3
addsd  %xmm2,%xmm3
mulsd  %xmm1,%xmm0
mulsd  0xee0(%rip),%xmm0
addsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @mismatch_pear(double %0, double %1, i8* %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i8*
store double %0, double* %4
store double %1, double* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load double, double* %4
%9 = fsub double 1.000000e+00, %8
%10 = load double, double* %5
%11 = fmul double %9, %10
%12 = fdiv double %11, 3.000000e+00
%13 = load double, double* %5
%14 = fsub double 1.000000e+00, %13
%15 = load double, double* %4
%16 = fmul double %14, %15
%17 = fdiv double %16, 3.000000e+00
%18 = fadd double %12, %17
%19 = load double, double* %4
%20 = load double, double* %5
%21 = fmul double %19, %20
%22 = fdiv double %21, 2.000000e+00
%23 = fadd double %18, %22
ret double %23
}

LLVM IR (-O2):
define double @mismatch_pear(double %0, double %1, i8* nocapture readnone %2) {
%4 = insertelement <2 x double> poison, double %0, i64 0
%5 = insertelement <2 x double> %4, double %1, i64 1
%6 = fsub <2 x double> <double 1.000000e+00, double 1.000000e+00>, %5
%7 = insertelement <2 x double> poison, double %1, i64 0
%8 = insertelement <2 x double> %7, double %0, i64 1
%9 = fmul <2 x double> %6, %8
%10 = fdiv <2 x double> %9, <double 3.000000e+00, double 3.000000e+00>
%11 = shufflevector <2 x double> %10, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%12 = fadd <2 x double> %10, %11
%13 = extractelement <2 x double> %12, i64 0
%14 = fmul double %0, %1
%15 = fmul double %14, 5.000000e-01
%16 = fadd double %15, %13
ret double %16
}
/* Variables and functions */
int /*<<< orphan*/ isspace(char const);
char *find_space(const char *s) {
  while (!isspace(*s) && *s != '\0')
    ++s;
  return (char *)s;
}


x86 assembly (clang, -O0):
<find_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    1148 <find_space+0x38>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1158 <find_space+0x48>
jmp    1169 <find_space+0x59>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <find_space+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_space>:
push   %rbx
mov    %rdi,%rbx
movsbl (%rdi),%edi
nopw   0x0(%rax,%rax,1)
call   1030 <isspace@plt>
test   %eax,%eax
jne    1138 <find_space+0x28>
cmpb   $0x0,(%rbx)
je     1138 <find_space+0x28>
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
jmp    1120 <find_space+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @find_space(i8* %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @isspace(i8 signext %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %14
5: ; preds = %1, %9
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = tail call i32 @isspace(i8 signext %11)
%13 = icmp eq i32 %12, 0
br i1 %13, label %5, label %14
14: ; preds = %5, %9, %1
%15 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %5 ]
ret i8* %15
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ __glTexGendv_size(int /*<<< orphan*/);
GLint __glTexGenfv_size(GLenum e) { return __glTexGendv_size(e); }


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

x86 assembly (clang, -O2):
<__glTexGenfv_size>:
jmp    1030 <__glTexGendv_size@plt>

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

LLVM IR (-O2):
define i32 @__glTexGenfv_size(i32 %0) {
%2 = tail call i32 @__glTexGendv_size(i32 %0)
ret i32 %2
}