xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fuck();
int /*<<< orphan*/ hello();
int main() {
  hello();
  fuck();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <hello@plt>
mov    $0x0,%al
call   1040 <fuck@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @hello()
%2 = call i32 (...) @fuck()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @hello()
%2 = tail call i32 (...) @fuck()
ret i32 0
}
/* Variables and functions */
int strlen(char const *);
char strlast(const char *str) { return str[strlen(str) - 1]; }


x86 assembly (clang, -O0):
<strlast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlast>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
mov    -0x1(%rax,%rbx,1),%al
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @strlast(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sub nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %3, i64 %7
%9 = load i8, i8* %8
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @strlast(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
ret i8 %6
}
char *next_stack_pos(char *stack) { return stack - 4; }


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

x86 assembly (clang, -O2):
<next_stack_pos>:
lea    -0x4(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @next_stack_pos(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 -4
ret i8* %4
}

LLVM IR (-O2):
define i8* @next_stack_pos(i8* readnone %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -4
ret i8* %2
}
/* Variables and functions */
int rand();
void funcWithLabelAtStart() {
  int x;
  int y;
  {
  retry:
    x = rand();
    y = rand();
    if (x != y)
      goto retry;
    return;
  }
}


x86 assembly (clang, -O0):
<funcWithLabelAtStart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     113d <funcWithLabelAtStart+0x2d>
jmp    1118 <funcWithLabelAtStart+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcWithLabelAtStart>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cmp    %eax,%ebx
jne    1120 <funcWithLabelAtStart+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @funcWithLabelAtStart() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @rand()
%3 = tail call i32 (...) @rand()
%4 = icmp eq i32 %2, %3
br i1 %4, label %5, label %1
5: ; preds = %1
ret void
}
void gbox_send_init_hello(void) {}


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

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

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

LLVM IR (-O2):
define void @gbox_send_init_hello() {
ret void
}
/* Type definitions */
struct afp_volume {
  int dummy;
};

/* Variables and functions */
int EPERM;
int extra_translate(struct afp_volume *, char const *, char **);
int /*<<< orphan*/ free(char *);
int appledouble_rmdir(struct afp_volume *volume, const char *path) {
  int resource;
  char *newpath;
  resource = extra_translate(volume, path, &newpath);
  free(newpath);
  if (resource == 0)
    return 0;
  return -EPERM;
}


x86 assembly (clang, -O0):
<appledouble_rmdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x28(%rbp),%rdx
call   1040 <extra_translate@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
cmpl   $0x0,-0x1c(%rbp)
jne    1163 <appledouble_rmdir+0x43>
movl   $0x0,-0x4(%rbp)
jmp    1171 <appledouble_rmdir+0x51>
xor    %eax,%eax
mov    0x2e6c(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<appledouble_rmdir>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rdx
call   1040 <extra_translate@plt>
mov    %eax,%ebx
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    0x2e96(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
test   %ebx,%ebx
cmove  %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.afp_volume = type { i32 }
@EPERM = global i32 0
define i32 @appledouble_rmdir(%struct.afp_volume* %0, i8* %1) {
%3 = alloca i32
%4 = alloca %struct.afp_volume*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store %struct.afp_volume* %0, %struct.afp_volume** %4
store i8* %1, i8** %5
%8 = load %struct.afp_volume*, %struct.afp_volume** %4
%9 = load i8*, i8** %5
%10 = call i32 @extra_translate(%struct.afp_volume* %8, i8* %9, i8** %7)
store i32 %10, i32* %6
%11 = load i8*, i8** %7
%12 = call i32 @free(i8* %11)
%13 = load i32, i32* %6
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 0, i32* %3
br label %19
16: ; preds = %2
%17 = load i32, i32* @EPERM
%18 = sub nsw i32 0, %17
store i32 %18, i32* %3
br label %19
19: ; preds = %16, %15
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
%struct.afp_volume = type { i32 }
@EPERM = global i32 0
define i32 @appledouble_rmdir(%struct.afp_volume* %0, i8* %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @extra_translate(%struct.afp_volume* %0, i8* %1, i8** %3)
%6 = load i8*, i8** %3
%7 = call i32 @free(i8* %6)
%8 = icmp eq i32 %5, 0
%9 = load i32, i32* @EPERM
%10 = sub nsw i32 0, %9
%11 = select i1 %8, i32 0, i32 %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *btp_malloc(size_t size) {
  void *ptr = malloc(size);
  if (ptr == NULL) {
    fprintf(stderr, "btp: out of memory");
    exit(1);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<btp_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <btp_malloc+0x43>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btp_malloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <btp_malloc+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 = [19 x i8] c"btp: out of memory\00"
define i8* @btp_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"btp: out of memory\00"
define noalias i8* @btp_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Type definitions */
typedef char *uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint8_t inportb_p(uint16_t port) {
  uint8_t ret;
  asm volatile("inb %%dx,%%al;outb %%al,$0x80" : "=a"(ret) : "d"(port));
  return ret;
}


x86 assembly (clang, -O0):
<inportb_p>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
in     (%dx),%al
out    %al,$0x80
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inportb_p>:
mov    %edi,%edx
in     (%dx),%al
out    %al,$0x80
ret

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

LLVM IR (-O2):
define i8* @inportb_p(i32 %0) {
%2 = tail call i8* asm sideeffect "inb %dx,%al;outb %al,$$0x80", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i8* %2
}
int test_imm_FCuint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xFC << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_FCuint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 252
%6 = icmp ne i64 %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_FCuint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 252
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char const *, char const *);
int string_equal(const char *s1, const char *s2) { return !strcmp(s1, s2); }


x86 assembly (clang, -O0):
<string_equal>:
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 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_equal>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @string_equal(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @strcmp(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @string_equal(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int DBL_MAX_EXP;
int maxexponentdbl_(double *x) { return DBL_MAX_EXP; }


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

x86 assembly (clang, -O2):
<maxexponentdbl_>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@DBL_MAX_EXP = global i32 0
define i32 @maxexponentdbl_(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load i32, i32* @DBL_MAX_EXP
ret i32 %3
}

LLVM IR (-O2):
@DBL_MAX_EXP = global i32 0
define i32 @maxexponentdbl_(double* nocapture readnone %0) {
%2 = load i32, i32* @DBL_MAX_EXP
ret i32 %2
}
/* Variables and functions */
int fac(int);
int main(int x) {
  int y;
  y = fac(x);
  return y;
}


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <fac@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0) {
%2 = tail call i32 @fac(i32 %0)
ret i32 %2
}
void toAvoidCompilerWarnings(void) { return; }


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

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

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

LLVM IR (-O2):
define void @toAvoidCompilerWarnings() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ setIntakeSpeed(int);
void simpleAutoIntake(int cycles) {
  for (int i = 0; i < cycles; i++) {
    delay(1000);
    setIntakeSpeed(100);
    delay(1000);
    setIntakeSpeed(0);
  }
}


x86 assembly (clang, -O0):
<simpleAutoIntake>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1171 <simpleAutoIntake+0x51>
mov    $0x3e8,%edi
call   1030 <delay@plt>
mov    $0x64,%edi
call   1040 <setIntakeSpeed@plt>
mov    $0x3e8,%edi
call   1030 <delay@plt>
xor    %edi,%edi
call   1040 <setIntakeSpeed@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <simpleAutoIntake+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simpleAutoIntake>:
push   %rbx
test   %edi,%edi
jle    115a <simpleAutoIntake+0x3a>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x3e8,%edi
call   1030 <delay@plt>
mov    $0x64,%edi
call   1040 <setIntakeSpeed@plt>
mov    $0x3e8,%edi
call   1030 <delay@plt>
xor    %edi,%edi
call   1040 <setIntakeSpeed@plt>
add    $0xffffffff,%ebx
jne    1130 <simpleAutoIntake+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @simpleAutoIntake(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %16
8: ; preds = %4
%9 = call i32 @delay(i32 1000)
%10 = call i32 @setIntakeSpeed(i32 100)
%11 = call i32 @delay(i32 1000)
%12 = call i32 @setIntakeSpeed(i32 0)
br label %13
13: ; preds = %8
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %4
16: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @simpleAutoIntake(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %10, %4 ], [ 0, %1 ]
%6 = tail call i32 @delay(i32 1000)
%7 = tail call i32 @setIntakeSpeed(i32 100)
%8 = tail call i32 @delay(i32 1000)
%9 = tail call i32 @setIntakeSpeed(i32 0)
%10 = add nuw nsw i32 %5, 1
%11 = icmp eq i32 %10, %0
br i1 %11, label %3, label %4
}
void rcu_print_detail_task_stall_rnp(struct rcu_node *rnp) {}


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

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

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

LLVM IR (-O2):
%struct.rcu_node = type opaque
define void @rcu_print_detail_task_stall_rnp(%struct.rcu_node* nocapture %0) {
ret void
}
int test() {
  __complex__ double C;
  double D;
  C / D;
}


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

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

LLVM IR (-O0):
define i32 @test() {
%1 = alloca i32
%2 = alloca { double, double }
%3 = alloca double
%4 = getelementptr inbounds { double, double }, { double, double }* %2, i32 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds { double, double }, { double, double }* %2, i32 0, i32 1
%7 = load double, double* %6
%8 = load double, double* %3
%9 = fdiv double %5, %8
%10 = fdiv double %7, %8
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @test() {
ret i32 undef
}
/* Variables and functions */
double drnd();
float dpn1() { return ((drnd() * 2.0) - 1.0); }


x86 assembly (clang, -O0):
<dpn1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <drnd@plt>
addsd  %xmm0,%xmm0
movsd  0xed9(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dpn1>:
push   %rax
xor    %eax,%eax
call   1030 <drnd@plt>
addsd  %xmm0,%xmm0
addsd  0xedc(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @dpn1() {
%1 = call double (...) @drnd()
%2 = call double @llvm.fmuladd.f64(double %1, double 2.000000e+00, double -1.000000e+00)
%3 = fptrunc double %2 to float
ret float %3
}

LLVM IR (-O2):
define float @dpn1() {
%1 = tail call double (...) @drnd()
%2 = tail call double @llvm.fmuladd.f64(double %1, double 2.000000e+00, double -1.000000e+00)
%3 = fptrunc double %2 to float
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void _Exit(int i) { abort(); }


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

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

LLVM IR (-O0):
define void @_Exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @_Exit(i32 %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
struct output {
  int dummy;
};

/* Variables and functions */
struct output *output_string(struct output *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ u_n_bytes(char const *);
struct output *output_zstring(struct output *output, const char *string) {
  return output_string(output, string, u_n_bytes(string));
}


x86 assembly (clang, -O0):
<output_zstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <u_n_bytes@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <output_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_zstring>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <u_n_bytes@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <output_string@plt>

LLVM IR (-O0):
%struct.output = type { i32 }
define %struct.output* @output_zstring(%struct.output* %0, i8* %1) {
%3 = alloca %struct.output*
%4 = alloca i8*
store %struct.output* %0, %struct.output** %3
store i8* %1, i8** %4
%5 = load %struct.output*, %struct.output** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @u_n_bytes(i8* %7)
%9 = call %struct.output* @output_string(%struct.output* %5, i8* %6, i32 %8)
ret %struct.output* %9
}

LLVM IR (-O2):
%struct.output = type { i32 }
define %struct.output* @output_zstring(%struct.output* %0, i8* %1) {
%3 = tail call i32 @u_n_bytes(i8* %1)
%4 = tail call %struct.output* @output_string(%struct.output* %0, i8* %1, i32 %3)
ret %struct.output* %4
}
void print_build_env() {}


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

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

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

LLVM IR (-O2):
define void @print_build_env() {
ret void
}
long __mp_cmpcontents(char *s, void *p) { return -1; }


x86 assembly (clang, -O0):
<__mp_cmpcontents>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__mp_cmpcontents>:
mov    $0xffffffffffffffff,%rax
ret

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

LLVM IR (-O2):
define i64 @__mp_cmpcontents(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i64 -1
}
/* Type definitions */
struct olist_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __olist_del_entry(struct olist_head *);
int /*<<< orphan*/ olist_add_tail(struct olist_head *, struct olist_head *);
void olist_move_tail(struct olist_head *list, struct olist_head *head) {
  __olist_del_entry(list);
  olist_add_tail(list, head);
}


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

x86 assembly (clang, -O2):
<olist_move_tail>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <__olist_del_entry@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <olist_add_tail@plt>

LLVM IR (-O0):
%struct.olist_head = type { i32 }
define void @olist_move_tail(%struct.olist_head* %0, %struct.olist_head* %1) {
%3 = alloca %struct.olist_head*
%4 = alloca %struct.olist_head*
store %struct.olist_head* %0, %struct.olist_head** %3
store %struct.olist_head* %1, %struct.olist_head** %4
%5 = load %struct.olist_head*, %struct.olist_head** %3
%6 = call i32 @__olist_del_entry(%struct.olist_head* %5)
%7 = load %struct.olist_head*, %struct.olist_head** %3
%8 = load %struct.olist_head*, %struct.olist_head** %4
%9 = call i32 @olist_add_tail(%struct.olist_head* %7, %struct.olist_head* %8)
ret void
}

LLVM IR (-O2):
%struct.olist_head = type { i32 }
define void @olist_move_tail(%struct.olist_head* %0, %struct.olist_head* %1) {
%3 = tail call i32 @__olist_del_entry(%struct.olist_head* %0)
%4 = tail call i32 @olist_add_tail(%struct.olist_head* %0, %struct.olist_head* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int __attribute__((no)) foo(const char *s) {
  if (!s)
    return 1;
  if (s[0] != 'a')
    abort();
  s += 4096 - 1;
  if (s[0] != 'b')
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <foo+0x23>
movl   $0x1,-0x4(%rbp)
jmp    1176 <foo+0x66>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
je     114a <foo+0x3a>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0xfff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x62,%eax
je     116f <foo+0x5f>
mov    $0x0,%al
call   1030 <abort@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
test   %rdi,%rdi
je     1128 <foo+0x18>
cmpb   $0x61,(%rdi)
jne    112f <foo+0x1f>
xor    %eax,%eax
cmpb   $0x62,0xfff(%rdi)
jne    112f <foo+0x1f>
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @foo(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 97
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %0, i64 4095
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 98
br i1 %11, label %14, label %12
12: ; preds = %8
%13 = tail call i32 (...) @abort()
unreachable
14: ; preds = %8, %1
%15 = phi i32 [ 1, %1 ], [ 0, %8 ]
ret i32 %15
}
int Cudd_ApaNumberOfDigits(int binaryDigits) {
  int digits;
  digits = binaryDigits / 16;
  if ((digits * 16) != binaryDigits)
    digits++;
  return (digits);
}


x86 assembly (clang, -O0):
<Cudd_ApaNumberOfDigits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x4,%eax
cmp    -0x4(%rbp),%eax
je     112d <Cudd_ApaNumberOfDigits+0x2d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cudd_ApaNumberOfDigits>:
lea    0xf(%rdi),%ecx
test   %edi,%edi
cmovns %edi,%ecx
mov    %ecx,%edx
sar    $0x4,%edx
and    $0xfffffff0,%ecx
xor    %eax,%eax
cmp    %edi,%ecx
setne  %al
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @Cudd_ApaNumberOfDigits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 16
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = mul nsw i32 %6, 16
%8 = load i32, i32* %2
%9 = icmp ne i32 %7, %8
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %13
13: ; preds = %10, %1
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @Cudd_ApaNumberOfDigits(i32 %0) {
%2 = sdiv i32 %0, 16
%3 = shl nsw i32 %2, 4
%4 = icmp ne i32 %3, %0
%5 = zext i1 %4 to i32
%6 = add nsw i32 %2, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ non_fatal(char *, char *);
void pragendm() {
  non_fatal("\"#pragma endmacro\" not allowed outside macro", "");
}


x86 assembly (clang, -O0):
<pragendm>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xf0a(%rip),%rsi
call   1030 <non_fatal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pragendm>:
lea    0xee9(%rip),%rdi
lea    0xf0e(%rip),%rsi
jmp    1030 <non_fatal@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"\22#pragma endmacro\22 not allowed outside macro\00"
@.str.1 = [1 x i8] zeroinitializer
define void @pragendm() {
%1 = call i32 @non_fatal(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"\22#pragma endmacro\22 not allowed outside macro\00"
@.str.1 = [1 x i8] zeroinitializer
define void @pragendm() {
%1 = tail call i32 @non_fatal(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int getpsr();
int /*<<< orphan*/ set_fsr(int /*<<< orphan*/);
int /*<<< orphan*/ setpsr(int);
fpu_init() {
  int tmp;
  tmp = getpsr();
  setpsr(tmp | (1 << 12));
  set_fsr(0);
}


x86 assembly (clang, -O0):
<fpu_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getpsr@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
or     $0x1000,%edi
call   1050 <setpsr@plt>
xor    %edi,%edi
call   1030 <set_fsr@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpu_init>:
push   %rax
xor    %eax,%eax
call   1040 <getpsr@plt>
or     $0x1000,%eax
mov    %eax,%edi
call   1050 <setpsr@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <set_fsr@plt>

LLVM IR (-O0):
define i32 @fpu_init() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @getpsr()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = or i32 %4, 4096
%6 = call i32 @setpsr(i32 %5)
%7 = call i32 @set_fsr(i32 0)
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @fpu_init() {
%1 = tail call i32 (...) @getpsr()
%2 = or i32 %1, 4096
%3 = tail call i32 @setpsr(i32 %2)
%4 = tail call i32 @set_fsr(i32 0)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ fork();
int getpid();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
int main() {
  pid_t f, f1;
  printf("Pai (PID=%u) \n", getpid());
  printf("A");
  f = fork();
  f1 = fork();
  sleep(15);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <fork@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1060 <fork@plt>
mov    %eax,-0xc(%rbp)
mov    $0xf,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xea1(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x41,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1070 <fork@plt>
xor    %eax,%eax
call   1070 <fork@plt>
mov    $0xf,%edi
call   1060 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Pai (PID=%u) \0A\00"
@.str.1 = [2 x i8] c"A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @getpid()
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (...) @fork()
store i32 %7, i32* %2
%8 = call i32 (...) @fork()
store i32 %8, i32* %3
%9 = call i32 @sleep(i32 15)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Pai (PID=%u) \0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @putchar(i32 65)
%4 = tail call i32 (...) @fork()
%5 = tail call i32 (...) @fork()
%6 = tail call i32 @sleep(i32 15)
ret i32 0
}
void save_mtproc_info(struct task_struct *p, unsigned long long ts) {}


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

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

LLVM IR (-O0):
%struct.task_struct = type opaque
define void @save_mtproc_info(%struct.task_struct* %0, i64 %1) {
%3 = alloca %struct.task_struct*
%4 = alloca i64
store %struct.task_struct* %0, %struct.task_struct** %3
store i64 %1, i64* %4
ret void
}

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @save_mtproc_info(%struct.task_struct* nocapture %0, i64 %1) {
ret void
}
void domark(unsigned *m, int n) {
  unsigned mark;
  mark = 1;
  mark <<= n % 32;
  m[n / 32] |= mark;
}


x86 assembly (clang, -O0):
<domark>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    -0x10(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    -0x1c(%rbp),%edx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
or     (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<domark>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
lea    0x1f(%rcx),%edx
test   %esi,%esi
cmovns %ecx,%edx
sar    $0x5,%edx
movslq %edx,%rcx
or     %eax,(%rdi,%rcx,4)
ret

LLVM IR (-O0):
define void @domark(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 1, i32* %5
%6 = load i32, i32* %4
%7 = srem i32 %6, 32
%8 = load i32, i32* %5
%9 = shl i32 %8, %7
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i32*, i32** %3
%12 = load i32, i32* %4
%13 = sdiv i32 %12, 32
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %11, i64 %14
%16 = load i32, i32* %15
%17 = or i32 %16, %10
store i32 %17, i32* %15
ret void
}

LLVM IR (-O2):
define void @domark(i32* nocapture %0, i32 %1) {
%3 = and i32 %1, 31
%4 = shl nuw i32 1, %3
%5 = sdiv i32 %1, 32
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = or i32 %8, %4
store i32 %9, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stdout;
char *strerror(int /*<<< orphan*/);
void unix_error(char *msg) {
  fprintf(stdout, "%s: %s\n", msg, strerror(errno));
  exit(1);
}


x86 assembly (clang, -O0):
<unix_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<unix_error>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2e9b(%rip),%rax
mov    (%rax),%ebp
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeac(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define void @unix_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = load i32, i32* @errno
%6 = call i8* @strerror(i32 %5)
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define void @unix_error(i8* %0) {
%2 = load i32, i32* @stdout
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ReverseGPIOP__0__Out__toggle();
void LedsP__Led0__toggle(void) { ReverseGPIOP__0__Out__toggle(); }


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

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

LLVM IR (-O0):
define void @LedsP__Led0__toggle() {
%1 = call i32 (...) @ReverseGPIOP__0__Out__toggle()
ret void
}

LLVM IR (-O2):
define void @LedsP__Led0__toggle() {
%1 = tail call i32 (...) @ReverseGPIOP__0__Out__toggle()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char toupper(char);
void capitalize(const char *word, char *new_word) {
  int len;
  len = strlen(word);
  if (len < 1) {
    return;
  }
  strcpy(new_word, word);
  new_word[0] = toupper(new_word[0]);
}


x86 assembly (clang, -O0):
<capitalize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jge    115b <capitalize+0x2b>
jmp    117c <capitalize+0x4c>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<capitalize>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1050 <strlen@plt>
test   %eax,%eax
jle    115a <capitalize+0x2a>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
movsbl (%r14),%edi
call   1040 <toupper@plt>
mov    %al,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @capitalize(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %2
br label %21
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = load i8*, i8** %3
%14 = call i32 @strcpy(i8* %12, i8* %13)
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 0
%17 = load i8, i8* %16
%18 = call signext i8 @toupper(i8 signext %17)
%19 = load i8*, i8** %4
%20 = getelementptr inbounds i8, i8* %19, i64 0
store i8 %18, i8* %20
br label %21
21: ; preds = %11, %10
ret void
}

LLVM IR (-O2):
define void @capitalize(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp slt i32 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @strcpy(i8* %1, i8* %0)
%7 = load i8, i8* %1
%8 = tail call signext i8 @toupper(i8 signext %7)
store i8 %8, i8* %1
br label %9
9: ; preds = %2, %5
ret void
}
/* Variables and functions */
int dfs(int **, int /*<<< orphan*/, int /*<<< orphan*/, int **, int, int, int);
int /*<<< orphan*/ free_2d_array(int **, int);
int **make_2d_array(int, int);
int count(int **graph, int rows, int cols) {
  int **visited = make_2d_array(cols, rows);
  int ret = dfs(graph, 0, 0, visited, graph[0][0], rows, cols);
  free_2d_array(visited, rows);
  return ret;
}


x86 assembly (clang, -O0):
<count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <make_2d_array@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%r8d
mov    -0xc(%rbp),%r9d
mov    -0x10(%rbp),%eax
xor    %edx,%edx
mov    %edx,%esi
mov    %eax,(%rsp)
call   1050 <dfs@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <free_2d_array@plt>
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %edx,%edi
call   1030 <make_2d_array@plt>
mov    %rax,%r15
mov    (%r14),%rax
mov    (%rax),%r8d
mov    %ebx,(%rsp)
mov    %r14,%rdi
xor    %esi,%esi
xor    %edx,%edx
mov    %r15,%rcx
mov    %ebp,%r9d
call   1050 <dfs@plt>
mov    %eax,%ebx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <free_2d_array@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @count(i32** %0, i32 %1, i32 %2) {
%4 = alloca i32**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32**
%8 = alloca i32
store i32** %0, i32*** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %6
%10 = load i32, i32* %5
%11 = call i32** @make_2d_array(i32 %9, i32 %10)
store i32** %11, i32*** %7
%12 = load i32**, i32*** %4
%13 = load i32**, i32*** %7
%14 = load i32**, i32*** %4
%15 = getelementptr inbounds i32*, i32** %14, i64 0
%16 = load i32*, i32** %15
%17 = getelementptr inbounds i32, i32* %16, i64 0
%18 = load i32, i32* %17
%19 = load i32, i32* %5
%20 = load i32, i32* %6
%21 = call i32 @dfs(i32** %12, i32 0, i32 0, i32** %13, i32 %18, i32 %19, i32 %20)
store i32 %21, i32* %8
%22 = load i32**, i32*** %7
%23 = load i32, i32* %5
%24 = call i32 @free_2d_array(i32** %22, i32 %23)
%25 = load i32, i32* %8
ret i32 %25
}

LLVM IR (-O2):
define i32 @count(i32** %0, i32 %1, i32 %2) {
%4 = tail call i32** @make_2d_array(i32 %2, i32 %1)
%5 = load i32*, i32** %0
%6 = load i32, i32* %5
%7 = tail call i32 @dfs(i32** %0, i32 0, i32 0, i32** %4, i32 %6, i32 %1, i32 %2)
%8 = tail call i32 @free_2d_array(i32** %4, i32 %1)
ret i32 %7
}
/* Variables and functions */
scalar_t__ EEXIST;
scalar_t__ errno;
char *get_db_directory();
int mkdir(char const *, int);
int /*<<< orphan*/ perror(char const *);
void ensure_db_directory_exists(void) {
  const char *db_directory = get_db_directory();
  int result = mkdir(db_directory, 0700);
  if (result && EEXIST != errno) {
    perror(db_directory);
  }
}


x86 assembly (clang, -O0):
<ensure_db_directory_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <get_db_directory@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1c0,%esi
call   1030 <mkdir@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1181 <ensure_db_directory_exists+0x51>
mov    0x2e7b(%rip),%rax
mov    (%rax),%rax
mov    0x2e69(%rip),%rcx
cmp    (%rcx),%rax
je     1181 <ensure_db_directory_exists+0x51>
mov    -0x8(%rbp),%rdi
call   1050 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ensure_db_directory_exists>:
push   %rbx
xor    %eax,%eax
call   1040 <get_db_directory@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x1c0,%esi
call   1030 <mkdir@plt>
test   %eax,%eax
je     1162 <ensure_db_directory_exists+0x32>
mov    0x2e8d(%rip),%rax
mov    (%rax),%rax
mov    0x2e7b(%rip),%rcx
cmp    (%rcx),%rax
jne    1164 <ensure_db_directory_exists+0x34>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <perror@plt>

LLVM IR (-O0):
@EEXIST = global i64 0
@errno = global i64 0
define void @ensure_db_directory_exists() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i8* (...) @get_db_directory()
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @mkdir(i8* %4, i32 448)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %0
%9 = load i64, i64* @EEXIST
%10 = load i64, i64* @errno
%11 = icmp ne i64 %9, %10
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i8*, i8** %1
%14 = call i32 @perror(i8* %13)
br label %15
15: ; preds = %12, %8, %0
ret void
}

LLVM IR (-O2):
@EEXIST = global i64 0
@errno = global i64 0
define void @ensure_db_directory_exists() {
%1 = tail call i8* (...) @get_db_directory()
%2 = tail call i32 @mkdir(i8* %1, i32 448)
%3 = icmp eq i32 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %0
%5 = load i64, i64* @EEXIST
%6 = load i64, i64* @errno
%7 = icmp eq i64 %5, %6
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = tail call i32 @perror(i8* %1)
br label %10
10: ; preds = %8, %4, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int test1_exit(int ec) {
  exit(ec);
  return (ec);
  return (0);
}


x86 assembly (clang, -O0):
<test1_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<test1_exit>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define i32 @test1_exit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
int setreuid(int ruid, int euid) {}


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

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

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

LLVM IR (-O2):
define i32 @setreuid(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int clz(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", clz(1 << 9));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @clz(i32 512)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void glDepthMask(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glDepthMask() {
ret void
}
/* Variables and functions */
int O_APPEND;
int O_CREAT;
int O_SYNC;
int O_WRONLY;
int S_IRUSR;
int S_IWUSR;
int open(char const *, int, int);
int log_file_open(const char *fname) {
  return open(fname, O_WRONLY | O_CREAT | O_APPEND | O_SYNC, S_IRUSR | S_IWUSR);
}


x86 assembly (clang, -O0):
<log_file_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
mov    0x2ec8(%rip),%rax
or     (%rax),%esi
mov    0x2e77(%rip),%rax
or     (%rax),%esi
mov    0x2e9e(%rip),%rax
or     (%rax),%esi
mov    0x2e7d(%rip),%rax
mov    (%rax),%edx
mov    0x2e84(%rip),%rax
or     (%rax),%edx
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_file_open>:
mov    0x2ea1(%rip),%rax
mov    0x2eda(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e87(%rip),%rax
or     (%rax),%esi
mov    0x2eae(%rip),%rax
or     (%rax),%esi
mov    0x2e8d(%rip),%rax
mov    0x2e96(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_APPEND = global i32 0
@O_SYNC = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
define i32 @log_file_open(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @O_WRONLY
%5 = load i32, i32* @O_CREAT
%6 = or i32 %4, %5
%7 = load i32, i32* @O_APPEND
%8 = or i32 %6, %7
%9 = load i32, i32* @O_SYNC
%10 = or i32 %8, %9
%11 = load i32, i32* @S_IRUSR
%12 = load i32, i32* @S_IWUSR
%13 = or i32 %11, %12
%14 = call i32 @open(i8* %3, i32 %10, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_APPEND = global i32 0
@O_SYNC = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
define i32 @log_file_open(i8* nocapture %0) {
%2 = load i32, i32* @O_WRONLY
%3 = load i32, i32* @O_CREAT
%4 = or i32 %3, %2
%5 = load i32, i32* @O_APPEND
%6 = or i32 %4, %5
%7 = load i32, i32* @O_SYNC
%8 = or i32 %6, %7
%9 = load i32, i32* @S_IRUSR
%10 = load i32, i32* @S_IWUSR
%11 = or i32 %10, %9
%12 = tail call i32 @open(i8* %0, i32 %8, i32 %11)
ret i32 %12
}