xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int i;
  int j;
  i = 0;
  j = 1;
  while (i < 6) {
    j = j << 1;
    i = i + 1;
  }
  assert(j == 64);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x6,-0x8(%rbp)
jge    114e <main+0x3e>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
cmpl   $0x40,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 6
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i32, i32* %3
%9 = shl i32 %8, 1
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 64
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int /*<<< orphan*/);
void t_isspace_0x00() {
  Assert_real((isspace(0) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              5, ("isspace should be 0 for 0x00"));
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec2(%rip),%rsi
mov    $0x5,%edx
lea    0xf5e(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
xor    %edi,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec8(%rip),%rsi
lea    0xf69(%rip),%rcx
mov    $0x5,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x00\00"
define void @t_isspace_0x00() {
%1 = call i64 @isspace(i32 0)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 5, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x00\00"
define void @t_isspace_0x00() {
%1 = tail call i64 @isspace(i32 0)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 5, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int biExit(char *name, char **args, char **environ) {
  printf("\nBye!\n");
  exit(0);
}


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

x86 assembly (clang, -O2):
<biExit>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\0ABye!\0A\00"
define i32 @biExit(i8* %0, i8** %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [6 x i8] c"\0ABye!\00"
define i32 @biExit(i8* nocapture readnone %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ fd_nrf8001_disconnected_event(int /*<<< orphan*/,
                                                 int /*<<< orphan*/);
int /*<<< orphan*/ fd_nrf8001_error();
void fd_nrf8001_decode_disconnected_event(uint8_t *buffer, uint32_t length) {
  if (length != 3) {
    fd_nrf8001_error();
    return;
  }
  uint8_t aci_status = buffer[1];
  uint8_t btle_status = buffer[2];
  fd_nrf8001_disconnected_event(aci_status, btle_status);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
je     1145 <fd_nrf8001_decode_disconnected_event+0x25>
mov    $0x0,%al
call   1040 <fd_nrf8001_error@plt>
jmp    1164 <fd_nrf8001_decode_disconnected_event+0x44>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <fd_nrf8001_disconnected_event@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
cmp    $0x3,%esi
jne    1132 <fd_nrf8001_decode_disconnected_event+0x12>
mov    0x4(%rdi),%eax
mov    0x8(%rdi),%esi
mov    %eax,%edi
jmp    1030 <fd_nrf8001_disconnected_event@plt>
xor    %eax,%eax
jmp    1040 <fd_nrf8001_error@plt>

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

LLVM IR (-O2):
define void @fd_nrf8001_decode_disconnected_event(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 3
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @fd_nrf8001_error()
br label %12
6: ; preds = %2
%7 = getelementptr inbounds i32, i32* %0, i64 1
%8 = load i32, i32* %7
%9 = getelementptr inbounds i32, i32* %0, i64 2
%10 = load i32, i32* %9
%11 = tail call i32 @fd_nrf8001_disconnected_event(i32 %8, i32 %10)
br label %12
12: ; preds = %6, %4
ret void
}
/* Type definitions */
struct mdoc {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mdoc_node(struct mdoc const *);
int /*<<< orphan*/ print_mdoc(int /*<<< orphan*/, int /*<<< orphan*/);
void tree_mdoc(void *arg, const struct mdoc *mdoc) {
  print_mdoc(mdoc_node(mdoc), 0);
}


x86 assembly (clang, -O0):
<tree_mdoc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <mdoc_node@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <print_mdoc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tree_mdoc>:
push   %rax
mov    %rsi,%rdi
call   1040 <mdoc_node@plt>
mov    %eax,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <print_mdoc@plt>

LLVM IR (-O0):
%struct.mdoc = type { i32 }
define void @tree_mdoc(i8* %0, %struct.mdoc* %1) {
%3 = alloca i8*
%4 = alloca %struct.mdoc*
store i8* %0, i8** %3
store %struct.mdoc* %1, %struct.mdoc** %4
%5 = load %struct.mdoc*, %struct.mdoc** %4
%6 = call i32 @mdoc_node(%struct.mdoc* %5)
%7 = call i32 @print_mdoc(i32 %6, i32 0)
ret void
}

LLVM IR (-O2):
%struct.mdoc = type { i32 }
define void @tree_mdoc(i8* nocapture readnone %0, %struct.mdoc* %1) {
%3 = tail call i32 @mdoc_node(%struct.mdoc* %1)
%4 = tail call i32 @print_mdoc(i32 %3, i32 0)
ret void
}
void ramp_destroy(union envelop *envelop) { (void)envelop; }


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

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

LLVM IR (-O0):
%union.envelop = type opaque
define void @ramp_destroy(%union.envelop* %0) {
%2 = alloca %union.envelop*
store %union.envelop* %0, %union.envelop** %2
%3 = load %union.envelop*, %union.envelop** %2
ret void
}

LLVM IR (-O2):
%union.envelop = type opaque
define void @ramp_destroy(%union.envelop* nocapture %0) {
ret void
}
/* Type definitions */
struct yaffs_dev {
  int dummy;
};

/* Variables and functions */
int yaffs_sync_common(struct yaffs_dev *, int /*<<< orphan*/,
                      int /*<<< orphan*/);
int yaffs_sync_files_reldev(struct yaffs_dev *dev) {
  return yaffs_sync_common(dev, (0), 0);
}


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

x86 assembly (clang, -O2):
<yaffs_sync_files_reldev>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <yaffs_sync_common@plt>

LLVM IR (-O0):
%struct.yaffs_dev = type { i32 }
define i32 @yaffs_sync_files_reldev(%struct.yaffs_dev* %0) {
%2 = alloca %struct.yaffs_dev*
store %struct.yaffs_dev* %0, %struct.yaffs_dev** %2
%3 = load %struct.yaffs_dev*, %struct.yaffs_dev** %2
%4 = call i32 @yaffs_sync_common(%struct.yaffs_dev* %3, i32 0, i32 0)
ret i32 %4
}

LLVM IR (-O2):
%struct.yaffs_dev = type { i32 }
define i32 @yaffs_sync_files_reldev(%struct.yaffs_dev* %0) {
%2 = tail call i32 @yaffs_sync_common(%struct.yaffs_dev* %0, i32 0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ broadcast(int);
void leave_critical_section() { broadcast(2); }


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

x86 assembly (clang, -O2):
<leave_critical_section>:
mov    $0x2,%edi
jmp    1030 <broadcast@plt>

LLVM IR (-O0):
define void @leave_critical_section() {
%1 = call i32 @broadcast(i32 2)
ret void
}

LLVM IR (-O2):
define void @leave_critical_section() {
%1 = tail call i32 @broadcast(i32 2)
ret void
}
/* Variables and functions */
double log(int /*<<< orphan*/);
int /*<<< orphan*/ myrandom(int);
double random_exp_real(int sn, double m) { return (-m * log(myrandom(sn))); }


x86 assembly (clang, -O0):
<random_exp_real>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <myrandom@plt>
mov    %eax,%edi
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_exp_real>:
sub    $0x18,%rsp
xorpd  0xed4(%rip),%xmm0
movapd %xmm0,(%rsp)
call   1030 <myrandom@plt>
mov    %eax,%edi
call   1040 <log@plt>
mulsd  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @random_exp_real(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fneg double %5
%7 = load i32, i32* %3
%8 = call i32 @myrandom(i32 %7)
%9 = call double @log(i32 %8)
%10 = fmul double %6, %9
ret double %10
}

LLVM IR (-O2):
define double @random_exp_real(i32 %0, double %1) {
%3 = fneg double %1
%4 = tail call i32 @myrandom(i32 %0)
%5 = tail call double @log(i32 %4)
%6 = fmul double %5, %3
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr,
                "usage: mount_nullfs [-o options] target mount-point\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [53 x i8] c"usage: mount_nullfs [-o options] target mount-point\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"usage: mount_nullfs [-o options] target mount-point\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int *a = malloc(sizeof(int));
  free(a);
  int *b = malloc(sizeof(int));
  *b = 128;
  *a = 55;
  printf("a=%d,  b=%d (==128!)\n", *a, *b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x80,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x37,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xe7c(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
mov    $0x4,%edi
call   1050 <malloc@plt>
lea    0xeac(%rip),%rdi
mov    $0x37,%esi
mov    $0x80,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"a=%d, b=%d (==128!)\0A\00"
define i32 @main() {
%1 = alloca i32*
%2 = alloca i32*
%3 = call i32* @malloc(i32 4)
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = call i32 @free(i32* %4)
%6 = call i32* @malloc(i32 4)
store i32* %6, i32** %2
%7 = load i32*, i32** %2
store i32 128, i32* %7
%8 = load i32*, i32** %1
store i32 55, i32* %8
%9 = load i32*, i32** %1
%10 = load i32, i32* %9
%11 = load i32*, i32** %2
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"a=%d, b=%d (==128!)\0A\00"
define i32 @main() {
%1 = tail call i32* @malloc(i32 4)
%2 = tail call i32 @free(i32* %1)
%3 = tail call i32* @malloc(i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 55, i32 128)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, char *, int *);
void read_from_line(char *line, char *val) {
  int prm_name;
  sscanf(line, "%s %d\n", val, &prm_name);
}


x86 assembly (clang, -O0):
<read_from_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rsi
lea    -0x14(%rbp),%rcx
call   1030 <sscanf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_from_line>:
push   %rax
mov    %rsi,%rdx
lea    0xee5(%rip),%rsi
lea    0x4(%rsp),%rcx
call   1030 <sscanf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%s %d\0A\00"
define void @read_from_line(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 = load i8*, i8** %4
%8 = call i32 @sscanf(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %7, i32* %5)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s %d\0A\00"
define void @read_from_line(i8* nocapture %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1, i32* %3)
ret void
}
int foo_impl(int x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @foo_impl(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ SYS_write;
int /*<<< orphan*/ syscall(int /*<<< orphan*/, int, char *, int);
int main() {
  syscall(SYS_write, 1, "Hello, world\n", 13);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
lea    0xecc(%rip),%rdx
mov    $0xd,%ecx
call   1030 <syscall@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rdx
mov    $0x1,%esi
mov    $0xd,%ecx
call   1030 <syscall@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SYS_write = global i32 0
@.str = [14 x i8] c"Hello, world\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @SYS_write
%3 = call i32 @syscall(i32 %2, i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
ret i32 0
}

LLVM IR (-O2):
@SYS_write = global i32 0
@.str = [14 x i8] c"Hello, world\0A\00"
define i32 @main() {
%1 = load i32, i32* @SYS_write
%2 = tail call i32 @syscall(i32 %1, i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
ret i32 0
}
__attribute__((always_)) void check_trace_callback_type_mm_page_pcpu_drain(
    void (*cb)(void *__data, struct page *page, unsigned int order,
               int migratetype)) {}


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

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

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

LLVM IR (-O2):
%struct.page = type opaque
define void @check_trace_callback_type_mm_page_pcpu_drain(void (i8*, %struct.page*, i32, i32)* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printChar(char, int);
void printBlank(int num) { printChar(' ', num); }


x86 assembly (clang, -O0):
<printBlank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x20,%edi
call   1030 <printChar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printBlank>:
mov    %edi,%esi
mov    $0x20,%edi
jmp    1030 <printChar@plt>

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

LLVM IR (-O2):
define void @printBlank(i32 %0) {
%2 = tail call i32 @printChar(i8 signext 32, i32 %0)
ret void
}
int isspace(int c) { return (c == ' '); }


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
xor    %eax,%eax
cmp    $0x20,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int semctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int sem_destroy(int semid) { return semctl(semid, 0, IPC_RMID); }


x86 assembly (clang, -O0):
<sem_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <semctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sem_destroy>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
jmp    1030 <semctl@plt>

LLVM IR (-O0):
@IPC_RMID = global i32 0
define i32 @sem_destroy(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @IPC_RMID
%5 = call i32 @semctl(i32 %3, i32 0, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@IPC_RMID = global i32 0
define i32 @sem_destroy(i32 %0) {
%2 = load i32, i32* @IPC_RMID
%3 = tail call i32 @semctl(i32 %0, i32 0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 5, count = 0;
  while ((a = (a << 1)) != 0)
    count++;
  printf("%d\n", (count + 1) / 8);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     114d <main+0x3d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x4,%esi
call   1030 <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
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %8, %0
%5 = load i32, i32* %2
%6 = shl i32 %5, 1
store i32 %6, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
br label %4
11: ; preds = %4
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
%14 = sdiv i32 %13, 8
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
/* Type definitions */
struct hostent {
  int dummy;
};
typedef enum nss_status { ____Placeholder_nss_status } nss_status;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int _nss_neoip_gethostbyname2_r(char const *, int /*<<< orphan*/,
                                struct hostent *, char *, size_t, int *, int *);
enum nss_status _nss_neoip_gethostbyname_r(const char *name,
                                           struct hostent *result, char *buffer,
                                           size_t buflen, int *errnop,
                                           int *h_errnop) {
  return _nss_neoip_gethostbyname2_r(name, AF_INET, result, buffer, buflen,
                                     errnop, h_errnop);
}


x86 assembly (clang, -O0):
<_nss_neoip_gethostbyname_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <_nss_neoip_gethostbyname2_r@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nss_neoip_gethostbyname_r>:
push   %rax
mov    %r8,%rax
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    0x2ec4(%rip),%rsi
mov    (%rsi),%esi
mov    %r9,(%rsp)
mov    %rax,%r9
call   1030 <_nss_neoip_gethostbyname2_r@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.hostent = type { i32 }
@AF_INET = global i32 0
define i32 @_nss_neoip_gethostbyname_r(i8* %0, %struct.hostent* %1, i8* %2, i64 %3, i32* %4, i32* %5) {
%7 = alloca i8*
%8 = alloca %struct.hostent*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i32*
%12 = alloca i32*
store i8* %0, i8** %7
store %struct.hostent* %1, %struct.hostent** %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%13 = load i8*, i8** %7
%14 = load i32, i32* @AF_INET
%15 = load %struct.hostent*, %struct.hostent** %8
%16 = load i8*, i8** %9
%17 = load i64, i64* %10
%18 = load i32*, i32** %11
%19 = load i32*, i32** %12
%20 = call i32 @_nss_neoip_gethostbyname2_r(i8* %13, i32 %14, %struct.hostent* %15, i8* %16, i64 %17, i32* %18, i32* %19)
ret i32 %20
}

LLVM IR (-O2):
%struct.hostent = type { i32 }
@AF_INET = global i32 0
define i32 @_nss_neoip_gethostbyname_r(i8* %0, %struct.hostent* %1, i8* %2, i64 %3, i32* %4, i32* %5) {
%7 = load i32, i32* @AF_INET
%8 = tail call i32 @_nss_neoip_gethostbyname2_r(i8* %0, i32 %7, %struct.hostent* %1, i8* %2, i64 %3, i32* %4, i32* %5)
ret i32 %8
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double getElapsedTime(double startTime) {
  struct timeval tp;
  gettimeofday(&tp, NULL);
  return (double)tp.tv_sec + (double)tp.tv_usec / (double)1000000 - startTime;
}


x86 assembly (clang, -O0):
<getElapsedTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x10(%rbp),%xmm0
cvtsi2sdq -0x18(%rbp),%xmm1
movsd  0xec2(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
subsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getElapsedTime>:
sub    $0x18,%rsp
movsd  %xmm0,(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xec2(%rip),%xmm0
addsd  %xmm1,%xmm0
subsd  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @getElapsedTime(double %0) {
%2 = alloca double
%3 = alloca %struct.timeval
store double %0, double* %2
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = fdiv double %10, 1.000000e+06
%12 = fadd double %7, %11
%13 = load double, double* %2
%14 = fsub double %12, %13
ret double %14
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @getElapsedTime(double %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = fdiv double %10, 1.000000e+06
%12 = fadd double %11, %7
%13 = fsub double %12, %0
ret double %13
}
/* Variables and functions */
int /*<<< orphan*/ wDateTimePush(char, int /*<<< orphan*/);
int /*<<< orphan*/ wStackPopDateTime();
void wBuiltinSecond() { wDateTimePush('s', wStackPopDateTime()); }


x86 assembly (clang, -O0):
<wBuiltinSecond>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <wStackPopDateTime@plt>
mov    %eax,%esi
mov    $0x73,%edi
call   1030 <wDateTimePush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBuiltinSecond>:
push   %rax
xor    %eax,%eax
call   1040 <wStackPopDateTime@plt>
mov    $0x73,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <wDateTimePush@plt>

LLVM IR (-O0):
define void @wBuiltinSecond() {
%1 = call i32 (...) @wStackPopDateTime()
%2 = call i32 @wDateTimePush(i8 signext 115, i32 %1)
ret void
}

LLVM IR (-O2):
define void @wBuiltinSecond() {
%1 = tail call i32 (...) @wStackPopDateTime()
%2 = tail call i32 @wDateTimePush(i8 signext 115, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ch341Configure(int, int);
int /*<<< orphan*/ ch341SetStream(int);
void ch341_init() {
  ch341Configure(0x1A86, 0x5512);
  ch341SetStream(1);
}


x86 assembly (clang, -O0):
<ch341_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1a86,%edi
mov    $0x5512,%esi
call   1030 <ch341Configure@plt>
mov    $0x1,%edi
call   1040 <ch341SetStream@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ch341_init>:
push   %rax
mov    $0x1a86,%edi
mov    $0x5512,%esi
call   1030 <ch341Configure@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <ch341SetStream@plt>

LLVM IR (-O0):
define void @ch341_init() {
%1 = call i32 @ch341Configure(i32 6790, i32 21778)
%2 = call i32 @ch341SetStream(i32 1)
ret void
}

LLVM IR (-O2):
define void @ch341_init() {
%1 = tail call i32 @ch341Configure(i32 6790, i32 21778)
%2 = tail call i32 @ch341SetStream(i32 1)
ret void
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *strdup(char *str) {
  char *buf = malloc(strlen(str) + 1);
  if (buf)
    strcpy(buf, str);
  return buf;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <strdup+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <strdup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = call i32 @strcpy(i8* %11, i8* %12)
br label %14
14: ; preds = %10, %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
void p() {}


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

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

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

LLVM IR (-O2):
define void @p() {
ret void
}
int countCards(int value, int current) {
  if ((value > 2) && (value < 7)) {
    current++;
  } else if (value == 10) {
    current--;
  }
  return current;
}


x86 assembly (clang, -O0):
<countCards>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x2,-0x4(%rbp)
jle    112c <countCards+0x2c>
cmpl   $0x7,-0x4(%rbp)
jge    112c <countCards+0x2c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <countCards+0x44>
cmpl   $0xa,-0x4(%rbp)
jne    113f <countCards+0x3f>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <countCards+0x44>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countCards>:
lea    -0x3(%rdi),%eax
xor    %ecx,%ecx
cmp    $0xa,%edi
sete   %cl
neg    %ecx
cmp    $0x4,%eax
mov    $0x1,%eax
cmovae %ecx,%eax
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @countCards(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 = icmp sgt i32 %5, 2
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 7
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
store i32 %12, i32* %4
br label %20
13: ; preds = %7, %2
%14 = load i32, i32* %3
%15 = icmp eq i32 %14, 10
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = load i32, i32* %4
%18 = add nsw i32 %17, -1
store i32 %18, i32* %4
br label %19
19: ; preds = %16, %13
br label %20
20: ; preds = %19, %10
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
define i32 @countCards(i32 %0, i32 %1) {
%3 = add i32 %0, -3
%4 = icmp ult i32 %3, 4
%5 = icmp eq i32 %0, 10
%6 = sext i1 %5 to i32
%7 = select i1 %4, i32 1, i32 %6
%8 = add nsw i32 %7, %1
ret i32 %8
}
void *fun_ptr(void) { return &fun_ptr; }


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

x86 assembly (clang, -O2):
<fun_ptr>:
mov    0x2ed9(%rip),%rax
ret

LLVM IR (-O0):
define i8* @fun_ptr() {
ret i8* bitcast (i8* ()* @fun_ptr to i8*)
}

LLVM IR (-O2):
define i8* @fun_ptr() {
ret i8* bitcast (i8* ()* @fun_ptr to i8*)
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ nrerror(char *);
int *ivector(long nl, long nh) {
  int *v;
  v = (int *)malloc((size_t)((nh - nl + 1 + 0) * sizeof(int)));
  if (!v)
    nrerror("allocation failure in ivector()");
  return v - nl + 0;
}


x86 assembly (clang, -O0):
<ivector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x0,%rdi
shl    $0x2,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1164 <ivector+0x44>
lea    0xea1(%rip),%rdi
call   1030 <nrerror@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %rdi,%rsi
lea    0x4(,%rsi,4),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <ivector+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <nrerror@plt>
shl    $0x2,%r14
sub    %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [32 x i8] c"allocation failure in ivector()\00"
define i32* @ivector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 0
%11 = mul i64 %10, 4
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to i32*
store i32* %13, i32** %5
%14 = load i32*, i32** %5
%15 = icmp ne i32* %14, null
br i1 %15, label %18, label %16
16: ; preds = %2
%17 = call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %2
%19 = load i32*, i32** %5
%20 = load i64, i64* %3
%21 = sub i64 0, %20
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = getelementptr inbounds i32, i32* %22, i64 0
ret i32* %23
}

LLVM IR (-O2):
@.str = [32 x i8] c"allocation failure in ivector()\00"
define i32* @ivector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 2
%5 = add i64 %4, 4
%6 = tail call i64 @malloc(i64 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to i32*
%12 = sub i64 0, %0
%13 = getelementptr inbounds i32, i32* %11, i64 %12
ret i32* %13
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void closeFile(FILE *f) { fclose(f); }


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

x86 assembly (clang, -O2):
<closeFile>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define void @closeFile(i32* nocapture %0) {
%2 = tail call i32 @fclose(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sound_is_done(int /*<<< orphan*/);
int /*<<< orphan*/ sound_stop(int /*<<< orphan*/);
void state_title_destroy() {
  if (!sound_is_done(0)) {
    sound_stop(0);
  }
}


x86 assembly (clang, -O0):
<state_title_destroy>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <sound_is_done@plt>
cmp    $0x0,%eax
jne    113b <state_title_destroy+0x1b>
xor    %edi,%edi
call   1030 <sound_stop@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<state_title_destroy>:
push   %rax
xor    %edi,%edi
call   1040 <sound_is_done@plt>
test   %eax,%eax
je     112e <state_title_destroy+0xe>
pop    %rax
ret
xor    %edi,%edi
pop    %rax
jmp    1030 <sound_stop@plt>

LLVM IR (-O0):
define void @state_title_destroy() {
%1 = call i32 @sound_is_done(i32 0)
%2 = icmp ne i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = call i32 @sound_stop(i32 0)
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @state_title_destroy() {
%1 = tail call i32 @sound_is_done(i32 0)
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @sound_stop(i32 0)
br label %5
5: ; preds = %3, %0
ret void
}
int abs(int ii) { return (ii < 0) ? ii * -1 : ii; }


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111d <abs+0x1d>
imul   $0xffffffff,-0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1123 <abs+0x23>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @abs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = mul nsw i32 %6, -1
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_ouput_header() {
  printf("addr: [code]  inst  arg1, arg2\n"
         "-------------------------------\n");
}


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

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

LLVM IR (-O0):
@.str = [64 x i8] c"addr: [code] inst arg1, arg2\0A-------------------------------\0A\00"
define void @print_ouput_header() {
%1 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [63 x i8] c"addr: [code] inst arg1, arg2\0A-------------------------------\00"
define void @print_ouput_header() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double ln_get_jupiter_earth_dist(double);
double ln_get_jupiter_pol_sdiam(double JD) {
  double So = 92.06;
  double dist;
  dist = ln_get_jupiter_earth_dist(JD);
  return So / dist;
}


x86 assembly (clang, -O0):
<ln_get_jupiter_pol_sdiam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <ln_get_jupiter_earth_dist@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_get_jupiter_pol_sdiam>:
push   %rax
call   1030 <ln_get_jupiter_earth_dist@plt>
movsd  0xee2(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ln_get_jupiter_pol_sdiam(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
store double 9.206000e+01, double* %3
%5 = load double, double* %2
%6 = call double @ln_get_jupiter_earth_dist(double %5)
store double %6, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fdiv double %7, %8
ret double %9
}

LLVM IR (-O2):
define double @ln_get_jupiter_pol_sdiam(double %0) {
%2 = tail call double @ln_get_jupiter_earth_dist(double %0)
%3 = fdiv double 9.206000e+01, %2
ret double %3
}
/* Variables and functions */
size_t vec_next_capacity(size_t req_size) {
  size_t next_power = req_size;
  size_t num_bits = sizeof(size_t) * 8;
  size_t bit_n;
  next_power--;
  for (bit_n = 1; bit_n < num_bits; bit_n = bit_n << 1) {
    next_power = next_power | (next_power >> bit_n);
  }
  next_power++;
  return next_power;
}


x86 assembly (clang, -O0):
<vec_next_capacity>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movq   $0x40,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
movq   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1164 <vec_next_capacity+0x64>
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
shr    %cl,%rdx
mov    %rdx,%rcx
or     %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <vec_next_capacity+0x2c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec_next_capacity>:
lea    -0x1(%rdi),%rax
mov    %rax,%rcx
shr    %rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x2,%rax
or     %rcx,%rax
mov    %rax,%rcx
shr    $0x4,%rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x8,%rax
or     %rcx,%rax
mov    %rax,%rcx
shr    $0x10,%rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x20,%rax
or     %rcx,%rax
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @vec_next_capacity(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %2
%6 = load i64, i64* %2
store i64 %6, i64* %3
store i64 64, i64* %4
%7 = load i64, i64* %3
%8 = add i64 %7, -1
store i64 %8, i64* %3
store i64 1, i64* %5
br label %9
9: ; preds = %19, %1
%10 = load i64, i64* %5
%11 = load i64, i64* %4
%12 = icmp ult i64 %10, %11
br i1 %12, label %13, label %22
13: ; preds = %9
%14 = load i64, i64* %3
%15 = load i64, i64* %3
%16 = load i64, i64* %5
%17 = lshr i64 %15, %16
%18 = or i64 %14, %17
store i64 %18, i64* %3
br label %19
19: ; preds = %13
%20 = load i64, i64* %5
%21 = shl i64 %20, 1
store i64 %21, i64* %5
br label %9
22: ; preds = %9
%23 = load i64, i64* %3
%24 = add i64 %23, 1
store i64 %24, i64* %3
%25 = load i64, i64* %3
ret i64 %25
}

LLVM IR (-O2):
define i64 @vec_next_capacity(i64 %0) {
%2 = add i64 %0, -1
%3 = lshr i64 %2, 1
%4 = or i64 %3, %2
%5 = lshr i64 %4, 2
%6 = or i64 %5, %4
%7 = lshr i64 %6, 4
%8 = or i64 %7, %6
%9 = lshr i64 %8, 8
%10 = or i64 %9, %8
%11 = lshr i64 %10, 16
%12 = or i64 %11, %10
%13 = lshr i64 %12, 32
%14 = or i64 %13, %12
%15 = add i64 %14, 1
ret i64 %15
}
int sendFd(int sockfd, int fd, int pid) { return -1; }


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

x86 assembly (clang, -O2):
<sendFd>:
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @sendFd(i32 %0, i32 %1, i32 %2) {
ret i32 -1
}
int net_ring_common_module_destroy(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @net_ring_common_module_destroy() {
ret i32 0
}
int ft_unite(int n) {
  if (n < 0)
    return (n % -10);
  return (n % 10);
}


x86 assembly (clang, -O0):
<ft_unite>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1124 <ft_unite+0x24>
mov    -0x8(%rbp),%eax
mov    $0xfffffff6,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
jmp    1132 <ft_unite+0x32>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ft_unite(i32 %0) {
%2 = srem i32 %0, 10
ret i32 %2
}
/* Variables and functions */
size_t ta_calc_array_size(size_t element_size, size_t count) {
  if (count > (((size_t)-1) / element_size))
    return (size_t)-1;
  return element_size * count;
}


x86 assembly (clang, -O0):
<ta_calc_array_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0xffffffffffffffff,%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jbe    1140 <ta_calc_array_size+0x40>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    114d <ta_calc_array_size+0x4d>
mov    -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ta_calc_array_size>:
mov    %rdi,%rax
mov    %rsi,%rcx
imul   %rdi,%rcx
mul    %rsi
mov    $0xffffffffffffffff,%rax
cmovno %rcx,%rax
ret

LLVM IR (-O0):
define i64 @ta_calc_array_size(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = load i64, i64* %4
%8 = udiv i64 -1, %7
%9 = icmp ugt i64 %6, %8
br i1 %9, label %10, label %11
10: ; preds = %2
store i64 -1, i64* %3
br label %15
11: ; preds = %2
%12 = load i64, i64* %4
%13 = load i64, i64* %5
%14 = mul i64 %12, %13
store i64 %14, i64* %3
br label %15
15: ; preds = %11, %10
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
define i64 @ta_calc_array_size(i64 %0, i64 %1) {
%3 = tail call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %0, i64 %1)
%4 = extractvalue { i64, i1 } %3, 1
%5 = mul i64 %1, %0
%6 = select i1 %4, i64 -1, i64 %5
ret i64 %6
}