xunge/DecIR huggingface dataset:
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  const char *name = argc > 1 ? argv[1] : "Travis";
  fprintf(stdout, "Hello World %s!\n", name);
  return EXIT_SUCCESS;
}


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)
jle    1141 <main+0x31>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    1151 <main+0x41>
lea    0xeb8(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    1151 <main+0x41>
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xe9a(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e5f(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jl     111c <main+0xc>
mov    0x8(%rsi),%rdx
jmp    1123 <main+0x13>
lea    0xedd(%rip),%rdx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"Travis\00"
@stdout = global i32 0
@.str.1 = [17 x i8] c"Hello World %s!\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
br label %14
13: ; preds = %2
br label %14
14: ; preds = %13, %9
%15 = phi i8* [ %12, %9 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %13 ]
store i8* %15, i8** %6
%16 = load i32, i32* @stdout
%17 = load i8*, i8** %6
%18 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %17)
%19 = load i32, i32* @EXIT_SUCCESS
ret i32 %19
}

LLVM IR (-O2):
@.str = [7 x i8] c"Travis\00"
@stdout = global i32 0
@.str.1 = [17 x i8] c"Hello World %s!\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
br label %7
7: ; preds = %2, %4
%8 = phi i8* [ %6, %4 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %2 ]
%9 = load i32, i32* @stdout
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}
void TestAppP$Leds$led0Off(void) { LedsP$Leds$led0Off(); }


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

x86 assembly (clang, -O2):
<TestAppP$Leds$led0Off>:
xor    %eax,%eax
jmp    1030 <LedsP$Leds$led0Off@plt>

LLVM IR (-O0):
define void @"TestAppP$Leds$led0Off"() {
%1 = call i32 (...) @"LedsP$Leds$led0Off"()
ret void
}

LLVM IR (-O2):
define void @"TestAppP$Leds$led0Off"() {
%1 = tail call i32 (...) @"LedsP$Leds$led0Off"()
ret void
}
int GET_NWORDS(int len) {
  return len > 0 ? (len - 1) / (sizeof(unsigned int) * 8) + 1 : 0;
}


x86 assembly (clang, -O0):
<GET_NWORDS>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    112a <GET_NWORDS+0x2a>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
cltq
shr    $0x5,%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1135 <GET_NWORDS+0x35>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    1135 <GET_NWORDS+0x35>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GET_NWORDS>:
lea    -0x1(%rdi),%ecx
shr    $0x5,%ecx
add    $0x1,%ecx
xor    %eax,%eax
test   %edi,%edi
cmovg  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @GET_NWORDS(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = udiv i64 %8, 32
%10 = add i64 %9, 1
br label %12
11: ; preds = %1
br label %12
12: ; preds = %11, %5
%13 = phi i64 [ %10, %5 ], [ 0, %11 ]
%14 = trunc i64 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @GET_NWORDS(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = add nsw i32 %0, -1
%4 = lshr i32 %3, 5
%5 = add nuw nsw i32 %4, 1
%6 = select i1 %2, i32 %5, i32 0
ret i32 %6
}
int fun941() { return 941; }


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

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

LLVM IR (-O0):
define i32 @fun941() {
ret i32 941
}

LLVM IR (-O2):
define i32 @fun941() {
ret i32 941
}
void uex_free(void *p) {}


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

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

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

LLVM IR (-O2):
define void @uex_free(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ SVCXPRT;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ *svcfd_create(int, int /*<<< orphan*/, int /*<<< orphan*/);
int main(int argn, char *argc[]) {
  int run_mode = 0;
  int test_status = 1;
  int fd = 0;
  SVCXPRT *svcr = NULL;
  svcr = svcfd_create(fd, 0, 0);
  test_status = ((SVCXPRT *)svcr != NULL) ? 0 : 1;
  printf("%d\n", test_status);
  return test_status;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x1c(%rbp),%edi
xor    %edx,%edx
mov    %edx,%esi
call   1040 <svcfd_create@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <svcfd_create@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
lea    0xec5(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 1, i32* %7
store i32 0, i32* %8
store i32* null, i32** %9
%10 = load i32, i32* %8
%11 = call i32* @svcfd_create(i32 %10, i32 0, i32 0)
store i32* %11, i32** %9
%12 = load i32*, i32** %9
%13 = icmp ne i32* %12, null
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 0, i32 1
store i32 %15, i32* %7
%16 = load i32, i32* %7
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @svcfd_create(i32 0, i32 0, i32 0)
%4 = icmp eq i32* %3, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 %5
}
/* Variables and functions */
void cc3_camera_set_auto_exposure(bool exp) {}


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

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

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

LLVM IR (-O2):
define void @cc3_camera_set_auto_exposure(i32 %0) {
ret void
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int __cpu_to_le16(int);
int ieee80211_has_order(__le16 fc) { return (fc & __cpu_to_le16(0x8000)) != 0; }


x86 assembly (clang, -O0):
<ieee80211_has_order>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x8000,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_has_order>:
push   %rbx
mov    %edi,%ebx
mov    $0x8000,%edi
call   1030 <__cpu_to_le16@plt>
xor    %ecx,%ecx
test   %ebx,%eax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ieee80211_has_order(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @__cpu_to_le16(i32 32768)
%5 = and i32 %3, %4
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @ieee80211_has_order(i32 %0) {
%2 = tail call i32 @__cpu_to_le16(i32 32768)
%3 = and i32 %2, %0
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char);
int /*<<< orphan*/ stdout;
void print_squares_comp(char *squares) {
  for (int i = 0; i < 64; i++) {
    fprintf(stdout, "%d ", squares[i]);
  }
}


x86 assembly (clang, -O0):
<print_squares_comp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x40,-0xc(%rbp)
jge    115c <print_squares_comp+0x4c>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
lea    0xebb(%rip),%rsi
movsbl (%rax,%rcx,1),%edx
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <print_squares_comp+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_squares_comp>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r15
xor    %ebx,%ebx
mov    0x2ebc(%rip),%r12
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r12),%edi
movsbl (%r15,%rbx,1),%edx
mov    %r14,%rsi
call   1030 <fprintf@plt>
add    $0x1,%rbx
cmp    $0x40,%rbx
jne    1130 <print_squares_comp+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [4 x i8] c"%d \00"
define void @print_squares_comp(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %15, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 64
br i1 %6, label %7, label %18
7: ; preds = %4
%8 = load i32, i32* @stdout
%9 = load i8*, i8** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = load i8, i8* %12
%14 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %13)
br label %15
15: ; preds = %7
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %4
18: ; preds = %4
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"%d \00"
define void @print_squares_comp(i8* nocapture %0) {
br label %3
2: ; preds = %3
ret void
3: ; preds = %1, %3
%4 = phi i64 [ 0, %1 ], [ %9, %3 ]
%5 = load i32, i32* @stdout
%6 = getelementptr inbounds i8, i8* %0, i64 %4
%7 = load i8, i8* %6
%8 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %7)
%9 = add nuw nsw i64 %4, 1
%10 = icmp eq i64 %9, 64
br i1 %10, label %2, label %3
}
/* Variables and functions */
int /*<<< orphan*/ bar(unsigned long long);
void foo(unsigned long long n) {
  unsigned long long i;
#pragma omp for schedule(nonmonotonic : dynamic)
  for (i = 0; i < n; ++i)
    bar(i);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    114c <foo+0x3c>
mov    -0x10(%rbp),%rdi
call   1030 <bar@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <foo+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1131 <foo+0x21>
mov    %rdi,%r14
xor    %ebx,%ebx
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <bar@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1120 <foo+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @foo(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @bar(i64 %4)
%6 = add nuw i64 %4, 1
%7 = icmp eq i64 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
FILE *efopen(const char *fname) {
  FILE *fp;
  if ((fp = fopen(fname, "rb")) == NULL) {
    fprintf(stderr, "Err: could not open file \"%s\"\n", fname);
    exit(EXIT_FAILURE);
  }
  return fp;
}


x86 assembly (clang, -O0):
<efopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1181 <efopen+0x51>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe95(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<efopen>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1147 <efopen+0x17>
pop    %rbx
ret
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
@stderr = global i32 0
@.str.1 = [31 x i8] c"Err: could not open file \22%s\22\0A\00"
@EXIT_FAILURE = global i32 0
define i32* @efopen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %2
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %1
%14 = load i32*, i32** %3
ret i32* %14
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
@stderr = global i32 0
@.str.1 = [31 x i8] c"Err: could not open file \22%s\22\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i32* @efopen(i8* %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i32* %2
}
void CIntOct(int *p, int target) {
  if (target == 1) {
    *p = 1;
  } else {
    *p = target % 8;
    CIntOct(--p, (int)(target / 8));
  }
}


x86 assembly (clang, -O0):
<CIntOct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1138 <CIntOct+0x28>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
jmp    1167 <CIntOct+0x57>
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
mov    %edx,(%rax)
mov    -0x8(%rbp),%rdi
add    $0xfffffffffffffffc,%rdi
mov    %rdi,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
call   1030 <CIntOct@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CIntOct>:
cmp    $0x1,%esi
je     1134 <CIntOct+0x34>
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x7(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
mov    %eax,%ecx
and    $0xfffffff8,%ecx
mov    %esi,%edx
sub    %ecx,%edx
mov    %edx,(%rdi)
add    $0xfffffffffffffffc,%rdi
sar    $0x3,%eax
and    $0xfffffff8,%esi
cmp    $0x8,%esi
mov    %eax,%esi
jne    1110 <CIntOct+0x10>
movl   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @CIntOct(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i32*, i32** %3
store i32 1, i32* %8
br label %17
9: ; preds = %2
%10 = load i32, i32* %4
%11 = srem i32 %10, 8
%12 = load i32*, i32** %3
store i32 %11, i32* %12
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i32 -1
store i32* %14, i32** %3
%15 = load i32, i32* %4
%16 = sdiv i32 %15, 8
br label %17
17: ; preds = %9, %7
ret void
}

LLVM IR (-O2):
define void @CIntOct(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 1
br i1 %3, label %4, label %6
4: ; preds = %6, %2
%5 = phi i32* [ %0, %2 ], [ %10, %6 ]
store i32 1, i32* %5
ret void
6: ; preds = %2, %6
%7 = phi i32 [ %11, %6 ], [ %1, %2 ]
%8 = phi i32* [ %10, %6 ], [ %0, %2 ]
%9 = srem i32 %7, 8
store i32 %9, i32* %8
%10 = getelementptr inbounds i32, i32* %8, i64 -1
%11 = sdiv i32 %7, 8
%12 = and i32 %7, -8
%13 = icmp eq i32 %12, 8
br i1 %13, label %4, label %6
}
unsigned addval_433(unsigned x) { return x + 3221280393U; }


x86 assembly (clang, -O0):
<addval_433>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc000d689,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addval_433>:
lea    -0x3fff2977(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @addval_433(i32 %0) {
%2 = add i32 %0, -1073686903
ret i32 %2
}
char *getname() {
  static char *name = "EEE 13";
  return name;
}


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

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

LLVM IR (-O0):
@getname.name = internal global i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i32 0, i32 0)
@.str = [7 x i8] c"EEE 13\00"
define i8* @getname() {
%1 = load i8*, i8** @getname.name
ret i8* %1
}

LLVM IR (-O2):
@.str = [7 x i8] c"EEE 13\00"
define i8* @getname() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite_int64;
typedef int /*<<< orphan*/ sqlite3_file;

/* Variables and functions */
int SQLITE_OK;
int /*<<< orphan*/ printfHelper(char *);
int wrap_Truncate(sqlite3_file *pFile, sqlite_int64 size) {
  printfHelper("wrap_Truncate\n");
  return SQLITE_OK;
}


x86 assembly (clang, -O0):
<wrap_Truncate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printfHelper@plt>
mov    0x2eb6(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrap_Truncate>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printfHelper@plt>
mov    0x2ec4(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"wrap_Truncate\0A\00"
@SQLITE_OK = global i32 0
define i32 @wrap_Truncate(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = call i32 @printfHelper(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @SQLITE_OK
ret i32 %6
}

LLVM IR (-O2):
@.str = [15 x i8] c"wrap_Truncate\0A\00"
@SQLITE_OK = global i32 0
define i32 @wrap_Truncate(i32* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @printfHelper(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @SQLITE_OK
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EMLINK;
int /*<<< orphan*/ errno;
int link(char *old, char *new) {
  errno = EMLINK;
  return -1;
}


x86 assembly (clang, -O0):
<link>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<link>:
mov    0x2ee9(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EMLINK = global i32 0
@errno = global i32 0
define i32 @link(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @EMLINK
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EMLINK = global i32 0
@errno = global i32 0
define i32 @link(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EMLINK
store i32 %3, i32* @errno
ret i32 -1
}
int notEqual(int lhs, int rhs) { return lhs != rhs; }


x86 assembly (clang, -O0):
<notEqual>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<notEqual>:
xor    %eax,%eax
cmp    %esi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @notEqual(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp ne i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @notEqual(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void xfs_qm_init_procfs(void) {}


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

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

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

LLVM IR (-O2):
define void @xfs_qm_init_procfs() {
ret void
}
/* Variables and functions */
double atan2(double, double);
double atan22(double y, double x) {
  double a;
  a = atan2(y, x);
  if (a < 0)
    a += 6.28318530717959;
  return (a);
}


x86 assembly (clang, -O0):
<atan22>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <atan2@plt>
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1156 <atan22+0x46>
movsd  0xeb4(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atan22>:
push   %rax
call   1030 <atan2@plt>
movsd  0xee2(%rip),%xmm2
addsd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @atan22(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = call double @atan2(double %6, double %7)
store double %8, double* %5
%9 = load double, double* %5
%10 = fcmp olt double %9, 0.000000e+00
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load double, double* %5
%13 = fadd double %12, 0x401921FB54442D1C
store double %13, double* %5
br label %14
14: ; preds = %11, %2
%15 = load double, double* %5
ret double %15
}

LLVM IR (-O2):
define double @atan22(double %0, double %1) {
%3 = tail call double @atan2(double %0, double %1)
%4 = fcmp olt double %3, 0.000000e+00
%5 = fadd double %3, 0x401921FB54442D1C
%6 = select i1 %4, double %5, double %3
ret double %6
}
ich(pn) int pn;
{ brc(pn, '@'); }


x86 assembly (clang, -O0):
<ich>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x40,%esi
mov    $0x0,%al
call   1030 <brc@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ich>:
mov    $0x40,%esi
xor    %eax,%eax
jmp    1030 <brc@plt>

LLVM IR (-O0):
define i32 @ich(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, i32, ...) bitcast (i32 (...)* @brc to i32 (i32, i32, ...)*)(i32 %4, i32 64)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @ich(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @brc to i32 (i32, i32, ...)*)(i32 %0, i32 64)
ret i32 undef
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISREG(int /*<<< orphan*/);
int /*<<< orphan*/ stat(char *, struct stat *);
int /*<<< orphan*/ testOpenFile(char *);
int fileExists(char *path) {
  struct stat stat_p;
  stat(path, &stat_p);
  return S_ISREG(stat_p.st_mode) && !testOpenFile(path);
}


x86 assembly (clang, -O0):
<fileExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    -0x10(%rbp),%edi
call   1040 <S_ISREG@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     1177 <fileExists+0x47>
mov    -0x8(%rbp),%rdi
call   1050 <testOpenFile@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileExists>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
call   1030 <stat@plt>
mov    0x8(%rsp),%edi
call   1040 <S_ISREG@plt>
test   %rax,%rax
je     1163 <fileExists+0x33>
mov    %rbx,%rdi
call   1050 <testOpenFile@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
jmp    1165 <fileExists+0x35>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @fileExists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%7 = load i32, i32* %6
%8 = call i64 @S_ISREG(i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %1
%11 = load i8*, i8** %2
%12 = call i32 @testOpenFile(i8* %11)
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
br label %15
15: ; preds = %10, %1
%16 = phi i1 [ false, %1 ], [ %14, %10 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @fileExists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i64 @S_ISREG(i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %1
%10 = tail call i32 @testOpenFile(i8* %0)
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %9, %1
%14 = phi i32 [ 0, %1 ], [ %12, %9 ]
ret i32 %14
}
void log10ify(void *number) {
  printf("%s:%d: %s ("
         "%.15g"
         ")\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/joshuapena/cmps012b-wm-w15/refs/heads/"
         "master/mackey/labs/lab9c-voidstar-generic/examples/numberproc.c",
         20, __func__, *(double *)number);
  ;
  double *value = (double *)number;
  *value = log10(*value);
}


x86 assembly (clang, -O0):
<log10ify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xec5(%rip),%rdi
lea    0xed1(%rip),%rsi
mov    $0x14,%edx
lea    0xf85(%rip),%rcx
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
call   1040 <log10@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log10ify>:
push   %rbx
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
lea    0xed1(%rip),%rdi
lea    0xedd(%rip),%rsi
lea    0xf96(%rip),%rcx
mov    $0x14,%edx
mov    $0x1,%al
call   1030 <printf@plt>
movsd  (%rbx),%xmm0
call   1040 <log10@plt>
movsd  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"%s:%d: %s (%.15g)\0A\00"
@.str.1 = [192 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/joshuapena/cmps012b-wm-w15/refs/heads/master/mackey/labs/lab9c-voidstar-generic/examples/numberproc.c\00"
@__func__.log10ify = [9 x i8] c"log10ify\00"
define void @log10ify(i8* %0) {
%2 = alloca i8*
%3 = alloca double*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to double*
%6 = load double, double* %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([192 x i8], [192 x i8]* @.str.1, i64 0, i64 0), i32 20, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.log10ify, i64 0, i64 0), double %6)
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to double*
store double* %9, double** %3
%10 = load double*, double** %3
%11 = load double, double* %10
%12 = call double @log10(double %11)
%13 = load double*, double** %3
store double %12, double* %13
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"%s:%d: %s (%.15g)\0A\00"
@.str.1 = [192 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/joshuapena/cmps012b-wm-w15/refs/heads/master/mackey/labs/lab9c-voidstar-generic/examples/numberproc.c\00"
@__func__.log10ify = [9 x i8] c"log10ify\00"
define void @log10ify(i8* nocapture %0) {
%2 = bitcast i8* %0 to double*
%3 = load double, double* %2
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([192 x i8], [192 x i8]* @.str.1, i64 0, i64 0), i32 20, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.log10ify, i64 0, i64 0), double %3)
%5 = load double, double* %2
%6 = tail call double @log10(double %5)
store double %6, double* %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *opendir(char *);
int /*<<< orphan*/ setgid(int);
int /*<<< orphan*/ setuid(int);
void group_test_5() {
  DIR *dirp = NULL;
  do {
    setgid((100) + 1);
    setuid(101);
  } while (0);
  dirp = opendir("DIR_046/sub");
  exit(dirp != NULL);
}


x86 assembly (clang, -O0):
<group_test_5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    $0x65,%edi
call   1040 <setgid@plt>
mov    $0x65,%edi
call   1060 <setuid@plt>
lea    0xe95(%rip),%rdi
call   1030 <opendir@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<group_test_5>:
push   %rax
mov    $0x65,%edi
call   1040 <setgid@plt>
mov    $0x65,%edi
call   1060 <setuid@plt>
lea    0xea4(%rip),%rdi
call   1030 <opendir@plt>
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"DIR_046/sub\00"
define void @group_test_5() {
%1 = alloca i32*
store i32* null, i32** %1
br label %2
2: ; preds = %0
%3 = call i32 @setgid(i32 101)
%4 = call i32 @setuid(i32 101)
br label %5
5: ; preds = %2
%6 = call i32* @opendir(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %1
%7 = load i32*, i32** %1
%8 = icmp ne i32* %7, null
%9 = zext i1 %8 to i32
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@.str = [12 x i8] c"DIR_046/sub\00"
define void @group_test_5() {
%1 = tail call i32 @setgid(i32 101)
%2 = tail call i32 @setuid(i32 101)
%3 = tail call i32* @opendir(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @exit(i32 %5)
unreachable
}
int print_element(input, curr)
char *input;
char *curr;
{
  printf(" %d", *(int *)curr);
  return (1);
}


x86 assembly (clang, -O0):
<print_element>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_element>:
push   %rax
mov    (%rsi),%esi
lea    0xee6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c" %d\00"
define i32 @print_element(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 1
}

LLVM IR (-O2):
@.str = [4 x i8] c" %d\00"
define i32 @print_element(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO(int);
long int BNCWaveform() {
  long int stat = 99;
  BNCIO(26);
  return (stat);
}


x86 assembly (clang, -O0):
<BNCWaveform>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x63,-0x8(%rbp)
mov    $0x1a,%edi
call   1030 <BNCIO@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNCWaveform>:
push   %rax
mov    $0x1a,%edi
call   1030 <BNCIO@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @BNCWaveform() {
%1 = alloca i64
store i64 99, i64* %1
%2 = call i32 @BNCIO(i32 26)
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @BNCWaveform() {
%1 = tail call i32 @BNCIO(i32 26)
ret i64 99
}
/* Variables and functions */
int /*<<< orphan*/ print(char *, char const *);
int user_multiboot(const char *file) {
  print("\t(template driver) user_multiboot(%s)\n", file);
  return 0;
}


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

x86 assembly (clang, -O2):
<user_multiboot>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <print@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"\09(template driver) user_multiboot(%s)\0A\00"
define i32 @user_multiboot(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @print(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"\09(template driver) user_multiboot(%s)\0A\00"
define i32 @user_multiboot(i8* %0) {
%2 = tail call i32 @print(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
void dead(unsigned int deadcode) {
  set_std_color(0x4);
  printf("Critical fault of %x\n", 0xDEADDEAD);
  printf("Section %x\n", deadcode);
  printf("processor halt!");
  while (1) {
    __asm__("hlt;");
  }
}


x86 assembly (clang, -O0):
<dead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x4,%edi
mov    $0x0,%al
call   1040 <set_std_color@plt>
lea    0xec2(%rip),%rdi
mov    $0xdeaddead,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
hlt
jmp    1169 <dead+0x49>

x86 assembly (clang, -O2):
<dead>:
push   %rbx
mov    %edi,%ebx
mov    $0x4,%edi
xor    %eax,%eax
call   1040 <set_std_color@plt>
lea    0xeca(%rip),%rdi
mov    $0xdeaddead,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
hlt
jmp    1160 <dead+0x40>

LLVM IR (-O0):
@.str = [22 x i8] c"Critical fault of %x\0A\00"
@.str.1 = [12 x i8] c"Section %x\0A\00"
@.str.2 = [16 x i8] c"processor halt!\00"
define void @dead(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i32, ...) bitcast (i32 (...)* @set_std_color to i32 (i32, ...)*)(i32 4)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 -559030611)
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
br label %8
8: ; preds = %1, %8
br label %8
}

LLVM IR (-O2):
@.str = [22 x i8] c"Critical fault of %x\0A\00"
@.str.1 = [12 x i8] c"Section %x\0A\00"
@.str.2 = [16 x i8] c"processor halt!\00"
define void @dead(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @set_std_color to i32 (i32, ...)*)(i32 4)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 -559030611)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
br label %6
6: ; preds = %1, %6
tail call void asm sideeffect "hlt;", "~{dirflag},~{fpsr},~{flags}"()
br label %6
}
void av_codec_set_pkt_timebase() {}


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

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

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

LLVM IR (-O2):
define void @av_codec_set_pkt_timebase() {
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
void write_be32(FILE *out, uint32_t p) {
  unsigned char q[4];
  q[0] = (p >> 24) & 0xFF;
  q[1] = (p >> 16) & 0xFF;
  q[2] = (p >> 8) & 0xFF;
  q[3] = p & 0xFF;
  fwrite(q, 1, 4, out);
  return;
}


x86 assembly (clang, -O0):
<write_be32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,-0xf(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,-0xe(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,-0xd(%rbp)
lea    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_be32>:
push   %rax
mov    %rdi,%rcx
bswap  %esi
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <fwrite@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @write_be32(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca [4 x i8]
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = ashr i32 %6, 24
%8 = and i32 %7, 255
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
store i8 %9, i8* %10
%11 = load i32, i32* %4
%12 = ashr i32 %11, 16
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 1
store i8 %14, i8* %15
%16 = load i32, i32* %4
%17 = ashr i32 %16, 8
%18 = and i32 %17, 255
%19 = trunc i32 %18 to i8
%20 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 2
store i8 %19, i8* %20
%21 = load i32, i32* %4
%22 = and i32 %21, 255
%23 = trunc i32 %22 to i8
%24 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 3
store i8 %23, i8* %24
%25 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%26 = load i32*, i32** %3
%27 = call i32 @fwrite(i8* %25, i32 1, i32 4, i32* %26)
ret void
}

LLVM IR (-O2):
define void @write_be32(i32* nocapture %0, i32 %1) {
%3 = alloca [4 x i8]
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = lshr i32 %1, 24
%6 = trunc i32 %5 to i8
store i8 %6, i8* %4
%7 = lshr i32 %1, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
store i8 %8, i8* %9
%10 = lshr i32 %1, 8
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
store i8 %11, i8* %12
%13 = trunc i32 %1 to i8
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
store i8 %13, i8* %14
%15 = call i32 @fwrite(i8* %4, i32 1, i32 4, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sub(int, int, int, int);
int /*<<< orphan*/ sum(int);
int main() {
  int n;
  int y = 3;
  int z;
  int p;
  sum(n);
  sub(n, z, y, p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <sum@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1040 <sub@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <sum@plt>
mov    $0x3,%edx
call   1040 <sub@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 3, i32* %2
%5 = load i32, i32* %1
%6 = call i32 @sum(i32 %5)
%7 = load i32, i32* %1
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = load i32, i32* %4
%11 = call i32 @sub(i32 %7, i32 %8, i32 %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sum(i32 undef)
%2 = tail call i32 @sub(i32 undef, i32 undef, i32 3, i32 undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ deputy_fail_mayreturn(char const *, char const *,
                                         char const *, int, char const *);
void CLeqInt(unsigned int e1, unsigned int e2, const char *why,
             const char *text, const char *file, int line, const char *func) {
  if (!(e1 <= e2) || 0) {
    deputy_fail_mayreturn(why, text, file, line, func);
  };
}


x86 assembly (clang, -O0):
<CLeqInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jbe    1156 <CLeqInt+0x46>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    0x10(%rbp),%r8
call   1030 <deputy_fail_mayreturn@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CLeqInt>:
cmp    %esi,%edi
jbe    112d <CLeqInt+0x1d>
mov    0x8(%rsp),%rax
mov    %rdx,%rdi
mov    %rcx,%rsi
mov    %r8,%rdx
mov    %r9d,%ecx
mov    %rax,%r8
jmp    1030 <deputy_fail_mayreturn@plt>
ret

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

LLVM IR (-O2):
define void @CLeqInt(i32 %0, i32 %1, i8* %2, i8* %3, i8* %4, i32 %5, i8* %6) {
%8 = icmp ugt i32 %0, %1
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = tail call i32 @deputy_fail_mayreturn(i8* %2, i8* %3, i8* %4, i32 %5, i8* %6)
br label %11
11: ; preds = %9, %7
ret void
}
void finn_vec2_add_vec2(float *result, float *lhs, float *rhs) {
  result[0] = lhs[0] + rhs[0];
  result[1] = lhs[1] + rhs[1];
}


x86 assembly (clang, -O0):
<finn_vec2_add_vec2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
addss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
addss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<finn_vec2_add_vec2>:
movss  (%rsi),%xmm0
addss  (%rdx),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
addss  0x4(%rdx),%xmm0
movss  %xmm0,0x4(%rdi)
ret

LLVM IR (-O0):
define void @finn_vec2_add_vec2(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %5
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %6
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fadd float %9, %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = load float*, float** %5
%17 = getelementptr inbounds float, float* %16, i64 1
%18 = load float, float* %17
%19 = load float*, float** %6
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %20
%22 = fadd float %18, %21
%23 = load float*, float** %4
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
ret void
}

LLVM IR (-O2):
define void @finn_vec2_add_vec2(float* nocapture writeonly %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %1
%5 = load float, float* %2
%6 = fadd float %4, %5
store float %6, float* %0
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %2, i64 1
%10 = load float, float* %9
%11 = fadd float %8, %10
%12 = getelementptr inbounds float, float* %0, i64 1
store float %11, float* %12
ret void
}