xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ result;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/ const *);
int /*<<< orphan*/ be32toh(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
uint32_t knot_wire_read_u32(const uint8_t *pos) {
  assert(pos);
  uint32_t result;
  memcpy(&result, pos, sizeof(result));
  return be32toh(result);
}


x86 assembly (clang, -O0):
<knot_wire_read_u32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    -0xc(%rbp),%edi
call   1050 <be32toh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<knot_wire_read_u32>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1030 <assert@plt>
lea    0xc(%rsp),%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    0xc(%rsp),%edi
call   1050 <be32toh@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @knot_wire_read_u32(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @assert(i32* %4)
%6 = load i32*, i32** %2
%7 = call i32 @memcpy(i32* %3, i32* %6, i32 4)
%8 = load i32, i32* %3
%9 = call i32 @be32toh(i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @knot_wire_read_u32(i32* %0) {
%2 = alloca i32
%3 = tail call i32 @assert(i32* %0)
%4 = bitcast i32* %2 to i8*
%5 = call i32 @memcpy(i32* %2, i32* %0, i32 4)
%6 = load i32, i32* %2
%7 = call i32 @be32toh(i32 %6)
ret i32 %7
}
void genround_w_d() {}


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

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

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

LLVM IR (-O2):
define void @genround_w_d() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Programming in Cee.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [20 x i8] c"Programming in Cee.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void vla_allocate_signed(int x) { int vla[x]; }


x86 assembly (clang, -O0):
<vla_allocate_signed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @vla_allocate_signed(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i32, i64 %6
store i64 %6, i64* %4
%9 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
define void @vla_allocate_signed(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void c() { puts("this is c()"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"this is c()\00"
define void @c() {
%1 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"this is c()\00"
define void @c() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
long timer_to_date(int /*<<< orphan*/);
long qfits_date_now(void) { return (timer_to_date(time(NULL))); }


x86 assembly (clang, -O0):
<qfits_date_now>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <timer_to_date@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<qfits_date_now>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <timer_to_date@plt>

LLVM IR (-O0):
define i64 @qfits_date_now() {
%1 = call i32 @time(i32* null)
%2 = call i64 @timer_to_date(i32 %1)
ret i64 %2
}

LLVM IR (-O2):
define i64 @qfits_date_now() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i64 @timer_to_date(i32 %1)
ret i64 %2
}
int chainlength(const int v_orig) {
  long v = v_orig;
  int len = 1;
  while (v != 1) {
    ++len;
    if (v % 2 == 0) {
      v /= 2;
    } else {
      v *= 3;
      ++v;
    }
  }
  return len;
}


x86 assembly (clang, -O0):
<chainlength>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpq   $0x1,-0x10(%rbp)
je     1173 <chainlength+0x73>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    1159 <chainlength+0x59>
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
jmp    116e <chainlength+0x6e>
imul   $0x3,-0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1116 <chainlength+0x16>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chainlength>:
mov    $0x1,%eax
cmp    $0x1,%edi
jne    110b <chainlength+0xb>
ret
movslq %edi,%rcx
mov    $0x1,%eax
jmp    1131 <chainlength+0x31>
cs nopw 0x0(%rax,%rax,1)
nop
lea    (%rcx,%rcx,2),%rcx
add    $0x1,%rcx
add    $0x1,%eax
cmp    $0x1,%rcx
je     110a <chainlength+0xa>
test   $0x1,%cl
jne    1120 <chainlength+0x20>
mov    %rcx,%rdx
shr    $0x3f,%rdx
add    %rcx,%rdx
sar    %rdx
mov    %rdx,%rcx
jmp    1128 <chainlength+0x28>

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

LLVM IR (-O2):
define i32 @chainlength(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %19, label %3
3: ; preds = %1
%4 = sext i32 %0 to i64
br label %5
5: ; preds = %3, %16
%6 = phi i32 [ %8, %16 ], [ 1, %3 ]
%7 = phi i64 [ %17, %16 ], [ %4, %3 ]
%8 = add nuw nsw i32 %6, 1
%9 = and i64 %7, 1
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %5
%12 = sdiv i64 %7, 2
br label %16
13: ; preds = %5
%14 = mul nsw i64 %7, 3
%15 = add nsw i64 %14, 1
br label %16
16: ; preds = %13, %11
%17 = phi i64 [ %12, %11 ], [ %15, %13 ]
%18 = icmp eq i64 %17, 1
br i1 %18, label %19, label %5
19: ; preds = %16, %1
%20 = phi i32 [ 1, %1 ], [ %8, %16 ]
ret i32 %20
}
const char *check_cptr_CA_SPAWN_CMDchar(const char *v) { return v; }


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

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

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

LLVM IR (-O2):
define i8* @check_cptr_CA_SPAWN_CMDchar(i8* readnone returned %0) {
ret i8* %0
}
/* Type definitions */
struct gmap_map {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gmap_fprint(struct gmap_map *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void gmap_print(struct gmap_map *map) { gmap_fprint(map, stdout); }


x86 assembly (clang, -O0):
<gmap_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
call   1030 <gmap_fprint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gmap_print>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <gmap_fprint@plt>

LLVM IR (-O0):
%struct.gmap_map = type { i32 }
@stdout = global i32 0
define void @gmap_print(%struct.gmap_map* %0) {
%2 = alloca %struct.gmap_map*
store %struct.gmap_map* %0, %struct.gmap_map** %2
%3 = load %struct.gmap_map*, %struct.gmap_map** %2
%4 = load i32, i32* @stdout
%5 = call i32 @gmap_fprint(%struct.gmap_map* %3, i32 %4)
ret void
}

LLVM IR (-O2):
%struct.gmap_map = type { i32 }
@stdout = global i32 0
define void @gmap_print(%struct.gmap_map* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @gmap_fprint(%struct.gmap_map* %0, i32 %2)
ret void
}
/* Variables and functions */
void *OP1_TYPECAST(void *);
void *OP2_TYPECAST(void *);
void *op_PLUS(void *inp1, void *inp2) {
  inp1 = OP1_TYPECAST(inp1);
  inp2 = OP2_TYPECAST(inp2);
  int first = (int)inp1;
  int second = (int)inp2;
  return (void *)(first + second);
}


x86 assembly (clang, -O0):
<op_PLUS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <OP1_TYPECAST@plt>
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <OP2_TYPECAST@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_PLUS>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <OP1_TYPECAST@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <OP2_TYPECAST@plt>
add    %r14d,%eax
cltq
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @op_PLUS(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i8* @OP1_TYPECAST(i8* %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %4
%10 = call i8* @OP2_TYPECAST(i8* %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %3
%12 = ptrtoint i8* %11 to i32
store i32 %12, i32* %5
%13 = load i8*, i8** %4
%14 = ptrtoint i8* %13 to i32
store i32 %14, i32* %6
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = add nsw i32 %15, %16
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i8*
ret i8* %19
}

LLVM IR (-O2):
define i8* @op_PLUS(i8* %0, i8* %1) {
%3 = tail call i8* @OP1_TYPECAST(i8* %0)
%4 = tail call i8* @OP2_TYPECAST(i8* %1)
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %4 to i64
%7 = add i64 %6, %5
%8 = shl i64 %7, 32
%9 = ashr exact i64 %8, 32
%10 = inttoptr i64 %9 to i8*
ret i8* %10
}
int sys$nxtvol(struct _fab *fab, void *err, void *suc) {
  return ({
    unsigned long resultvar;
    register long int _a3 asm("rdx") = (long)(suc);
    register long int _a2 asm("rsi") = (long)(err);
    register long int _a1 asm("rdi") = (long)(fab);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x82\n\t"
                 : "=a"(resultvar)
                 : "i"(15), "r"(_a1), "r"(_a2), "r"(_a3)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$nxtvol>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    $0xf,%rax
int    $0x82
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$nxtvol>:
mov    $0xf,%rax
int    $0x82
ret

LLVM IR (-O0):
%struct._fab = type opaque
define i32 @"sys$nxtvol"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = alloca %struct._fab*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store %struct._fab* %0, %struct._fab** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%12 = load i8*, i8** %6
%13 = ptrtoint i8* %12 to i64
store i64 %13, i64* %8
%14 = load i8*, i8** %5
%15 = ptrtoint i8* %14 to i64
store i64 %15, i64* %9
%16 = load %struct._fab*, %struct._fab** %4
%17 = ptrtoint %struct._fab* %16 to i64
store i64 %17, i64* %10
%18 = load i64, i64* %10
%19 = load i64, i64* %9
%20 = load i64, i64* %8
%21 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 15, i64 %18, i64 %19, i64 %20)
store i64 %21, i64* %7
%22 = load i64, i64* %7
store i64 %22, i64* %11
%23 = load i64, i64* %11
%24 = trunc i64 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
%struct._fab = type opaque
define i32 @"sys$nxtvol"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint %struct._fab* %0 to i64
%7 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 15, i64 %6, i64 %5, i64 %4)
%8 = trunc i64 %7 to i32
ret i32 %8
}
unsigned int _cpuFlags() {
  int flags = 0;
  return (flags);
}


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

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

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

LLVM IR (-O2):
define i32 @_cpuFlags() {
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int celcon_copy_from_standard_systems_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(100, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_copy_from_standard_systems_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x64,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_copy_from_standard_systems_container>:
mov    $0x64,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @celcon_copy_from_standard_systems_container() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 100, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @celcon_copy_from_standard_systems_container() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 100, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int SocketAndSendto(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ findBroadcastAddr();
int sendBroadcast() { return SocketAndSendto(1, 0, findBroadcastAddr()); }


x86 assembly (clang, -O0):
<sendBroadcast>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <findBroadcastAddr@plt>
mov    %eax,%edx
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <SocketAndSendto@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendBroadcast>:
push   %rax
xor    %eax,%eax
call   1040 <findBroadcastAddr@plt>
mov    $0x1,%edi
xor    %esi,%esi
mov    %eax,%edx
pop    %rax
jmp    1030 <SocketAndSendto@plt>

LLVM IR (-O0):
define i32 @sendBroadcast() {
%1 = call i32 (...) @findBroadcastAddr()
%2 = call i32 @SocketAndSendto(i32 1, i32 0, i32 %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @sendBroadcast() {
%1 = tail call i32 (...) @findBroadcastAddr()
%2 = tail call i32 @SocketAndSendto(i32 1, i32 0, i32 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int main() {
  int *p;
  unsigned int n;
  p = malloc(sizeof(int) * 10);
  free(p);
  free(p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x28,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x28,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 40)
%2 = tail call i32 @free(i32* %1)
%3 = tail call i32 @free(i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ f(int);
int main() {
  f(1);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <f@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <f@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 1)
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRCORE_N16_swap(char *, int, int);
void U_WMRINTERSECTCLIPRECT_swap(char *record, int torev) {
  U_WMRCORE_N16_swap(record, 4, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRINTERSECTCLIPRECT_swap>:
mov    %esi,%edx
mov    $0x4,%esi
jmp    1030 <U_WMRCORE_N16_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRINTERSECTCLIPRECT_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRCORE_N16_swap(i8* %0, i32 4, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __asm_utils_io_wait();
int /*<<< orphan*/ __asm_utils_out8(int, int);
void pic_disable_pic() {
  __asm_utils_out8((0x20 + 1), 0xFF);
  __asm_utils_io_wait();
  __asm_utils_out8((0xA0 + 1), 0xFF);
  __asm_utils_io_wait();
}


x86 assembly (clang, -O0):
<pic_disable_pic>:
push   %rbp
mov    %rsp,%rbp
mov    $0x21,%edi
mov    $0xff,%esi
call   1040 <__asm_utils_out8@plt>
mov    $0x0,%al
call   1030 <__asm_utils_io_wait@plt>
mov    $0xa1,%edi
mov    $0xff,%esi
call   1040 <__asm_utils_out8@plt>
mov    $0x0,%al
call   1030 <__asm_utils_io_wait@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pic_disable_pic>:
push   %rax
mov    $0x21,%edi
mov    $0xff,%esi
call   1040 <__asm_utils_out8@plt>
xor    %eax,%eax
call   1030 <__asm_utils_io_wait@plt>
mov    $0xa1,%edi
mov    $0xff,%esi
call   1040 <__asm_utils_out8@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <__asm_utils_io_wait@plt>

LLVM IR (-O0):
define void @pic_disable_pic() {
%1 = call i32 @__asm_utils_out8(i32 33, i32 255)
%2 = call i32 (...) @__asm_utils_io_wait()
%3 = call i32 @__asm_utils_out8(i32 161, i32 255)
%4 = call i32 (...) @__asm_utils_io_wait()
ret void
}

LLVM IR (-O2):
define void @pic_disable_pic() {
%1 = tail call i32 @__asm_utils_out8(i32 33, i32 255)
%2 = tail call i32 (...) @__asm_utils_io_wait()
%3 = tail call i32 @__asm_utils_out8(i32 161, i32 255)
%4 = tail call i32 (...) @__asm_utils_io_wait()
ret void
}
/* Variables and functions */
char const *firstPointer(char const *p1, char const *p2) {
  if ((((intptr_t)p1 < (intptr_t)p2) && ((intptr_t)p1 != 0)) ||
      ((intptr_t)p2 == 0))
    return p1;
  else
    return p2;
}


x86 assembly (clang, -O0):
<firstPointer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmp    %rcx,%rax
jge    112b <firstPointer+0x2b>
mov    -0x10(%rbp),%rax
cmp    $0x0,%rax
jne    1139 <firstPointer+0x39>
mov    -0x18(%rbp),%rax
cmp    $0x0,%rax
jne    1146 <firstPointer+0x46>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <firstPointer+0x4e>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<firstPointer>:
cmp    %rsi,%rdi
mov    %rsi,%rax
cmovl  %rdi,%rax
test   %rdi,%rdi
cmove  %rsi,%rax
test   %rsi,%rsi
cmove  %rdi,%rax
ret

LLVM IR (-O0):
define i8* @firstPointer(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = ptrtoint i8* %6 to i64
%8 = load i8*, i8** %5
%9 = ptrtoint i8* %8 to i64
%10 = icmp slt i64 %7, %9
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = ptrtoint i8* %12 to i64
%14 = icmp ne i64 %13, 0
br i1 %14, label %19, label %15
15: ; preds = %11, %2
%16 = load i8*, i8** %5
%17 = ptrtoint i8* %16 to i64
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %15, %11
%20 = load i8*, i8** %4
store i8* %20, i8** %3
br label %23
21: ; preds = %15
%22 = load i8*, i8** %5
store i8* %22, i8** %3
br label %23
23: ; preds = %21, %19
%24 = load i8*, i8** %3
ret i8* %24
}

LLVM IR (-O2):
define i8* @firstPointer(i8* readnone %0, i8* readnone %1) {
%3 = icmp slt i8* %0, %1
%4 = icmp ne i8* %0, null
%5 = and i1 %4, %3
%6 = icmp eq i8* %1, null
%7 = or i1 %6, %5
%8 = select i1 %7, i8* %0, i8* %1
ret i8* %8
}
XXorRegion() {}


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

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

LLVM IR (-O0):
define i32 @XXorRegion() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XXorRegion() {
ret i32 undef
}
void plat_post_dma_flush(struct device *dev) {}


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define void @plat_post_dma_flush(%struct.device* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ write(int, char *, int);
int main() {
  write(1, "Hello!\n", 7);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
lea    0xec5(%rip),%rsi
mov    $0x7,%edx
call   1030 <write@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x1,%edi
mov    $0x7,%edx
call   1030 <write@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"Hello!\0A\00"
define i32 @main() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
scalar_t__ allocate_mem(int, int /*<<< orphan*/, int, unsigned long);
char **allocate_char_pointers(long n_pointers) {
  return (char **)allocate_mem(4, 0, sizeof(char *), (unsigned long)n_pointers);
}


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

x86 assembly (clang, -O2):
<allocate_char_pointers>:
mov    %rdi,%rcx
mov    $0x4,%edi
xor    %esi,%esi
mov    $0x8,%edx
jmp    1030 <allocate_mem@plt>

LLVM IR (-O0):
define i8** @allocate_char_pointers(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @allocate_mem(i32 4, i32 0, i32 8, i64 %3)
%5 = inttoptr i64 %4 to i8**
ret i8** %5
}

LLVM IR (-O2):
define i8** @allocate_char_pointers(i64 %0) {
%2 = tail call i64 @allocate_mem(i32 4, i32 0, i32 8, i64 %0)
%3 = inttoptr i64 %2 to i8**
ret i8** %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void test2(void *dead) {
  sleep(200000);
  printf("test2\n");
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x30d40,%edi
call   1040 <sleep@plt>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
push   %rax
mov    $0x30d40,%edi
call   1040 <sleep@plt>
lea    0xece(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"test2\0A\00"
define void @test2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @sleep(i32 200000)
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"test2\00"
define void @test2(i8* nocapture readnone %0) {
%2 = tail call i32 @sleep(i32 200000)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double cbrt(double);
int /*<<< orphan*/ printf(char *, double, double);
int main(void) {
  {
    double x = 27.0;
    double c = cbrt(x);
    printf("cbrt(%g) is %g\n", x, c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cbrt@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
call   1040 <cbrt@plt>
movaps %xmm0,%xmm1
lea    0xed0(%rip),%rdi
movsd  0xec0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"cbrt(%g) is %g\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
store double 2.700000e+01, double* %2
%4 = load double, double* %2
%5 = call double @cbrt(double %4)
store double %5, double* %3
%6 = load double, double* %2
%7 = load double, double* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %6, double %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"cbrt(%g) is %g\0A\00"
define i32 @main() {
%1 = tail call double @cbrt(double 2.700000e+01)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double 2.700000e+01, double %1)
ret i32 0
}
/* Variables and functions */
int rand();
int return_nores(void) {
  int foo = rand();
  if (foo == 0)
    return 1;
  int bar = rand();
  if (bar == 0)
    return 2;
  int baz = rand();
  if (baz == 0)
    return 3;
  return 0;
}


x86 assembly (clang, -O0):
<return_nores>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1138 <return_nores+0x28>
movl   $0x1,-0x4(%rbp)
jmp    117f <return_nores+0x6f>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1158 <return_nores+0x48>
movl   $0x2,-0x4(%rbp)
jmp    117f <return_nores+0x6f>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1178 <return_nores+0x68>
movl   $0x3,-0x4(%rbp)
jmp    117f <return_nores+0x6f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_nores>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
test   %eax,%eax
je     113a <return_nores+0x2a>
xor    %eax,%eax
call   1030 <rand@plt>
test   %eax,%eax
je     1141 <return_nores+0x31>
xor    %eax,%eax
call   1030 <rand@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
lea    (%rcx,%rcx,2),%eax
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret
mov    $0x2,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @return_nores() {
%1 = tail call i32 (...) @rand()
%2 = icmp eq i32 %1, 0
br i1 %2, label %10, label %3
3: ; preds = %0
%4 = tail call i32 (...) @rand()
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i32 (...) @rand()
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i32 3, i32 0
br label %10
10: ; preds = %6, %3, %0
%11 = phi i32 [ 1, %0 ], [ %9, %6 ], [ 2, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ death();
int /*<<< orphan*/ normend();
dwarfend() {
  death();
  normend();
}


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

x86 assembly (clang, -O2):
<dwarfend>:
push   %rax
xor    %eax,%eax
call   1030 <death@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <normend@plt>

LLVM IR (-O0):
define i32 @dwarfend() {
%1 = alloca i32
%2 = call i32 (...) @death()
%3 = call i32 (...) @normend()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @dwarfend() {
%1 = tail call i32 (...) @death()
%2 = tail call i32 (...) @normend()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Round200(void *, int);
int /*<<< orphan*/ add_Byte(void *, int, int);
void Ketje_step(void *state, int block_size, unsigned char padding) {
  add_Byte(state, padding, block_size);
  add_Byte(state, 0x08, 2);
  int i = 0;
  for (i = (18 - 1); i < 18; i++) {
    Round200(state, i);
  }
}


x86 assembly (clang, -O0):
<Ketje_step>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0xd(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <add_Byte@plt>
mov    -0x8(%rbp),%rdi
mov    $0x8,%esi
mov    $0x2,%edx
call   1030 <add_Byte@plt>
movl   $0x0,-0x14(%rbp)
movl   $0x11,-0x14(%rbp)
cmpl   $0x12,-0x14(%rbp)
jge    1189 <Ketje_step+0x69>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <Round200@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1165 <Ketje_step+0x45>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ketje_step>:
push   %rbx
mov    %esi,%eax
mov    %rdi,%rbx
mov    %edx,%esi
mov    %eax,%edx
call   1030 <add_Byte@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x2,%edx
call   1030 <add_Byte@plt>
mov    %rbx,%rdi
mov    $0x11,%esi
pop    %rbx
jmp    1040 <Round200@plt>

LLVM IR (-O0):
define void @Ketje_step(i8* %0, i32 %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%8 = load i8*, i8** %4
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = load i32, i32* %5
%12 = call i32 @add_Byte(i8* %8, i32 %10, i32 %11)
%13 = load i8*, i8** %4
%14 = call i32 @add_Byte(i8* %13, i32 8, i32 2)
store i32 0, i32* %7
store i32 17, i32* %7
br label %15
15: ; preds = %22, %3
%16 = load i32, i32* %7
%17 = icmp slt i32 %16, 18
br i1 %17, label %18, label %25
18: ; preds = %15
%19 = load i8*, i8** %4
%20 = load i32, i32* %7
%21 = call i32 @Round200(i8* %19, i32 %20)
br label %22
22: ; preds = %18
%23 = load i32, i32* %7
%24 = add nsw i32 %23, 1
store i32 %24, i32* %7
br label %15
25: ; preds = %15
ret void
}

LLVM IR (-O2):
define void @Ketje_step(i8* %0, i32 %1, i8 zeroext %2) {
%4 = zext i8 %2 to i32
%5 = tail call i32 @add_Byte(i8* %0, i32 %4, i32 %1)
%6 = tail call i32 @add_Byte(i8* %0, i32 8, i32 2)
%7 = tail call i32 @Round200(i8* %0, i32 17)
ret void
}
float flabs(float n) {
  if (n < 0) {
    n *= -1;
  }
  return n;
}


x86 assembly (clang, -O0):
<flabs>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1128 <flabs+0x28>
movss  0xee2(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<flabs>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @flabs(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load float, float* %2
%7 = fmul float %6, -1.000000e+00
store float %7, float* %2
br label %8
8: ; preds = %5, %1
%9 = load float, float* %2
ret float %9
}

LLVM IR (-O2):
define float @flabs(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
int nwswrap(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @nwswrap() {
ret i32 1
}

LLVM IR (-O2):
define i32 @nwswrap() {
ret i32 1
}
double fatorial(int N) {
  double r = 1;
  int i = 0;
  for (i = N; i > 1; i--) {
    r *= i;
  }
  return r;
}


x86 assembly (clang, -O0):
<fatorial>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  0xef1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jle    1148 <fatorial+0x48>
cvtsi2sdl -0x14(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1121 <fatorial+0x21>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fatorial>:
movsd  0xef8(%rip),%xmm0
cmp    $0x2,%edi
jl     1125 <fatorial+0x25>
nopl   (%rax)
xorps  %xmm1,%xmm1
cvtsi2sd %edi,%xmm1
mulsd  %xmm1,%xmm0
lea    -0x1(%rdi),%eax
cmp    $0x2,%edi
mov    %eax,%edi
ja     1110 <fatorial+0x10>
ret

LLVM IR (-O0):
define double @fatorial(i32 %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca i32
store i32 %0, i32* %2
store double 1.000000e+00, double* %3
store i32 0, i32* %4
%5 = load i32, i32* %2
store i32 %5, i32* %4
br label %6
6: ; preds = %14, %1
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %17
9: ; preds = %6
%10 = load i32, i32* %4
%11 = sitofp i32 %10 to double
%12 = load double, double* %3
%13 = fmul double %12, %11
store double %13, double* %3
br label %14
14: ; preds = %9
%15 = load i32, i32* %4
%16 = add nsw i32 %15, -1
store i32 %16, i32* %4
br label %6
17: ; preds = %6
%18 = load double, double* %3
ret double %18
}

LLVM IR (-O2):
define double @fatorial(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi double [ %7, %3 ], [ 1.000000e+00, %1 ]
%6 = sitofp i32 %4 to double
%7 = fmul double %5, %6
%8 = add nsw i32 %4, -1
%9 = icmp ugt i32 %4, 2
br i1 %9, label %3, label %10
10: ; preds = %3, %1
%11 = phi double [ 1.000000e+00, %1 ], [ %7, %3 ]
ret double %11
}
int pinmux_register_mappings(struct pinmux_map const *map, unsigned num_maps) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.pinmux_map = type opaque
define i32 @pinmux_register_mappings(%struct.pinmux_map* %0, i32 %1) {
%3 = alloca %struct.pinmux_map*
%4 = alloca i32
store %struct.pinmux_map* %0, %struct.pinmux_map** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.pinmux_map = type opaque
define i32 @pinmux_register_mappings(%struct.pinmux_map* nocapture readnone %0, i32 %1) {
ret i32 0
}
int wsys_win32_api(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @wsys_win32_api() {
ret i32 0
}
/* Variables and functions */
char *strrchr(char const *, char);
char *get_filename_ext(const char *filename) {
  char *slash = strrchr(filename, '/');
  char *dot = strrchr(slash, '.');
  if (!dot || dot == slash)
    return "";
  return dot;
}


x86 assembly (clang, -O0):
<get_filename_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1159 <get_filename_ext+0x49>
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1169 <get_filename_ext+0x59>
lea    0xea0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1171 <get_filename_ext+0x61>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @get_filename_ext(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i8* @strrchr(i8* %6, i8 signext 47)
store i8* %7, i8** %4
%8 = load i8*, i8** %4
%9 = call i8* @strrchr(i8* %8, i8 signext 46)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %16
12: ; preds = %1
%13 = load i8*, i8** %5
%14 = load i8*, i8** %4
%15 = icmp eq i8* %13, %14
br i1 %15, label %16, label %17
16: ; preds = %12, %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %19
17: ; preds = %12
%18 = load i8*, i8** %5
store i8* %18, i8** %2
br label %19
19: ; preds = %17, %16
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @get_filename_ext(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %2, i8 signext 46)
%4 = icmp eq i8* %3, null
%5 = icmp eq i8* %3, %2
%6 = or i1 %4, %5
%7 = select i1 %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ read_num_from_file(char *, int *);
int inotifytools_get_max_user_watches() {
  int ret;
  if (!read_num_from_file("/proc/sys/fs/inotify/"
                          "max_user_watches",
                          &ret))
    return -1;
  return ret;
}


x86 assembly (clang, -O0):
<inotifytools_get_max_user_watches>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <read_num_from_file@plt>
cmp    $0x0,%eax
jne    113d <inotifytools_get_max_user_watches+0x2d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1143 <inotifytools_get_max_user_watches+0x33>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inotifytools_get_max_user_watches>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <read_num_from_file@plt>
cmp    $0x1,%eax
sbb    %eax,%eax
or     0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"/proc/sys/fs/inotify/max_user_watches\00"
define i32 @inotifytools_get_max_user_watches() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @read_num_from_file(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = icmp ne i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %0
store i32 -1, i32* %1
br label %8
6: ; preds = %0
%7 = load i32, i32* %2
store i32 %7, i32* %1
br label %8
8: ; preds = %6, %5
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [38 x i8] c"/proc/sys/fs/inotify/max_user_watches\00"
define i32 @inotifytools_get_max_user_watches() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @read_num_from_file(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = icmp eq i32 %3, 0
%5 = load i32, i32* %1
%6 = select i1 %4, i32 -1, i32 %5
ret i32 %6
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
struct timespec monotonic_now() {
  struct timespec now;
  clock_gettime(CLOCK_MONOTONIC, &now);
  return now;
}


x86 assembly (clang, -O0):
<monotonic_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<monotonic_now>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @monotonic_now() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @monotonic_now() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ECHILD;
int _stub(int /*<<< orphan*/);
int wait(int *status) { return _stub(ECHILD); }


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

x86 assembly (clang, -O2):
<wait>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <_stub@plt>

LLVM IR (-O0):
@ECHILD = global i32 0
define i32 @wait(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @ECHILD
%4 = call i32 @_stub(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
@ECHILD = global i32 0
define i32 @wait(i32* nocapture readnone %0) {
%2 = load i32, i32* @ECHILD
%3 = tail call i32 @_stub(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ lwgeom_install_default_allocators();
void lwgeom_init_allocators() { lwgeom_install_default_allocators(); }


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

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

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

LLVM IR (-O2):
define void @lwgeom_init_allocators() {
%1 = tail call i32 (...) @lwgeom_install_default_allocators()
ret void
}
/* Variables and functions */
unsigned int RTC_getTicks();
int /*<<< orphan*/ Sleep(int);
void setFps(int fpsWish) {
  static unsigned int fps = 0, fps_count = 0;
  do {
    fps = RTC_getTicks();
    Sleep(1);
  } while (fps < fps_count + fpsWish);
  fps_count = RTC_getTicks();
}


x86 assembly (clang, -O0):
<setFps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <RTC_getTicks@plt>
mov    %eax,0x2efc(%rip)
mov    $0x1,%edi
call   1040 <Sleep@plt>
mov    0x2eec(%rip),%eax
mov    0x2eea(%rip),%ecx
add    -0x4(%rbp),%ecx
cmp    %ecx,%eax
jb     112b <setFps+0xb>
mov    $0x0,%al
call   1030 <RTC_getTicks@plt>
mov    %eax,0x2ed2(%rip)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setFps>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <RTC_getTicks@plt>
mov    %eax,0x2ef7(%rip)
mov    $0x1,%edi
call   1040 <Sleep@plt>
mov    0x2eeb(%rip),%eax
add    %ebx,%eax
cmp    %eax,0x2edf(%rip)
jb     1130 <setFps+0x10>
xor    %eax,%eax
call   1030 <RTC_getTicks@plt>
mov    %eax,0x2ed4(%rip)
pop    %rbx
ret

LLVM IR (-O0):
@setFps.fps = internal global i32 0
@setFps.fps_count = internal global i32 0
define void @setFps(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %6, %1
%4 = call i32 (...) @RTC_getTicks()
store i32 %4, i32* @setFps.fps
%5 = call i32 @Sleep(i32 1)
br label %6
6: ; preds = %3
%7 = load i32, i32* @setFps.fps
%8 = load i32, i32* @setFps.fps_count
%9 = load i32, i32* %2
%10 = add i32 %8, %9
%11 = icmp ult i32 %7, %10
br i1 %11, label %3, label %12
12: ; preds = %6
%13 = call i32 (...) @RTC_getTicks()
store i32 %13, i32* @setFps.fps_count
ret void
}

LLVM IR (-O2):
@setFps.fps = internal unnamed_addr global i32 0
@setFps.fps_count = internal unnamed_addr global i32 0
define void @setFps(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 (...) @RTC_getTicks()
store i32 %3, i32* @setFps.fps
%4 = tail call i32 @Sleep(i32 1)
%5 = load i32, i32* @setFps.fps
%6 = load i32, i32* @setFps.fps_count
%7 = add i32 %6, %0
%8 = icmp ult i32 %5, %7
br i1 %8, label %2, label %9
9: ; preds = %2
%10 = tail call i32 (...) @RTC_getTicks()
store i32 %10, i32* @setFps.fps_count
ret void
}