xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int min(void *a, void *b) {
  assert(a && "Expected non-NULL element in comparitor");
  assert(b && "Expected non-NULL element in comparitor");
  return (*(int *)a - *(int *)b);
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     113a <min+0x2a>
mov    $0x1,%al
mov    %al,-0x11(%rbp)
jmp    113a <min+0x2a>
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x12(%rbp)
je     1161 <min+0x51>
mov    $0x1,%al
mov    %al,-0x12(%rbp)
jmp    1161 <min+0x51>
mov    -0x12(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1030 <assert@plt>
mov    (%rbx),%eax
sub    (%r14),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Expected non-NULL element in comparitor\00"
define i32 @min(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %2
br label %8
8: ; preds = %7, %2
%9 = phi i1 [ false, %2 ], [ true, %7 ]
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i8*, i8** %4
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %15
14: ; preds = %8
br label %15
15: ; preds = %14, %8
%16 = phi i1 [ false, %8 ], [ true, %14 ]
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = load i8*, i8** %3
%20 = bitcast i8* %19 to i32*
%21 = load i32, i32* %20
%22 = load i8*, i8** %4
%23 = bitcast i8* %22 to i32*
%24 = load i32, i32* %23
%25 = sub nsw i32 %21, %24
ret i32 %25
}

LLVM IR (-O2):
define i32 @min(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp ne i8* %1, null
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = bitcast i8* %0 to i32*
%10 = load i32, i32* %9
%11 = bitcast i8* %1 to i32*
%12 = load i32, i32* %11
%13 = sub nsw i32 %10, %12
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "httpd [-t] port [path]\n");
  exit(EX_USAGE);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"httpd [-t] port [path]\0A\00"
@EX_USAGE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"httpd [-t] port [path]\0A\00"
@EX_USAGE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
void XtAddConverter() {}


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

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

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

LLVM IR (-O2):
define void @XtAddConverter() {
ret void
}
void RTStrStripL(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrStripL() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glLineWidth(float);
void LineWidth(float w) { glLineWidth(w); }


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

x86 assembly (clang, -O2):
<LineWidth>:
jmp    1030 <glLineWidth@plt>

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

LLVM IR (-O2):
define void @LineWidth(float %0) {
%2 = tail call i32 @glLineWidth(float %0)
ret void
}
char *csoundLocalizeString(const char *s) { return (char *)s; }


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

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

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

LLVM IR (-O2):
define i8* @csoundLocalizeString(i8* readnone returned %0) {
ret i8* %0
}
unsigned char hexval(unsigned char v) {
  switch (v) {
  case '0' ... '9':
    return v - '0';
  case 'a' ... 'f':
    return v - 'a' + 10;
  case 'A' ... 'F':
    return v - 'A' + 10;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<hexval>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
add    $0xffffffd0,%eax
sub    $0xa,%eax
jb     114a <hexval+0x4a>
jmp    1122 <hexval+0x22>
mov    -0x8(%rbp),%eax
add    $0xffffffbf,%eax
sub    $0x6,%eax
jb     116b <hexval+0x6b>
jmp    1136 <hexval+0x36>
mov    -0x8(%rbp),%eax
add    $0xffffff9f,%eax
sub    $0x6,%eax
jb     1159 <hexval+0x59>
jmp    117d <hexval+0x7d>
movzbl -0x2(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1181 <hexval+0x81>
movzbl -0x2(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %al,-0x1(%rbp)
jmp    1181 <hexval+0x81>
movzbl -0x2(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %al,-0x1(%rbp)
jmp    1181 <hexval+0x81>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexval>:
add    $0xd0,%dil
cmp    $0x36,%dil
ja     1119 <hexval+0x19>
movsbq %dil,%rax
lea    0xeeb(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define zeroext i8 @hexval(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
switch i32 %5, label %23 [
i32 48, label %6
i32 49, label %6
i32 50, label %6
i32 51, label %6
i32 52, label %6
i32 53, label %6
i32 54, label %6
i32 55, label %6
i32 56, label %6
i32 57, label %6
i32 97, label %11
i32 98, label %11
i32 99, label %11
i32 100, label %11
i32 101, label %11
i32 102, label %11
i32 65, label %17
i32 66, label %17
i32 67, label %17
i32 68, label %17
i32 69, label %17
i32 70, label %17
]
6: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
%7 = load i8, i8* %3
%8 = zext i8 %7 to i32
%9 = sub nsw i32 %8, 48
%10 = trunc i32 %9 to i8
store i8 %10, i8* %2
br label %24
11: ; preds = %1, %1, %1, %1, %1, %1
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = sub nsw i32 %13, 97
%15 = add nsw i32 %14, 10
%16 = trunc i32 %15 to i8
store i8 %16, i8* %2
br label %24
17: ; preds = %1, %1, %1, %1, %1, %1
%18 = load i8, i8* %3
%19 = zext i8 %18 to i32
%20 = sub nsw i32 %19, 65
%21 = add nsw i32 %20, 10
%22 = trunc i32 %21 to i8
store i8 %22, i8* %2
br label %24
23: ; preds = %1
store i8 0, i8* %2
br label %24
24: ; preds = %23, %17, %11, %6
%25 = load i8, i8* %2
ret i8 %25
}

LLVM IR (-O2):
@switch.table.hexval = [55 x i8] c"\00\01\02\03\04\05\06\07\08\09\00\00\00\00\00\00\00\0A\0B\0C\0D\0E\0F\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\0A\0B\0C\0D\0E\0F"
define zeroext i8 @hexval(i8 zeroext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 55
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i8 %2 to i64
%6 = getelementptr inbounds [55 x i8], [55 x i8]* @switch.table.hexval, i64 0, i64 %5
%7 = load i8, i8* %6
br label %8
8: ; preds = %4, %1
%9 = phi i8 [ 0, %1 ], [ %7, %4 ]
ret i8 %9
}
double jiffiesToSeconds(double jiffies) { return jiffies * (1.0 / 32768.0); }


x86 assembly (clang, -O0):
<jiffiesToSeconds>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<jiffiesToSeconds>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @jiffiesToSeconds(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x3F00000000000000
ret double %4
}

LLVM IR (-O2):
define double @jiffiesToSeconds(double %0) {
%2 = fmul double %0, 0x3F00000000000000
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x5c() {
  Assert_real((iscntrl(92) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              465, ("iscntrl should be 0 for 0x5c"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0x5c>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5c,%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x1d1,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0x5c>:
push   %rax
mov    $0x5c,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1d1,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0x5c\00"
define void @t_iscntrl_0x5c() {
%1 = tail call i64 @iscntrl(i32 92)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 465, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int path_036_expected_2(int y) {
  int x;
  for (x = 0; x < y; x++) {
    break;
    if (x) {
    } else {
    }
  }
  return x;
}


x86 assembly (clang, -O0):
<path_036_expected_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    111f <path_036_expected_2+0x1f>
jmp    111f <path_036_expected_2+0x1f>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @path_036_expected_2(i32 %0) {
ret i32 0
}
/* Type definitions */
struct Patch {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ set_audio_patch_attributes(struct Patch *, void *);
void AUDIO_InitPatch(struct Patch *patch, void *patchdata) {
  set_audio_patch_attributes(patch, patchdata);
}


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

x86 assembly (clang, -O2):
<AUDIO_InitPatch>:
jmp    1030 <set_audio_patch_attributes@plt>

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

LLVM IR (-O2):
%struct.Patch = type { i32 }
define void @AUDIO_InitPatch(%struct.Patch* %0, i8* %1) {
%3 = tail call i32 @set_audio_patch_attributes(%struct.Patch* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void b_putchar_32(int idx, int *cells, int size) { putchar(cells[idx]); }


x86 assembly (clang, -O0):
<b_putchar_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_putchar_32>:
movslq %edi,%rax
mov    (%rsi,%rax,4),%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @b_putchar_32(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %5
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
%11 = load i32, i32* %10
%12 = call i32 @putchar(i32 %11)
ret void
}

LLVM IR (-O2):
define void @b_putchar_32(i32 %0, i32* nocapture %1, i32 %2) {
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds i32, i32* %1, i64 %4
%6 = load i32, i32* %5
%7 = tail call i32 @putchar(i32 %6)
ret void
}
int g(double x) { return x; }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @g(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @g(double %0) {
%2 = fptosi double %0 to i32
ret i32 %2
}
int arraySearch(int array[], int size, int needle) {
  for (int i = 0; i < size; i++) {
    if (array[i] == needle) {
      return i;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<arraySearch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1153 <arraySearch+0x53>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1140 <arraySearch+0x40>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <arraySearch+0x5a>
jmp    1145 <arraySearch+0x45>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <arraySearch+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arraySearch>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111e <arraySearch+0x1e>
mov    %esi,%esi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edx,(%rdi,%rcx,4)
je     111f <arraySearch+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <arraySearch+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @arraySearch(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
int need_bs_quote(char c) { return (c == '\'' || c == '!'); }


x86 assembly (clang, -O0):
<need_bs_quote>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x27,%ecx
mov    %al,-0x2(%rbp)
je     1129 <need_bs_quote+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x21,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<need_bs_quote>:
cmp    $0x27,%dil
sete   %al
cmp    $0x21,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @need_bs_quote(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 39
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 33
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @need_bs_quote(i8 signext %0) {
%2 = icmp eq i8 %0, 39
%3 = icmp eq i8 %0, 33
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Run 'tests', not this file.\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 = [29 x i8] c"Run 'tests', not this file.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [28 x i8] c"Run 'tests', not this file.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void ff_hevc_put_hevc_uni_epel_v16_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_v16_8_sse4() {
ret void
}
void glGenBuffers(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGenBuffers() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ core_test();
int main(int argc, char *argv[]) {
  core_test();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @core_test()
ret i32 0
}
int producerinit(int tid) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @producerinit(i32 %0) {
ret i32 0
}
/* Variables and functions */
int foo();
void main(void) {
  int x;
  int y;
  x = y + foo();
}


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

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %2
%4 = call i32 (...) @foo()
%5 = add nsw i32 %3, %4
store i32 %5, i32* %1
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @foo()
ret void
}
void rop3_235_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T ^ S;
  stk2 = ~stk2;
  stk1 = *D | stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_235_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_235_0_1>:
mov    %esi,%eax
xor    %dl,%al
not    %al
mov    (%rdi),%r8b
or     %r8b,%al
mov    %edx,%ecx
not    %cl
or     %sil,%cl
and    %al,%cl
not    %sil
and    %dl,%sil
and    %r8b,%sil
or     %cl,%sil
mov    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_235_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, %2
%5 = xor i8 %4, -1
%6 = load i8, i8* %0
%7 = or i8 %6, %5
%8 = xor i8 %2, -1
%9 = or i8 %8, %1
%10 = and i8 %7, %9
%11 = xor i8 %1, -1
%12 = and i8 %11, %2
%13 = and i8 %12, %6
%14 = or i8 %10, %13
store i8 %14, i8* %0
ret void
}
int fun1307() { return 1307; }


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

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

LLVM IR (-O0):
define i32 @fun1307() {
ret i32 1307
}

LLVM IR (-O2):
define i32 @fun1307() {
ret i32 1307
}
/* Type definitions */
typedef int /*<<< orphan*/ args;

/* Variables and functions */
int spawn(int, char **);
int main(int argc, char *argv[]) {
  char *args[] = {"pg", "/fat-dragon/lib/resh/resh-help", NULL};
  return (spawn((sizeof(args) / sizeof((args)[0])) - 1, args));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2cd3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0x2cd0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0x2ccd(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    -0x30(%rbp),%rsi
mov    $0x2,%edi
call   1030 <spawn@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0x2cf5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0x2cd9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x2,%edi
call   1030 <spawn@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"pg\00"
@.str.1 = [31 x i8] c"/fat-dragon/lib/resh/resh-help\00"
@__const.main.args = [3 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i32 0, i32 0), i8* null]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [3 x i8*]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [3 x i8*]* %6 to i8*
%8 = getelementptr inbounds [3 x i8*], [3 x i8*]* %6, i64 0, i64 0
%9 = call i32 @spawn(i32 2, i8** %8)
ret i32 %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"pg\00"
@.str.1 = [31 x i8] c"/fat-dragon/lib/resh/resh-help\00"
@__const.main.args = [3 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i32 0, i32 0), i8* null]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [3 x i8*]
%4 = bitcast [3 x i8*]* %3 to i8*
%5 = getelementptr inbounds [3 x i8*], [3 x i8*]* %3, i64 0, i64 0
%6 = call i32 @spawn(i32 2, i8** %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void Error(char *message) {
  printf("\n%s\n", message);
  exit(-1);
}


x86 assembly (clang, -O0):
<Error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"\0A%s\0A\00"
define void @Error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ log_set_callback(void (*)(int const, char const *));
__attribute__((visibility("default"))) void
louis_set_log_callback(void (*callback)(const int level, const char *message)) {
  log_set_callback(callback);
}


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

x86 assembly (clang, -O2):
<louis_set_log_callback>:
jmp    1030 <log_set_callback@plt>

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

LLVM IR (-O2):
define void @louis_set_log_callback(void (i32, i8*)* %0) {
%2 = tail call i32 @log_set_callback(void (i32, i8*)* %0)
ret void
}
/* Type definitions */
struct memorycontainer {
  int dummy;
};

/* Variables and functions */
struct memorycontainer *createExpression(int, struct memorycontainer *,
                                         struct memorycontainer *);
struct memorycontainer *
createLtExpression(struct memorycontainer *expression1,
                   struct memorycontainer *expression2) {
  return createExpression(0x0007, expression1, expression2);
}


x86 assembly (clang, -O0):
<createLtExpression>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x7,%edi
call   1030 <createExpression@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createLtExpression>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x7,%edi
jmp    1030 <createExpression@plt>

LLVM IR (-O0):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createLtExpression(%struct.memorycontainer* %0, %struct.memorycontainer* %1) {
%3 = alloca %struct.memorycontainer*
%4 = alloca %struct.memorycontainer*
store %struct.memorycontainer* %0, %struct.memorycontainer** %3
store %struct.memorycontainer* %1, %struct.memorycontainer** %4
%5 = load %struct.memorycontainer*, %struct.memorycontainer** %3
%6 = load %struct.memorycontainer*, %struct.memorycontainer** %4
%7 = call %struct.memorycontainer* @createExpression(i32 7, %struct.memorycontainer* %5, %struct.memorycontainer* %6)
ret %struct.memorycontainer* %7
}

LLVM IR (-O2):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createLtExpression(%struct.memorycontainer* %0, %struct.memorycontainer* %1) {
%3 = tail call %struct.memorycontainer* @createExpression(i32 7, %struct.memorycontainer* %0, %struct.memorycontainer* %1)
ret %struct.memorycontainer* %3
}
int sem_timedwait() {
  ;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @sem_timedwait() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
__attribute__((weak)) int _kill(int pid, int sig) {
  do {
    (void)(pid);
  } while (0);
  do {
    (void)(sig);
  } while (0);
  errno = EINVAL;
  return (-1);
}


x86 assembly (clang, -O0):
<_kill>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
jmp    110f <_kill+0xf>
mov    0x2ec2(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec1(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_kill>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@errno = global i32 0
define weak i32 @_kill(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %5
5: ; preds = %2
%6 = load i32, i32* %3
br label %7
7: ; preds = %5
br label %8
8: ; preds = %7
%9 = load i32, i32* %4
br label %10
10: ; preds = %8
%11 = load i32, i32* @EINVAL
store i32 %11, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EINVAL = global i32 0
@errno = global i32 0
define weak i32 @_kill(i32 %0, i32 %1) {
%3 = load i32, i32* @EINVAL
store i32 %3, i32* @errno
ret i32 -1
}
unsigned ZWRAP_swap32(unsigned in) { return __builtin_bswap32(in); }


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

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

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

LLVM IR (-O2):
define i32 @ZWRAP_swap32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Type definitions */
struct hdr_histogram {
  int dummy;
};
typedef int /*<<< orphan*/ int64_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ counts_get_direct(struct hdr_histogram const *,
                                     int /*<<< orphan*/);
int /*<<< orphan*/ normalize_index(struct hdr_histogram const *,
                                   int /*<<< orphan*/);
int64_t counts_get_normalised(const struct hdr_histogram *h, int32_t index) {
  return counts_get_direct(h, normalize_index(h, index));
}


x86 assembly (clang, -O0):
<counts_get_normalised>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <normalize_index@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1030 <counts_get_direct@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<counts_get_normalised>:
push   %rbx
mov    %rdi,%rbx
call   1040 <normalize_index@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <counts_get_direct@plt>

LLVM IR (-O0):
%struct.hdr_histogram = type { i32 }
define i32 @counts_get_normalised(%struct.hdr_histogram* %0, i32 %1) {
%3 = alloca %struct.hdr_histogram*
%4 = alloca i32
store %struct.hdr_histogram* %0, %struct.hdr_histogram** %3
store i32 %1, i32* %4
%5 = load %struct.hdr_histogram*, %struct.hdr_histogram** %3
%6 = load %struct.hdr_histogram*, %struct.hdr_histogram** %3
%7 = load i32, i32* %4
%8 = call i32 @normalize_index(%struct.hdr_histogram* %6, i32 %7)
%9 = call i32 @counts_get_direct(%struct.hdr_histogram* %5, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.hdr_histogram = type { i32 }
define i32 @counts_get_normalised(%struct.hdr_histogram* %0, i32 %1) {
%3 = tail call i32 @normalize_index(%struct.hdr_histogram* %0, i32 %1)
%4 = tail call i32 @counts_get_direct(%struct.hdr_histogram* %0, i32 %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ wiznetRegWriteWord(int /*<<< orphan*/, int,
                                      int /*<<< orphan*/);
void wiznetSetSocketSourcePort(uint8_t socket, uint16_t port) {
  wiznetRegWriteWord(socket, (0x0000 + 0x0004), port);
}


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

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

LLVM IR (-O0):
define void @wiznetSetSocketSourcePort(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 @wiznetRegWriteWord(i32 %5, i32 4, i32 %6)
ret void
}

LLVM IR (-O2):
define void @wiznetSetSocketSourcePort(i32 %0, i32 %1) {
%3 = tail call i32 @wiznetRegWriteWord(i32 %0, i32 4, i32 %1)
ret void
}
/* Variables and functions */
int EXIT_FAILURE;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(void) {
  fprintf(stderr, "luac: not yet ready\n");
  return EXIT_FAILURE;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"luac: not yet ready\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_FAILURE
ret i32 %4
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"luac: not yet ready\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
ret i32 %3
}
/* Variables and functions */
size_t __utils_max(size_t a0, size_t a1) {
  if (a0 < a1)
    return a1;
  return a0;
}


x86 assembly (clang, -O0):
<__utils_max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1127 <__utils_max+0x27>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <__utils_max+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__utils_max>:
mov    %rdi,%rax
cmp    %rsi,%rdi
cmovb  %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @__utils_max(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i64 %1, i64 %0
ret i64 %4
}
/* Variables and functions */
int IOWaitForInt(int);
int vpu_WaitForInt(int timeout_in_ms) { return IOWaitForInt(timeout_in_ms); }


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

x86 assembly (clang, -O2):
<vpu_WaitForInt>:
jmp    1030 <IOWaitForInt@plt>

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

LLVM IR (-O2):
define i32 @vpu_WaitForInt(i32 %0) {
%2 = tail call i32 @IOWaitForInt(i32 %0)
ret i32 %2
}
void smatrix_all_free(short **m) {
  short *a;
  a = m[0];
  free(m);
  free(a);
  return;
}


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

x86 assembly (clang, -O2):
<smatrix_all_free>:
push   %rbx
mov    (%rdi),%rbx
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @smatrix_all_free(i16** %0) {
%2 = alloca i16**
%3 = alloca i16*
store i16** %0, i16*** %2
%4 = load i16**, i16*** %2
%5 = getelementptr inbounds i16*, i16** %4, i64 0
%6 = load i16*, i16** %5
store i16* %6, i16** %3
%7 = load i16**, i16*** %2
%8 = bitcast i16** %7 to i8*
%9 = load i16*, i16** %3
%10 = bitcast i16* %9 to i8*
ret void
}

LLVM IR (-O2):
define void @smatrix_all_free(i16** nocapture %0) {
%2 = bitcast i16** %0 to i8**
%3 = load i8*, i8** %2
%4 = bitcast i16** %0 to i8*
tail call void @free(i8* %4)
tail call void @free(i8* %3)
ret void
}
unsigned numset_mask(int i) { return 1 << (i - 1); }


x86 assembly (clang, -O0):
<numset_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numset_mask>:
lea    -0x1(%rdi),%ecx
mov    $0x1,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @numset_mask(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
%5 = shl i32 1, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @numset_mask(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = shl nuw i32 1, %2
ret i32 %3
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
uint32_t rotl(uint32_t value, unsigned int n) {
  return (value << n) | (value >> (32 - n));
}


x86 assembly (clang, -O0):
<rotl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotl>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%eax
ret

LLVM IR (-O0):
define i32 @rotl(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 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 32, %9
%11 = lshr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rotl(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub i32 32, %1
%5 = lshr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int difftime(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int runevery(time_t *ltime, int sec) {
  time_t now = time(NULL);
  if (difftime(now, *ltime) >= sec) {
    *ltime = now;
    return (1);
  } else
    return (0);
}


x86 assembly (clang, -O0):
<runevery>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1030 <difftime@plt>
cmp    -0x14(%rbp),%eax
jl     1167 <runevery+0x47>
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    116e <runevery+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<runevery>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r15d
mov    %rdi,%r14
xor    %ebx,%ebx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%ebp
mov    (%r14),%esi
mov    %eax,%edi
call   1030 <difftime@plt>
cmp    %r15d,%eax
jl     114f <runevery+0x2f>
mov    %ebp,(%r14)
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @runevery(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @time(i32* null)
%4 = load i32, i32* %0
%5 = tail call i32 @difftime(i32 %3, i32 %4)
%6 = icmp slt i32 %5, %1
br i1 %6, label %8, label %7
7: ; preds = %2
store i32 %3, i32* %0
br label %8
8: ; preds = %2, %7
%9 = phi i32 [ 1, %7 ], [ 0, %2 ]
ret i32 %9
}
int ti_kvo_start(double const *options) {
  (void)options;
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @ti_kvo_start(double* nocapture readnone %0) {
ret i32 1
}
int f_bun_cr2(float a1) { return !(__builtin_isunordered(100, a1)); }


x86 assembly (clang, -O0):
<f_bun_cr2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
setp   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_bun_cr2>:
xor    %eax,%eax
ucomiss %xmm0,%xmm0
setnp  %al
ret

LLVM IR (-O0):
define i32 @f_bun_cr2(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp uno float 1.000000e+02, %3
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @f_bun_cr2(float %0) {
%2 = fcmp ord float %0, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
void rte_smp_rmb(void) {}


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

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

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

LLVM IR (-O2):
define void @rte_smp_rmb() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ chars;
};
typedef TYPE_1__ XTextItem16;

/* Variables and functions */
void *get_XTextItem16_chars(void *_p) {
  return (void *)((XTextItem16 *)_p)->chars;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i8* @get_XTextItem16_chars(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @get_XTextItem16_chars(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}