xunge/DecIR huggingface dataset:
/* Variables and functions */
char *optarg;
int /*<<< orphan*/ parse_binary(char *);
int /*<<< orphan*/ print_help();
int /*<<< orphan*/ printf(char *, char *);
void process_args(int c, int option_index) {
  switch (c) {
  case 0:
    break;
  case 'e':
    printf("Reading ELF file \"%s\"\n", optarg);
    parse_binary(optarg);
    break;
  case 'h':
  default:
    print_help();
    break;
  }
}


x86 assembly (clang, -O0):
<process_args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     1173 <process_args+0x43>
jmp    1151 <process_args+0x21>
mov    -0xc(%rbp),%eax
sub    $0x65,%eax
je     1178 <process_args+0x48>
jmp    1162 <process_args+0x32>
mov    -0xc(%rbp),%eax
sub    $0x68,%eax
je     11a2 <process_args+0x72>
jmp    11a7 <process_args+0x77>
jmp    11ae <process_args+0x7e>
mov    0x2e79(%rip),%rax
mov    (%rax),%rsi
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%rdi
call   1040 <parse_binary@plt>
jmp    11ae <process_args+0x7e>
jmp    11a7 <process_args+0x77>
mov    $0x0,%al
call   1050 <print_help@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_args>:
test   %edi,%edi
je     1159 <process_args+0x29>
cmp    $0x65,%edi
jne    115a <process_args+0x2a>
push   %rbx
mov    0x2eb7(%rip),%rbx
mov    (%rbx),%rsi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    (%rbx),%rdi
pop    %rbx
jmp    1040 <parse_binary@plt>
ret
xor    %eax,%eax
jmp    1050 <print_help@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Reading ELF file \22%s\22\0A\00"
@optarg = global i8* null
define void @process_args(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
switch i32 %5, label %13 [
i32 0, label %6
i32 101, label %7
i32 104, label %12
]
6: ; preds = %2
br label %15
7: ; preds = %2
%8 = load i8*, i8** @optarg
%9 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** @optarg
%11 = call i32 @parse_binary(i8* %10)
br label %15
12: ; preds = %2
br label %13
13: ; preds = %2, %12
%14 = call i32 (...) @print_help()
br label %15
15: ; preds = %13, %7, %6
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Reading ELF file \22%s\22\0A\00"
@optarg = global i8* null
define void @process_args(i32 %0, i32 %1) {
switch i32 %0, label %8 [
i32 0, label %10
i32 101, label %3
]
3: ; preds = %2
%4 = load i8*, i8** @optarg
%5 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** @optarg
%7 = tail call i32 @parse_binary(i8* %6)
br label %10
8: ; preds = %2
%9 = tail call i32 (...) @print_help()
br label %10
10: ; preds = %8, %3, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ nums;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int threeSumClosest(int *, int, int);
int main(void) {
  int i, target = 1;
  int nums[] = {-1, 2, 1, -4};
  printf("%d\n", threeSumClosest(nums, sizeof(nums) / sizeof(nums[0]), target));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x4,%esi
call   1030 <threeSumClosest@plt>
mov    %eax,%esi
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <threeSumClosest@plt>
lea    0xec8(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.nums = [4 x i32] [i32 -1, i32 2, i32 1, i32 -4]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @threeSumClosest(i32* %3, i32 4, i32 1)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
int fAuxiliar(int n, int m, int p) { return n + m + p; }


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

x86 assembly (clang, -O2):
<fAuxiliar>:
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @fAuxiliar(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* %4
%8 = load i32, i32* %5
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @fAuxiliar(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = add nsw i32 %4, %2
ret i32 %5
}
double m_min_double(double left, double right) {
  return (left < right) ? left : right;
}


x86 assembly (clang, -O0):
<m_min_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <m_min_double+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <m_min_double+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_min_double>:
minsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @m_min_double(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ ipod_beep();
scalar_t__ ipod_get_setting(int);
void beep(void) {
  if (ipod_get_setting(10))
    ipod_beep();
}


x86 assembly (clang, -O0):
<beep>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <ipod_get_setting@plt>
cmp    $0x0,%rax
je     113f <beep+0x1f>
mov    $0x0,%al
call   1040 <ipod_beep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<beep>:
push   %rax
mov    $0xa,%edi
call   1030 <ipod_get_setting@plt>
test   %rax,%rax
je     1138 <beep+0x18>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ipod_beep@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @beep() {
%1 = call i64 @ipod_get_setting(i32 10)
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @ipod_beep()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @beep() {
%1 = tail call i64 @ipod_get_setting(i32 10)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @ipod_beep()
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nrf_cel();
int /*<<< orphan*/ nrf_csl();
int /*<<< orphan*/ nrf_reg_write(int, int /*<<< orphan*/, int);
void nrf_powerdown() {
  nrf_reg_write(0x00, 0, 1);
  nrf_csl();
  nrf_cel();
  *(unsigned char *)0x500C &= ~(1 << 3);
  *(unsigned char *)0x500D &= ~(1 << 3);
}


x86 assembly (clang, -O0):
<nrf_powerdown>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    $0x1,%edx
mov    %esi,%edi
call   1030 <nrf_reg_write@plt>
mov    $0x0,%al
call   1040 <nrf_csl@plt>
mov    $0x0,%al
call   1050 <nrf_cel@plt>
mov    $0x500c,%eax
movzbl (%rax),%eax
and    $0xfffffff7,%eax
mov    %al,%cl
mov    $0x500c,%eax
mov    %cl,(%rax)
mov    $0x500d,%eax
movzbl (%rax),%eax
and    $0xfffffff7,%eax
mov    %al,%cl
mov    $0x500d,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_powerdown>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <nrf_reg_write@plt>
xor    %eax,%eax
call   1040 <nrf_csl@plt>
xor    %eax,%eax
call   1050 <nrf_cel@plt>
andb   $0xf7,0x500c
f7
andb   $0xf7,0x500d
f7
pop    %rax
ret

LLVM IR (-O0):
define void @nrf_powerdown() {
%1 = call i32 @nrf_reg_write(i32 0, i32 0, i32 1)
%2 = call i32 (...) @nrf_csl()
%3 = call i32 (...) @nrf_cel()
%4 = load i8, i8* inttoptr (i64 20492 to i8*)
%5 = zext i8 %4 to i32
%6 = and i32 %5, -9
%7 = trunc i32 %6 to i8
store i8 %7, i8* inttoptr (i64 20492 to i8*)
%8 = load i8, i8* inttoptr (i64 20493 to i8*)
%9 = zext i8 %8 to i32
%10 = and i32 %9, -9
%11 = trunc i32 %10 to i8
store i8 %11, i8* inttoptr (i64 20493 to i8*)
ret void
}

LLVM IR (-O2):
define void @nrf_powerdown() {
%1 = tail call i32 @nrf_reg_write(i32 0, i32 0, i32 1)
%2 = tail call i32 (...) @nrf_csl()
%3 = tail call i32 (...) @nrf_cel()
%4 = load i8, i8* inttoptr (i64 20492 to i8*)
%5 = and i8 %4, -9
store i8 %5, i8* inttoptr (i64 20492 to i8*)
%6 = load i8, i8* inttoptr (i64 20493 to i8*)
%7 = and i8 %6, -9
store i8 %7, i8* inttoptr (i64 20493 to i8*)
ret void
}
void bar_t02() { struct type_t02 *var; }


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

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

LLVM IR (-O0):
%struct.type_t02 = type opaque
define void @bar_t02() {
%1 = alloca %struct.type_t02*
ret void
}

LLVM IR (-O2):
%struct.type_t02 = type opaque
define void @bar_t02() {
ret void
}
main(int x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ PF_UNIX;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ err(int, char *, char const *);
scalar_t__ socketpair(int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/, int *);
void domainsocketpair(const char *test, int *fdp) {
  if (socketpair(PF_UNIX, SOCK_STREAM, 0, fdp) < 0)
    err(-1, "%s: socketpair(PF_UNIX, SOCK_STREAM)", test);
}


x86 assembly (clang, -O0):
<domainsocketpair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
mov    0x2e98(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rcx
xor    %edx,%edx
call   1030 <socketpair@plt>
cmp    $0x0,%rax
jge    116c <domainsocketpair+0x4c>
mov    -0x8(%rbp),%rdx
mov    $0xffffffff,%edi
lea    0xe99(%rip),%rsi
call   1040 <err@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<domainsocketpair>:
push   %rbx
mov    %rsi,%rcx
mov    %rdi,%rbx
mov    0x2eca(%rip),%rax
mov    (%rax),%edi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <socketpair@plt>
test   %rax,%rax
js     1147 <domainsocketpair+0x27>
pop    %rbx
ret
lea    0xeb2(%rip),%rsi
mov    $0xffffffff,%edi
mov    %rbx,%rdx
pop    %rbx
jmp    1040 <err@plt>

LLVM IR (-O0):
@PF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
@.str = [37 x i8] c"%s: socketpair(PF_UNIX, SOCK_STREAM)\00"
define void @domainsocketpair(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32, i32* @PF_UNIX
%6 = load i32, i32* @SOCK_STREAM
%7 = load i32*, i32** %4
%8 = call i64 @socketpair(i32 %5, i32 %6, i32 0, i32* %7)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = call i32 @err(i32 -1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
@PF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
@.str = [37 x i8] c"%s: socketpair(PF_UNIX, SOCK_STREAM)\00"
define void @domainsocketpair(i8* %0, i32* %1) {
%3 = load i32, i32* @PF_UNIX
%4 = load i32, i32* @SOCK_STREAM
%5 = tail call i64 @socketpair(i32 %3, i32 %4, i32 0, i32* %1)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @err(i32 -1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %7, %2
ret void
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ isdigit(char);
int human(char board[], char player) {
  char move;
  move = getchar();
  while (!(isdigit(move))) {
    move = getchar();
  }
  return move - '0';
}


x86 assembly (clang, -O0):
<human>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0xa(%rbp)
movsbl -0xa(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    115a <human+0x3a>
jmp    1169 <human+0x49>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0xa(%rbp)
jmp    113c <human+0x1c>
movsbl -0xa(%rbp),%eax
sub    $0x30,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<human>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     1130 <human+0x10>
movsbl %bl,%eax
add    $0xffffffd0,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @human(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = call signext i8 (...) @getchar()
store i8 %6, i8* %5
br label %7
7: ; preds = %12, %2
%8 = load i8, i8* %5
%9 = call i32 @isdigit(i8 signext %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = call signext i8 (...) @getchar()
store i8 %13, i8* %5
br label %7
14: ; preds = %7
%15 = load i8, i8* %5
%16 = sext i8 %15 to i32
%17 = sub nsw i32 %16, 48
ret i32 %17
}

LLVM IR (-O2):
define i32 @human(i8* nocapture readnone %0, i8 signext %1) {
%3 = tail call signext i8 (...) @getchar()
%4 = tail call i32 @isdigit(i8 signext %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %2, %6
%7 = tail call signext i8 (...) @getchar()
%8 = tail call i32 @isdigit(i8 signext %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %6, label %10
10: ; preds = %6, %2
%11 = phi i8 [ %3, %2 ], [ %7, %6 ]
%12 = sext i8 %11 to i32
%13 = add nsw i32 %12, -48
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  puts("This is an example Anvil package!");
  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)
lea    0xed3(%rip),%rdi
call   1030 <puts@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 = [34 x i8] c"This is an example Anvil package!\00"
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 @puts(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"This is an example Anvil package!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int compute_checksum(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  int rv;
  if (argc == 1) {
    printf("Usage: %s <filename>\n", argv[0]);
    rv = 1;
  } else {
    rv = compute_checksum(argv[1]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    115f <main+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    116f <main+0x4f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <compute_checksum@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jne    1137 <main+0x17>
mov    (%rsi),%rsi
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
jmp    1140 <main+0x20>
mov    0x8(%rsi),%rdi
call   1030 <compute_checksum@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Usage: %s <filename>\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %12)
store i32 1, i32* %6
br label %19
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @compute_checksum(i8* %17)
store i32 %18, i32* %6
br label %19
19: ; preds = %14, %9
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Usage: %s <filename>\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %11
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @compute_checksum(i8* %9)
br label %11
11: ; preds = %7, %4
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int /*<<< orphan*/ setjmp(int /*<<< orphan*/);
int /*<<< orphan*/ tst3(int /*<<< orphan*/);
void tst4(jmp_buf loc) {
  jmp_buf jmp;
  setjmp(jmp);
  int i, a[2], b[2];
  for (i = 0; i < 2; i++)
    a[i] = 0;
  for (i = 0; i < 2; i++)
    b[i] = 0;
  tst3(loc);
}


x86 assembly (clang, -O0):
<tst4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <setjmp@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    115e <tst4+0x3e>
movslq -0xc(%rbp),%rax
movl   $0x0,-0x14(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <tst4+0x1a>
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    1189 <tst4+0x69>
movslq -0xc(%rbp),%rax
movl   $0x0,-0x1c(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1165 <tst4+0x45>
mov    -0x4(%rbp),%edi
call   1030 <tst3@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst4>:
push   %rbx
mov    %edi,%ebx
call   1040 <setjmp@plt>
mov    %ebx,%edi
call   1030 <tst3@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @tst4(i32 %0) {
%2 = call i32 @setjmp(i32 undef)
%3 = call i32 @tst3(i32 %0)
ret void
}
unsigned int gcd(unsigned int a, unsigned int b) {
  while (b) {
    unsigned int tmp = b;
    b = a % b;
    a = tmp;
  }
  return a;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1130 <gcd+0x30>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110a <gcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111e <gcd+0x1e>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
xor    %edx,%edx
div    %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = urem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
/* Variables and functions */
int test_unpriv_remount(int, int, int);
bool test_unpriv_remount_atime(int mount_flags, int invalid_flags) {
  return test_unpriv_remount(mount_flags, mount_flags, invalid_flags);
}


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

x86 assembly (clang, -O2):
<test_unpriv_remount_atime>:
mov    %esi,%edx
mov    %edi,%esi
jmp    1030 <test_unpriv_remount@plt>

LLVM IR (-O0):
define i32 @test_unpriv_remount_atime(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* %3
%7 = load i32, i32* %4
%8 = call i32 @test_unpriv_remount(i32 %5, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_unpriv_remount_atime(i32 %0, i32 %1) {
%3 = tail call i32 @test_unpriv_remount(i32 %0, i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *);
void WHEN(char *text) {
  printf("%s  when:%s %s\n", "\x1B[33m", "\x1B[0m", text);
}


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

x86 assembly (clang, -O2):
<WHEN>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
lea    0xeef(%rip),%rsi
lea    0xeee(%rip),%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"%s when:%s %s\0A\00"
@.str.1 = [6 x i8] c"\1B[33m\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
define void @WHEN(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"%s when:%s %s\0A\00"
@.str.1 = [6 x i8] c"\1B[33m\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
define void @WHEN(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %0)
ret void
}
int main() {
  int a = 5;
  int b = 5;
  int placeholder = a;
  a = b;
  b = placeholder;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x5,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
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
%3 = alloca i32
store i32 5, i32* %1
store i32 5, i32* %2
%4 = load i32, i32* %1
store i32 %4, i32* %3
%5 = load i32, i32* %2
store i32 %5, i32* %1
%6 = load i32, i32* %3
store i32 %6, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int compare(void *const key, void *const key2) {
  if (*(int *)key > *(int *)key2)
    return 1;
  else
    return -1;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    112a <compare+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1131 <compare+0x31>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
lea    (%rcx,%rcx,1),%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = icmp sgt i32 %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 1, i32* %3
br label %15
14: ; preds = %2
store i32 -1, i32* %3
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @compare(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 = icmp sgt i32 %4, %6
%8 = select i1 %7, i32 1, i32 -1
ret i32 %8
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int scale8(int, int);
uint8_t ease8InOutQuad(uint8_t i) {
  uint8_t j = i;
  if (j & 0x80) {
    j = 255 - j;
  }
  uint8_t jj = scale8(j, j);
  uint8_t jj2 = jj << 1;
  if (i & 0x80) {
    jj2 = 255 - jj2;
  }
  return jj2;
}


x86 assembly (clang, -O0):
<ease8InOutQuad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     113d <ease8InOutQuad+0x2d>
mov    $0xff,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <scale8@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1170 <ease8InOutQuad+0x60>
mov    $0xff,%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ease8InOutQuad>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xff,%ebp
mov    $0xff,%edi
sub    %ebx,%edi
test   $0x80,%bl
cmove  %ebx,%edi
mov    %edi,%esi
call   1030 <scale8@plt>
add    %eax,%eax
sub    %eax,%ebp
test   $0x80,%bl
cmovne %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ease8InOutQuad(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = and i32 %7, 128
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i32, i32* %3
%12 = sub nsw i32 255, %11
store i32 %12, i32* %3
br label %13
13: ; preds = %10, %1
%14 = load i32, i32* %3
%15 = load i32, i32* %3
%16 = call i32 @scale8(i32 %14, i32 %15)
store i32 %16, i32* %4
%17 = load i32, i32* %4
%18 = shl i32 %17, 1
store i32 %18, i32* %5
%19 = load i32, i32* %2
%20 = and i32 %19, 128
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %13
%23 = load i32, i32* %5
%24 = sub nsw i32 255, %23
store i32 %24, i32* %5
br label %25
25: ; preds = %22, %13
%26 = load i32, i32* %5
ret i32 %26
}

LLVM IR (-O2):
define i32 @ease8InOutQuad(i32 %0) {
%2 = and i32 %0, 128
%3 = icmp eq i32 %2, 0
%4 = sub nsw i32 255, %0
%5 = select i1 %3, i32 %0, i32 %4
%6 = tail call i32 @scale8(i32 %5, i32 %5)
%7 = shl i32 %6, 1
%8 = sub nsw i32 255, %7
%9 = select i1 %3, i32 %7, i32 %8
ret i32 %9
}
/* Type definitions */
typedef int uint;

/* Variables and functions */
uint int_code(char c) {
  switch (c) {
  case 'C':
  case 'c':
    return 1;
  case 'G':
  case 'g':
    return 2;
  case 'A':
  case 'a':
    return 3;
  case 'T':
  case 't':
  case 'U':
  case 'u':
    return 4;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<int_code>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x34,%eax
ja     1164 <int_code+0x64>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    116b <int_code+0x6b>
movl   $0x2,-0x4(%rbp)
jmp    116b <int_code+0x6b>
movl   $0x3,-0x4(%rbp)
jmp    116b <int_code+0x6b>
movl   $0x4,-0x4(%rbp)
jmp    116b <int_code+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_code>:
add    $0xffffffbf,%edi
cmp    $0x34,%edi
ja     112f <int_code+0x2f>
mov    $0x1,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x4,%eax
ret
mov    $0x3,%eax
ret
mov    $0x2,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @int_code(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %10 [
i32 67, label %6
i32 99, label %6
i32 71, label %7
i32 103, label %7
i32 65, label %8
i32 97, label %8
i32 84, label %9
i32 116, label %9
i32 85, label %9
i32 117, label %9
]
6: ; preds = %1, %1
store i32 1, i32* %2
br label %11
7: ; preds = %1, %1
store i32 2, i32* %2
br label %11
8: ; preds = %1, %1
store i32 3, i32* %2
br label %11
9: ; preds = %1, %1, %1, %1
store i32 4, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9, %8, %7, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @int_code(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %6 [
i32 67, label %7
i32 99, label %7
i32 71, label %3
i32 103, label %3
i32 65, label %4
i32 97, label %4
i32 84, label %5
i32 116, label %5
i32 85, label %5
i32 117, label %5
]
3: ; preds = %1, %1
br label %7
4: ; preds = %1, %1
br label %7
5: ; preds = %1, %1, %1, %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %1, %6, %5, %4, %3
%8 = phi i32 [ 0, %6 ], [ 4, %5 ], [ 3, %4 ], [ 2, %3 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %8
}
void process_ssdp(struct Seaper *seap, struct NetFrame *frame,
                  const unsigned char *px, unsigned length) {
  seap;
  frame;
  px;
  length;
}


x86 assembly (clang, -O0):
<process_ssdp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.Seaper = type opaque
%struct.NetFrame = type opaque
define void @process_ssdp(%struct.Seaper* %0, %struct.NetFrame* %1, i8* %2, i32 %3) {
%5 = alloca %struct.Seaper*
%6 = alloca %struct.NetFrame*
%7 = alloca i8*
%8 = alloca i32
store %struct.Seaper* %0, %struct.Seaper** %5
store %struct.NetFrame* %1, %struct.NetFrame** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load %struct.Seaper*, %struct.Seaper** %5
%10 = load %struct.NetFrame*, %struct.NetFrame** %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
ret void
}

LLVM IR (-O2):
%struct.Seaper = type opaque
%struct.NetFrame = type opaque
define void @process_ssdp(%struct.Seaper* nocapture %0, %struct.NetFrame* nocapture %1, i8* nocapture %2, i32 %3) {
ret void
}
/* Variables and functions */
bool close_png_input_file(void) { return (1); }


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

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

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

LLVM IR (-O2):
define i32 @close_png_input_file() {
ret i32 1
}
void ao_arch_memory_barrier() { asm volatile("" ::: "memory"); }


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

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

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

LLVM IR (-O2):
define void @ao_arch_memory_barrier() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
int x30_process_synack(struct mypacket *packet) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.mypacket = type opaque
define i32 @x30_process_synack(%struct.mypacket* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int pthread_mutex_unlock(int /*<<< orphan*/ *);
void mutex_unlock(pthread_mutex_t *mutex) {
  int err = pthread_mutex_unlock(mutex);
  if (err != 0) {
    perror("pthread_mutex_unlock");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<mutex_unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pthread_mutex_unlock@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     116c <mutex_unlock+0x3c>
lea    0xea7(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutex_unlock>:
push   %rax
call   1030 <pthread_mutex_unlock@plt>
test   %eax,%eax
jne    113c <mutex_unlock+0xc>
pop    %rax
ret
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"pthread_mutex_unlock\00"
@EXIT_FAILURE = global i32 0
define void @mutex_unlock(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @pthread_mutex_unlock(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"pthread_mutex_unlock\00"
@EXIT_FAILURE = global i32 0
define void @mutex_unlock(i32* %0) {
%2 = tail call i32 @pthread_mutex_unlock(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret void
}
/* Variables and functions */
int pow(float, int);
float poly(float fraction, float start, float delta, float slope, int degree) {
  return delta * ((1 - slope) * pow(fraction, degree) + slope * fraction) +
         start;
}


x86 assembly (clang, -O0):
<poly>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  0xebf(%rip),%xmm0
subss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x14(%rbp),%edi
call   1030 <pow@plt>
movss  -0x1c(%rbp),%xmm2
movss  -0x18(%rbp),%xmm0
cvtsi2ss %eax,%xmm3
movss  -0x10(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
mulss  %xmm3,%xmm2
addss  %xmm1,%xmm2
movss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<poly>:
sub    $0x18,%rsp
movss  %xmm3,0xc(%rsp)
movss  %xmm2,0x10(%rsp)
movss  %xmm1,0x14(%rsp)
movss  %xmm0,0x4(%rsp)
movss  0xecc(%rip),%xmm1
subss  %xmm3,%xmm1
movss  %xmm1,0x8(%rsp)
call   1030 <pow@plt>
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
mulss  0x8(%rsp),%xmm1
movss  0x4(%rsp),%xmm0
mulss  0xc(%rsp),%xmm0
addss  %xmm1,%xmm0
mulss  0x10(%rsp),%xmm0
addss  0x14(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @poly(float %0, float %1, float %2, float %3, i32 %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca i32
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store i32 %4, i32* %10
%11 = load float, float* %8
%12 = load float, float* %9
%13 = fsub float 1.000000e+00, %12
%14 = load float, float* %6
%15 = load i32, i32* %10
%16 = call i32 @pow(float %14, i32 %15)
%17 = sitofp i32 %16 to float
%18 = load float, float* %9
%19 = load float, float* %6
%20 = fmul float %18, %19
%21 = call float @llvm.fmuladd.f32(float %13, float %17, float %20)
%22 = load float, float* %7
%23 = call float @llvm.fmuladd.f32(float %11, float %21, float %22)
ret float %23
}

LLVM IR (-O2):
define float @poly(float %0, float %1, float %2, float %3, i32 %4) {
%6 = fsub float 1.000000e+00, %3
%7 = tail call i32 @pow(float %0, i32 %4)
%8 = sitofp i32 %7 to float
%9 = fmul float %0, %3
%10 = tail call float @llvm.fmuladd.f32(float %6, float %8, float %9)
%11 = tail call float @llvm.fmuladd.f32(float %2, float %10, float %1)
ret float %11
}
/* Variables and functions */
int /*<<< orphan*/ _libev_unregister_sock(int, void *);
void libev_unregister_sock(int sock, void *app_arg) {
  _libev_unregister_sock(sock, app_arg);
}


x86 assembly (clang, -O0):
<libev_unregister_sock>:
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 <_libev_unregister_sock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libev_unregister_sock>:
jmp    1030 <_libev_unregister_sock@plt>

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

LLVM IR (-O2):
define void @libev_unregister_sock(i32 %0, i8* %1) {
%3 = tail call i32 @_libev_unregister_sock(i32 %0, i8* %1)
ret void
}
/* Variables and functions */
int smcGetVariable(int, int);
int smcGetTargetSpeed(int fd) {
  int val = smcGetVariable(fd, 20);
  return val == -9999 ? -9999 : (signed short)val;
}


x86 assembly (clang, -O0):
<smcGetTargetSpeed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x14,%esi
call   1030 <smcGetVariable@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffd8f1,-0x8(%rbp)
jne    1145 <smcGetTargetSpeed+0x35>
mov    $0xffffd8f1,%eax
mov    %eax,-0xc(%rbp)
jmp    114c <smcGetTargetSpeed+0x3c>
mov    -0x8(%rbp),%eax
cwtl
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smcGetTargetSpeed>:
push   %rax
mov    $0x14,%esi
call   1030 <smcGetVariable@plt>
cmp    $0xffffd8f1,%eax
movswl %ax,%ecx
cmovne %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @smcGetTargetSpeed(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @smcGetVariable(i32 %4, i32 20)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, -9999
br i1 %7, label %8, label %9
8: ; preds = %1
br label %13
9: ; preds = %1
%10 = load i32, i32* %3
%11 = trunc i32 %10 to i16
%12 = sext i16 %11 to i32
br label %13
13: ; preds = %9, %8
%14 = phi i32 [ -9999, %8 ], [ %12, %9 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @smcGetTargetSpeed(i32 %0) {
%2 = tail call i32 @smcGetVariable(i32 %0, i32 20)
%3 = icmp eq i32 %2, -9999
%4 = shl i32 %2, 16
%5 = ashr exact i32 %4, 16
%6 = select i1 %3, i32 -9999, i32 %5
ret i32 %6
}
int test_imm_20uint16_reg(unsigned short val) {
  return ((val) & (0x20 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_20uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x20,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_20uint16_reg>:
test   $0x20,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_20uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 32
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_20uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 32
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void put_byte(p, x) unsigned char *p;
unsigned char x;
{ p[0] = x; }


x86 assembly (clang, -O0):
<put_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_byte>:
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @put_byte(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = trunc i32 %1 to i8
store i8* %0, i8** %3
store i8 %5, i8* %4
%6 = load i8, i8* %4
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 %6, i8* %8
ret void
}

LLVM IR (-O2):
define void @put_byte(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int *malloc(int);
int main(void) {
  int *r = malloc(5 * sizeof(int));
  r[3] = 2;
  assert(r[4] == 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2,0xc(%rax)
mov    -0x8(%rbp),%rax
cmpl   $0x2,0x10(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x14,%edi
call   1040 <malloc@plt>
xor    %edi,%edi
cmpl   $0x2,0x10(%rax)
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 20)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = getelementptr inbounds i32, i32* %3, i64 3
store i32 2, i32* %4
%5 = load i32*, i32** %1
%6 = getelementptr inbounds i32, i32* %5, i64 4
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 2
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 20)
%2 = getelementptr inbounds i32, i32* %1, i64 4
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 2
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
ret i32 0
}
call2c(s, d1, i, f2, l, d2, c, f1) short s;
double d1;
int i;
float f2;
long l;
double d2;
char c;
float f1;
{
  c = 'a';
  f1 = 0.0;
  s = 5;
  d1 = 0.0;
  i = 6;
  f2 = 0.1;
  l = 7;
  d2 = 0.2;
}


x86 assembly (clang, -O0):
<call2c>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm3,-0x38(%rbp)
mov    %ecx,%eax
movaps %xmm0,%xmm3
movsd  -0x38(%rbp),%xmm0
mov    %di,%cx
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
mov    %cx,-0x6(%rbp)
movsd  %xmm3,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movss  %xmm1,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
mov    %al,-0x29(%rbp)
movss  %xmm0,-0x30(%rbp)
movb   $0x61,-0x29(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x30(%rbp)
movw   $0x5,-0x6(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x6,-0x14(%rbp)
movss  0xe9f(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movq   $0x7,-0x20(%rbp)
movsd  0xe82(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @call2c(i32 %0, double %1, i32 %2, double %3, i64 %4, double %5, i32 %6, double %7) {
%9 = alloca i32
%10 = alloca i16
%11 = alloca double
%12 = alloca i32
%13 = alloca float
%14 = alloca i64
%15 = alloca double
%16 = alloca i8
%17 = alloca float
%18 = trunc i32 %0 to i16
%19 = fptrunc double %3 to float
%20 = trunc i32 %6 to i8
%21 = fptrunc double %7 to float
store i16 %18, i16* %10
store double %1, double* %11
store i32 %2, i32* %12
store float %19, float* %13
store i64 %4, i64* %14
store double %5, double* %15
store i8 %20, i8* %16
store float %21, float* %17
store i8 97, i8* %16
store float 0.000000e+00, float* %17
store i16 5, i16* %10
store double 0.000000e+00, double* %11
store i32 6, i32* %12
store float 0x3FB99999A0000000, float* %13
store i64 7, i64* %14
store double 2.000000e-01, double* %15
%22 = load i32, i32* %9
ret i32 %22
}

LLVM IR (-O2):
define i32 @call2c(i32 %0, double %1, i32 %2, double %3, i64 %4, double %5, i32 %6, double %7) {
ret i32 undef
}
long extract_ds(unsigned long insn, int *invalid) {
  if ((insn & 0x8000) != 0)
    return (insn & 0xfffc) - 0x10000;
  else
    return insn & 0xfffc;
}


x86 assembly (clang, -O0):
<extract_ds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
and    $0x8000,%rax
cmp    $0x0,%rax
je     1139 <extract_ds+0x39>
mov    -0x10(%rbp),%rax
and    $0xfffc,%rax
sub    $0x10000,%rax
mov    %rax,-0x8(%rbp)
jmp    1147 <extract_ds+0x47>
mov    -0x10(%rbp),%rax
and    $0xfffc,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_ds>:
mov    %edi,%ecx
and    $0xfffc,%ecx
lea    -0x10000(%rcx),%rax
test   $0x8000,%edi
cmove  %rcx,%rax
ret

LLVM IR (-O0):
define i64 @extract_ds(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32*
store i64 %0, i64* %4
store i32* %1, i32** %5
%6 = load i64, i64* %4
%7 = and i64 %6, 32768
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i64, i64* %4
%11 = and i64 %10, 65532
%12 = sub i64 %11, 65536
store i64 %12, i64* %3
br label %16
13: ; preds = %2
%14 = load i64, i64* %4
%15 = and i64 %14, 65532
store i64 %15, i64* %3
br label %16
16: ; preds = %13, %9
%17 = load i64, i64* %3
ret i64 %17
}

LLVM IR (-O2):
define i64 @extract_ds(i64 %0, i32* nocapture readnone %1) {
%3 = and i64 %0, 32768
%4 = icmp eq i64 %3, 0
%5 = and i64 %0, 65532
%6 = or i64 %5, -65536
%7 = select i1 %4, i64 %5, i64 %6
ret i64 %7
}