xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ HibernateWriteComplete();
void HibernateClockConfig(unsigned long ulConfig) {
  unsigned long ulHIBCtl;

  ;
  ulHIBCtl = (*((volatile unsigned long *)(0x400FC010)));
  ulHIBCtl &= ~(0x00020000 | 0x00000000 | 0x00010000);
  ulHIBCtl |= ulConfig & (0x00020000 | 0x00000000 | 0x00010000);
  (*((volatile unsigned long *)(0x400FC010))) = ulHIBCtl;
  HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateClockConfig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x400fc010,%eax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xfffffffffffcffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
and    $0x30000,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x400fc010,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <HibernateWriteComplete@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateClockConfig>:
mov    $0xfffffffffffcffff,%rax
and    0x400fc010,%rax
40
and    $0x30000,%edi
or     %rax,%rdi
mov    %rdi,0x400fc010
40
xor    %eax,%eax
jmp    1030 <HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateClockConfig(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
store i64 %4, i64* %3
%5 = load i64, i64* %3
%6 = and i64 %5, -196609
store i64 %6, i64* %3
%7 = load i64, i64* %2
%8 = and i64 %7, 196608
%9 = load i64, i64* %3
%10 = or i64 %9, %8
store i64 %10, i64* %3
%11 = load i64, i64* %3
store volatile i64 %11, i64* inttoptr (i64 1074774032 to i64*)
%12 = call i32 (...) @HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateClockConfig(i64 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%3 = and i64 %2, -196609
%4 = and i64 %0, 196608
%5 = or i64 %3, %4
store volatile i64 %5, i64* inttoptr (i64 1074774032 to i64*)
%6 = tail call i32 (...) @HibernateWriteComplete()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ flush_outbuf();
int bz2_fclose(void *stream) {
  flush_outbuf();
  return 0;
}


x86 assembly (clang, -O0):
<bz2_fclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <flush_outbuf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bz2_fclose>:
push   %rax
xor    %eax,%eax
call   1030 <flush_outbuf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @bz2_fclose(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @flush_outbuf()
ret i32 0
}
char *ctime(const unsigned long *timep) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @ctime(i64* nocapture readnone %0) {
ret i8* null
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ DAC_Init();
void Sound_Init(void) {
  DAC_Init();
  (*((volatile uint32_t *)0xE000E010)) = 0;
  (*((volatile uint32_t *)0xE000E014)) = 0;
  (*((volatile uint32_t *)0xE000E018)) = 0;
  (*((volatile uint32_t *)0xE000ED20)) =
      ((*((volatile uint32_t *)0xE000ED20)) & 0x00FFFFFF) | 0x60000000;
  (*((volatile uint32_t *)0xE000E010)) = 0x0007;
}


x86 assembly (clang, -O0):
<Sound_Init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <DAC_Init@plt>
mov    $0xe000e010,%eax
movl   $0x0,(%rax)
mov    $0xe000e014,%eax
movl   $0x0,(%rax)
mov    $0xe000e018,%eax
movl   $0x0,(%rax)
mov    $0xe000ed20,%eax
mov    (%rax),%ecx
and    $0xffffff,%ecx
or     $0x60000000,%ecx
mov    $0xe000ed20,%eax
mov    %ecx,(%rax)
mov    $0xe000e010,%eax
movl   $0x7,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sound_Init>:
push   %rax
xor    %eax,%eax
call   1030 <DAC_Init@plt>
mov    $0xe000e010,%eax
movl   $0x0,(%rax)
movl   $0x0,0x4(%rax)
movl   $0x0,0x8(%rax)
mov    $0xffffff,%ecx
and    0xd10(%rax),%ecx
or     $0x60000000,%ecx
mov    %ecx,0xd10(%rax)
movl   $0x7,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @Sound_Init() {
%1 = call i32 (...) @DAC_Init()
store volatile i32 0, i32* inttoptr (i64 3758153744 to i32*)
store volatile i32 0, i32* inttoptr (i64 3758153748 to i32*)
store volatile i32 0, i32* inttoptr (i64 3758153752 to i32*)
%2 = load volatile i32, i32* inttoptr (i64 3758157088 to i32*)
%3 = and i32 %2, 16777215
%4 = or i32 %3, 1610612736
store volatile i32 %4, i32* inttoptr (i64 3758157088 to i32*)
store volatile i32 7, i32* inttoptr (i64 3758153744 to i32*)
ret void
}

LLVM IR (-O2):
define void @Sound_Init() {
%1 = tail call i32 (...) @DAC_Init()
store volatile i32 0, i32* inttoptr (i64 3758153744 to i32*)
store volatile i32 0, i32* inttoptr (i64 3758153748 to i32*)
store volatile i32 0, i32* inttoptr (i64 3758153752 to i32*)
%2 = load volatile i32, i32* inttoptr (i64 3758157088 to i32*)
%3 = and i32 %2, 16777215
%4 = or i32 %3, 1610612736
store volatile i32 %4, i32* inttoptr (i64 3758157088 to i32*)
store volatile i32 7, i32* inttoptr (i64 3758153744 to i32*)
ret void
}
void sa1100_register_uart_fns(struct sa1100_port_fns *fns) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
%struct.sa1100_port_fns = type opaque
define void @sa1100_register_uart_fns(%struct.sa1100_port_fns* nocapture %0) {
ret void
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int time(int /*<<< orphan*/ *);
int main() {
  time_t ctime;
  ctime = time(NULL);
  printf("ctime is %d\n", ctime);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"ctime is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("Fuzita Hiromu\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Fuzita Hiromu\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int sprintf(char *, char *, char *, char *, char *);
int MFpathAppend(char *dest, char *prefix, char *postfix) {
  return (sprintf(dest, "%s%s%s", prefix, "/", postfix));
}


x86 assembly (clang, -O0):
<MFpathAppend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%r8
lea    0xec9(%rip),%rsi
lea    0xec9(%rip),%rcx
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MFpathAppend>:
mov    %rdx,%r8
mov    %rsi,%rdx
lea    0xee3(%rip),%rsi
lea    0xee3(%rip),%rcx
jmp    1030 <sprintf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%s%s%s\00"
@.str.1 = [2 x i8] c"/\00"
define i32 @MFpathAppend(i8* nocapture writeonly %0, i8* %1, i8* %2) {
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ b_show_tape(int, int *, int);
void b_debug_32(int idx, int *cells, int size) {
  b_show_tape(idx, cells, size);
}


x86 assembly (clang, -O0):
<b_debug_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <b_show_tape@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_debug_32>:
jmp    1030 <b_show_tape@plt>

LLVM IR (-O0):
define void @b_debug_32(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 @b_show_tape(i32 %7, i32* %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @b_debug_32(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @b_show_tape(i32 %0, i32* %1, i32 %2)
ret void
}
int ffi_test_18(int x, int y, int z, int t) { return x + y + z * t; }


x86 assembly (clang, -O0):
<ffi_test_18>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffi_test_18>:
lea    (%rdi,%rsi,1),%eax
imul   %ecx,%edx
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @ffi_test_18(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
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = mul nsw i32 %12, %13
%15 = add nsw i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @ffi_test_18(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %1, %0
%6 = mul nsw i32 %3, %2
%7 = add nsw i32 %5, %6
ret i32 %7
}
int main(void) {
  int i, j;
  const int n = 10;
  int seq[n], sum, max;
  max = 0;
  for (i = 0; i < n; i++) {
    sum = 0;
    for (j = i; j < n; j++) {
      sum += seq[j];
      max = max > sum ? max : sum;
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x10(%rbp)
mov    %rsp,%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    119a <main+0x9a>
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1187 <main+0x87>
movslq -0xc(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    116d <main+0x6d>
mov    -0x20(%rbp),%eax
mov    %eax,-0x54(%rbp)
jmp    1173 <main+0x73>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113e <main+0x3e>
jmp    118c <main+0x8c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1127 <main+0x27>
movl   $0x0,-0x4(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%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
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %4
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %5
%9 = alloca i32, i64 10
store i32 0, i32* %7
store i32 0, i32* %2
br label %10
10: ; preds = %38, %0
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 10
br i1 %12, label %13, label %41
13: ; preds = %10
store i32 0, i32* %6
%14 = load i32, i32* %2
store i32 %14, i32* %3
br label %15
15: ; preds = %34, %13
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 10
br i1 %17, label %18, label %37
18: ; preds = %15
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %9, i64 %20
%22 = load i32, i32* %21
%23 = load i32, i32* %6
%24 = add nsw i32 %23, %22
store i32 %24, i32* %6
%25 = load i32, i32* %7
%26 = load i32, i32* %6
%27 = icmp sgt i32 %25, %26
br i1 %27, label %28, label %30
28: ; preds = %18
%29 = load i32, i32* %7
br label %32
30: ; preds = %18
%31 = load i32, i32* %6
br label %32
32: ; preds = %30, %28
%33 = phi i32 [ %29, %28 ], [ %31, %30 ]
store i32 %33, i32* %7
br label %34
34: ; preds = %32
%35 = load i32, i32* %3
%36 = add nsw i32 %35, 1
store i32 %36, i32* %3
br label %15
37: ; preds = %15
br label %38
38: ; preds = %37
%39 = load i32, i32* %2
%40 = add nsw i32 %39, 1
store i32 %40, i32* %2
br label %10
41: ; preds = %10
store i32 0, i32* %1
%42 = load i8*, i8** %5
%43 = load i32, i32* %1
ret i32 %43
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int twice(int a) { return 2 * a; }


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

x86 assembly (clang, -O2):
<twice>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @twice(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void ofl_buffer_print(FILE *stream, uint32_t buffer) {
  switch (buffer) {
  case (0xffffffff): {
    fprintf(stream, "none");
    return;
  }
  default: {
    fprintf(stream, "%u", buffer);
    return;
  }
  }
}


x86 assembly (clang, -O0):
<ofl_buffer_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0xffffffff,%eax
jne    1147 <ofl_buffer_print+0x37>
jmp    1130 <ofl_buffer_print+0x20>
mov    -0x8(%rbp),%rdi
lea    0xec5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    115c <ofl_buffer_print+0x4c>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xeb0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ofl_buffer_print>:
mov    %rdi,%rcx
cmp    $0xffffffff,%esi
je     113b <ofl_buffer_print+0x1b>
mov    %esi,%edx
lea    0xed4(%rip),%rsi
mov    %rcx,%rdi
xor    %eax,%eax
jmp    1030 <fprintf@plt>
lea    0xebe(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"none\00"
@.str.1 = [3 x i8] c"%u\00"
define void @ofl_buffer_print(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
switch i32 %5, label %9 [
i32 -1, label %6
]
6: ; preds = %2
%7 = load i32*, i32** %3
%8 = call i32 (i32*, i8*, ...) @fprintf(i32* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %13
9: ; preds = %2
%10 = load i32*, i32** %3
%11 = load i32, i32* %4
%12 = call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"none\00"
@.str.1 = [3 x i8] c"%u\00"
define void @ofl_buffer_print(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, -1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 4, i64 1, i32* %0)
br label %8
6: ; preds = %2
%7 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %1)
br label %8
8: ; preds = %6, %4
ret void
}
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans =
      ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn("/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/"
                        "cyclone/refs/heads/master/bin/genfiles/kinds.c",
                        284));
  return word_ans;
}


x86 assembly (clang, -O0):
<_check_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jb     114d <_check_times+0x3d>
cmpl   $0x10000000,-0x14(%rbp)
jbe    1160 <_check_times+0x50>
lea    0xeac(%rip),%rdi
mov    $0x11c,%esi
mov    $0x0,%al
call   1030 <_throw_badalloc_fn@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_times>:
push   %rbx
mov    %edi,%eax
mul    %esi
mov    %eax,%ebx
jo     1121 <_check_times+0x11>
cmp    $0x10000001,%ebx
jb     1134 <_check_times+0x24>
lea    0xed8(%rip),%rdi
mov    $0x11c,%esi
xor    %eax,%eax
call   1030 <_throw_badalloc_fn@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [146 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/kinds.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = mul i64 %8, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = load i64, i64* %5
%17 = icmp ult i64 %15, %16
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %6
%20 = icmp ugt i32 %19, 268435456
br i1 %20, label %21, label %23
21: ; preds = %18, %2
%22 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i32 284)
br label %23
23: ; preds = %21, %18
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
@.str = [146 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/kinds.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = tail call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %0, i32 %1)
%4 = extractvalue { i32, i1 } %3, 0
%5 = extractvalue { i32, i1 } %3, 1
%6 = icmp ugt i32 %4, 268435456
%7 = or i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i32 284)
br label %10
10: ; preds = %2, %8
ret i32 %4
}
/* Variables and functions */
int do_lib_for_each(int (*)(void *, struct track_info *), void *,
                    int /*<<< orphan*/);
int lib_for_each(int (*cb)(void *data, struct track_info *ti), void *data) {
  return do_lib_for_each(cb, data, 0);
}


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

x86 assembly (clang, -O2):
<lib_for_each>:
xor    %edx,%edx
jmp    1030 <do_lib_for_each@plt>

LLVM IR (-O0):
%struct.track_info = type opaque
%struct.track_info.0 = type opaque
define i32 @lib_for_each(i32 (i8*, %struct.track_info*)* %0, i8* %1) {
%3 = alloca i32 (i8*, %struct.track_info*)*
%4 = alloca i8*
store i32 (i8*, %struct.track_info*)* %0, i32 (i8*, %struct.track_info*)** %3
store i8* %1, i8** %4
%5 = load i32 (i8*, %struct.track_info*)*, i32 (i8*, %struct.track_info*)** %3
%6 = bitcast i32 (i8*, %struct.track_info*)* %5 to i32 (i8*, %struct.track_info.0*)*
%7 = load i8*, i8** %4
%8 = call i32 @do_lib_for_each(i32 (i8*, %struct.track_info.0*)* %6, i8* %7, i32 0)
ret i32 %8
}

LLVM IR (-O2):
%struct.track_info = type opaque
%struct.track_info.0 = type opaque
define i32 @lib_for_each(i32 (i8*, %struct.track_info*)* %0, i8* %1) {
%3 = bitcast i32 (i8*, %struct.track_info*)* %0 to i32 (i8*, %struct.track_info.0*)*
%4 = tail call i32 @do_lib_for_each(i32 (i8*, %struct.track_info.0*)* %3, i8* %1, i32 0)
ret i32 %4
}
unsigned long fls(unsigned long value) {
  if (!value)
    return 0;
  __asm__("bsr %1, %0" : "=r"(value) : "rm"(value) : "cc");
  return value + 1;
}


x86 assembly (clang, -O0):
<fls>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1120 <fls+0x20>
movq   $0x0,-0x8(%rbp)
jmp    113d <fls+0x3d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
bsr    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fls>:
test   %rdi,%rdi
je     1115 <fls+0x15>
mov    %rdi,-0x8(%rsp)
bsr    -0x8(%rsp),%rax
add    $0x1,%rax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @fls(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp ne i64 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %1
store i64 0, i64* %2
br label %12
7: ; preds = %1
%8 = load i64, i64* %3
%9 = call i64 asm "bsr $1, $0", "=r,rm,~{cc},~{dirflag},~{fpsr},~{flags}"(i64 %8)
store i64 %9, i64* %3
%10 = load i64, i64* %3
%11 = add i64 %10, 1
store i64 %11, i64* %2
br label %12
12: ; preds = %7, %6
%13 = load i64, i64* %2
ret i64 %13
}

LLVM IR (-O2):
define i64 @fls(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i64 asm "bsr $1, $0", "=r,rm,~{cc},~{dirflag},~{fpsr},~{flags}"(i64 %0)
%5 = add i64 %4, 1
br label %6
6: ; preds = %1, %3
%7 = phi i64 [ %5, %3 ], [ 0, %1 ]
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
int func() {
  char *memoryArea = malloc(10);
  char *newArea = malloc(10);
  memoryArea = newArea;
  free(memoryArea);
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rax
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define i32 @func() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = call i8* @malloc(i32 10)
store i8* %4, i8** %2
%5 = call i8* @malloc(i32 10)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
store i8* %6, i8** %2
%7 = load i8*, i8** %2
%8 = call i32 @free(i8* %7)
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @func() {
%1 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%2 = tail call i32 @free(i8* %1)
ret i32 undef
}
float test_sinf(float x) { return __builtin_sinf(x); }


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

x86 assembly (clang, -O2):
<test_sinf>:
jmp    1030 <sinf@plt>

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

LLVM IR (-O2):
define float @test_sinf(float %0) {
%2 = tail call float @sinf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ printw(char *);
int /*<<< orphan*/ refresh();
int main() {
  initscr();
  printw("PC Tools");
  refresh();
  getch();
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <initscr@plt>
lea    0xe93(%rip),%rdi
call   1040 <printw@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
mov    $0x0,%al
call   1060 <getch@plt>
mov    $0x0,%al
call   1070 <endwin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <initscr@plt>
lea    0xea1(%rip),%rdi
call   1040 <printw@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
xor    %eax,%eax
call   1060 <getch@plt>
xor    %eax,%eax
call   1070 <endwin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"PC Tools\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @initscr()
%3 = call i32 @printw(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @refresh()
%5 = call i32 (...) @getch()
%6 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"PC Tools\00"
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 @printw(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @refresh()
%4 = tail call i32 (...) @getch()
%5 = tail call i32 (...) @endwin()
ret i32 0
}
void getgpo_(x, y, z, w) float *x, *y, *z, *w;
{ getgpos(x, y, z, w); }


x86 assembly (clang, -O0):
<getgpo_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x0,%al
call   1030 <getgpos@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @getgpo_(float* %0, float* %1, float* %2, float* %3) {
%5 = alloca float*
%6 = alloca float*
%7 = alloca float*
%8 = alloca float*
store float* %0, float** %5
store float* %1, float** %6
store float* %2, float** %7
store float* %3, float** %8
%9 = load float*, float** %5
%10 = load float*, float** %6
%11 = load float*, float** %7
%12 = load float*, float** %8
%13 = call i32 (float*, float*, float*, float*, ...) bitcast (i32 (...)* @getgpos to i32 (float*, float*, float*, float*, ...)*)(float* %9, float* %10, float* %11, float* %12)
ret void
}

LLVM IR (-O2):
define void @getgpo_(float* %0, float* %1, float* %2, float* %3) {
%5 = tail call i32 (float*, float*, float*, float*, ...) bitcast (i32 (...)* @getgpos to i32 (float*, float*, float*, float*, ...)*)(float* %0, float* %1, float* %2, float* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_clbk(void *elem, void *data) { free(elem); }


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

x86 assembly (clang, -O2):
<free_clbk>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_clbk(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @free_clbk(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int twister_genrand64_int64();
double twister_genrand64_real2(void) {
  return (twister_genrand64_int64() >> 11) * (1.0 / 9007199254740992.0);
}


x86 assembly (clang, -O0):
<twister_genrand64_real2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <twister_genrand64_int64@plt>
sar    $0xb,%eax
cvtsi2sd %eax,%xmm0
movsd  0xed6(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<twister_genrand64_real2>:
push   %rax
xor    %eax,%eax
call   1030 <twister_genrand64_int64@plt>
sar    $0xb,%eax
cvtsi2sd %eax,%xmm0
mulsd  0xed9(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @twister_genrand64_real2() {
%1 = call i32 (...) @twister_genrand64_int64()
%2 = ashr i32 %1, 11
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 0x3CA0000000000000
ret double %4
}

LLVM IR (-O2):
define double @twister_genrand64_real2() {
%1 = tail call i32 (...) @twister_genrand64_int64()
%2 = ashr i32 %1, 11
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 0x3CA0000000000000
ret double %4
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ _TimerBaseValid(scalar_t__);
void TimerIntClear(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ASSERT(_TimerBaseValid(ui32Base));
  (*((volatile uint32_t *)(ui32Base + 0x00000024))) = ui32IntFlags;
}


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

x86 assembly (clang, -O2):
<TimerIntClear>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <_TimerBaseValid@plt>
mov    %eax,%edi
call   1030 <ASSERT@plt>
mov    %r14,0x24(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @TimerIntClear(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = call i32 @_TimerBaseValid(i64 %5)
%7 = call i32 @ASSERT(i32 %6)
%8 = load i64, i64* %4
%9 = load i64, i64* %3
%10 = add nsw i64 %9, 36
%11 = inttoptr i64 %10 to i64*
store volatile i64 %8, i64* %11
ret void
}

LLVM IR (-O2):
define void @TimerIntClear(i64 %0, i64 %1) {
%3 = tail call i32 @_TimerBaseValid(i64 %0)
%4 = tail call i32 @ASSERT(i32 %3)
%5 = add nsw i64 %0, 36
%6 = inttoptr i64 %5 to i64*
store volatile i64 %1, i64* %6
ret void
}
void LS(unsigned char *bits, unsigned char *buffer, int count) {
  int i;
  for (i = 0; i < 28; i++) {
    buffer[i] = bits[(i + count) % 28];
  }
}


x86 assembly (clang, -O0):
<LS>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x1c,-0x18(%rbp)
jge    1159 <LS+0x59>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
add    -0x14(%rbp),%eax
mov    $0x1c,%ecx
cltd
idiv   %ecx
mov    -0x20(%rbp),%rax
movslq %edx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1116 <LS+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LS>:
mov    $0x1,%r8d
cs nopw 0x0(%rax,%rax,1)
movslq %edx,%rdx
imul   $0xffffffff92492493,%rdx,%rcx
shr    $0x20,%rcx
add    %edx,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
sar    $0x4,%ecx
add    %eax,%ecx
lea    (%rcx,%rcx,8),%eax
lea    (%rax,%rax,2),%eax
add    %ecx,%eax
mov    %edx,%ecx
sub    %eax,%ecx
movslq %ecx,%rax
movzbl (%rdi,%rax,1),%eax
mov    %al,-0x1(%rsi,%r8,1)
lea    0x1(%rdx),%eax
cltq
imul   $0xffffffff92492493,%rax,%rax
shr    $0x20,%rax
add    %edx,%eax
add    $0x1,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x4,%eax
add    %ecx,%eax
lea    (%rax,%rax,8),%ecx
lea    (%rcx,%rcx,2),%ecx
add    %eax,%ecx
neg    %ecx
lea    (%rdx,%rcx,1),%eax
add    $0x1,%eax
cltq
movzbl (%rdi,%rax,1),%eax
mov    %al,(%rsi,%r8,1)
add    $0x2,%edx
add    $0x2,%r8
cmp    $0x1d,%r8
jne    1110 <LS+0x10>
ret

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

LLVM IR (-O2):
define void @LS(i8* nocapture %0, i8* nocapture writeonly %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i64 [ 0, %3 ], [ %21, %4 ]
%6 = trunc i64 %5 to i32
%7 = add i32 %6, %2
%8 = srem i32 %7, 28
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = getelementptr inbounds i8, i8* %1, i64 %5
store i8 %11, i8* %12
%13 = or i64 %5, 1
%14 = trunc i64 %13 to i32
%15 = add i32 %14, %2
%16 = srem i32 %15, 28
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %0, i64 %17
%19 = load i8, i8* %18
%20 = getelementptr inbounds i8, i8* %1, i64 %13
store i8 %19, i8* %20
%21 = add nuw nsw i64 %5, 2
%22 = icmp eq i64 %21, 28
br i1 %22, label %23, label %4
23: ; preds = %4
ret void
}
void cprop_test11(int *data) {
  int i;
  int stop = data[0];
  int j = 1;
  for (i = 1; i < stop; i++)
    if (!j)
      j = i;
  data[1] = j;
  data[2] = i;
}


x86 assembly (clang, -O0):
<cprop_test11>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    114e <cprop_test11+0x4e>
cmpl   $0x0,-0x14(%rbp)
jne    113b <cprop_test11+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1140 <cprop_test11+0x40>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <cprop_test11+0x1f>
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cprop_test11>:
mov    (%rdi),%eax
cmp    $0x2,%eax
mov    $0x1,%ecx
cmovge %eax,%ecx
movl   $0x1,0x4(%rdi)
mov    %ecx,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @cprop_test11(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = call i32 @llvm.smax.i32(i32 %2, i32 1)
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 1, i32* %4
%5 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %3, i32* %5
ret void
}
int test_imm_1Duint32_reg(unsigned int val) {
  return ((val) & (0x1D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Duint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x1d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_1Duint32_reg>:
test   $0x1d,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_1Duint32_reg(i32 %0) {
%2 = and i32 %0, 29
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
unsigned char inb(unsigned int port) {
  unsigned char b;
  __asm__ __volatile__("inb %w1, %b0" : "=a"(b) : "d"(port));
  return b;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
in     (%dx),%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i8 @inb(i32 %0) {
%2 = tail call i8 asm sideeffect "inb ${1:w}, ${0:b}", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i8 %2
}
double umrechnung_durchschnittsverbrauch(double durchschnittsverbrauch) {
  const double umrechnungsfaktor = 235.2146;
  double umgerechneter_durchschnittsverbrauch =
      umrechnungsfaktor / durchschnittsverbrauch;
  return umgerechneter_durchschnittsverbrauch;
}


x86 assembly (clang, -O0):
<umrechnung_durchschnittsverbrauch>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xee2(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<umrechnung_durchschnittsverbrauch>:
movsd  0xef8(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @umrechnung_durchschnittsverbrauch(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
store double 0x406D66DE00D1B717, double* %3
%5 = load double, double* %2
%6 = fdiv double 0x406D66DE00D1B717, %5
store double %6, double* %4
%7 = load double, double* %4
ret double %7
}

LLVM IR (-O2):
define double @umrechnung_durchschnittsverbrauch(double %0) {
%2 = fdiv double 0x406D66DE00D1B717, %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void pirfree(void *ptr) { free((char *)ptr); }


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

x86 assembly (clang, -O2):
<pirfree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @pirfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int my_hello() { printf("Hello from mydll\n"); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"Hello from mydll\0A\00"
define i32 @my_hello() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [17 x i8] c"Hello from mydll\00"
define i32 @my_hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int fib(int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int n = 9;
  printf("Fibonacci number is %d ", fib(n));
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x9,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <fib@plt>
mov    %eax,%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x9,%edi
call   1050 <fib@plt>
lea    0xebe(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Fibonacci number is %d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 9, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @fib(i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Fibonacci number is %d \00"
define i32 @main() {
%1 = tail call i32 @fib(i32 9)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @getchar()
ret i32 0
}
/* Type definitions */
struct pci_device_id {
  int dummy;
};
struct pci_dev {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pci_info(struct pci_dev *, char *);
int pci_stub_probe(struct pci_dev *dev, const struct pci_device_id *id) {
  pci_info(dev, "claimed by stub\n");
  return 0;
}


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

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

LLVM IR (-O0):
%struct.pci_dev = type { i32 }
%struct.pci_device_id = type { i32 }
@.str = [17 x i8] c"claimed by stub\0A\00"
define i32 @pci_stub_probe(%struct.pci_dev* %0, %struct.pci_device_id* %1) {
%3 = alloca %struct.pci_dev*
%4 = alloca %struct.pci_device_id*
store %struct.pci_dev* %0, %struct.pci_dev** %3
store %struct.pci_device_id* %1, %struct.pci_device_id** %4
%5 = load %struct.pci_dev*, %struct.pci_dev** %3
%6 = call i32 @pci_info(%struct.pci_dev* %5, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.pci_dev = type { i32 }
%struct.pci_device_id = type { i32 }
@.str = [17 x i8] c"claimed by stub\0A\00"
define i32 @pci_stub_probe(%struct.pci_dev* %0, %struct.pci_device_id* nocapture readnone %1) {
%3 = tail call i32 @pci_info(%struct.pci_dev* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void __clear_bit(int nr, volatile unsigned long *addr) {
  unsigned long mask = (1UL << ((nr) % (8 * sizeof(long))));
  unsigned long *p = ((unsigned long *)addr) + ((nr) / (8 * sizeof(long)));
  *p &= ~mask;
}


x86 assembly (clang, -O0):
<__clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movslq -0x4(%rbp),%rcx
and    $0x3f,%rcx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
shr    $0x6,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
xor    $0xffffffffffffffff,%rcx
mov    -0x20(%rbp),%rax
and    (%rax),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__clear_bit>:
movslq %edi,%rcx
mov    %rcx,%rax
mov    $0xfffffffffffffffe,%rdx
rol    %cl,%rdx
shr    $0x6,%rax
and    %rdx,(%rsi,%rax,8)
ret

LLVM IR (-O0):
define void @__clear_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = urem i64 %8, 64
%10 = shl i64 1, %9
store i64 %10, i64* %5
%11 = load i64*, i64** %4
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = udiv i64 %13, 64
%15 = getelementptr inbounds i64, i64* %11, i64 %14
store i64* %15, i64** %6
%16 = load i64, i64* %5
%17 = xor i64 %16, -1
%18 = load i64*, i64** %6
%19 = load i64, i64* %18
%20 = and i64 %19, %17
store i64 %20, i64* %18
ret void
}

LLVM IR (-O2):
define void @__clear_bit(i32 %0, i64* nocapture %1) {
%3 = sext i32 %0 to i64
%4 = and i64 %3, 63
%5 = shl nuw i64 1, %4
%6 = lshr i64 %3, 6
%7 = getelementptr inbounds i64, i64* %1, i64 %6
%8 = xor i64 %5, -1
%9 = load i64, i64* %7
%10 = and i64 %9, %8
store i64 %10, i64* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalnum(int);
void t_isalnum_0x44() {
  Assert_real((isalnum(68)),
              "/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",
              345, ("isalnum should be 1 for D"));
}


x86 assembly (clang, -O0):
<t_isalnum_0x44>:
push   %rbp
mov    %rsp,%rbp
mov    $0x44,%edi
call   1030 <isalnum@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x159,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0x44>:
push   %rax
mov    $0x44,%edi
call   1030 <isalnum@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x159,%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 = [26 x i8] c"isalnum should be 1 for D\00"
define void @t_isalnum_0x44() {
%1 = call i32 @isalnum(i32 68)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 345, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for D\00"
define void @t_isalnum_0x44() {
%1 = tail call i32 @isalnum(i32 68)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 345, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}