xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ internal_init_partial_coastline(int /*<<< orphan*/,
                                                   int /*<<< orphan*/, int,
                                                   int);
void init_coastline() { internal_init_partial_coastline(0, 0, 1799, 3600); }


x86 assembly (clang, -O0):
<init_coastline>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    $0x707,%edx
mov    $0xe10,%ecx
mov    %esi,%edi
call   1030 <internal_init_partial_coastline@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_coastline>:
xor    %edi,%edi
xor    %esi,%esi
mov    $0x707,%edx
mov    $0xe10,%ecx
jmp    1030 <internal_init_partial_coastline@plt>

LLVM IR (-O0):
define void @init_coastline() {
%1 = call i32 @internal_init_partial_coastline(i32 0, i32 0, i32 1799, i32 3600)
ret void
}

LLVM IR (-O2):
define void @init_coastline() {
%1 = tail call i32 @internal_init_partial_coastline(i32 0, i32 0, i32 1799, i32 3600)
ret void
}
void segment_init(void) {
  *(volatile unsigned *)0x03ff5000 |= 0x1FC00;
  *(volatile unsigned *)0x03ff5008 |= 0x1FC00;
}


x86 assembly (clang, -O0):
<segment_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3ff5000,%eax
mov    (%rax),%ecx
or     $0x1fc00,%ecx
mov    $0x3ff5000,%eax
mov    %ecx,(%rax)
mov    $0x3ff5008,%eax
mov    (%rax),%ecx
or     $0x1fc00,%ecx
mov    $0x3ff5008,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<segment_init>:
orl    $0x1fc00,0x3ff5000
orl    $0x1fc00,0x3ff5008
ret

LLVM IR (-O0):
define void @segment_init() {
%1 = load volatile i32, i32* inttoptr (i64 67063808 to i32*)
%2 = or i32 %1, 130048
store volatile i32 %2, i32* inttoptr (i64 67063808 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 67063816 to i32*)
%4 = or i32 %3, 130048
store volatile i32 %4, i32* inttoptr (i64 67063816 to i32*)
ret void
}

LLVM IR (-O2):
define void @segment_init() {
%1 = load volatile i32, i32* inttoptr (i64 67063808 to i32*)
%2 = or i32 %1, 130048
store volatile i32 %2, i32* inttoptr (i64 67063808 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 67063816 to i32*)
%4 = or i32 %3, 130048
store volatile i32 %4, i32* inttoptr (i64 67063816 to i32*)
ret void
}
short n(short bz) {
  short pb = 0, Md = 1, ih = 2, sfp = 3, sjs = 4, fo, u = 5, scp = 6, t, gq = 7,
        oh, r = 8, pcf = 9, rs = 10;
  char o = 1, i = 1, l, pc = i, b = r + o / 2, _f = 6, m = 7, s = 8, g, q,
       od = o * rs + 4 ^ s, js = _f;
}


x86 assembly (clang, -O0):
<n>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movw   $0x0,-0x6(%rbp)
movw   $0x1,-0x8(%rbp)
movw   $0x2,-0xa(%rbp)
movw   $0x3,-0xc(%rbp)
movw   $0x4,-0xe(%rbp)
movw   $0x5,-0x12(%rbp)
movw   $0x6,-0x14(%rbp)
movw   $0x7,-0x18(%rbp)
movw   $0x8,-0x1c(%rbp)
movw   $0x9,-0x1e(%rbp)
movw   $0xa,-0x20(%rbp)
movb   $0x1,-0x21(%rbp)
movb   $0x1,-0x22(%rbp)
mov    -0x22(%rbp),%al
mov    %al,-0x24(%rbp)
movswl -0x1c(%rbp),%eax
mov    %eax,-0x30(%rbp)
movsbl -0x21(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x30(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x25(%rbp)
movb   $0x6,-0x26(%rbp)
movb   $0x7,-0x27(%rbp)
movb   $0x8,-0x28(%rbp)
movsbl -0x21(%rbp),%eax
movswl -0x20(%rbp),%ecx
imul   %ecx,%eax
add    $0x4,%eax
movsbl -0x28(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0x2b(%rbp)
mov    -0x26(%rbp),%al
mov    %al,-0x2c(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @n(i16 signext %0) {
%2 = alloca i16
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16
%9 = alloca i16
%10 = alloca i16
%11 = alloca i16
%12 = alloca i16
%13 = alloca i16
%14 = alloca i16
%15 = alloca i16
%16 = alloca i16
%17 = alloca i16
%18 = alloca i8
%19 = alloca i8
%20 = alloca i8
%21 = alloca i8
%22 = alloca i8
%23 = alloca i8
%24 = alloca i8
%25 = alloca i8
%26 = alloca i8
%27 = alloca i8
%28 = alloca i8
%29 = alloca i8
store i16 %0, i16* %3
store i16 0, i16* %4
store i16 1, i16* %5
store i16 2, i16* %6
store i16 3, i16* %7
store i16 4, i16* %8
store i16 5, i16* %10
store i16 6, i16* %11
store i16 7, i16* %13
store i16 8, i16* %15
store i16 9, i16* %16
store i16 10, i16* %17
store i8 1, i8* %18
store i8 1, i8* %19
%30 = load i8, i8* %19
store i8 %30, i8* %21
%31 = load i16, i16* %15
%32 = sext i16 %31 to i32
%33 = load i8, i8* %18
%34 = sext i8 %33 to i32
%35 = sdiv i32 %34, 2
%36 = add nsw i32 %32, %35
%37 = trunc i32 %36 to i8
store i8 %37, i8* %22
store i8 6, i8* %23
store i8 7, i8* %24
store i8 8, i8* %25
%38 = load i8, i8* %18
%39 = sext i8 %38 to i32
%40 = load i16, i16* %17
%41 = sext i16 %40 to i32
%42 = mul nsw i32 %39, %41
%43 = add nsw i32 %42, 4
%44 = load i8, i8* %25
%45 = sext i8 %44 to i32
%46 = xor i32 %43, %45
%47 = trunc i32 %46 to i8
store i8 %47, i8* %28
%48 = load i8, i8* %23
store i8 %48, i8* %29
%49 = load i16, i16* %2
ret i16 %49
}

LLVM IR (-O2):
define signext i16 @n(i16 signext %0) {
ret i16 undef
}
const char *scamper_do_dealias_usage(void) {
  return "dealias [-d dport] [-f fudge] [-m method] [-o replyc] [-O option]\n"
         "        [-p '[-c sum] [-d dp] [-F sp] [-i ip] [-M mtu] [-P meth] [-s "
         "size] [-t ttl]']\n"
         "        [-q attempts] [-r wait-round] [-s sport] [-t ttl]\n"
         "        [-U userid] [-w wait-timeout] [-W wait-probe] [-x exclude]\n";
}


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

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

LLVM IR (-O0):
@.str = [278 x i8] c"dealias [-d dport] [-f fudge] [-m method] [-o replyc] [-O option]\0A [-p '[-c sum] [-d dp] [-F sp] [-i ip] [-M mtu] [-P meth] [-s size] [-t ttl]']\0A [-q attempts] [-r wait-round] [-s sport] [-t ttl]\0A [-U userid] [-w wait-timeout] [-W wait-probe] [-x exclude]\0A\00"
define i8* @scamper_do_dealias_usage() {
ret i8* getelementptr inbounds ([278 x i8], [278 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [278 x i8] c"dealias [-d dport] [-f fudge] [-m method] [-o replyc] [-O option]\0A [-p '[-c sum] [-d dp] [-F sp] [-i ip] [-M mtu] [-P meth] [-s size] [-t ttl]']\0A [-q attempts] [-r wait-round] [-s sport] [-t ttl]\0A [-U userid] [-w wait-timeout] [-W wait-probe] [-x exclude]\0A\00"
define i8* @scamper_do_dealias_usage() {
ret i8* getelementptr inbounds ([278 x i8], [278 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void usage(FILE *fp, int argc, char **argv) {
  fprintf(fp,
          "Usage: %s [options]\n\n"
          "Options:\n"
          "-d | --device name   Video device name [/dev/video]\n"
          "-i | --info          Print this message\n"
          "-w | --width w       Image width\n"
          "-h | --height h      Image height\n"
          "-p | --port h        TCP port\n"
          "-f | --format n      Format 0:MJPEG 1:YUYV\n"
          "-m | --mmap          Use memory mapped buffers\n"
          "-r | --read          Use read() calls\n"
          "-u | --userp         Use application allocated buffers\n"
          "",
          argv[0]);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    (%rdx),%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [403 x i8] c"Usage: %s [options]\0A\0AOptions:\0A-d | --device name Video device name [/dev/video]\0A-i | --info Print this message\0A-w | --width w Image width\0A-h | --height h Image height\0A-p | --port h TCP port\0A-f | --format n Format 0:MJPEG 1:YUYV\0A-m | --mmap Use memory mapped buffers\0A-r | --read Use read() calls\0A-u | --userp Use application allocated buffers\0A\00"
define void @usage(i32* %0, i32 %1, i8** %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8**
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load i32*, i32** %4
%8 = load i8**, i8*** %6
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([403 x i8], [403 x i8]* @.str, i64 0, i64 0), i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [403 x i8] c"Usage: %s [options]\0A\0AOptions:\0A-d | --device name Video device name [/dev/video]\0A-i | --info Print this message\0A-w | --width w Image width\0A-h | --height h Image height\0A-p | --port h TCP port\0A-f | --format n Format 0:MJPEG 1:YUYV\0A-m | --mmap Use memory mapped buffers\0A-r | --read Use read() calls\0A-u | --userp Use application allocated buffers\0A\00"
define void @usage(i32* nocapture %0, i32 %1, i8** nocapture %2) {
%4 = load i8*, i8** %2
%5 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([403 x i8], [403 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
float convert_dist_ft2m(float f) { return (0.3048 * f); }


x86 assembly (clang, -O0):
<convert_dist_ft2m>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_dist_ft2m>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @convert_dist_ft2m(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double 3.048000e-01, %4
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @convert_dist_ft2m(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 3.048000e-01
%4 = fptrunc double %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double shannon(char *);
int main(int argc, char *argv[]) { printf("%f", shannon(argv[1])); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <shannon@plt>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <shannon@plt>
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %6
%8 = call double @shannon(i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call double @shannon(i8* %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/);
__attribute__((no, noclone)) unsigned long f2(unsigned long x,
                                              unsigned long y) {
  unsigned long r = x - y;
  if (r <= y)
    foo(0);
  return r;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
ja     1141 <f2+0x31>
xor    %edi,%edi
call   1030 <foo@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rbx
mov    %rdi,%rbx
sub    %rsi,%rbx
cmp    %rsi,%rbx
ja     1123 <f2+0x13>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @f2(i64 %0, i64 %1) {
%3 = sub i64 %0, %1
%4 = icmp ugt i64 %3, %1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @foo(i32 0)
br label %7
7: ; preds = %5, %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void adc_reg32_reg32(unsigned int reg1, unsigned int reg2) {
  put8(0x11);
  put8(0xC0 | (reg2 << 3) | reg1);
}


x86 assembly (clang, -O0):
<adc_reg32_reg32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x11,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%edi
shl    $0x3,%edi
or     $0xc0,%edi
or     -0x4(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adc_reg32_reg32>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x11,%edi
call   1030 <put8@plt>
shl    $0x3,%ebx
or     %ebp,%ebx
or     $0xc0,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @adc_reg32_reg32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @put8(i32 17)
%6 = load i32, i32* %4
%7 = shl i32 %6, 3
%8 = or i32 192, %7
%9 = load i32, i32* %3
%10 = or i32 %8, %9
%11 = call i32 @put8(i32 %10)
ret void
}

LLVM IR (-O2):
define void @adc_reg32_reg32(i32 %0, i32 %1) {
%3 = tail call i32 @put8(i32 17)
%4 = shl i32 %1, 3
%5 = or i32 %4, %0
%6 = or i32 %5, 192
%7 = tail call i32 @put8(i32 %6)
ret void
}
/* Variables and functions */
bool check_string_buffer_terminated(const char *buf, size_t len) {
  size_t i;
  for (i = 0; i < len; i++) {
    if (buf[i] == '\0') {
      return true;
    }
  }
  return false;
}


x86 assembly (clang, -O0):
<check_string_buffer_terminated>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1159 <check_string_buffer_terminated+0x59>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1143 <check_string_buffer_terminated+0x43>
movl   $0x1,-0x4(%rbp)
jmp    1160 <check_string_buffer_terminated+0x60>
jmp    1148 <check_string_buffer_terminated+0x48>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1114 <check_string_buffer_terminated+0x14>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_string_buffer_terminated>:
test   %rsi,%rsi
je     111f <check_string_buffer_terminated+0x1f>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
je     1122 <check_string_buffer_terminated+0x22>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <check_string_buffer_terminated+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @check_string_buffer_terminated(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %6
4: ; preds = %6
%5 = icmp eq i64 %11, %1
br i1 %5, label %12, label %6
6: ; preds = %2, %4
%7 = phi i64 [ %11, %4 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
%11 = add nuw i64 %7, 1
br i1 %10, label %12, label %4
12: ; preds = %6, %4, %2
%13 = phi i32 [ 0, %2 ], [ 0, %4 ], [ 1, %6 ]
ret i32 %13
}
int main() {
  int i;
  i = 0;
  while (i < 0) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1121 <main+0x21>
jmp    1112 <main+0x12>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3
br label %3
7: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sum(short *, int);
int main(void) {
  short arr1[] = {10, -2, 3, 1};
  short arr2[] = {5, 4, -100};
  printf("%hd\n", sum(arr1, sizeof arr1 / sizeof *arr1 - 1));
  printf("%hd\n", sum(arr2, sizeof arr2 / sizeof *arr2 - 1));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x12(%rbp)
mov    0xec2(%rip),%ax
mov    %ax,-0xe(%rbp)
lea    -0xc(%rbp),%rdi
mov    $0x3,%esi
call   1040 <sum@plt>
mov    %eax,%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
lea    -0x12(%rbp),%rdi
mov    $0x2,%esi
call   1040 <sum@plt>
mov    %eax,%esi
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x10003fffe000a,%rax
mov    %rax,0x8(%rsp)
movzwl 0xec9(%rip),%eax
mov    %ax,0x4(%rsp)
mov    0xeba(%rip),%eax
mov    %eax,(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x3,%esi
call   1040 <sum@plt>
lea    0xea7(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rsp,%rdi
mov    $0x2,%esi
call   1040 <sum@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr1 = [4 x i16] [i16 10, i16 -2, i16 3, i16 1]
@__const.main.arr2 = [3 x i16] [i16 5, i16 4, i16 -100]
@.str = [5 x i8] c"%hd\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i16]
%3 = alloca [3 x i16]
store i32 0, i32* %1
%4 = bitcast [4 x i16]* %2 to i8*
%5 = bitcast [3 x i16]* %3 to i8*
%6 = getelementptr inbounds [4 x i16], [4 x i16]* %2, i64 0, i64 0
%7 = call i32 @sum(i16* %6, i32 3)
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds [3 x i16], [3 x i16]* %3, i64 0, i64 0
%10 = call i32 @sum(i16* %9, i32 2)
%11 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr2 = [3 x i16] [i16 5, i16 4, i16 -100]
@.str = [5 x i8] c"%hd\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca [3 x i16]
%3 = bitcast i64* %1 to i8*
store i64 281492156448778, i64* %1
%4 = bitcast [3 x i16]* %2 to i8*
%5 = bitcast i64* %1 to i16*
%6 = call i32 @sum(i16* %5, i32 3)
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [3 x i16], [3 x i16]* %2, i64 0, i64 0
%9 = call i32 @sum(i16* %8, i32 2)
%10 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}
int cmp_int(const void *a, const void *b) {
  int ia = *(int *)a;
  int ib = *(int *)b;
  return ia - ib;
}


x86 assembly (clang, -O0):
<cmp_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_int>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @cmp_int(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 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = sub nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @cmp_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
float flt_test(float a, float b, float c, float d) { return (a > b) ? c : d; }


x86 assembly (clang, -O0):
<flt_test>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1136 <flt_test+0x36>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1140 <flt_test+0x40>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<flt_test>:
cmpltss %xmm0,%xmm1
andps  %xmm1,%xmm2
andnps %xmm3,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @flt_test(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = load float, float* %6
%11 = fcmp ogt float %9, %10
br i1 %11, label %12, label %14
12: ; preds = %4
%13 = load float, float* %7
br label %16
14: ; preds = %4
%15 = load float, float* %8
br label %16
16: ; preds = %14, %12
%17 = phi float [ %13, %12 ], [ %15, %14 ]
ret float %17
}

LLVM IR (-O2):
define float @flt_test(float %0, float %1, float %2, float %3) {
%5 = fcmp ogt float %0, %1
%6 = select i1 %5, float %2, float %3
ret float %6
}
/* Variables and functions */
scalar_t__ malloc(int);
unsigned char **uniqueiv_init(void) {
  int i;
  unsigned char **uiv_root =
      (unsigned char **)malloc(256 * sizeof(unsigned char *));
  if (uiv_root == NULL)
    return (NULL);
  for (i = 0; i < 256; ++i)
    uiv_root[i] = NULL;
  return (uiv_root);
}


x86 assembly (clang, -O0):
<uniqueiv_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x800,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    113e <uniqueiv_init+0x2e>
movq   $0x0,-0x8(%rbp)
jmp    1178 <uniqueiv_init+0x68>
movl   $0x0,-0xc(%rbp)
cmpl   $0x100,-0xc(%rbp)
jge    1170 <uniqueiv_init+0x60>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1145 <uniqueiv_init+0x35>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uniqueiv_init>:
push   %rbx
mov    $0x800,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1144 <uniqueiv_init+0x24>
mov    %rax,%rbx
mov    $0x800,%edx
mov    %rax,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
jmp    1146 <uniqueiv_init+0x26>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8** @uniqueiv_init() {
%1 = tail call i64 @malloc(i32 2048)
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = inttoptr i64 %1 to i8**
%5 = inttoptr i64 %1 to i8*
br label %6
6: ; preds = %3, %0
%7 = phi i8** [ null, %0 ], [ %4, %3 ]
ret i8** %7
}
void mr97311_shutdown(struct usb_spca50x *spca50x) {}


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

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

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

LLVM IR (-O2):
%struct.usb_spca50x = type opaque
define void @mr97311_shutdown(%struct.usb_spca50x* nocapture %0) {
ret void
}
void av_mul_i() {}


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

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

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

LLVM IR (-O2):
define void @av_mul_i() {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t update_seq_num(uint8_t *old_seq_num) {
  (*old_seq_num == 255) ? *old_seq_num = 0 : (*old_seq_num)++;
  return *old_seq_num;
}


x86 assembly (clang, -O0):
<update_seq_num>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0xff,(%rax)
jne    1127 <update_seq_num+0x27>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
jmp    1132 <update_seq_num+0x32>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_seq_num>:
mov    (%rdi),%ecx
lea    0x1(%rcx),%edx
xor    %eax,%eax
cmp    $0xff,%ecx
cmovne %edx,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define i32 @update_seq_num(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 255
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32*, i32** %2
store i32 0, i32* %7
br label %12
8: ; preds = %1
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
%11 = add nsw i32 %10, 1
store i32 %11, i32* %9
br label %12
12: ; preds = %8, %6
%13 = phi i32 [ 0, %6 ], [ %10, %8 ]
%14 = load i32*, i32** %2
%15 = load i32, i32* %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @update_seq_num(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 255
%4 = add nsw i32 %2, 1
%5 = select i1 %3, i32 0, i32 %4
store i32 %5, i32* %0
ret i32 %5
}
int getcapn(const char *cap) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @getcapn(i8* nocapture readnone %0) {
ret i32 -1
}
void g_async_queue_unref() {}


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

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

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

LLVM IR (-O2):
define void @g_async_queue_unref() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint8_t;

/* Variables and functions */
uint8_t joy_swap(uint8_t data) {
  volatile int lag;
  (*(volatile uint8_t *)(0x00000000 + 0x1F801040)) = data;
  for (lag = 0; lag < 300; lag++) {
  }
  uint8_t v = (*(volatile uint8_t *)(0x00000000 + 0x1F801040));
  return v;
}


x86 assembly (clang, -O0):
<joy_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1f801040,%eax
mov    %ecx,(%rax)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    $0x12c,%eax
jge    1139 <joy_swap+0x39>
jmp    112b <joy_swap+0x2b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1118 <joy_swap+0x18>
mov    $0x1f801040,%eax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<joy_swap>:
mov    %edi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
mov    %eax,0x1f801040
movl   $0x0,-0xc(%rsp)
mov    -0xc(%rsp),%eax
cmp    $0x12b,%eax
jg     1140 <joy_swap+0x40>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
addl   $0x1,-0xc(%rsp)
mov    -0xc(%rsp),%eax
cmp    $0x12c,%eax
jl     1130 <joy_swap+0x30>
mov    0x1f801040,%eax
mov    %eax,-0x8(%rsp)
mov    -0x8(%rsp),%eax
ret

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

LLVM IR (-O2):
define i32 @joy_swap(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store volatile i32 %0, i32* %2
%5 = bitcast i32* %3 to i8*
%6 = load volatile i32, i32* %2
store volatile i32 %6, i32* inttoptr (i64 528486464 to i32*)
store volatile i32 0, i32* %3
%7 = load volatile i32, i32* %3
%8 = icmp slt i32 %7, 300
br i1 %8, label %9, label %14
9: ; preds = %1, %9
%10 = load volatile i32, i32* %3
%11 = add nsw i32 %10, 1
store volatile i32 %11, i32* %3
%12 = load volatile i32, i32* %3
%13 = icmp slt i32 %12, 300
br i1 %13, label %9, label %14
14: ; preds = %9, %1
%15 = bitcast i32* %4 to i8*
%16 = load volatile i32, i32* inttoptr (i64 528486464 to i32*)
store volatile i32 %16, i32* %4
%17 = load volatile i32, i32* %4
ret i32 %17
}
void fdc_indexpulse() {}


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

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

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

LLVM IR (-O2):
define void @fdc_indexpulse() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ open_http_server();
scalar_t__ parseOpts(int, char **);
int /*<<< orphan*/ printUsage();
int main(int argc, char **argv) {
  if (parseOpts(argc, argv)) {
    printUsage();
    return 1;
  }
  open_http_server();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <parseOpts@plt>
cmp    $0x0,%rax
je     116f <main+0x3f>
mov    $0x0,%al
call   1050 <printUsage@plt>
movl   $0x1,-0x4(%rbp)
jmp    117d <main+0x4d>
mov    $0x0,%al
call   1040 <open_http_server@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
call   1030 <parseOpts@plt>
test   %rax,%rax
je     1149 <main+0x19>
xor    %eax,%eax
call   1050 <printUsage@plt>
mov    $0x1,%ebx
jmp    1152 <main+0x22>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <open_http_server@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i64 @parseOpts(i32 %0, i8** %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (...) @printUsage()
br label %9
7: ; preds = %2
%8 = tail call i32 (...) @open_http_server()
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ 1, %5 ], [ 0, %7 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int strlen(char *);
char *getNewString(char *value) {
  int size = strlen(value) + 3;
  char *result = (char *)malloc(size);
  snprintf(result, size, "\"%s\"", value);
  free(value);
  return result;
}


x86 assembly (clang, -O0):
<getNewString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x3,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rcx
lea    0xe87(%rip),%rdx
call   1050 <snprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNewString>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x3(%rax),%ebp
mov    %ebp,%edi
call   1060 <malloc@plt>
mov    %rax,%r14
lea    0xea0(%rip),%rdx
mov    %rax,%rdi
mov    %ebp,%esi
mov    %rbx,%rcx
call   1050 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\22%s\22\00"
define i8* @getNewString(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 3
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i32, i32* %3
%13 = load i8*, i8** %2
%14 = call i32 @snprintf(i8* %11, i32 %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = load i8*, i8** %2
%16 = call i32 @free(i8* %15)
%17 = load i8*, i8** %4
ret i8* %17
}

LLVM IR (-O2):
@.str = [5 x i8] c"\22%s\22\00"
define i8* @getNewString(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 3
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @snprintf(i8* %5, i32 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = tail call i32 @free(i8* %0)
ret i8* %5
}
/* Type definitions */
struct delayed_work {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cancel_delayed_work_sync(struct delayed_work *);
void cancel_rearming_delayed_work(struct delayed_work *work) {
  cancel_delayed_work_sync(work);
}


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

x86 assembly (clang, -O2):
<cancel_rearming_delayed_work>:
jmp    1030 <cancel_delayed_work_sync@plt>

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

LLVM IR (-O2):
%struct.delayed_work = type { i32 }
define void @cancel_rearming_delayed_work(%struct.delayed_work* %0) {
%2 = tail call i32 @cancel_delayed_work_sync(%struct.delayed_work* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t get_u32(const void *buf) {
  const uint8_t *p = buf;
  return ((uint32_t)p[3] + ((uint32_t)p[2] << 8) + ((uint32_t)p[1] << 16) +
          ((uint32_t)p[0] << 24));
}


x86 assembly (clang, -O0):
<get_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    -0x10(%rbp),%rcx
mov    0x10(%rcx),%rcx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
shl    $0x18,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_u32>:
mov    0x10(%rdi),%ecx
shl    $0x8,%ecx
add    0x18(%rdi),%ecx
mov    (%rdi),%eax
mov    0x8(%rdi),%edx
shl    $0x10,%edx
add    %ecx,%edx
shl    $0x18,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @get_u32(i8* %0) {
%2 = alloca i8*
%3 = alloca i64*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i64*
store i64* %5, i64** %3
%6 = load i64*, i64** %3
%7 = getelementptr inbounds i64, i64* %6, i64 3
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = load i64*, i64** %3
%11 = getelementptr inbounds i64, i64* %10, i64 2
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
%14 = shl i32 %13, 8
%15 = add nsw i32 %9, %14
%16 = load i64*, i64** %3
%17 = getelementptr inbounds i64, i64* %16, i64 1
%18 = load i64, i64* %17
%19 = trunc i64 %18 to i32
%20 = shl i32 %19, 16
%21 = add nsw i32 %15, %20
%22 = load i64*, i64** %3
%23 = getelementptr inbounds i64, i64* %22, i64 0
%24 = load i64, i64* %23
%25 = trunc i64 %24 to i32
%26 = shl i32 %25, 24
%27 = add nsw i32 %21, %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @get_u32(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = getelementptr inbounds i8, i8* %0, i64 24
%4 = bitcast i8* %3 to i64*
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = getelementptr inbounds i8, i8* %0, i64 16
%8 = bitcast i8* %7 to i64*
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = shl i32 %10, 8
%12 = add nsw i32 %11, %6
%13 = getelementptr inbounds i8, i8* %0, i64 8
%14 = bitcast i8* %13 to i64*
%15 = load i64, i64* %14
%16 = trunc i64 %15 to i32
%17 = shl i32 %16, 16
%18 = add nsw i32 %12, %17
%19 = load i64, i64* %2
%20 = trunc i64 %19 to i32
%21 = shl i32 %20, 24
%22 = add nsw i32 %18, %21
ret i32 %22
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_CLR(int, int /*<<< orphan*/ *);
void llio_fd_clr(int fd, fd_set *set) { FD_CLR(fd, set); }


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

x86 assembly (clang, -O2):
<llio_fd_clr>:
jmp    1030 <FD_CLR@plt>

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

LLVM IR (-O2):
define void @llio_fd_clr(i32 %0, i32* %1) {
%3 = tail call i32 @FD_CLR(i32 %0, i32* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ GPIODirModeSet(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ GPIOPadConfigSet(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                    int);
void GPIOPinTypeLEDSeq(uint32_t ui32Port, uint8_t ui8Pins) {
  ;
  GPIODirModeSet(ui32Port, ui8Pins, 0x00000002);
  GPIOPadConfigSet(ui32Port, ui8Pins, 0x00000066, 0x00000008);
}


x86 assembly (clang, -O0):
<GPIOPinTypeLEDSeq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x2,%edx
call   1040 <GPIODirModeSet@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x66,%edx
mov    $0x8,%ecx
call   1030 <GPIOPadConfigSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinTypeLEDSeq>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x2,%edx
call   1040 <GPIODirModeSet@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x66,%edx
mov    $0x8,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <GPIOPadConfigSet@plt>

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

LLVM IR (-O2):
define void @GPIOPinTypeLEDSeq(i32 %0, i32 %1) {
%3 = tail call i32 @GPIODirModeSet(i32 %0, i32 %1, i32 2)
%4 = tail call i32 @GPIOPadConfigSet(i32 %0, i32 %1, i32 102, i32 8)
ret void
}
/* Type definitions */
struct timeval {
  unsigned long long tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned long long os_usecs(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return ((unsigned long long)tv.tv_sec * 1000000 + tv.tv_usec);
}


x86 assembly (clang, -O0):
<os_usecs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x8(%rbp),%rax
add    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_usecs>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x10(%rsp),%rax
add    0x8(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @os_usecs() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = mul i64 %4, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = add i64 %5, %7
ret i64 %8
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @os_usecs() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = add i64 %6, %8
ret i64 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vsnprintf(char *, size_t, char *, int /*<<< orphan*/);
int log_vsnprintf(char *out, size_t taille, char *format, va_list arguments) {
  return vsnprintf(out, taille, format, arguments);
}


x86 assembly (clang, -O0):
<log_vsnprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <vsnprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_vsnprintf>:
jmp    1030 <vsnprintf@plt>

LLVM IR (-O0):
define i32 @log_vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @vsnprintf(i8* %9, i64 %10, i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @log_vsnprintf(i8* nocapture %0, i64 %1, i8* nocapture %2, i32 %3) {
%5 = tail call i32 @vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int dup(int);
int c_dup(int oldfd) { return dup(oldfd); }


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

x86 assembly (clang, -O2):
<c_dup>:
jmp    1030 <dup@plt>

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

LLVM IR (-O2):
define i32 @c_dup(i32 %0) {
%2 = tail call i32 @dup(i32 %0)
ret i32 %2
}
/* Variables and functions */
int floor(float);
float roundToThousandths(float number) {
  return floor(number * 1000 + .5) / 1000;
}


x86 assembly (clang, -O0):
<roundToThousandths>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xee3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeca(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <floor@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundToThousandths>:
push   %rax
mulss  0xee7(%rip),%xmm0
addss  0xee3(%rip),%xmm0
call   1030 <floor@plt>
cltq
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @roundToThousandths(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 1.000000e+03
%5 = fpext float %4 to double
%6 = fadd double %5, 5.000000e-01
%7 = fptrunc double %6 to float
%8 = call i32 @floor(float %7)
%9 = sdiv i32 %8, 1000
%10 = sitofp i32 %9 to float
ret float %10
}

LLVM IR (-O2):
define float @roundToThousandths(float %0) {
%2 = fmul float %0, 1.000000e+03
%3 = fadd float %2, 5.000000e-01
%4 = tail call i32 @floor(float %3)
%5 = sdiv i32 %4, 1000
%6 = sitofp i32 %5 to float
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_socket_cloexec() {
  printf("NOT IMPLEMENTED:"
         "pa_socket_cloexec"
         "\n");
}


x86 assembly (clang, -O0):
<pa_socket_cloexec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [35 x i8] c"NOT IMPLEMENTED:pa_socket_cloexec\0A\00"
define i32 @pa_socket_cloexec() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [34 x i8] c"NOT IMPLEMENTED:pa_socket_cloexec\00"
define i32 @pa_socket_cloexec() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ error(char *, char const *);
void progerr(const char *s) { error("program error ", s); }


x86 assembly (clang, -O0):
<progerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<progerr>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <error@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"program error \00"
define void @progerr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @error(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"program error \00"
define void @progerr(i8* %0) {
%2 = tail call i32 @error(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int checkAUTH() {}


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

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

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

LLVM IR (-O2):
define i32 @checkAUTH() {
ret i32 undef
}