xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void _Q_add(void) {
  printf("Unimplemented %s called, exiting\n", "_Q_add");
  exit(-1);
}


x86 assembly (clang, -O0):
<_Q_add>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xef0(%rip),%rsi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<_Q_add>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xef3(%rip),%rsi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Unimplemented %s called, exiting\0A\00"
@.str.1 = [7 x i8] c"_Q_add\00"
define void @_Q_add() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [34 x i8] c"Unimplemented %s called, exiting\0A\00"
@.str.1 = [7 x i8] c"_Q_add\00"
define void @_Q_add() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fnext_char(int *, int /*<<< orphan*/ *);
scalar_t__ isspace(int);
void fnext_skip_layout(int *c, FILE *f) {
  do {
    fnext_char(c, f);
  } while (isspace(*c));
}


x86 assembly (clang, -O0):
<fnext_skip_layout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <fnext_char@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
jne    1130 <fnext_skip_layout+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnext_skip_layout>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <fnext_char@plt>
mov    (%rbx),%edi
call   1040 <isspace@plt>
test   %rax,%rax
jne    1130 <fnext_skip_layout+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @fnext_skip_layout(i32* %0, i32* %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @fnext_char(i32* %0, i32* %1)
%5 = load i32, i32* %0
%6 = tail call i64 @isspace(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ the_overflow();
int main(int argc, char *argv[]) {
  the_overflow();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <the_overflow@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @the_overflow()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @the_overflow()
ret i32 0
}
int ispunct(int c) {
  unsigned y = (unsigned)c;
  return ((y - '!' < 95) & (((y | 32) - 'a' > 25) | (y - '0' > 9)));
}


x86 assembly (clang, -O0):
<ispunct>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x21,%eax
cmp    $0x5f,%eax
setb   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x8(%rbp),%ecx
or     $0x20,%ecx
sub    $0x61,%ecx
cmp    $0x19,%ecx
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    -0x8(%rbp),%edx
sub    $0x30,%edx
cmp    $0x9,%edx
seta   %dl
and    $0x1,%dl
movzbl %dl,%edx
or     %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispunct>:
lea    -0x21(%rdi),%eax
cmp    $0x5f,%eax
setb   %al
mov    %edi,%ecx
or     $0x20,%ecx
add    $0xffffff85,%ecx
cmp    $0xffffffe6,%ecx
setb   %cl
add    $0xffffffc6,%edi
cmp    $0xfffffff6,%edi
setb   %dl
or     %cl,%dl
and    %al,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @ispunct(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = sub i32 %5, 33
%7 = icmp ult i32 %6, 95
%8 = zext i1 %7 to i32
%9 = load i32, i32* %3
%10 = or i32 %9, 32
%11 = sub i32 %10, 97
%12 = icmp ugt i32 %11, 25
%13 = zext i1 %12 to i32
%14 = load i32, i32* %3
%15 = sub i32 %14, 48
%16 = icmp ugt i32 %15, 9
%17 = zext i1 %16 to i32
%18 = or i32 %13, %17
%19 = and i32 %8, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @ispunct(i32 %0) {
%2 = add i32 %0, -33
%3 = icmp ult i32 %2, 95
%4 = or i32 %0, 32
%5 = add i32 %4, -123
%6 = icmp ult i32 %5, -26
%7 = add i32 %0, -58
%8 = icmp ult i32 %7, -10
%9 = or i1 %8, %6
%10 = and i1 %3, %9
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
char *calloc(int, int);
int /*<<< orphan*/ printf(char *, char *);
int read(int, char *, int);
void *mine_read(void *fd_2) {
  int fd = *((int *)fd_2);
  int er = 0;
  char *output;
  output = calloc(1024, sizeof(char));
  do {
    er = read(fd, output, 1024);
    printf("ans:%s", output);
  } while (er > 0);
}


x86 assembly (clang, -O0):
<mine_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    $0x400,%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    $0x400,%edx
call   1040 <read@plt>
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x18(%rbp)
jg     115f <mine_read+0x2f>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mine_read>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%r15d
mov    $0x400,%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
lea    0xead(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15d,%edi
mov    %rbx,%rsi
mov    $0x400,%edx
call   1040 <read@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
test   %ebp,%ebp
jg     1160 <mine_read+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"ans:%s\00"
define noalias i8* @mine_read(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call dereferenceable_or_null(1024) i8* @calloc(i32 1024, i32 1)
br label %5
5: ; preds = %5, %1
%6 = tail call i32 @read(i32 %3, i8* %4, i32 1024)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4)
%8 = icmp sgt i32 %6, 0
br i1 %8, label %5, label %9
9: ; preds = %5
ret i8* undef
}
/* Type definitions */
struct terminal {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct terminal *);
void term_destroy(struct terminal *term) {
  if (!term)
    return;
  free(term);
}


x86 assembly (clang, -O0):
<term_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <term_destroy+0x1c>
jmp    1135 <term_destroy+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_destroy>:
test   %rdi,%rdi
je     111a <term_destroy+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.terminal = type { i32 }
define void @term_destroy(%struct.terminal* %0) {
%2 = alloca %struct.terminal*
store %struct.terminal* %0, %struct.terminal** %2
%3 = load %struct.terminal*, %struct.terminal** %2
%4 = icmp ne %struct.terminal* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load %struct.terminal*, %struct.terminal** %2
%8 = call i32 @free(%struct.terminal* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
%struct.terminal = type { i32 }
define void @term_destroy(%struct.terminal* %0) {
%2 = icmp eq %struct.terminal* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.terminal* %0)
br label %5
5: ; preds = %1, %3
ret void
}
char *basename(name)
char *name;
{
  char *base;
  base = strrchr(name, '/');
  return base ? base + 1 : name;
}


x86 assembly (clang, -O0):
<basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <basename+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <basename+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i32 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i32 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
__attribute__((section(".after_vectors"))) void SysTick_Handler(void) {
  while (1) {
  }
}


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

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

LLVM IR (-O0):
define void @SysTick_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @SysTick_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}
int test_imm_1Fint32_reg(int val) { return ((val) & (0x1F << 0)) ? -20 : -40; }


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

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

LLVM IR (-O0):
define i32 @test_imm_1Fint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 31
%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_1Fint32_reg(i32 %0) {
%2 = and i32 %0, 31
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ kattach_sysexec(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
void kattach_vkaos_launch(void) {
  char lcmd[255];
  sprintf(lcmd, "%s/%s", "/kaos/apps", "vkaos_launch");
  kattach_sysexec(lcmd);
  return;
}


x86 assembly (clang, -O0):
<kattach_vkaos_launch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
lea    0xec6(%rip),%rdx
lea    0xeca(%rip),%rcx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <kattach_sysexec@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kattach_vkaos_launch>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
lea    0xed0(%rip),%rdx
lea    0xed4(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <kattach_sysexec@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s/%s\00"
@.str.1 = [11 x i8] c"/kaos/apps\00"
@.str.2 = [13 x i8] c"vkaos_launch\00"
define void @kattach_vkaos_launch() {
%1 = alloca [255 x i8]
%2 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%5 = call i32 @kattach_sysexec(i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s/%s\00"
@.str.1 = [11 x i8] c"/kaos/apps\00"
@.str.2 = [13 x i8] c"vkaos_launch\00"
define void @kattach_vkaos_launch() {
%1 = alloca [255 x i8]
%2 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @kattach_sysexec(i8* %2)
ret void
}
/* Variables and functions */
scalar_t__ tolower(int);
int char_ci_eq(int c1, int c2) { return tolower(c1) == tolower(c2); }


x86 assembly (clang, -O0):
<char_ci_eq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <tolower@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <tolower@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_ci_eq>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1030 <tolower@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1030 <tolower@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @char_ci_eq(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 = call i64 @tolower(i32 %5)
%7 = load i32, i32* %4
%8 = call i64 @tolower(i32 %7)
%9 = icmp eq i64 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @char_ci_eq(i32 %0, i32 %1) {
%3 = tail call i64 @tolower(i32 %0)
%4 = tail call i64 @tolower(i32 %1)
%5 = icmp eq i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int fu();
int main(void) { return fu(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fu()
ret i32 %1
}
void mmc_unregister_key_type(void) {}


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

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

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

LLVM IR (-O2):
define void @mmc_unregister_key_type() {
ret void
}
/* Variables and functions */
size_t more(unsigned int);
char more_call(char *p, unsigned int x) { return p[more(x)]; }


x86 assembly (clang, -O0):
<more_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <more@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
movsbl (%rax,%rcx,1),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<more_call>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <more@plt>
mov    (%rbx,%rax,1),%al
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @more_call(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i64 @more(i32 %6)
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @more_call(i8* nocapture %0, i32 %1) {
%3 = tail call i64 @more(i32 %1)
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
ret i8 %5
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int bgc_format_includes_be(int64_t format_id) { return (format_id % 10) == 5; }


x86 assembly (clang, -O0):
<bgc_format_includes_be>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x5,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bgc_format_includes_be>:
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rax
add    %edx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ecx
xor    %eax,%eax
cmp    $0x5,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @bgc_format_includes_be(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 10
%5 = icmp eq i32 %4, 5
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @bgc_format_includes_be(i32 %0) {
%2 = srem i32 %0, 10
%3 = icmp eq i32 %2, 5
%4 = zext i1 %3 to i32
ret i32 %4
}
void d2i_SXNET(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_SXNET() {
ret void
}
/* Type definitions */
struct winsize {
  int ws_col;
};

/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ TIOCGWINSZ;
int /*<<< orphan*/ ioctl(int /*<<< orphan*/, int /*<<< orphan*/,
                         struct winsize *);
int get_terminal_width() {
  struct winsize wsize;
  ioctl(STDOUT_FILENO, TIOCGWINSZ, &wsize);
  return wsize.ws_col;
}


x86 assembly (clang, -O0):
<get_terminal_width>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_terminal_width>:
push   %rax
mov    0x2ed8(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <ioctl@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.winsize = type { i32 }
@STDOUT_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
define i32 @get_terminal_width() {
%1 = alloca %struct.winsize
%2 = load i32, i32* @STDOUT_FILENO
%3 = load i32, i32* @TIOCGWINSZ
%4 = call i32 @ioctl(i32 %2, i32 %3, %struct.winsize* %1)
%5 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i32 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
%struct.winsize = type { i32 }
@STDOUT_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
define i32 @get_terminal_width() {
%1 = alloca %struct.winsize
%2 = bitcast %struct.winsize* %1 to i8*
%3 = load i32, i32* @STDOUT_FILENO
%4 = load i32, i32* @TIOCGWINSZ
%5 = call i32 @ioctl(i32 %3, i32 %4, %struct.winsize* %1)
%6 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i64 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}
int XParseGeometry(char *parsestring, int *x_return, int *y_return,
                   unsigned int *width_return, unsigned int *height_return) {
  return 0;
}


x86 assembly (clang, -O0):
<XParseGeometry>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @XParseGeometry(i8* %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i8* %0, i8** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
ret i32 0
}

LLVM IR (-O2):
define i32 @XParseGeometry(i8* nocapture readnone %0, i32* nocapture readnone %1, i32* nocapture readnone %2, i32* nocapture readnone %3, i32* nocapture readnone %4) {
ret i32 0
}
int prime(int num) {
  if (num < 0)
    return -1;
  int i = 2;
  for (; i <= num - 1; i++) {
    if (num % i == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <prime+0x1d>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <prime+0x6b>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1164 <prime+0x64>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1151 <prime+0x51>
movl   $0x0,-0x4(%rbp)
jmp    116b <prime+0x6b>
jmp    1156 <prime+0x56>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <prime+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prime>:
test   %edi,%edi
js     1133 <prime+0x33>
mov    $0x1,%ecx
cmp    $0x3,%edi
jb     1130 <prime+0x30>
mov    $0x2,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1139 <prime+0x39>
add    $0x1,%esi
cmp    %esi,%edi
jne    1120 <prime+0x20>
mov    %ecx,%eax
ret
mov    $0xffffffff,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @prime(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = icmp ugt i32 %0, 2
br i1 %4, label %7, label %12
5: ; preds = %7
%6 = icmp eq i32 %11, %0
br i1 %6, label %12, label %7
7: ; preds = %3, %5
%8 = phi i32 [ %11, %5 ], [ 2, %3 ]
%9 = srem i32 %0, %8
%10 = icmp eq i32 %9, 0
%11 = add nuw nsw i32 %8, 1
br i1 %10, label %12, label %5
12: ; preds = %5, %7, %3, %1
%13 = phi i32 [ -1, %1 ], [ 1, %3 ], [ 1, %5 ], [ 0, %7 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fwrite(char const *, int, int, int /*<<< orphan*/ *);
int fs_fnwrite(FILE *file, const char *buffer, int len) {
  return (int)fwrite(buffer, 1, len, file);
}


x86 assembly (clang, -O0):
<fs_fnwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_fnwrite>:
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x1,%esi
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
define i32 @fs_fnwrite(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = load i32*, i32** %4
%10 = call i64 @fwrite(i8* %7, i32 1, i32 %8, i32* %9)
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @fs_fnwrite(i32* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i64 @fwrite(i8* %1, i32 1, i32 %2, i32* %0)
%5 = trunc i64 %4 to i32
ret i32 %5
}
double ls_cost_nm10_sign(double x) { return x < 0 ? -1 : x > 0 ? 1 : x; }


x86 assembly (clang, -O0):
<ls_cost_nm10_sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1129 <ls_cost_nm10_sign+0x29>
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1161 <ls_cost_nm10_sign+0x61>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <ls_cost_nm10_sign+0x4d>
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1157 <ls_cost_nm10_sign+0x57>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_cost_nm10_sign>:
xorpd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
movsd  0xeeb(%rip),%xmm3
andpd  %xmm2,%xmm3
andnpd %xmm0,%xmm2
orpd   %xmm3,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm1
andnpd %xmm2,%xmm1
movsd  0xed2(%rip),%xmm2
andpd  %xmm2,%xmm0
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @ls_cost_nm10_sign(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load double, double* %2
%8 = fcmp ogt double %7, 0.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %6
br label %12
10: ; preds = %6
%11 = load double, double* %2
br label %12
12: ; preds = %10, %9
%13 = phi double [ 1.000000e+00, %9 ], [ %11, %10 ]
br label %14
14: ; preds = %12, %5
%15 = phi double [ -1.000000e+00, %5 ], [ %13, %12 ]
ret double %15
}

LLVM IR (-O2):
define double @ls_cost_nm10_sign(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp ogt double %0, 0.000000e+00
%4 = select i1 %3, double 1.000000e+00, double %0
%5 = select i1 %2, double -1.000000e+00, double %4
ret double %5
}
int base64_encode_length(int srclen) { return (((srclen + 2) / 3) * 4) + 1; }


x86 assembly (clang, -O0):
<base64_encode_length>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
shl    $0x2,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_encode_length>:
add    $0x2,%edi
movslq %edi,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
lea    0x1(,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @base64_encode_length(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 2
%5 = sdiv i32 %4, 3
%6 = mul nsw i32 %5, 4
%7 = add nsw i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @base64_encode_length(i32 %0) {
%2 = add nsw i32 %0, 2
%3 = sdiv i32 %2, 3
%4 = shl nsw i32 %3, 2
%5 = or i32 %4, 1
ret i32 %5
}
void cpu_step(struct cpu *cpu) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ has_int_tag(void *);
int32_t untag_i32(void *p) {
  assert(has_int_tag(p));
  return ((int32_t)((uintptr_t)p)) >> 1;
}


x86 assembly (clang, -O0):
<untag_i32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <has_int_tag@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
sar    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<untag_i32>:
push   %rbx
mov    %rdi,%rbx
call   1030 <has_int_tag@plt>
mov    %eax,%edi
call   1040 <assert@plt>
sar    %ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @untag_i32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @has_int_tag(i8* %3)
%5 = call i32 @assert(i32 %4)
%6 = load i8*, i8** %2
%7 = ptrtoint i8* %6 to i64
%8 = trunc i64 %7 to i32
%9 = ashr i32 %8, 1
ret i32 %9
}

LLVM IR (-O2):
define i32 @untag_i32(i8* %0) {
%2 = tail call i32 @has_int_tag(i8* %0)
%3 = tail call i32 @assert(i32 %2)
%4 = ptrtoint i8* %0 to i64
%5 = trunc i64 %4 to i32
%6 = ashr i32 %5, 1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x30_setup() {
  char cmd[256];
  sprintf(cmd,
          "iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x30_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x30_setup>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x30_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x30_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
void g_node_child_index() {}


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

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

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

LLVM IR (-O2):
define void @g_node_child_index() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ terror(char *);
void assertIntGE(int a, int b, char *msg) {
  if (a < b) {
    terror(msg);
  }
}


x86 assembly (clang, -O0):
<assertIntGE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1137 <assertIntGE+0x27>
mov    -0x10(%rbp),%rdi
call   1030 <terror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assertIntGE>:
cmp    %esi,%edi
jge    111c <assertIntGE+0xc>
mov    %rdx,%rdi
jmp    1030 <terror@plt>
ret

LLVM IR (-O0):
define void @assertIntGE(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i8*, i8** %6
%12 = call i32 @terror(i8* %11)
br label %13
13: ; preds = %10, %3
ret void
}

LLVM IR (-O2):
define void @assertIntGE(i32 %0, i32 %1, i8* %2) {
%4 = icmp slt i32 %0, %1
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @terror(i8* %2)
br label %7
7: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void force_computation(uint32_t forcedValue) {
  if (forcedValue % 277387 == 17)
    printf("wow, what a coincidence! (in benchmark.c)");
}


x86 assembly (clang, -O0):
<force_computation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x43b8b,%ecx
cltd
idiv   %ecx
cmp    $0x11,%edx
jne    113b <force_computation+0x2b>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<force_computation>:
movslq %edi,%rax
imul   $0x3c7baa29,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x30,%rcx
add    %edx,%ecx
imul   $0x43b8b,%ecx,%ecx
sub    %ecx,%eax
cmp    $0x11,%eax
jne    1140 <force_computation+0x30>
lea    0xec5(%rip),%rdi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [42 x i8] c"wow, what a coincidence! (in benchmark.c)\00"
define void @force_computation(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 277387
%5 = icmp eq i32 %4, 17
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"wow, what a coincidence! (in benchmark.c)\00"
define void @force_computation(i32 %0) {
%2 = srem i32 %0, 277387
%3 = icmp eq i32 %2, 17
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
long double *_zero_arr_plus_longdouble_fn(long double *, int, int, char const *,
                                          unsigned int);
long double *_zero_arr_inplace_plus_post_longdouble_fn(long double **x,
                                                       int orig_i,
                                                       const char *filename,
                                                       unsigned lineno) {
  long double *_zap_res = *x;
  *x = _zero_arr_plus_longdouble_fn(_zap_res, 1, orig_i, filename, lineno);
  return _zap_res;
}


x86 assembly (clang, -O0):
<_zero_arr_inplace_plus_post_longdouble_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    $0x1,%esi
call   1030 <_zero_arr_plus_longdouble_fn@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_zero_arr_inplace_plus_post_longdouble_fn>:
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rbx
mov    (%rdi),%r14
mov    %r14,%rdi
mov    $0x1,%esi
call   1030 <_zero_arr_plus_longdouble_fn@plt>
mov    %rax,(%rbx)
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define x86_fp80* @_zero_arr_inplace_plus_post_longdouble_fn(x86_fp80** %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca x86_fp80**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca x86_fp80*
store x86_fp80** %0, x86_fp80*** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load x86_fp80**, x86_fp80*** %5
%11 = load x86_fp80*, x86_fp80** %10
store x86_fp80* %11, x86_fp80** %9
%12 = load x86_fp80*, x86_fp80** %9
%13 = load i32, i32* %6
%14 = load i8*, i8** %7
%15 = load i32, i32* %8
%16 = call x86_fp80* @_zero_arr_plus_longdouble_fn(x86_fp80* %12, i32 1, i32 %13, i8* %14, i32 %15)
%17 = load x86_fp80**, x86_fp80*** %5
store x86_fp80* %16, x86_fp80** %17
%18 = load x86_fp80*, x86_fp80** %9
ret x86_fp80* %18
}

LLVM IR (-O2):
define x86_fp80* @_zero_arr_inplace_plus_post_longdouble_fn(x86_fp80** nocapture %0, i32 %1, i8* %2, i32 %3) {
%5 = load x86_fp80*, x86_fp80** %0
%6 = tail call x86_fp80* @_zero_arr_plus_longdouble_fn(x86_fp80* %5, i32 1, i32 %1, i8* %2, i32 %3)
store x86_fp80* %6, x86_fp80** %0
ret x86_fp80* %5
}
/* Variables and functions */
char *get_current_dir_name();
scalar_t__ getuid();
int /*<<< orphan*/ printf(char *, ...);
void printPrompt() {
  printf("%s ", get_current_dir_name());
  if (getuid() == 0)
    printf("#");
  else
    printf("$");
}


x86 assembly (clang, -O0):
<printPrompt>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <get_current_dir_name@plt>
mov    %rax,%rsi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <getuid@plt>
cmp    $0x0,%rax
jne    1170 <printPrompt+0x40>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    117e <printPrompt+0x4e>
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printPrompt>:
push   %rax
xor    %eax,%eax
call   1060 <get_current_dir_name@plt>
lea    0xeb1(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <getuid@plt>
cmp    $0x1,%rax
mov    $0x24,%edi
sbb    $0x0,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s \00"
@.str.1 = [2 x i8] c"#\00"
@.str.2 = [2 x i8] c"$\00"
define void @printPrompt() {
%1 = call i8* (...) @get_current_dir_name()
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = call i64 (...) @getuid()
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %9
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
define void @printPrompt() {
%1 = tail call i8* (...) @get_current_dir_name()
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i64 (...) @getuid()
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 35, i32 36
%6 = tail call i32 @putchar(i32 %5)
ret void
}
/* Variables and functions */
double sla_dsep_(double *, double *, double *, double *);
double slaDsep(double a1, double b1, double a2, double b2) {
  double A1;
  double B1;
  double A2;
  double B2;
  double result;
  A1 = a1;
  B1 = b1;
  A2 = a2;
  B2 = b2;
  result = sla_dsep_(&A1, &B1, &A2, &B2);
  return result;
}


x86 assembly (clang, -O0):
<slaDsep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
lea    -0x28(%rbp),%rdi
lea    -0x30(%rbp),%rsi
lea    -0x38(%rbp),%rdx
lea    -0x40(%rbp),%rcx
call   1030 <sla_dsep_@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slaDsep>:
sub    $0x28,%rsp
movsd  %xmm0,0x20(%rsp)
movsd  %xmm1,0x18(%rsp)
movsd  %xmm2,0x10(%rsp)
movsd  %xmm3,0x8(%rsp)
lea    0x20(%rsp),%rdi
lea    0x18(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1030 <sla_dsep_@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @slaDsep(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%14 = load double, double* %5
store double %14, double* %9
%15 = load double, double* %6
store double %15, double* %10
%16 = load double, double* %7
store double %16, double* %11
%17 = load double, double* %8
store double %17, double* %12
%18 = call double @sla_dsep_(double* %9, double* %10, double* %11, double* %12)
store double %18, double* %13
%19 = load double, double* %13
ret double %19
}

LLVM IR (-O2):
define double @slaDsep(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = bitcast double* %5 to i8*
%10 = bitcast double* %6 to i8*
%11 = bitcast double* %7 to i8*
%12 = bitcast double* %8 to i8*
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%13 = call double @sla_dsep_(double* %5, double* %6, double* %7, double* %8)
ret double %13
}
double mysub(double a, double b) { return a - b; }


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

x86 assembly (clang, -O2):
<mysub>:
subsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @mysub(double %0, double %1) {
%3 = fsub double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ sum(int, int);
int main(int argc, char const *argv[]) {
  sum(5, 6);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x5,%edi
mov    $0x6,%esi
call   1030 <sum@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x6,%esi
call   1030 <sum@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @sum(i32 5, i32 6)
ret i32 0
}
/* Type definitions */
struct btf_type {
  int dummy;
};
typedef int /*<<< orphan*/ __u8;
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
int /*<<< orphan*/ BTF_INT_OFFSET(int /*<<< orphan*/);
__u8 btf_int_offset(const struct btf_type *t) {
  return BTF_INT_OFFSET(*(__u32 *)(t + 1));
}


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

x86 assembly (clang, -O2):
<btf_int_offset>:
mov    0x4(%rdi),%edi
jmp    1030 <BTF_INT_OFFSET@plt>

LLVM IR (-O0):
%struct.btf_type = type { i32 }
define i32 @btf_int_offset(%struct.btf_type* %0) {
%2 = alloca %struct.btf_type*
store %struct.btf_type* %0, %struct.btf_type** %2
%3 = load %struct.btf_type*, %struct.btf_type** %2
%4 = getelementptr inbounds %struct.btf_type, %struct.btf_type* %3, i64 1
%5 = bitcast %struct.btf_type* %4 to i32*
%6 = load i32, i32* %5
%7 = call i32 @BTF_INT_OFFSET(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.btf_type = type { i32 }
define i32 @btf_int_offset(%struct.btf_type* nocapture %0) {
%2 = getelementptr inbounds %struct.btf_type, %struct.btf_type* %0, i64 1, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @BTF_INT_OFFSET(i32 %3)
ret i32 %4
}
int convert_method1(char *str) {
  __asm__ __volatile__("subl $1,%%ebx;"
                       "REPEAT: addl $1,%%ebx;"
                       "movl 0(%%ebx),%%edx;"
                       "movzbl  %%dl,%%ecx;"
                       "testl %%ecx,%%ecx;"
                       "je END;"
                       "cmpl $97,%%ecx;"
                       "jb REPEAT;"
                       "cmpl $122,%%ecx; "
                       "ja REPEAT;"
                       "subl $32,(%%ebx);"
                       "jmp REPEAT;"
                       "END:;"
                       :
                       : "b"(str));
  printf("first = %s\n", str);
  return 1;
}


x86 assembly (clang, -O0):
<convert_method1>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rbx
sub    $0x1,%ebx

x86 assembly (clang, -O2):
<convert_method1>:
push   %rbx
mov    %rdi,%rbx
sub    $0x1,%ebx

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

LLVM IR (-O2):
@.str = [12 x i8] c"first = %s\0A\00"
define i32 @convert_method1(i8* %0) {
tail call void asm sideeffect "subl $$1,%ebx;REPEAT: addl $$1,%ebx;movl 0(%ebx),%edx;movzbl %dl,%ecx;testl %ecx,%ecx;je END;cmpl $$97,%ecx;jb REPEAT;cmpl $$122,%ecx; ja REPEAT;subl $$32,(%ebx);jmp REPEAT;END:;", "{bx},~{dirflag},~{fpsr},~{flags}"(i8* %0)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 1
}
int ld_bun_mr2(long double *a1, long double a2) {
  return !(__builtin_isunordered(*a1, a2));
}


x86 assembly (clang, -O0):
<ld_bun_mr2>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
mov    %rdi,-0x8(%rbp)
fstpt  -0x20(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
fldt   -0x20(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setp   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_bun_mr2>:
fldt   0x8(%rsp)
fldt   (%rdi)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
setnp  %al
ret

LLVM IR (-O0):
define i32 @ld_bun_mr2(x86_fp80* %0, x86_fp80 %1) {
%3 = alloca x86_fp80*
%4 = alloca x86_fp80
store x86_fp80* %0, x86_fp80** %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80*, x86_fp80** %3
%6 = load x86_fp80, x86_fp80* %5
%7 = load x86_fp80, x86_fp80* %4
%8 = fcmp uno x86_fp80 %6, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ld_bun_mr2(x86_fp80* nocapture %0, x86_fp80 %1) {
%3 = load x86_fp80, x86_fp80* %0
%4 = fcmp ord x86_fp80 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
long double logbl(long double x) {
  long double res = 0.0L;
  asm volatile("fxtract\n\t"
               "fstp	%%st"
               : "=t"(res)
               : "0"(x));
  return res;
}


x86 assembly (clang, -O0):
<logbl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldz
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fxtract
fstp   %st(0)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<logbl>:
fldt   0x8(%rsp)
fxtract
fstp   %st(0)
ret

LLVM IR (-O0):
define x86_fp80 @logbl(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
store x86_fp80 0xK00000000000000000000, x86_fp80* %3
%4 = load x86_fp80, x86_fp80* %2
%5 = call x86_fp80 asm sideeffect "fxtract\0A\09fstp\09%st", "={st},0,~{dirflag},~{fpsr},~{flags}"(x86_fp80 %4)
store x86_fp80 %5, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @logbl(x86_fp80 %0) {
%2 = tail call x86_fp80 asm sideeffect "fxtract\0A\09fstp\09%st", "={st},0,~{dirflag},~{fpsr},~{flags}"(x86_fp80 %0)
ret x86_fp80 %2
}