xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ execvp(char *, char **);
int /*<<< orphan*/ mount(char *, char *, char *, int /*<<< orphan*/,
                         int /*<<< orphan*/ *);
int child(void *arg) {
  char **argv = (char **)arg;
  argv++;
  mount("/tmp/", "/tmp/", "tmpfs", 0, NULL);
  execvp(argv[0], argv);
  _exit(1);
}


x86 assembly (clang, -O0):
<child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
lea    0xea9(%rip),%rsi
lea    0xea8(%rip),%rdx
xor    %ecx,%ecx
xor    %eax,%eax
mov    %eax,%r8d
mov    %rsi,%rdi
call   1040 <mount@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <execvp@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<child>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x8(%rdi),%r14
lea    0xebe(%rip),%rdi
lea    0xebd(%rip),%rdx
mov    %rdi,%rsi
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <mount@plt>
mov    0x8(%rbx),%rdi
mov    %r14,%rsi
call   1050 <execvp@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"/tmp/\00"
@.str.1 = [6 x i8] c"tmpfs\00"
define i32 @child(i8* %0) {
%2 = alloca i8*
%3 = alloca i8**
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i8**
store i8** %5, i8*** %3
%6 = load i8**, i8*** %3
%7 = getelementptr inbounds i8*, i8** %6, i32 1
store i8** %7, i8*** %3
%8 = call i32 @mount(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 0, i32* null)
%9 = load i8**, i8*** %3
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = load i8**, i8*** %3
%13 = call i32 @execvp(i8* %11, i8** %12)
%14 = call i32 @_exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [6 x i8] c"/tmp/\00"
@.str.1 = [6 x i8] c"tmpfs\00"
define i32 @child(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 8
%3 = bitcast i8* %2 to i8**
%4 = tail call i32 @mount(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 0, i32* null)
%5 = load i8*, i8** %3
%6 = tail call i32 @execvp(i8* %5, i8** %3)
%7 = tail call i32 @_exit(i32 1)
unreachable
}
/* Type definitions */
typedef int int8_t;

/* Variables and functions */
int strcasecmp(char const *, char const *);
int8_t opdi_string_cmp(const char *s1, const char *s2) {
  int result = strcasecmp(s1, s2);
  if (result < 0)
    return -1;
  if (result > 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<opdi_string_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcasecmp@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1146 <opdi_string_cmp+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <opdi_string_cmp+0x53>
cmpl   $0x0,-0x1c(%rbp)
jle    115c <opdi_string_cmp+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1163 <opdi_string_cmp+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opdi_string_cmp>:
push   %rax
call   1030 <strcasecmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    $0xffffffff,%eax
cmovns %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @opdi_string_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcasecmp(i8* %0, i8* %1)
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = icmp sgt i32 %3, -1
%7 = select i1 %6, i32 %5, i32 -1
ret i32 %7
}
void xADCIntEnable(unsigned long ulBase, unsigned long ulIntFlags) {
  ;
  ;
  if (ulIntFlags & 0x000000A0) {
    (*((volatile unsigned long *)(ulBase + 0x00000004))) |= 0x000000A0;
  }
}


x86 assembly (clang, -O0):
<xADCIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xa0,%rax
cmp    $0x0,%rax
je     1133 <xADCIntEnable+0x33>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%rcx
or     $0xa0,%rcx
mov    %rcx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<xADCIntEnable>:
test   $0xa0,%sil
je     110e <xADCIntEnable+0xe>
orq    $0xa0,0x4(%rdi)
ret

LLVM IR (-O0):
define void @xADCIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = and i64 %5, 160
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i64, i64* %3
%10 = add i64 %9, 4
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = or i64 %12, 160
store volatile i64 %13, i64* %11
br label %14
14: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
define void @xADCIntEnable(i64 %0, i64 %1) {
%3 = and i64 %1, 160
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = add i64 %0, 4
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = or i64 %8, 160
store volatile i64 %9, i64* %7
br label %10
10: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ simexit(int);
void level2() { simexit(42); }


x86 assembly (clang, -O0):
<level2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%edi
call   1030 <simexit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<level2>:
mov    $0x2a,%edi
jmp    1030 <simexit@plt>

LLVM IR (-O0):
define void @level2() {
%1 = call i32 @simexit(i32 42)
ret void
}

LLVM IR (-O2):
define void @level2() {
%1 = tail call i32 @simexit(i32 42)
ret void
}
void clearScreen(volatile unsigned short *vram) {
  int pos;
  for (pos = 0; pos < (640) * (480); ++pos) {
    vram[pos] = 0;
  }
}


x86 assembly (clang, -O0):
<clearScreen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4b000,-0xc(%rbp)
jge    1138 <clearScreen+0x38>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movw   $0x0,(%rax,%rcx,2)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <clearScreen+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearScreen>:
mov    $0x7,%eax
cs nopw 0x0(%rax,%rax,1)
nop
movw   $0x0,-0xe(%rdi,%rax,2)
movw   $0x0,-0xc(%rdi,%rax,2)
movw   $0x0,-0xa(%rdi,%rax,2)
movw   $0x0,-0x8(%rdi,%rax,2)
movw   $0x0,-0x6(%rdi,%rax,2)
movw   $0x0,-0x4(%rdi,%rax,2)
movw   $0x0,-0x2(%rdi,%rax,2)
movw   $0x0,(%rdi,%rax,2)
add    $0x8,%rax
cmp    $0x4b007,%rax
jne    1110 <clearScreen+0x10>
ret

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

LLVM IR (-O2):
define void @clearScreen(i16* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %19, %2 ]
%4 = getelementptr inbounds i16, i16* %0, i64 %3
store volatile i16 0, i16* %4
%5 = or i64 %3, 1
%6 = getelementptr inbounds i16, i16* %0, i64 %5
store volatile i16 0, i16* %6
%7 = or i64 %3, 2
%8 = getelementptr inbounds i16, i16* %0, i64 %7
store volatile i16 0, i16* %8
%9 = or i64 %3, 3
%10 = getelementptr inbounds i16, i16* %0, i64 %9
store volatile i16 0, i16* %10
%11 = or i64 %3, 4
%12 = getelementptr inbounds i16, i16* %0, i64 %11
store volatile i16 0, i16* %12
%13 = or i64 %3, 5
%14 = getelementptr inbounds i16, i16* %0, i64 %13
store volatile i16 0, i16* %14
%15 = or i64 %3, 6
%16 = getelementptr inbounds i16, i16* %0, i64 %15
store volatile i16 0, i16* %16
%17 = or i64 %3, 7
%18 = getelementptr inbounds i16, i16* %0, i64 %17
store volatile i16 0, i16* %18
%19 = add nuw nsw i64 %3, 8
%20 = icmp eq i64 %19, 307200
br i1 %20, label %21, label %2
21: ; preds = %2
ret void
}
int test_imm_44int16_reg(short val) {
  return ((val) & (0x44 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_44int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x44,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_44int16_reg(i16 signext %0) {
%2 = and i16 %0, 68
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
void *quick_task(void *arg) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @quick_task(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
scalar_t__ execlp(char *, char *, char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ getpid();
int /*<<< orphan*/ printf(char *, long);
void child_main() {
  printf("child %ld started!\n", (long)getpid());
  if (execlp("./child", "child", (char *)0) < 0)
    exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<child_main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,%rsi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb3(%rip),%rdi
lea    0xeae(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1060 <execlp@plt>
cmp    $0x0,%rax
jge    1189 <child_main+0x49>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<child_main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeb1(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
lea    0xeb6(%rip),%rdi
lea    0xeb1(%rip),%rsi
xor    %edx,%edx
call   1060 <execlp@plt>
test   %rax,%rax
js     1173 <child_main+0x33>
pop    %rax
ret
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"child %ld started!\0A\00"
@.str.1 = [8 x i8] c"./child\00"
@.str.2 = [6 x i8] c"child\00"
@EXIT_FAILURE = global i32 0
define void @child_main() {
%1 = call i64 (...) @getpid()
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 %1)
%3 = call i64 @execlp(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* null)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
8: ; preds = %0
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"child %ld started!\0A\00"
@.str.1 = [8 x i8] c"./child\00"
@.str.2 = [6 x i8] c"child\00"
@EXIT_FAILURE = global i32 0
define void @child_main() {
%1 = tail call i64 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 %1)
%3 = tail call i64 @execlp(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* null)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *realloc_verify(void *ptr, size_t size) {
  void *p;
  p = realloc(ptr, size);
  if (!p) {
    fprintf(stderr, "blockrage: malloc failed!\n");
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<realloc_verify>:
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    117b <realloc_verify+0x4b>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<realloc_verify>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     113d <realloc_verify+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"blockrage: malloc failed!\0A\00"
define i8* @realloc_verify(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 ne i8* %9, null
br i1 %10, label %15, label %11
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"blockrage: malloc failed!\0A\00"
define noalias i8* @realloc_verify(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 %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i8* %3
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
uint32_t good_rand(uint32_t ctx) {
  int32_t hi, lo, x;
  x = (ctx % 0x7ffffffe) + 1;
  hi = x / 127773;
  lo = x % 127773;
  x = 16807 * lo - 2836 * hi;
  if (x < 0)
    x += 0x7fffffff;
  return (x - 1);
}


x86 assembly (clang, -O0):
<good_rand>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x7ffffffe,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x1f31d,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x1f31d,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
imul   $0x41a7,-0xc(%rbp),%eax
imul   $0xb14,-0x8(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    115c <good_rand+0x5c>
mov    -0x10(%rbp),%eax
add    $0x7fffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<good_rand>:
movslq %edi,%rax
imul   $0xffffffff80000003,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x1e,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x1f,%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %ecx,%esi
lea    (%rax,%rsi,1),%ecx
add    %esi,%eax
add    $0x1,%eax
cltq
imul   $0xffffffff834e0b5f,%rax,%rdx
shr    $0x20,%rdx
add    %edx,%ecx
add    $0x1,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x10,%ecx
add    %edx,%ecx
imul   $0x1f31d,%ecx,%edx
sub    %edx,%eax
imul   $0x41a7,%eax,%edx
imul   $0xfffff4ec,%ecx,%ecx
lea    (%rcx,%rdx,1),%eax
add    $0x7fffffff,%eax
add    %edx,%ecx
cmovns %ecx,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @good_rand(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 = srem i32 %6, 2147483646
%8 = add nsw i32 %7, 1
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = sdiv i32 %9, 127773
store i32 %10, i32* %3
%11 = load i32, i32* %5
%12 = srem i32 %11, 127773
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = mul nsw i32 16807, %13
%15 = load i32, i32* %3
%16 = mul nsw i32 2836, %15
%17 = sub nsw i32 %14, %16
store i32 %17, i32* %5
%18 = load i32, i32* %5
%19 = icmp slt i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %1
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 2147483647
store i32 %22, i32* %5
br label %23
23: ; preds = %20, %1
%24 = load i32, i32* %5
%25 = sub nsw i32 %24, 1
ret i32 %25
}

LLVM IR (-O2):
define i32 @good_rand(i32 %0) {
%2 = srem i32 %0, 2147483646
%3 = add nsw i32 %2, 1
%4 = sdiv i32 %3, 127773
%5 = srem i32 %3, 127773
%6 = mul nsw i32 %5, 16807
%7 = mul nsw i32 %4, -2836
%8 = add i32 %7, %6
%9 = icmp slt i32 %8, 0
%10 = add nsw i32 %8, 2147483647
%11 = select i1 %9, i32 %10, i32 %8
%12 = add nsw i32 %11, -1
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ WriteByte(int /*<<< orphan*/ *, int);
void WriteWord(FILE *fp, int w) {
  WriteByte(fp, w & 0xff);
  WriteByte(fp, (w & 0xff00) >> 8);
}


x86 assembly (clang, -O0):
<WriteWord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
and    $0xff,%esi
call   1030 <WriteByte@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
and    $0xff00,%esi
sar    $0x8,%esi
call   1030 <WriteByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteWord>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%eax
mov    %rdi,%rbx
movzbl %al,%esi
mov    %eax,%ebp
call   1030 <WriteByte@plt>
mov    %ebp,%eax
movzbl %ah,%esi
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <WriteByte@plt>

LLVM IR (-O0):
define void @WriteWord(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 = and i32 %6, 255
%8 = call i32 @WriteByte(i32* %5, i32 %7)
%9 = load i32*, i32** %3
%10 = load i32, i32* %4
%11 = and i32 %10, 65280
%12 = ashr i32 %11, 8
%13 = call i32 @WriteByte(i32* %9, i32 %12)
ret void
}

LLVM IR (-O2):
define void @WriteWord(i32* %0, i32 %1) {
%3 = and i32 %1, 255
%4 = tail call i32 @WriteByte(i32* %0, i32 %3)
%5 = lshr i32 %1, 8
%6 = and i32 %5, 255
%7 = tail call i32 @WriteByte(i32* %0, i32 %6)
ret void
}
void pci_iov_remove(struct pci_dev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pci_iov_remove(%struct.pci_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ strncat(char *, char *, int);
int /*<<< orphan*/ strncpy(char *, char *, int);
void newname(char *nname, char *oname, char *suff, int maxn) {
  strncpy(nname, oname, maxn - 1);
  strncat(nname, ".", 1);
  strncat(nname, suff, maxn - strlen(nname));
}


x86 assembly (clang, -O0):
<newname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
sub    $0x1,%edx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rdi
lea    0xe9b(%rip),%rsi
mov    $0x1,%edx
call   1050 <strncat@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x34(%rbp),%edx
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
sub    %eax,%edx
call   1050 <strncat@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newname>:
push   %r15
push   %r14
push   %rbx
mov    %ecx,%r15d
mov    %rdx,%r14
mov    %rdi,%rbx
lea    -0x1(%r15),%edx
call   1030 <strncpy@plt>
lea    0xeb2(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1050 <strncat@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
sub    %eax,%r15d
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <strncat@plt>

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
define void @newname(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %8
%12 = sub nsw i32 %11, 1
%13 = call i32 @strncpy(i8* %9, i8* %10, i32 %12)
%14 = load i8*, i8** %5
%15 = call i32 @strncat(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%16 = load i8*, i8** %5
%17 = load i8*, i8** %7
%18 = load i32, i32* %8
%19 = load i8*, i8** %5
%20 = call i32 @strlen(i8* %19)
%21 = sub nsw i32 %18, %20
%22 = call i32 @strncat(i8* %16, i8* %17, i32 %21)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define void @newname(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = add nsw i32 %3, -1
%6 = tail call i32 @strncpy(i8* %0, i8* %1, i32 %5)
%7 = tail call i32 @strncat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%8 = tail call i32 @strlen(i8* %0)
%9 = sub nsw i32 %3, %8
%10 = tail call i32 @strncat(i8* %0, i8* %2, i32 %9)
ret void
}
void XFreeColormap() {}


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

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

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

LLVM IR (-O2):
define void @XFreeColormap() {
ret void
}
void strsub(char *str, char find, char repl) {
  for (char *cur = str; *cur; cur++)
    if (*cur == find)
      *cur = repl;
}


x86 assembly (clang, -O0):
<strsub>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <strsub+0x5a>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1144 <strsub+0x44>
mov    -0xa(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
jmp    1149 <strsub+0x49>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111b <strsub+0x1b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strsub>:
mov    (%rdi),%al
test   %al,%al
je     1125 <strsub+0x25>
add    $0x1,%rdi
jmp    111b <strsub+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     1125 <strsub+0x25>
cmp    %sil,%al
jne    1110 <strsub+0x10>
mov    %dl,-0x1(%rdi)
jmp    1110 <strsub+0x10>
ret

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

LLVM IR (-O2):
define void @strsub(i8* nocapture %0, i8 signext %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %12, %3
ret void
7: ; preds = %3, %12
%8 = phi i8 [ %14, %12 ], [ %4, %3 ]
%9 = phi i8* [ %13, %12 ], [ %0, %3 ]
%10 = icmp eq i8 %8, %1
br i1 %10, label %11, label %12
11: ; preds = %7
store i8 %2, i8* %9
br label %12
12: ; preds = %7, %11
%13 = getelementptr inbounds i8, i8* %9, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %6, label %7
}
void MDString(string) char *string;
{
  char sum[33];
  checksum_simple(strlen(string), string, sum);
  printf("MD%d (\"%s\") = %s\n", 5, string, sum);
}


x86 assembly (clang, -O0):
<MDString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rdi
mov    -0x8(%rbp),%rsi
lea    -0x30(%rbp),%rdx
mov    $0x0,%al
call   1050 <checksum_simple@plt>
mov    -0x8(%rbp),%rdx
lea    -0x30(%rbp),%rcx
lea    0xe9a(%rip),%rdi
mov    $0x5,%esi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MDString>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rsp,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1050 <checksum_simple@plt>
lea    0xea7(%rip),%rdi
mov    $0x5,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [18 x i8] c"MD%d (\22%s\22) = %s\0A\00"
define void @MDString(i8* %0) {
%2 = alloca i8*
%3 = alloca [33 x i8]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = load i8*, i8** %2
%7 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 0
%8 = call i32 (i64, i8*, i8*, ...) bitcast (i32 (...)* @checksum_simple to i32 (i64, i8*, i8*, ...)*)(i64 %5, i8* %6, i8* %7)
%9 = load i8*, i8** %2
%10 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 5, i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"MD%d (\22%s\22) = %s\0A\00"
define void @MDString(i8* %0) {
%2 = alloca [33 x i8]
%3 = getelementptr inbounds [33 x i8], [33 x i8]* %2, i64 0, i64 0
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = call i32 (i64, i8*, i8*, ...) bitcast (i32 (...)* @checksum_simple to i32 (i64, i8*, i8*, ...)*)(i64 %4, i8* %0, i8* %3)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 5, i8* %0, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pthread_self();
int /*<<< orphan*/ pthread_setschedprio(int /*<<< orphan*/, int);
void niceme(int nice) { pthread_setschedprio(pthread_self(), nice); }


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

x86 assembly (clang, -O2):
<niceme>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <pthread_self@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <pthread_setschedprio@plt>

LLVM IR (-O0):
define void @niceme(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @pthread_self()
%4 = load i32, i32* %2
%5 = call i32 @pthread_setschedprio(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
define void @niceme(i32 %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @pthread_setschedprio(i32 %2, i32 %0)
ret void
}
/* Variables and functions */
unsigned int hex_linearCoord(unsigned int, unsigned int, unsigned int);
int /*<<< orphan*/ hex_xy2rki(int, int, unsigned int *, unsigned int *,
                              unsigned int *);
unsigned int hex_linearXY(signed int x, signed int y) {
  unsigned int r, k, i;
  hex_xy2rki(x, y, &r, &k, &i);
  return hex_linearCoord(r, k, i);
}


x86 assembly (clang, -O0):
<hex_linearXY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1040 <hex_xy2rki@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <hex_linearCoord@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_linearXY>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
call   1040 <hex_xy2rki@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
call   1030 <hex_linearCoord@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @hex_linearXY(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @hex_xy2rki(i32 %8, i32 %9, i32* %5, i32* %6, i32* %7)
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = call i32 @hex_linearCoord(i32 %11, i32 %12, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @hex_linearXY(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = call i32 @hex_xy2rki(i32 %0, i32 %1, i32* %3, i32* %4, i32* %5)
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = call i32 @hex_linearCoord(i32 %10, i32 %11, i32 %12)
ret i32 %13
}
void resume() {}


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

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

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

LLVM IR (-O2):
define void @resume() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xa1() {
  Assert_real((isodigit(161) == 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_isodigit.c",
              810, ("isodigit should be 0 for 0xa1"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0xa1>:
push   %rax
mov    $0xa1,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x32a,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xa1\00"
define void @t_isodigit_0xa1() {
%1 = call i64 @isodigit(i32 161)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 810, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xa1\00"
define void @t_isodigit_0xa1() {
%1 = tail call i64 @isodigit(i32 161)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 810, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glWindowPos4f(double, double, double, int);
void glWindowPos3d(double x, double y, double z) { glWindowPos4f(x, y, z, 1); }


x86 assembly (clang, -O0):
<glWindowPos3d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mov    $0x1,%edi
call   1030 <glWindowPos4f@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glWindowPos3d>:
mov    $0x1,%edi
jmp    1030 <glWindowPos4f@plt>

LLVM IR (-O0):
define void @glWindowPos3d(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call i32 @glWindowPos4f(double %7, double %8, double %9, i32 1)
ret void
}

LLVM IR (-O2):
define void @glWindowPos3d(double %0, double %1, double %2) {
%4 = tail call i32 @glWindowPos4f(double %0, double %1, double %2, i32 1)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int count0(uint32_t x) { return (int)x; }


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

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

LLVM IR (-O0):
define i32 @count0(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @count0(i64 %0) {
%2 = trunc i64 %0 to i32
ret i32 %2
}
float somar(float n1, float n2) { return n1 + n2; }


x86 assembly (clang, -O0):
<somar>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<somar>:
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @somar(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fadd float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @somar(float %0, float %1) {
%3 = fadd float %0, %1
ret float %3
}
/* Variables and functions */
scalar_t__ copysign(float, float);
float copysignf(float x, float y) { return (float)copysign(x, y); }


x86 assembly (clang, -O0):
<copysignf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <copysign@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copysignf>:
push   %rax
call   1030 <copysign@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @copysignf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call i64 @copysign(float %5, float %6)
%8 = sitofp i64 %7 to float
ret float %8
}

LLVM IR (-O2):
define float @copysignf(float %0, float %1) {
%3 = tail call i64 @copysign(float %0, float %1)
%4 = sitofp i64 %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ insert_sort(int *, int);
void sortLoop0(int *arr, int len) { insert_sort(arr, len); }


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

x86 assembly (clang, -O2):
<sortLoop0>:
jmp    1030 <insert_sort@plt>

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

LLVM IR (-O2):
define void @sortLoop0(i32* %0, i32 %1) {
%3 = tail call i32 @insert_sort(i32* %0, i32 %1)
ret void
}
char *get_sprintf_buffer() {
  static int i;
  static char tmp[4][256];
  return tmp[i++ & 3];
}


x86 assembly (clang, -O0):
<get_sprintf_buffer>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f26(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f1b(%rip)
and    $0x3,%eax
movslq %eax,%rcx
lea    0x2f1e(%rip),%rax
shl    $0x8,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sprintf_buffer>:
mov    0x2f2a(%rip),%ecx
lea    0x1(%rcx),%eax
mov    %eax,0x2f21(%rip)
and    $0x3,%ecx
shl    $0x8,%rcx
lea    0x2f23(%rip),%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
@get_sprintf_buffer.i = internal global i32 0
@get_sprintf_buffer.tmp = internal global [4 x [256 x i8]] zeroinitializer
define i8* @get_sprintf_buffer() {
%1 = load i32, i32* @get_sprintf_buffer.i
%2 = add nsw i32 %1, 1
store i32 %2, i32* @get_sprintf_buffer.i
%3 = and i32 %1, 3
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [4 x [256 x i8]], [4 x [256 x i8]]* @get_sprintf_buffer.tmp, i64 0, i64 %4
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
ret i8* %6
}

LLVM IR (-O2):
@get_sprintf_buffer.i = internal unnamed_addr global i32 0
@get_sprintf_buffer.tmp = internal global [4 x [256 x i8]] zeroinitializer
define i8* @get_sprintf_buffer() {
%1 = load i32, i32* @get_sprintf_buffer.i
%2 = add nsw i32 %1, 1
store i32 %2, i32* @get_sprintf_buffer.i
%3 = and i32 %1, 3
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds [4 x [256 x i8]], [4 x [256 x i8]]* @get_sprintf_buffer.tmp, i64 0, i64 %4, i64 0
ret i8* %5
}
void FreeFloatMatrix(float **Matrix, int M) {
  int m;
  for (m = 0; m < M; m++)
    free(Matrix[m]);
  free(Matrix);
}


x86 assembly (clang, -O0):
<FreeFloatMatrix>:
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    1151 <FreeFloatMatrix+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <FreeFloatMatrix+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FreeFloatMatrix>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <FreeFloatMatrix+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <FreeFloatMatrix+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @FreeFloatMatrix(float** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds float*, float** %0, i64 %7
%9 = bitcast float** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast float** %0 to i8*
tail call void @free(i8* %14)
ret void
}
int test_imm_37int32_reg(int val) { return ((val) & (0x37 << 0)) ? -20 : -40; }


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

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

LLVM IR (-O0):
define i32 @test_imm_37int32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 55
%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_37int32_reg(i32 %0) {
%2 = and i32 %0, 55
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int execute_get_kernel_syms() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_get_kernel_syms() {
ret i32 0
}
const char *test3(void) { return "hi there"; }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"hi there\00"
define i8* @test3() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [9 x i8] c"hi there\00"
define i8* @test3() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int recurse(int);
void main() { printf("%d\n", recurse(150000)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x249f0,%edi
call   1030 <recurse@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x249f0,%edi
call   1030 <recurse@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = tail call i32 @recurse(i32 150000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
unsigned int hash_ulong(const void *key) {
  unsigned int hval;
  hval = 1;
  hval += (unsigned long)key;
  hval += (hval << 10);
  hval ^= (hval >> 6);
  hval += ((unsigned long)key >> 32);
  hval &= 0x0fffffff;
  hval += (hval << 3);
  hval ^= (hval >> 11);
  hval += (hval << 15);
  return hval;
}


x86 assembly (clang, -O0):
<hash_ulong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%eax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0xa,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x6,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
shr    $0x20,%rcx
mov    -0xc(%rbp),%eax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xfffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x3,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0xb,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0xf,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_ulong>:
mov    %edi,%eax
shl    $0xa,%eax
add    %edi,%eax
add    $0x401,%eax
mov    %eax,%ecx
shr    $0x6,%ecx
xor    %eax,%ecx
shr    $0x20,%rdi
add    %ecx,%edi
and    $0xfffffff,%edi
lea    (%rdi,%rdi,8),%eax
mov    %eax,%ecx
shr    $0xb,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
shl    $0xf,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hash_ulong(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 1, i32* %3
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
%6 = load i32, i32* %3
%7 = zext i32 %6 to i64
%8 = add i64 %7, %5
%9 = trunc i64 %8 to i32
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = shl i32 %10, 10
%12 = load i32, i32* %3
%13 = add i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = lshr i32 %14, 6
%16 = load i32, i32* %3
%17 = xor i32 %16, %15
store i32 %17, i32* %3
%18 = load i8*, i8** %2
%19 = ptrtoint i8* %18 to i64
%20 = lshr i64 %19, 32
%21 = load i32, i32* %3
%22 = zext i32 %21 to i64
%23 = add i64 %22, %20
%24 = trunc i64 %23 to i32
store i32 %24, i32* %3
%25 = load i32, i32* %3
%26 = and i32 %25, 268435455
store i32 %26, i32* %3
%27 = load i32, i32* %3
%28 = shl i32 %27, 3
%29 = load i32, i32* %3
%30 = add i32 %29, %28
store i32 %30, i32* %3
%31 = load i32, i32* %3
%32 = lshr i32 %31, 11
%33 = load i32, i32* %3
%34 = xor i32 %33, %32
store i32 %34, i32* %3
%35 = load i32, i32* %3
%36 = shl i32 %35, 15
%37 = load i32, i32* %3
%38 = add i32 %37, %36
store i32 %38, i32* %3
%39 = load i32, i32* %3
ret i32 %39
}

LLVM IR (-O2):
define i32 @hash_ulong(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = mul i32 %3, 1025
%5 = add i32 %4, 1025
%6 = lshr i32 %5, 6
%7 = xor i32 %6, %5
%8 = lshr i64 %2, 32
%9 = trunc i64 %8 to i32
%10 = add i32 %7, %9
%11 = and i32 %10, 268435455
%12 = mul nuw i32 %11, 9
%13 = lshr i32 %12, 11
%14 = xor i32 %13, %12
%15 = mul i32 %14, 32769
ret i32 %15
}
/* Variables and functions */
double __ieee754_log10(double);
double jlog10(double x) { return __ieee754_log10(x); }


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

x86 assembly (clang, -O2):
<jlog10>:
jmp    1030 <__ieee754_log10@plt>

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

LLVM IR (-O2):
define double @jlog10(double %0) {
%2 = tail call double @__ieee754_log10(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void omp_set_nested(int nested) {
  fprintf(stderr,
          "You are using a dummy OpenMP runtime and cannot set anything! \n");
  return;
}


x86 assembly (clang, -O0):
<omp_set_nested>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
lea    0xed5(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [64 x i8] c"You are using a dummy OpenMP runtime and cannot set anything! \0A\00"
define void @omp_set_nested(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [64 x i8] c"You are using a dummy OpenMP runtime and cannot set anything! \0A\00"
define void @omp_set_nested(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
ret void
}