xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ absolutex();
int /*<<< orphan*/ adc8(int /*<<< orphan*/);
int /*<<< orphan*/ readmem65816(int /*<<< orphan*/);
void adcAbsx8(void) { adc8(readmem65816(absolutex())); }


x86 assembly (clang, -O0):
<adcAbsx8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <absolutex@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
call   1030 <adc8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<adcAbsx8>:
push   %rax
xor    %eax,%eax
call   1040 <absolutex@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <adc8@plt>

LLVM IR (-O0):
define void @adcAbsx8() {
%1 = call i32 (...) @absolutex()
%2 = call i32 @readmem65816(i32 %1)
%3 = call i32 @adc8(i32 %2)
ret void
}

LLVM IR (-O2):
define void @adcAbsx8() {
%1 = tail call i32 (...) @absolutex()
%2 = tail call i32 @readmem65816(i32 %1)
%3 = tail call i32 @adc8(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number;
  printf("Enter a number: ");
  scanf("%d", &number);
  printf("Digit at unit postion of %d is %d\n", number, number % 10);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%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
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
lea    0xeb9(%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    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0x4(%rsp),%rsi
imul   $0x66666667,%rsi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
mov    %esi,%edx
sub    %eax,%edx
lea    0xeab(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [35 x i8] c"Digit at unit postion of %d is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 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 = load i32, i32* %1
%6 = srem i32 %5, 10
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 %4, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [35 x i8] c"Digit at unit postion of %d is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 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 = srem i32 %5, 10
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int, int, int);
void C67_STW_PTR_PRE_INC(int r, int r2, int n) {
  C67_asm("STW.D +*", r, r2, n);
}


x86 assembly (clang, -O0):
<C67_STW_PTR_PRE_INC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xecf(%rip),%rdi
call   1030 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_STW_PTR_PRE_INC>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xee3(%rip),%rdi
jmp    1030 <C67_asm@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"STW.D +*\00"
define void @C67_STW_PTR_PRE_INC(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @C67_asm(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"STW.D +*\00"
define void @C67_STW_PTR_PRE_INC(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @C67_asm(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fifo_tests();
int /*<<< orphan*/ hashmap_tests();
int /*<<< orphan*/ list_tests();
void collections_tests() {
  fifo_tests();
  list_tests();
  hashmap_tests();
}


x86 assembly (clang, -O0):
<collections_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <fifo_tests@plt>
mov    $0x0,%al
call   1050 <list_tests@plt>
mov    $0x0,%al
call   1040 <hashmap_tests@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<collections_tests>:
push   %rax
xor    %eax,%eax
call   1030 <fifo_tests@plt>
xor    %eax,%eax
call   1050 <list_tests@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <hashmap_tests@plt>

LLVM IR (-O0):
define void @collections_tests() {
%1 = call i32 (...) @fifo_tests()
%2 = call i32 (...) @list_tests()
%3 = call i32 (...) @hashmap_tests()
ret void
}

LLVM IR (-O2):
define void @collections_tests() {
%1 = tail call i32 (...) @fifo_tests()
%2 = tail call i32 (...) @list_tests()
%3 = tail call i32 (...) @hashmap_tests()
ret void
}
void XtWindow() {}


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

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

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

LLVM IR (-O2):
define void @XtWindow() {
ret void
}
void PDDeallocatorNullFunc(void *ob) {}


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

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

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

LLVM IR (-O2):
define void @PDDeallocatorNullFunc(i8* nocapture %0) {
ret void
}
int subWordwith(int sourceWord, int destinationWord) {
  return sourceWord - destinationWord;
}


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

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

LLVM IR (-O0):
define i32 @subWordwith(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 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @subWordwith(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
char *usage(void) {
  return "--gdb (optional flag for running in a gdb debug session)\n"
         "    [ --gdb-port=1234 ] (port to use) ";
}


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

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

LLVM IR (-O0):
@.str = [96 x i8] c"--gdb (optional flag for running in a gdb debug session)\0A [ --gdb-port=1234 ] (port to use) \00"
define i8* @usage() {
ret i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [96 x i8] c"--gdb (optional flag for running in a gdb debug session)\0A [ --gdb-port=1234 ] (port to use) \00"
define i8* @usage() {
ret i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str, i64 0, i64 0)
}
float getval(float x) {
  float y;
  y = x * x * x - 5 * x * x + 16 * x - 80;
  return y;
}


x86 assembly (clang, -O0):
<getval>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
movss  0xee8(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x4(%rbp),%xmm0
movss  0xeb8(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  0xea4(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getval>:
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
movss  0xef1(%rip),%xmm2
mulss  %xmm0,%xmm2
mulss  %xmm0,%xmm2
mulss  %xmm0,%xmm1
mulss  0xee1(%rip),%xmm0
addss  %xmm2,%xmm1
addss  %xmm1,%xmm0
addss  0xed5(%rip),%xmm0
ret

LLVM IR (-O0):
define float @getval(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = load float, float* %2
%6 = fmul float %4, %5
%7 = load float, float* %2
%8 = load float, float* %2
%9 = fmul float 5.000000e+00, %8
%10 = load float, float* %2
%11 = fmul float %9, %10
%12 = fneg float %11
%13 = call float @llvm.fmuladd.f32(float %6, float %7, float %12)
%14 = load float, float* %2
%15 = call float @llvm.fmuladd.f32(float 1.600000e+01, float %14, float %13)
%16 = fsub float %15, 8.000000e+01
store float %16, float* %3
%17 = load float, float* %3
ret float %17
}

LLVM IR (-O2):
define float @getval(float %0) {
%2 = fmul float %0, %0
%3 = fmul float %0, -5.000000e+00
%4 = fmul float %3, %0
%5 = tail call float @llvm.fmuladd.f32(float %2, float %0, float %4)
%6 = tail call float @llvm.fmuladd.f32(float %0, float 1.600000e+01, float %5)
%7 = fadd float %6, -8.000000e+01
ret float %7
}
int _kill(pid, sig)
int pid;
int sig;
{ return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_kill(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, char *);
void merror(char *msg1, char *msg2) {
  printf("ERROR: %s %s\n", msg1, msg2);
  exit(1);
}


x86 assembly (clang, -O0):
<merror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<merror>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"ERROR: %s %s\0A\00"
define void @merror(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 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [14 x i8] c"ERROR: %s %s\0A\00"
define void @merror(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void pinmux_init_debugfs(struct dentry *subsys_root) {}


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

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

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

LLVM IR (-O2):
%struct.dentry = type opaque
define void @pinmux_init_debugfs(%struct.dentry* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e(int);
__attribute__((always_)) int t(int function_parameter) {
  e(function_parameter);
}


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

x86 assembly (clang, -O2):
<t>:
jmp    1030 <e@plt>

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

LLVM IR (-O2):
define i32 @t(i32 %0) {
%2 = tail call i32 @e(i32 %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ out_byte(int, int);
void init_8259A() {
  out_byte(0x20, 0x11);
  out_byte(0xA0, 0x11);
  out_byte(0x21, 0x20);
  out_byte(0xA1, 0x28);
  out_byte(0x21, 0x4);
  out_byte(0xA1, 0x2);
  out_byte(0x21, 0x1);
  out_byte(0xA1, 0x1);
  out_byte(0x21, 0xFD);
  out_byte(0xA1, 0xFF);
}


x86 assembly (clang, -O0):
<init_8259A>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <out_byte@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <out_byte@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <out_byte@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <out_byte@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <out_byte@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <out_byte@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <out_byte@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <out_byte@plt>
mov    $0x21,%edi
mov    $0xfd,%esi
call   1030 <out_byte@plt>
mov    $0xa1,%edi
mov    $0xff,%esi
call   1030 <out_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_8259A>:
push   %rax
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <out_byte@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <out_byte@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <out_byte@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <out_byte@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <out_byte@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <out_byte@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <out_byte@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <out_byte@plt>
mov    $0x21,%edi
mov    $0xfd,%esi
call   1030 <out_byte@plt>
mov    $0xa1,%edi
mov    $0xff,%esi
pop    %rax
jmp    1030 <out_byte@plt>

LLVM IR (-O0):
define void @init_8259A() {
%1 = call i32 @out_byte(i32 32, i32 17)
%2 = call i32 @out_byte(i32 160, i32 17)
%3 = call i32 @out_byte(i32 33, i32 32)
%4 = call i32 @out_byte(i32 161, i32 40)
%5 = call i32 @out_byte(i32 33, i32 4)
%6 = call i32 @out_byte(i32 161, i32 2)
%7 = call i32 @out_byte(i32 33, i32 1)
%8 = call i32 @out_byte(i32 161, i32 1)
%9 = call i32 @out_byte(i32 33, i32 253)
%10 = call i32 @out_byte(i32 161, i32 255)
ret void
}

LLVM IR (-O2):
define void @init_8259A() {
%1 = tail call i32 @out_byte(i32 32, i32 17)
%2 = tail call i32 @out_byte(i32 160, i32 17)
%3 = tail call i32 @out_byte(i32 33, i32 32)
%4 = tail call i32 @out_byte(i32 161, i32 40)
%5 = tail call i32 @out_byte(i32 33, i32 4)
%6 = tail call i32 @out_byte(i32 161, i32 2)
%7 = tail call i32 @out_byte(i32 33, i32 1)
%8 = tail call i32 @out_byte(i32 161, i32 1)
%9 = tail call i32 @out_byte(i32 33, i32 253)
%10 = tail call i32 @out_byte(i32 161, i32 255)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cleartextbox_color(unsigned char, unsigned char,
                                      unsigned char, unsigned char, int);
void cleartextbox(unsigned char x, unsigned char y, unsigned char w,
                  unsigned char h) {
  cleartextbox_color(x, y, w, h, (((0) << 7) | ((1) << 6) | ((7) << 3) | (0)));
}


x86 assembly (clang, -O0):
<cleartextbox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %cl,-0x3(%rbp)
mov    %al,-0x4(%rbp)
mov    -0x1(%rbp),%dl
mov    -0x2(%rbp),%cl
mov    -0x3(%rbp),%al
mov    $0x78,%r8d
movzbl %dl,%edi
movzbl %cl,%esi
movzbl %al,%edx
movzbl -0x4(%rbp),%ecx
call   1030 <cleartextbox_color@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleartextbox>:
mov    $0x78,%r8d
jmp    1030 <cleartextbox_color@plt>

LLVM IR (-O0):
define void @cleartextbox(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8 %0, i8* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%9 = load i8, i8* %5
%10 = load i8, i8* %6
%11 = load i8, i8* %7
%12 = load i8, i8* %8
%13 = call i32 @cleartextbox_color(i8 zeroext %9, i8 zeroext %10, i8 zeroext %11, i8 zeroext %12, i32 120)
ret void
}

LLVM IR (-O2):
define void @cleartextbox(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = tail call i32 @cleartextbox_color(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3, i32 120)
ret void
}
/* Variables and functions */
int isspace(char);
bool space(char c) { return isspace(c); }


x86 assembly (clang, -O0):
<space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isspace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<space>:
jmp    1030 <isspace@plt>

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

LLVM IR (-O2):
define i32 @space(i8 signext %0) {
%2 = tail call i32 @isspace(i8 signext %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x1e() {
  Assert_real((isalnum(30) == 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",
              155, ("isalnum should be 0 for 0x1e"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0x1e>:
push   %rax
mov    $0x1e,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x9b,%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 0x1e\00"
define void @t_isalnum_0x1e() {
%1 = call i64 @isalnum(i32 30)
%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 155, 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 0x1e\00"
define void @t_isalnum_0x1e() {
%1 = tail call i64 @isalnum(i32 30)
%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 155, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
char *_getbuf(void) {
  static char _buf[16][80];
  static int _num = -1;
  _num++;
  _num %= 16;
  memset(_buf[_num], 0, 80);
  return _buf[_num];
}


x86 assembly (clang, -O0):
<_getbuf>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f0e(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f05(%rip)
mov    0x2eff(%rip),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %edx,0x2ef1(%rip)
movslq 0x2eea(%rip),%rax
lea    0x2efb(%rip),%rdi
imul   $0x50,%rax,%rax
add    %rax,%rdi
xor    %esi,%esi
mov    $0x50,%edx
call   1030 <memset@plt>
movslq 0x2ec9(%rip),%rcx
lea    0x2eda(%rip),%rax
imul   $0x50,%rcx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_getbuf>:
push   %rbx
mov    0x2f11(%rip),%eax
lea    0x1(%rax),%ecx
lea    0x10(%rax),%edx
test   %ecx,%ecx
cmovns %ecx,%edx
and    $0xfffffff0,%edx
neg    %edx
add    %edx,%eax
add    $0x1,%eax
mov    %eax,0x2ef6(%rip)
cltq
lea    (%rax,%rax,4),%rdi
shl    $0x4,%rdi
lea    0x2efd(%rip),%rbx
add    %rbx,%rdi
xor    %esi,%esi
mov    $0x50,%edx
call   1030 <memset@plt>
movslq 0x2ecf(%rip),%rax
lea    (%rax,%rax,4),%rax
shl    $0x4,%rax
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@_getbuf._buf = internal global [16 x [80 x i8]] zeroinitializer
@_getbuf._num = internal global i32 -1
define i8* @_getbuf() {
%1 = load i32, i32* @_getbuf._num
%2 = add nsw i32 %1, 1
store i32 %2, i32* @_getbuf._num
%3 = load i32, i32* @_getbuf._num
%4 = srem i32 %3, 16
store i32 %4, i32* @_getbuf._num
%5 = load i32, i32* @_getbuf._num
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [16 x [80 x i8]], [16 x [80 x i8]]* @_getbuf._buf, i64 0, i64 %6
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%9 = call i32 @memset(i8* %8, i32 0, i32 80)
%10 = load i32, i32* @_getbuf._num
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [16 x [80 x i8]], [16 x [80 x i8]]* @_getbuf._buf, i64 0, i64 %11
%13 = getelementptr inbounds [80 x i8], [80 x i8]* %12, i64 0, i64 0
ret i8* %13
}

LLVM IR (-O2):
@_getbuf._buf = internal global [16 x [80 x i8]] zeroinitializer
@_getbuf._num = internal unnamed_addr global i32 -1
define i8* @_getbuf() {
%1 = load i32, i32* @_getbuf._num
%2 = add nsw i32 %1, 1
%3 = srem i32 %2, 16
store i32 %3, i32* @_getbuf._num
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [16 x [80 x i8]], [16 x [80 x i8]]* @_getbuf._buf, i64 0, i64 %4, i64 0
%6 = tail call i32 @memset(i8* %5, i32 0, i32 80)
%7 = load i32, i32* @_getbuf._num
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [16 x [80 x i8]], [16 x [80 x i8]]* @_getbuf._buf, i64 0, i64 %8, i64 0
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ nomem();
void *realloc(void *, size_t);
void *xrealloc(void *pp, size_t sz) {
  void *p = realloc(pp, sz);
  if (p == NULL)
    nomem();
  return p;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <xrealloc+0x33>
mov    $0x0,%al
call   1030 <nomem@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <xrealloc+0x15>
xor    %eax,%eax
call   1030 <nomem@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (...) @nomem()
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @nomem()
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_entire(char *buffer, int size) {
  int i;
  for (i = 0; i < size; i++) {
    printf("%c", buffer[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_entire>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <print_entire+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_entire+0x16>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_entire>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1143 <print_entire+0x33>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <print_entire+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @print_entire(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = tail call i32 @putchar(i32 %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ goodbye();
int /*<<< orphan*/ islogin();
dologout() {
  islogin();
  goodbye();
}


x86 assembly (clang, -O0):
<dologout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <islogin@plt>
mov    $0x0,%al
call   1030 <goodbye@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dologout>:
push   %rax
xor    %eax,%eax
call   1040 <islogin@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <goodbye@plt>

LLVM IR (-O0):
define i32 @dologout() {
%1 = alloca i32
%2 = call i32 (...) @islogin()
%3 = call i32 (...) @goodbye()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @dologout() {
%1 = tail call i32 (...) @islogin()
%2 = tail call i32 (...) @goodbye()
ret i32 undef
}
/* Variables and functions */
unsigned long HSV2RGB98(unsigned long);
unsigned long hsv2rgb(unsigned long hsn) { return HSV2RGB98(hsn); }


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

x86 assembly (clang, -O2):
<hsv2rgb>:
jmp    1030 <HSV2RGB98@plt>

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

LLVM IR (-O2):
define i64 @hsv2rgb(i64 %0) {
%2 = tail call i64 @HSV2RGB98(i64 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ logger_platform_init(char const *);
char *settings_logger_file();
void logger_init() {
  const char *file = settings_logger_file();
  logger_platform_init(file);
}


x86 assembly (clang, -O0):
<logger_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <settings_logger_file@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <logger_platform_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logger_init>:
push   %rax
xor    %eax,%eax
call   1040 <settings_logger_file@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <logger_platform_init@plt>

LLVM IR (-O0):
define void @logger_init() {
%1 = alloca i8*
%2 = call i8* (...) @settings_logger_file()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @logger_platform_init(i8* %3)
ret void
}

LLVM IR (-O2):
define void @logger_init() {
%1 = tail call i8* (...) @settings_logger_file()
%2 = tail call i32 @logger_platform_init(i8* %1)
ret void
}
unsigned char inb(unsigned short port) {
  unsigned char res;
  asm volatile("inb %%dx, %0" : "=a"(res) : "Nd"(port));
  return res;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb %dx, $0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb %dx, $0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void f1(int (*f)(int)) { printf("f1: %d\n", f(1)); }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   *-0x8(%rbp)
mov    %eax,%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
push   %rax
mov    %rdi,%rax
mov    $0x1,%edi
call   *%rax
lea    0xede(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"f1: %d\0A\00"
define void @f1(i32 (i32)* %0) {
%2 = alloca i32 (i32)*
store i32 (i32)* %0, i32 (i32)** %2
%3 = load i32 (i32)*, i32 (i32)** %2
%4 = call i32 %3(i32 1)
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"f1: %d\0A\00"
define void @f1(i32 (i32)* nocapture %0) {
%2 = tail call i32 %0(i32 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
void stress_iostat_dev_trim_nvme(char *devname) {
  char *ptr;
  for (ptr = devname; *ptr; ptr++)
    ;
  if ((--ptr > devname) && (*ptr == 'p'))
    *ptr = '\0';
}


x86 assembly (clang, -O0):
<stress_iostat_dev_trim_nvme>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1133 <stress_iostat_dev_trim_nvme+0x33>
jmp    1122 <stress_iostat_dev_trim_nvme+0x22>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <stress_iostat_dev_trim_nvme+0x10>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
cmp    -0x8(%rbp),%rax
jbe    1160 <stress_iostat_dev_trim_nvme+0x60>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x70,%eax
jne    1160 <stress_iostat_dev_trim_nvme+0x60>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<stress_iostat_dev_trim_nvme>:
lea    -0x2(%rdi),%rax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpb   $0x0,0x2(%rax)
lea    0x1(%rax),%rax
jne    1110 <stress_iostat_dev_trim_nvme+0x10>
cmp    %rdi,%rax
jbe    1127 <stress_iostat_dev_trim_nvme+0x27>
cmpb   $0x70,(%rax)
jne    1127 <stress_iostat_dev_trim_nvme+0x27>
movb   $0x0,(%rax)
ret

LLVM IR (-O0):
define void @stress_iostat_dev_trim_nvme(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %10, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %5
br label %10
10: ; preds = %9
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
br label %5
13: ; preds = %5
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i32 -1
store i8* %15, i8** %3
%16 = load i8*, i8** %2
%17 = icmp ugt i8* %15, %16
br i1 %17, label %18, label %25
18: ; preds = %13
%19 = load i8*, i8** %3
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 112
br i1 %22, label %23, label %25
23: ; preds = %18
%24 = load i8*, i8** %3
store i8 0, i8* %24
br label %25
25: ; preds = %23, %18, %13
ret void
}

LLVM IR (-O2):
define void @stress_iostat_dev_trim_nvme(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %3, i64 -1
%9 = icmp ugt i8* %8, %0
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 112
br i1 %12, label %13, label %14
13: ; preds = %10
store i8 0, i8* %8
br label %14
14: ; preds = %13, %10, %7
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
int /*<<< orphan*/ randinit();
int /*<<< orphan*/ random();
u_int32_t GenerateMagic(void) {
  randinit();
  return random();
}


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

x86 assembly (clang, -O2):
<GenerateMagic>:
push   %rax
xor    %eax,%eax
call   1030 <randinit@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <random@plt>

LLVM IR (-O0):
define i32 @GenerateMagic() {
%1 = call i32 (...) @randinit()
%2 = call i32 (...) @random()
ret i32 %2
}

LLVM IR (-O2):
define i32 @GenerateMagic() {
%1 = tail call i32 (...) @randinit()
%2 = tail call i32 (...) @random()
ret i32 %2
}
int is_tegra_camera_on(void) { return 0; }


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

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

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

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


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

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

LLVM IR (-O0):
define i32 @my_dest_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 @my_dest_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
}
unsigned short lookupw(unsigned char *p, int n) {
  return (p[n + 1] << 8) | p[n];
}


x86 assembly (clang, -O0):
<lookupw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookupw>:
movslq %esi,%rax
movzwl (%rdi,%rax,1),%eax
ret

LLVM IR (-O0):
define zeroext i16 @lookupw(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 = load i32, i32* %4
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = or i32 %12, %18
%20 = trunc i32 %19 to i16
ret i16 %20
}

LLVM IR (-O2):
define zeroext i16 @lookupw(i8* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = zext i8 %6 to i16
%8 = shl nuw i16 %7, 8
%9 = sext i32 %1 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = zext i8 %11 to i16
%13 = or i16 %8, %12
ret i16 %13
}
/* Variables and functions */
int fib(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n;
  int f = 0;
  int i = 0;
  scanf("%d", &n);
  do {
    printf("%d\n", f);
    f = fib(++i);
  } while (f <= n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xeac(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%edi
add    $0x1,%edi
mov    %edi,-0x10(%rbp)
call   1050 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    115d <main+0x2d>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
xor    %eax,%eax
mov    $0x1,%ebx
lea    0xeb0(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1050 <fib@plt>
add    $0x1,%ebx
cmp    0x4(%rsp),%eax
jle    1160 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
br label %4
4: ; preds = %4, %0
%5 = phi i32 [ 0, %0 ], [ %9, %4 ]
%6 = phi i32 [ 0, %0 ], [ %8, %4 ]
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%8 = add nuw nsw i32 %6, 1
%9 = call i32 @fib(i32 %8)
%10 = load i32, i32* %1
%11 = icmp sgt i32 %9, %10
br i1 %11, label %12, label %4
12: ; preds = %4
ret i32 0
}
/* Type definitions */
struct _WsbmBufStorage {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
unsigned long pool_offset(struct _WsbmBufStorage *buf) {
  abort();
  return 0UL;
}


x86 assembly (clang, -O0):
<pool_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<pool_offset>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct._WsbmBufStorage = type { i32 }
define i64 @pool_offset(%struct._WsbmBufStorage* %0) {
%2 = alloca %struct._WsbmBufStorage*
store %struct._WsbmBufStorage* %0, %struct._WsbmBufStorage** %2
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
%struct._WsbmBufStorage = type { i32 }
define i64 @pool_offset(%struct._WsbmBufStorage* nocapture readnone %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ pA(char *);
int /*<<< orphan*/ read_mem(char const *, char *);
void pop_stack(const char *regname_data) {
  pA("stack_head--;");
  read_mem(regname_data, "stack_head");
}


x86 assembly (clang, -O0):
<pop_stack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <pA@plt>
mov    -0x8(%rbp),%rdi
lea    0xecb(%rip),%rsi
call   1040 <read_mem@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pop_stack>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <pA@plt>
lea    0xed7(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <read_mem@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"stack_head--;\00"
@.str.1 = [11 x i8] c"stack_head\00"
define void @pop_stack(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @pA(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @read_mem(i8* %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"stack_head--;\00"
@.str.1 = [11 x i8] c"stack_head\00"
define void @pop_stack(i8* %0) {
%2 = tail call i32 @pA(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @read_mem(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct lifo {
  int dummy;
};

/* Variables and functions */
double pop(struct lifo *);
double tan(double);
double opr_tan(struct lifo *stack) {
  double op = pop(stack);
  return tan(op);
}


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

x86 assembly (clang, -O2):
<opr_tan>:
push   %rax
call   1030 <pop@plt>
pop    %rax
jmp    1040 <tan@plt>

LLVM IR (-O0):
%struct.lifo = type { i32 }
define double @opr_tan(%struct.lifo* %0) {
%2 = alloca %struct.lifo*
%3 = alloca double
store %struct.lifo* %0, %struct.lifo** %2
%4 = load %struct.lifo*, %struct.lifo** %2
%5 = call double @pop(%struct.lifo* %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = call double @tan(double %6)
ret double %7
}

LLVM IR (-O2):
%struct.lifo = type { i32 }
define double @opr_tan(%struct.lifo* %0) {
%2 = tail call double @pop(%struct.lifo* %0)
%3 = tail call double @tan(double %2)
ret double %3
}
void update(int i, int x, int *BIT, int n) {
  for (; i <= n; i += i & (-i)) {
    BIT[i] += x;
  }
}


x86 assembly (clang, -O0):
<update>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     1143 <update+0x43>
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
add    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x4(%rbp),%ecx
and    %ecx,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1111 <update+0x11>
pop    %rbp
ret

x86 assembly (clang, -O2):
<update>:
cmp    %ecx,%edi
jg     1122 <update+0x22>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movslq %edi,%rax
add    %esi,(%rdx,%rax,4)
mov    %eax,%edi
neg    %edi
and    %eax,%edi
add    %eax,%edi
cmp    %ecx,%edi
jle    1110 <update+0x10>
ret

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

LLVM IR (-O2):
define void @update(i32 %0, i32 %1, i32* nocapture %2, i32 %3) {
%5 = icmp sgt i32 %0, %3
br i1 %5, label %16, label %6
6: ; preds = %4, %6
%7 = phi i32 [ %14, %6 ], [ %0, %4 ]
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %2, i64 %8
%10 = load i32, i32* %9
%11 = add nsw i32 %10, %1
store i32 %11, i32* %9
%12 = sub nsw i32 0, %7
%13 = and i32 %7, %12
%14 = add nsw i32 %13, %7
%15 = icmp sgt i32 %14, %3
br i1 %15, label %16, label %6
16: ; preds = %6, %4
ret void
}
int test_imm_3Aint8_mem(signed char *val) {
  return ((*val) & (0x3A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_3Aint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 58
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
long long j(long long c) { return (c >> 35) << 35; }


x86 assembly (clang, -O0):
<j>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x23,%rax
shl    $0x23,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<j>:
movabs $0xfffffff800000000,%rax
ff ff ff
and    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @j(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 35
%5 = shl i64 %4, 35
ret i64 %5
}

LLVM IR (-O2):
define i64 @j(i64 %0) {
%2 = and i64 %0, -34359738368
ret i64 %2
}
int main(void) {
  int memoryLocation;
  int memory_location_2345;
  return 0;
}


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

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

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

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