xunge/DecIR huggingface dataset:
int pure_h(struct ure *p) { return !!p; }


x86 assembly (clang, -O0):
<pure_h>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pure_h>:
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
ret

LLVM IR (-O0):
%struct.ure = type opaque
define i32 @pure_h(%struct.ure* %0) {
%2 = alloca %struct.ure*
store %struct.ure* %0, %struct.ure** %2
%3 = load %struct.ure*, %struct.ure** %2
%4 = icmp ne %struct.ure* %3, null
%5 = xor i1 %4, true
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.ure = type opaque
define i32 @pure_h(%struct.ure* readnone %0) {
%2 = icmp ne %struct.ure* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("\ntemplate started\n\n");
  printf("template ended\n\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>
lea    0xee2(%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>
lea    0xeef(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"\0Atemplate started\0A\0A\00"
@.str.1 = [17 x i8] c"template ended\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"\0Atemplate started\0A\00"
@str.2 = [16 x i8] c"template ended\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ R_OK;
scalar_t__ access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ unlink(char *);
void unlink_pid_file(void) {
  if (0 == access("irid.pid", R_OK))
    unlink("irid.pid");
}


x86 assembly (clang, -O0):
<unlink_pid_file>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1040 <access@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1153 <unlink_pid_file+0x33>
lea    0xeb2(%rip),%rdi
call   1030 <unlink@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlink_pid_file>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <access@plt>
test   %rax,%rax
je     113d <unlink_pid_file+0x1d>
pop    %rax
ret
lea    0xebc(%rip),%rdi
pop    %rax
jmp    1030 <unlink@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"irid.pid\00"
@R_OK = global i32 0
define void @unlink_pid_file() {
%1 = load i32, i32* @R_OK
%2 = call i64 @access(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq i64 0, %2
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @unlink(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"irid.pid\00"
@R_OK = global i32 0
define void @unlink_pid_file() {
%1 = load i32, i32* @R_OK
%2 = tail call i64 @access(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @unlink(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err_printf(char *, char *, char *);
int /*<<< orphan*/ log_printf(char *, char *, char *);
void MSNError(char *f, char *s) {
  log_printf("eERROR: (%s) %s", s, f);
  err_printf("ERROR: %s -> %s\n", s, f);
}


x86 assembly (clang, -O0):
<MSNError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xec1(%rip),%rdi
call   1030 <log_printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xebd(%rip),%rdi
call   1040 <err_printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MSNError>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xecf(%rip),%rdi
mov    %r14,%rdx
call   1030 <log_printf@plt>
lea    0xed0(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <err_printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"eERROR: (%s) %s\00"
@.str.1 = [17 x i8] c"ERROR: %s -> %s\0A\00"
define void @MSNError(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @log_printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
%8 = load i8*, i8** %4
%9 = load i8*, i8** %3
%10 = call i32 @err_printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"eERROR: (%s) %s\00"
@.str.1 = [17 x i8] c"ERROR: %s -> %s\0A\00"
define void @MSNError(i8* %0, i8* %1) {
%3 = tail call i32 @log_printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0)
%4 = tail call i32 @err_printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %1, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ao();
int /*<<< orphan*/ mrp(int, int, int);
int /*<<< orphan*/ msleep(int);
int main() {
  mrp(0, 2000, 8000);
  mrp(2, 2000, 8000);
  msleep(5000);
  ao();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
mov    $0x7d0,%esi
mov    $0x1f40,%edx
call   1030 <mrp@plt>
mov    $0x2,%edi
mov    $0x7d0,%esi
mov    $0x1f40,%edx
call   1030 <mrp@plt>
mov    $0x1388,%edi
call   1040 <msleep@plt>
mov    $0x0,%al
call   1050 <ao@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x7d0,%esi
mov    $0x1f40,%edx
call   1030 <mrp@plt>
mov    $0x2,%edi
mov    $0x7d0,%esi
mov    $0x1f40,%edx
call   1030 <mrp@plt>
mov    $0x1388,%edi
call   1040 <msleep@plt>
xor    %eax,%eax
call   1050 <ao@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @mrp(i32 0, i32 2000, i32 8000)
%3 = call i32 @mrp(i32 2, i32 2000, i32 8000)
%4 = call i32 @msleep(i32 5000)
%5 = call i32 (...) @ao()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @mrp(i32 0, i32 2000, i32 8000)
%2 = tail call i32 @mrp(i32 2, i32 2000, i32 8000)
%3 = tail call i32 @msleep(i32 5000)
%4 = tail call i32 (...) @ao()
ret i32 0
}
/* Variables and functions */
scalar_t__ bcm_2708_power_off();
int bcm_2708_power_on();
int /*<<< orphan*/ emmc_usleep(int);
int bcm_2708_power_cycle() {
  if (bcm_2708_power_off() < 0)
    return -1;
  emmc_usleep(5000);
  return bcm_2708_power_on();
}


x86 assembly (clang, -O0):
<bcm_2708_power_cycle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <bcm_2708_power_off@plt>
cmp    $0x0,%rax
jge    1155 <bcm_2708_power_cycle+0x25>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <bcm_2708_power_cycle+0x39>
mov    $0x1388,%edi
call   1040 <emmc_usleep@plt>
mov    $0x0,%al
call   1030 <bcm_2708_power_on@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcm_2708_power_cycle>:
push   %rax
xor    %eax,%eax
call   1050 <bcm_2708_power_off@plt>
test   %rax,%rax
js     114f <bcm_2708_power_cycle+0x1f>
mov    $0x1388,%edi
call   1040 <emmc_usleep@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <bcm_2708_power_on@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bcm_2708_power_cycle() {
%1 = alloca i32
%2 = call i64 (...) @bcm_2708_power_off()
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 -1, i32* %1
br label %8
5: ; preds = %0
%6 = call i32 @emmc_usleep(i32 5000)
%7 = call i32 (...) @bcm_2708_power_on()
store i32 %7, i32* %1
br label %8
8: ; preds = %5, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @bcm_2708_power_cycle() {
%1 = tail call i64 (...) @bcm_2708_power_off()
%2 = icmp slt i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @emmc_usleep(i32 5000)
%5 = tail call i32 (...) @bcm_2708_power_on()
br label %6
6: ; preds = %0, %3
%7 = phi i32 [ %5, %3 ], [ -1, %0 ]
ret i32 %7
}
/* Variables and functions */
scalar_t__ strchr(char *, char);
int check_servername(char *servername) {
  if (strchr(servername, ':'))
    return -1;
  if (strchr(servername, '/'))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<check_servername>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     1140 <check_servername+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <check_servername+0x5b>
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     1164 <check_servername+0x54>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <check_servername+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_servername>:
push   %rbx
mov    %rdi,%rbx
mov    $0x3a,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     112d <check_servername+0x1d>
pop    %rbx
ret
mov    %rbx,%rdi
mov    $0x2f,%esi
call   1030 <strchr@plt>
neg    %rax
sbb    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @check_servername(i8* %0) {
%2 = tail call i64 @strchr(i8* %0, i8 signext 58)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @strchr(i8* %0, i8 signext 47)
%6 = icmp ne i64 %5, 0
%7 = sext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ -1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int jane, tarzan, cheeta;
  cheeta = tarzan = jane = 68;
  printf("	cheeta tarzan jane\n");
  printf("First round score %4d %8d %8d\n", cheeta, tarzan, jane);
#pragma region MyRegion
  printf("fadfasdf\n");
#pragma endregion
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x44,-0x8(%rbp)
movl   $0x44,-0xc(%rbp)
movl   $0x44,-0x10(%rbp)
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
mov    $0x44,%esi
mov    $0x44,%edx
mov    $0x44,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"\09cheeta tarzan jane\0A\00"
@.str.1 = [31 x i8] c"First round score %4d %8d %8d\0A\00"
@.str.2 = [10 x i8] c"fadfasdf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 68, i32* %2
store i32 68, i32* %3
store i32 68, i32* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7, i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [31 x i8] c"First round score %4d %8d %8d\0A\00"
@str = [20 x i8] c"\09cheeta tarzan jane\00"
@str.3 = [9 x i8] c"fadfasdf\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 68, i32 68, i32 68)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 (...) @getchar()
ret i32 0
}
int look_cond(naibupp, flg)
int **naibupp, flg;
{
  int *naibup, condrsl;
  naibup = *naibupp;
  condrsl = evlcond(&naibup);
  flg = flg && condrsl;
  look_choose(&naibup, flg);
  *naibupp = naibup;
  return (flg);
}


x86 assembly (clang, -O0):
<look_cond>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <evlcond@plt>
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x1d(%rbp)
je     1161 <look_cond+0x41>
cmpl   $0x0,-0x1c(%rbp)
setne  %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1040 <look_choose@plt>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<look_cond>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
mov    (%rdi),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <evlcond@plt>
test   %ebp,%ebp
setne  %cl
test   %eax,%eax
setne  %al
and    %cl,%al
movzbl %al,%ebp
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <look_choose@plt>
mov    0x8(%rsp),%rax
mov    %rax,(%rbx)
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @look_cond(i32** %0, i32 %1) {
%3 = alloca i32**
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32** %0, i32*** %3
store i32 %1, i32* %4
%7 = load i32**, i32*** %3
%8 = load i32*, i32** %7
store i32* %8, i32** %5
%9 = call i32 (i32**, ...) bitcast (i32 (...)* @evlcond to i32 (i32**, ...)*)(i32** %5)
store i32 %9, i32* %6
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i32, i32* %6
%14 = icmp ne i32 %13, 0
br label %15
15: ; preds = %12, %2
%16 = phi i1 [ false, %2 ], [ %14, %12 ]
%17 = zext i1 %16 to i32
store i32 %17, i32* %4
%18 = load i32, i32* %4
%19 = call i32 (i32**, i32, ...) bitcast (i32 (...)* @look_choose to i32 (i32**, i32, ...)*)(i32** %5, i32 %18)
%20 = load i32*, i32** %5
%21 = load i32**, i32*** %3
store i32* %20, i32** %21
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
define i32 @look_cond(i32** nocapture %0, i32 %1) {
%3 = alloca i32*
%4 = bitcast i32** %3 to i8*
%5 = load i32*, i32** %0
store i32* %5, i32** %3
%6 = call i32 (i32**, ...) bitcast (i32 (...)* @evlcond to i32 (i32**, ...)*)(i32** %3)
%7 = icmp ne i32 %1, 0
%8 = icmp ne i32 %6, 0
%9 = select i1 %7, i1 %8, i1 false
%10 = zext i1 %9 to i32
%11 = call i32 (i32**, i32, ...) bitcast (i32 (...)* @look_choose to i32 (i32**, i32, ...)*)(i32** %3, i32 %10)
%12 = load i32*, i32** %3
store i32* %12, i32** %0
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void printHelp(void) {
  fprintf(
      stdout,
      "\nOptions:\n"
      "-d / --device Where the video camera is mounted. Typically "
      "/dev/videoN.\n"
      "-h / --help   Display this help message.\n"
      "-f / --format Video format to display. Use -a to see formats "
      "available.\n"
      "-s / --frame-size Size of video frame. Use -a to see sizes available.\n"
      "-a / --available Prints available formats and sizes and then exits.\n");
}


x86 assembly (clang, -O0):
<printHelp>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printHelp>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [334 x i8] c"\0AOptions:\0A-d / --device Where the video camera is mounted. Typically /dev/videoN.\0A-h / --help Display this help message.\0A-f / --format Video format to display. Use -a to see formats available.\0A-s / --frame-size Size of video frame. Use -a to see sizes available.\0A-a / --available Prints available formats and sizes and then exits.\0A\00"
define void @printHelp() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([334 x i8], [334 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [334 x i8] c"\0AOptions:\0A-d / --device Where the video camera is mounted. Typically /dev/videoN.\0A-h / --help Display this help message.\0A-f / --format Video format to display. Use -a to see formats available.\0A-s / --frame-size Size of video frame. Use -a to see sizes available.\0A-a / --available Prints available formats and sizes and then exits.\0A\00"
define void @printHelp() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([334 x i8], [334 x i8]* @.str, i64 0, i64 0))
ret void
}
int simple_strlen(const char *str) {
  int len = 0;
  while (str[len] != '\0') {
    len++;
  }
  return len;
}


x86 assembly (clang, -O0):
<simple_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <simple_strlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <simple_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <simple_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @simple_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void sighandler3(int signum) {
  printf("this is sighandler3: %d\n", signum);
  return;
}


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

x86 assembly (clang, -O2):
<sighandler3>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [25 x i8] c"this is sighandler3: %d\0A\00"
define void @sighandler3(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void CFGMR3InsertStringFV(void) {}


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

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

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

LLVM IR (-O2):
define void @CFGMR3InsertStringFV() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void debug_print(char *msg) { fprintf(stdout, "%s\n", msg); }


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

x86 assembly (clang, -O2):
<debug_print>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @debug_print(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(float *, int, long);
void fvec_nan(float *v, long n) { memset(v, -1, n * sizeof(*v)); }


x86 assembly (clang, -O0):
<fvec_nan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
shl    $0x2,%rdx
mov    $0xffffffff,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fvec_nan>:
lea    0x0(,%rsi,4),%rdx
mov    $0xffffffff,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @fvec_nan(float* %0, i64 %1) {
%3 = alloca float*
%4 = alloca i64
store float* %0, float** %3
store i64 %1, i64* %4
%5 = load float*, float** %3
%6 = load i64, i64* %4
%7 = mul i64 %6, 4
%8 = call i32 @memset(float* %5, i32 -1, i64 %7)
ret void
}

LLVM IR (-O2):
define void @fvec_nan(float* %0, i64 %1) {
%3 = shl i64 %1, 2
%4 = tail call i32 @memset(float* %0, i32 -1, i64 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int ioctl(int, int /*<<< orphan*/);
int CED_BlkTransState(int fh) { return ioctl(fh, _IO(0xce, 19)); }


x86 assembly (clang, -O0):
<CED_BlkTransState>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0xce,%edi
mov    $0x13,%esi
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CED_BlkTransState>:
push   %rbx
mov    %edi,%ebx
mov    $0xce,%edi
mov    $0x13,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @CED_BlkTransState(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_IO(i32 206, i32 19)
%5 = call i32 @ioctl(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @CED_BlkTransState(i32 %0) {
%2 = tail call i32 @_IO(i32 206, i32 19)
%3 = tail call i32 @ioctl(i32 %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ write_src(char *);
void JUMP_handler(void) { write_src("JUMP(POP());\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"JUMP(POP());\0A\00"
define void @JUMP_handler() {
%1 = call i32 @write_src(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"JUMP(POP());\0A\00"
define void @JUMP_handler() {
%1 = tail call i32 @write_src(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_c_int(int x) { printf("x is %d\n", x); }


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

x86 assembly (clang, -O2):
<print_c_int>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"x is %d\0A\00"
define void @print_c_int(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int test_02(unsigned char *x) { return x[1]; }


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

x86 assembly (clang, -O2):
<test_02>:
movzbl 0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @test_02(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test_02(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int x;
  scanf("%d", &x);
  printf("%d", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
int test_170_16(int *mem) {
  int newval = 5;
  int prevval;
  __atomic_exchange(mem + 0, &newval, &prevval, 4);
  return prevval;
}


x86 assembly (clang, -O0):
<test_170_16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%eax
xchg   %eax,(%rcx)
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_170_16>:
mov    $0x5,%eax
xchg   %eax,(%rdi)
ret

LLVM IR (-O0):
define i32 @test_170_16(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
store i32 5, i32* %3
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %3
%8 = atomicrmw xchg i32* %6, i32 %7 acq_rel
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_170_16(i32* nocapture %0) {
%2 = atomicrmw xchg i32* %0, i32 5 acq_rel
ret i32 %2
}
/* Variables and functions */
unsigned int uart_getc();
unsigned int uart_read_int(void) {
  unsigned int ret = 0;
  unsigned int next_digit = 0;
  ret = 0;
  while (10 * ret < (1 << 32) - 1) {
    next_digit = uart_getc();
    if ((next_digit - 0x30) >= 0 && (next_digit - 0x30) <= 9)
      ret = 10 * ret + (next_digit - 0x30);
    else
      return ret;
  }
  return ret;
}


x86 assembly (clang, -O0):
<uart_read_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
imul   $0xa,-0x8(%rbp),%eax
cmp    %ecx,%eax
jae    1185 <uart_read_int+0x75>
mov    $0x0,%al
call   1030 <uart_getc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x30,%eax
cmp    $0x0,%eax
jb     1175 <uart_read_int+0x65>
mov    -0xc(%rbp),%eax
sub    $0x30,%eax
cmp    $0x9,%eax
ja     1175 <uart_read_int+0x65>
imul   $0xa,-0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    1180 <uart_read_int+0x70>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    118b <uart_read_int+0x7b>
jmp    112d <uart_read_int+0x1d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @uart_read_int() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %2
br label %4
4: ; preds = %25, %0
%5 = load i32, i32* %2
%6 = mul i32 10, %5
%7 = icmp ult i32 %6, poison
br i1 %7, label %8, label %26
8: ; preds = %4
%9 = call i32 (...) @uart_getc()
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = sub i32 %10, 48
%12 = icmp uge i32 %11, 0
br i1 %12, label %13, label %23
13: ; preds = %8
%14 = load i32, i32* %3
%15 = sub i32 %14, 48
%16 = icmp ule i32 %15, 9
br i1 %16, label %17, label %23
17: ; preds = %13
%18 = load i32, i32* %2
%19 = mul i32 10, %18
%20 = load i32, i32* %3
%21 = sub i32 %20, 48
%22 = add i32 %19, %21
store i32 %22, i32* %2
br label %25
23: ; preds = %13, %8
%24 = load i32, i32* %2
store i32 %24, i32* %1
br label %28
25: ; preds = %17
br label %4
26: ; preds = %4
%27 = load i32, i32* %2
store i32 %27, i32* %1
br label %28
28: ; preds = %26, %23
%29 = load i32, i32* %1
ret i32 %29
}

LLVM IR (-O2):
define i32 @uart_read_int() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ fpos_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgetpos(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
void crash_fgetpos() {
  FILE *f;
  fpos_t position;
  f = fopen("this_file_doesnt_exist", "r");
  fgetpos(f, &position);
  fclose(f);
}


x86 assembly (clang, -O0):
<crash_fgetpos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <fgetpos@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crash_fgetpos>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
lea    0xc(%rsp),%rsi
mov    %rax,%rdi
call   1040 <fgetpos@plt>
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
define void @crash_fgetpos() {
%1 = alloca i32*
%2 = alloca i32
%3 = call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = call i32 @fgetpos(i32* %4, i32* %2)
%6 = load i32*, i32** %1
%7 = call i32 @fclose(i32* %6)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
define void @crash_fgetpos() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @fgetpos(i32* %3, i32* %1)
%5 = tail call i32 @fclose(i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mat3d_rotateAxisVec_new(double *, double, double *);
int /*<<< orphan*/ vec3d_set(double *, double, double, double);
void mat3d_rotateAxis_new(double result[9], double degrees, double axisX,
                          double axisY, double axisZ) {
  double vec[3];
  vec3d_set(vec, axisX, axisY, axisZ);
  mat3d_rotateAxisVec_new(result, degrees, vec);
}


x86 assembly (clang, -O0):
<mat3d_rotateAxis_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
lea    -0x40(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
call   1030 <vec3d_set@plt>
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
lea    -0x40(%rbp),%rsi
call   1040 <mat3d_rotateAxisVec_new@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat3d_rotateAxis_new>:
push   %r14
push   %rbx
sub    $0x28,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %rdi,%rbx
lea    0x10(%rsp),%r14
mov    %r14,%rdi
movaps %xmm1,%xmm0
movaps %xmm2,%xmm1
movaps %xmm3,%xmm2
call   1030 <vec3d_set@plt>
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
mov    %r14,%rsi
call   1040 <mat3d_rotateAxisVec_new@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @mat3d_rotateAxis_new(double* %0, double %1, double %2, double %3, double %4) {
%6 = alloca double*
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca [3 x double]
store double* %0, double** %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%12 = getelementptr inbounds [3 x double], [3 x double]* %11, i64 0, i64 0
%13 = load double, double* %8
%14 = load double, double* %9
%15 = load double, double* %10
%16 = call i32 @vec3d_set(double* %12, double %13, double %14, double %15)
%17 = load double*, double** %6
%18 = load double, double* %7
%19 = getelementptr inbounds [3 x double], [3 x double]* %11, i64 0, i64 0
%20 = call i32 @mat3d_rotateAxisVec_new(double* %17, double %18, double* %19)
ret void
}

LLVM IR (-O2):
define void @mat3d_rotateAxis_new(double* %0, double %1, double %2, double %3, double %4) {
%6 = alloca [3 x double]
%7 = bitcast [3 x double]* %6 to i8*
%8 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%9 = call i32 @vec3d_set(double* %8, double %2, double %3, double %4)
%10 = call i32 @mat3d_rotateAxisVec_new(double* %0, double %1, double* %8)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ fmaxf(int /*<<< orphan*/, float const);
int /*<<< orphan*/ fminf(float, float const);
int /*<<< orphan*/ roundf(int /*<<< orphan*/);
int16_t clamp16_from_float(float f) {
  static const float scale = 1 << 15;
  return roundf(fmaxf(fminf(f * scale, scale - 1.f), -scale));
}


x86 assembly (clang, -O0):
<clamp16_from_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xec3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  0xeb2(%rip),%xmm1
call   1030 <fminf@plt>
mov    %eax,%edi
movss  0xe9f(%rip),%xmm0
call   1040 <fmaxf@plt>
mov    %eax,%edi
call   1050 <roundf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp16_from_float>:
push   %rax
mulss  0xec7(%rip),%xmm0
movss  0xec3(%rip),%xmm1
call   1030 <fminf@plt>
movss  0xeba(%rip),%xmm0
mov    %eax,%edi
call   1040 <fmaxf@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <roundf@plt>

LLVM IR (-O0):
@clamp16_from_float.scale = internal constant float 3.276800e+04
define i32 @clamp16_from_float(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 3.276800e+04
%5 = call i32 @fminf(float %4, float 3.276700e+04)
%6 = call i32 @fmaxf(i32 %5, float -3.276800e+04)
%7 = call i32 @roundf(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @clamp16_from_float(float %0) {
%2 = fmul float %0, 3.276800e+04
%3 = tail call i32 @fminf(float %2, float 3.276700e+04)
%4 = tail call i32 @fmaxf(i32 %3, float -3.276800e+04)
%5 = tail call i32 @roundf(i32 %4)
ret i32 %5
}
void copy_mc_inject_src(void *addr) {}


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

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

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

LLVM IR (-O2):
define void @copy_mc_inject_src(i8* nocapture %0) {
ret void
}
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  unsigned int local1;
  {
    state[0UL] = (input[0UL] | 51238316UL) >> 3U;
    local1 = 0UL;
    while (local1 < 0U) {
      state[0UL] <<= ((state[0UL] >> 3U) & 7U) | 1UL;
      local1 += 2UL;
    }
    output[0UL] = (state[0UL] | 28054104UL) | 326507717U;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
or     $0x30dd5ac,%rax
shr    $0x3,%rax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jae    1158 <RandomFunc+0x58>
mov    -0x14(%rbp),%eax
shr    $0x3,%eax
and    $0x7,%eax
mov    %eax,%eax
mov    %eax,%ecx
or     $0x1,%rcx
mov    -0x14(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x2,%rax
mov    %eax,-0x18(%rbp)
jmp    1126 <RandomFunc+0x26>
mov    -0x14(%rbp),%eax
or     $0x1ac1258,%rax
or     $0x13761cc5,%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%eax
shr    $0x3,%eax
or     $0x13ffbefd,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [1 x i32]
%6 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = zext i32 %9 to i64
%11 = or i64 %10, 51238316
%12 = lshr i64 %11, 3
%13 = trunc i64 %12 to i32
%14 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
store i32 %13, i32* %14
store i32 0, i32* %6
br label %15
15: ; preds = %18, %2
%16 = load i32, i32* %6
%17 = icmp ult i32 %16, 0
br i1 %17, label %18, label %33
18: ; preds = %15
%19 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%20 = load i32, i32* %19
%21 = lshr i32 %20, 3
%22 = and i32 %21, 7
%23 = zext i32 %22 to i64
%24 = or i64 %23, 1
%25 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%26 = load i32, i32* %25
%27 = trunc i64 %24 to i32
%28 = shl i32 %26, %27
store i32 %28, i32* %25
%29 = load i32, i32* %6
%30 = zext i32 %29 to i64
%31 = add i64 %30, 2
%32 = trunc i64 %31 to i32
store i32 %32, i32* %6
br label %15
33: ; preds = %15
%34 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%35 = load i32, i32* %34
%36 = zext i32 %35 to i64
%37 = or i64 %36, 28054104
%38 = or i64 %37, 326507717
%39 = trunc i64 %38 to i32
%40 = load i32*, i32** %4
%41 = getelementptr inbounds i32, i32* %40, i64 0
store i32 %39, i32* %41
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = lshr i32 %3, 3
%5 = or i32 %4, 335527677
store i32 %5, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handleTerminateRequest() { printf("Function unimplemented!\n"); }


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"Function unimplemented!\0A\00"
define void @handleTerminateRequest() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"Function unimplemented!\00"
define void @handleTerminateRequest() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int mask_get_bit(const size_t x, const size_t i) {
  return (x >> i) & ((size_t)1);
}


x86 assembly (clang, -O0):
<mask_get_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    %cl,%rax
and    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mask_get_bit>:
mov    %rsi,%rcx
mov    %rdi,%rax
shr    %cl,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @mask_get_bit(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = lshr i64 %5, %6
%8 = and i64 %7, 1
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @mask_get_bit(i64 %0, i64 %1) {
%3 = lshr i64 %0, %1
%4 = trunc i64 %3 to i32
%5 = and i32 %4, 1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ _disable();
int /*<<< orphan*/ console_write(char const *);
void crash_and_burn(const char *Msg) {
  _disable();
  console_write("[ABORT] ");
  console_write(Msg);
  while ((1 == 1))
    ;
}


x86 assembly (clang, -O0):
<crash_and_burn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <_disable@plt>
lea    0xec6(%rip),%rdi
call   1040 <console_write@plt>
mov    -0x8(%rbp),%rdi
call   1040 <console_write@plt>
jmp    1148 <crash_and_burn+0x28>

x86 assembly (clang, -O2):
<crash_and_burn>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <_disable@plt>
lea    0xece(%rip),%rdi
call   1040 <console_write@plt>
mov    %rbx,%rdi
call   1040 <console_write@plt>
nop
jmp    1140 <crash_and_burn+0x20>

LLVM IR (-O0):
@.str = [9 x i8] c"[ABORT] \00"
define void @crash_and_burn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @_disable()
%4 = call i32 @console_write(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 @console_write(i8* %5)
br label %7
7: ; preds = %1, %7
br label %7
}

LLVM IR (-O2):
@.str = [9 x i8] c"[ABORT] \00"
define void @crash_and_burn(i8* %0) {
%2 = tail call i32 (...) @_disable()
%3 = tail call i32 @console_write(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @console_write(i8* %0)
br label %5
5: ; preds = %1, %5
br label %5
}
/* Variables and functions */
char *strchr(char *, char);
char *strxfrchar(char *s, char from, char to) {
  char *p = s;
  while ((p = strchr(p, from)) != NULL)
    *p++ = to;
  return s;
}


x86 assembly (clang, -O0):
<strxfrchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1163 <strxfrchar+0x53>
mov    -0xa(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    112f <strxfrchar+0x1f>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strxfrchar>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
call   1030 <strchr@plt>
test   %rax,%rax
je     1145 <strxfrchar+0x35>
movsbl %bpl,%ebp
nopl   0x0(%rax)
mov    %bl,(%rax)
add    $0x1,%rax
mov    %rax,%rdi
mov    %ebp,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1130 <strxfrchar+0x20>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @strxfrchar(i8* returned %0, i8 signext %1, i8 signext %2) {
%4 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %11, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %9, %6 ], [ %4, %3 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %2, i8* %7
%9 = tail call i8* @strchr(i8* dereferenceable(1) %8, i8 signext %1)
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %6
11: ; preds = %6, %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ sfree(char *);
char *specfile_stringdupenv(char *);
void specfile_setstring(char **target, char *edata) {
  if (*target) {
    sfree(*target);
  }
  *target = specfile_stringdupenv(edata);
  return;
}


x86 assembly (clang, -O0):
<specfile_setstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     114a <specfile_setstring+0x2a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <sfree@plt>
mov    -0x10(%rbp),%rdi
call   1040 <specfile_stringdupenv@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<specfile_setstring>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1137 <specfile_setstring+0x17>
call   1030 <sfree@plt>
mov    %r14,%rdi
call   1040 <specfile_stringdupenv@plt>
mov    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @specfile_setstring(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 = load i8*, i8** %5
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8**, i8*** %3
%10 = load i8*, i8** %9
%11 = call i32 @sfree(i8* %10)
br label %12
12: ; preds = %8, %2
%13 = load i8*, i8** %4
%14 = call i8* @specfile_stringdupenv(i8* %13)
%15 = load i8**, i8*** %3
store i8* %14, i8** %15
ret void
}

LLVM IR (-O2):
define void @specfile_setstring(i8** nocapture %0, i8* %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @sfree(i8* %3)
br label %7
7: ; preds = %5, %2
%8 = tail call i8* @specfile_stringdupenv(i8* %1)
store i8* %8, i8** %0
ret void
}