xunge/DecIR huggingface dataset:
int func3(int x) { return (x + 4); }


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

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

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

LLVM IR (-O2):
define i32 @func3(i32 %0) {
%2 = add nsw i32 %0, 4
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ aescryptd();
int bstop() { aescryptd(); }


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

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

LLVM IR (-O0):
define i32 @bstop() {
%1 = alloca i32
%2 = call i32 (...) @aescryptd()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @bstop() {
%1 = tail call i32 (...) @aescryptd()
ret i32 undef
}
int sfd_isupper(const char c) { return (c >= 'A' && c <= 'Z'); }


x86 assembly (clang, -O0):
<sfd_isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <sfd_isupper+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sfd_isupper>:
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @sfd_isupper(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ draw_msg_at_color(int, int, int, int);
void grey_msg_at(int x, int y) { draw_msg_at_color(x, y, 84, 80); }


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

x86 assembly (clang, -O2):
<grey_msg_at>:
mov    $0x54,%edx
mov    $0x50,%ecx
jmp    1030 <draw_msg_at_color@plt>

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

LLVM IR (-O2):
define void @grey_msg_at(i32 %0, i32 %1) {
%3 = tail call i32 @draw_msg_at_color(i32 %0, i32 %1, i32 84, i32 80)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
int /*<<< orphan*/ foo(int);
int source();
void test(void) {
  int t = source();
  foo(t);
  bar(t);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <source@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <foo@plt>
mov    -0x4(%rbp),%edi
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
xor    %eax,%eax
call   1050 <source@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <foo@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <bar@plt>

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

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 (...) @source()
%2 = tail call i32 @foo(i32 %1)
%3 = tail call i32 @bar(i32 %1)
ret void
}
int isLegalCell(int boardDimen, int row, int col) {
  if (row < 0 || col < 0 || row >= boardDimen || col >= boardDimen)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<isLegalCell>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1139 <isLegalCell+0x39>
cmpl   $0x0,-0x10(%rbp)
jl     1139 <isLegalCell+0x39>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1139 <isLegalCell+0x39>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1145 <isLegalCell+0x45>
movl   $0x0,-0x4(%rbp)
jmp    114c <isLegalCell+0x4c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLegalCell>:
mov    %edx,%eax
or     %esi,%eax
setns  %al
cmp    %edi,%esi
setl   %cl
and    %al,%cl
cmp    %edi,%edx
setl   %al
and    %cl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @isLegalCell(i32 %0, i32 %1, i32 %2) {
%4 = or i32 %2, %1
%5 = icmp sgt i32 %4, -1
%6 = icmp slt i32 %1, %0
%7 = and i1 %6, %5
%8 = icmp slt i32 %2, %0
%9 = and i1 %8, %7
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int s_issem(mode_t mode) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @s_issem(i32 %0) {
ret i32 -1
}
/* Variables and functions */
unsigned long *malloc_frame_aligned(int);
int /*<<< orphan*/ memset(unsigned long *, int /*<<< orphan*/, int);
unsigned long *new_page_dir() {
  unsigned long *ans = malloc_frame_aligned(1024 * sizeof(long));
  memset(ans, 0, 1024 * sizeof(long));
  return ans;
}


x86 assembly (clang, -O0):
<new_page_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2000,%edi
call   1030 <malloc_frame_aligned@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x2000,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_page_dir>:
push   %rbx
mov    $0x2000,%edi
call   1030 <malloc_frame_aligned@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x2000,%edx
call   1040 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64* @new_page_dir() {
%1 = alloca i64*
%2 = call i64* @malloc_frame_aligned(i32 8192)
store i64* %2, i64** %1
%3 = load i64*, i64** %1
%4 = call i32 @memset(i64* %3, i32 0, i32 8192)
%5 = load i64*, i64** %1
ret i64* %5
}

LLVM IR (-O2):
define i64* @new_page_dir() {
%1 = tail call i64* @malloc_frame_aligned(i32 8192)
%2 = tail call i32 @memset(i64* %1, i32 0, i32 8192)
ret i64* %1
}
void CopyRow_Any_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @CopyRow_Any_SSE2() {
ret void
}
void CRYPTO_get_new_dynlockid(void) {}


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

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

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

LLVM IR (-O2):
define void @CRYPTO_get_new_dynlockid() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int wbsio_spi_shutdown(void *data) {
  free(data);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @wbsio_spi_shutdown(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
/* Variables and functions */
char tolower(char);
void lowercase(char s[]) {
  int i = 0;
  while (s[i]) {
    s[i] = tolower(s[i]);
    i++;
  }
}


x86 assembly (clang, -O0):
<lowercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1161 <lowercase+0x51>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <lowercase+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lowercase>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <lowercase+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <lowercase+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @lowercase(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %11, %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 = icmp ne i8 %9, 0
br i1 %10, label %11, label %24
11: ; preds = %4
%12 = load i8*, i8** %2
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = call signext i8 @tolower(i8 signext %16)
%18 = load i8*, i8** %2
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
store i8 %17, i8* %21
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %4
24: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @lowercase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = phi i8 [ %11, %4 ], [ %2, %1 ]
%7 = phi i8* [ %10, %4 ], [ %0, %1 ]
%8 = tail call signext i8 @tolower(i8 signext %6)
store i8 %8, i8* %7
%9 = add nuw i64 %5, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ prinfo(char *, int);
void signal_handler(int sig) {
  prinfo("Signal %d received. Terminating.\n", sig);
  exit(1);
}


x86 assembly (clang, -O0):
<signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <prinfo@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<signal_handler>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <prinfo@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [34 x i8] c"Signal %d received. Terminating.\0A\00"
define void @signal_handler(i32 %0) {
%2 = tail call i32 @prinfo(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ mach64_ext_outw(int, int, void *);
void mach64_ext_outl(uint16_t port, uint32_t val, void *p) {
  ;
  switch (port) {
  default:
    mach64_ext_outw(port, val, p);
    mach64_ext_outw(port + 2, val >> 16, p);
    break;
  }
}


x86 assembly (clang, -O0):
<mach64_ext_outl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <mach64_ext_outw@plt>
mov    -0x4(%rbp),%edi
add    $0x2,%edi
mov    -0x8(%rbp),%esi
sar    $0x10,%esi
mov    -0x10(%rbp),%rdx
call   1030 <mach64_ext_outw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mach64_ext_outl>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <mach64_ext_outw@plt>
add    $0x2,%ebx
sar    $0x10,%ebp
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <mach64_ext_outw@plt>

LLVM IR (-O0):
define void @mach64_ext_outl(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
switch i32 %7, label %8 [
]
8: ; preds = %3
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = load i8*, i8** %6
%12 = call i32 @mach64_ext_outw(i32 %9, i32 %10, i8* %11)
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 2
%15 = load i32, i32* %5
%16 = ashr i32 %15, 16
%17 = load i8*, i8** %6
%18 = call i32 @mach64_ext_outw(i32 %14, i32 %16, i8* %17)
br label %19
19: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @mach64_ext_outl(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @mach64_ext_outw(i32 %0, i32 %1, i8* %2)
%5 = add nsw i32 %0, 2
%6 = ashr i32 %1, 16
%7 = tail call i32 @mach64_ext_outw(i32 %5, i32 %6, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_acceptor();
int main(int argc, char **args) {
  test_acceptor();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_acceptor()
ret i32 0
}
/* Variables and functions */
unsigned long long __blcs_u64(unsigned long long);
unsigned long long func_blcs64(unsigned long long X) { return __blcs_u64(X); }


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

x86 assembly (clang, -O2):
<func_blcs64>:
jmp    1030 <__blcs_u64@plt>

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

LLVM IR (-O2):
define i64 @func_blcs64(i64 %0) {
%2 = tail call i64 @__blcs_u64(i64 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ semctl(int, int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/);
void removesem(int sid) {
  semctl(sid, 0, IPC_RMID, 0);
  printf("Semaphore removed\n");
}


x86 assembly (clang, -O0):
<removesem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
mov    %ecx,%esi
call   1040 <semctl@plt>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removesem>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
xor    %ecx,%ecx
call   1040 <semctl@plt>
lea    0xec6(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@IPC_RMID = global i32 0
@.str = [19 x i8] c"Semaphore removed\0A\00"
define void @removesem(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @IPC_RMID
%5 = call i32 @semctl(i32 %3, i32 0, i32 %4, i32 0)
%6 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@IPC_RMID = global i32 0
@str = [18 x i8] c"Semaphore removed\00"
define void @removesem(i32 %0) {
%2 = load i32, i32* @IPC_RMID
%3 = tail call i32 @semctl(i32 %0, i32 0, i32 %2, i32 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
void zeroleft(char *numero) {
  if (*numero == '0')
    while (*numero != '\0') {
      *numero = *(numero + 1);
      ++numero;
    }
  return;
}


x86 assembly (clang, -O0):
<zeroleft>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jne    1150 <zeroleft+0x50>
jmp    111d <zeroleft+0x1d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114b <zeroleft+0x4b>
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111d <zeroleft+0x1d>
jmp    1150 <zeroleft+0x50>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zeroleft>:
cmpb   $0x30,(%rdi)
jne    111e <zeroleft+0x1e>
add    $0x1,%rdi
nopl   0x0(%rax)
movzbl (%rdi),%eax
mov    %al,-0x1(%rdi)
add    $0x1,%rdi
test   %al,%al
jne    1110 <zeroleft+0x10>
ret

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

LLVM IR (-O2):
define void @zeroleft(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 48
br i1 %3, label %4, label %9
4: ; preds = %1, %4
%5 = phi i8* [ %6, %4 ], [ %0, %1 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
void subVec3f(float *a, float *b, float *out) {
  out[0] = a[0] - b[0];
  out[1] = a[1] - b[1];
  out[2] = a[2] - b[2];
}


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

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

LLVM IR (-O0):
define void @subVec3f(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** %4
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %5
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fsub float %9, %12
%14 = load float*, float** %6
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = load float*, float** %4
%17 = getelementptr inbounds float, float* %16, i64 1
%18 = load float, float* %17
%19 = load float*, float** %5
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %20
%22 = fsub float %18, %21
%23 = load float*, float** %6
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
%25 = load float*, float** %4
%26 = getelementptr inbounds float, float* %25, i64 2
%27 = load float, float* %26
%28 = load float*, float** %5
%29 = getelementptr inbounds float, float* %28, i64 2
%30 = load float, float* %29
%31 = fsub float %27, %30
%32 = load float*, float** %6
%33 = getelementptr inbounds float, float* %32, i64 2
store float %31, float* %33
ret void
}

LLVM IR (-O2):
define void @subVec3f(float* nocapture %0, float* nocapture %1, float* nocapture writeonly %2) {
%4 = load float, float* %0
%5 = load float, float* %1
%6 = fsub float %4, %5
store float %6, float* %2
%7 = getelementptr inbounds float, float* %0, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %1, i64 1
%10 = load float, float* %9
%11 = fsub float %8, %10
%12 = getelementptr inbounds float, float* %2, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %0, i64 2
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %1, i64 2
%16 = load float, float* %15
%17 = fsub float %14, %16
%18 = getelementptr inbounds float, float* %2, i64 2
store float %17, float* %18
ret void
}
/* Variables and functions */
scalar_t__ errno;
unsigned int strtoul(char const *, char **, int /*<<< orphan*/);
int str_to_u(const char *s, unsigned *u) {
  char *p;
  unsigned o;
  errno = 0;
  o = strtoul(s, &p, 0);
  if (errno || *p) {
    return -1;
  }
  *u = o;
  return 0;
}


x86 assembly (clang, -O0):
<str_to_u>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    0x2eb9(%rip),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
xor    %edx,%edx
call   1030 <strtoul@plt>
mov    %eax,-0x24(%rbp)
mov    0x2e99(%rip),%rax
cmpq   $0x0,(%rax)
jne    1161 <str_to_u+0x51>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116d <str_to_u+0x5d>
movl   $0xffffffff,-0x4(%rbp)
jmp    117d <str_to_u+0x6d>
mov    -0x24(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_to_u>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    0x2ec2(%rip),%rbx
movq   $0x0,(%rbx)
mov    %rsp,%rsi
xor    %edx,%edx
call   1030 <strtoul@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmpq   $0x0,(%rbx)
jne    114a <str_to_u+0x3a>
mov    (%rsp),%rdx
cmpb   $0x0,(%rdx)
jne    114a <str_to_u+0x3a>
mov    %ecx,(%r14)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@errno = global i64 0
define i32 @str_to_u(i8* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i32* %1, i32** %5
store i64 0, i64* @errno
%8 = load i8*, i8** %4
%9 = call i32 @strtoul(i8* %8, i8** %6, i32 0)
store i32 %9, i32* %7
%10 = load i64, i64* @errno
%11 = icmp ne i64 %10, 0
br i1 %11, label %17, label %12
12: ; preds = %2
%13 = load i8*, i8** %6
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %12, %2
store i32 -1, i32* %3
br label %21
18: ; preds = %12
%19 = load i32, i32* %7
%20 = load i32*, i32** %5
store i32 %19, i32* %20
store i32 0, i32* %3
br label %21
21: ; preds = %18, %17
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
@errno = global i64 0
define i32 @str_to_u(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i64 0, i64* @errno
%5 = call i32 @strtoul(i8* %0, i8** %3, i32 0)
%6 = load i64, i64* @errno
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 %5, i32* %1
br label %13
13: ; preds = %2, %8, %12
%14 = phi i32 [ 0, %12 ], [ -1, %8 ], [ -1, %2 ]
ret i32 %14
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solve_linear_product_system(void) {
  int fail, *a, *b;
  double *c;
  fail = _ada_use_c2phc4c(114, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solve_linear_product_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x72,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve_linear_product_system>:
mov    $0x72,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @solve_linear_product_system() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca double*
%5 = load i32*, i32** %2
%6 = load i32*, i32** %3
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 114, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %1
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @solve_linear_product_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 114, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit_with_diagnostic(char *);
void *realloc(void *, size_t const);
void *buffer_allocate(void *existing_buffer, const size_t buffer_len) {
  void *buffer;
  buffer = realloc(existing_buffer, buffer_len);
  if (!buffer) {
    exit_with_diagnostic("Unable to allocate buffer");
  }
  return buffer;
}


x86 assembly (clang, -O0):
<buffer_allocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <buffer_allocate+0x38>
lea    0xead(%rip),%rdi
call   1040 <exit_with_diagnostic@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_allocate>:
push   %rbx
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <buffer_allocate+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <exit_with_diagnostic@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Unable to allocate buffer\00"
define i8* @buffer_allocate(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 @exit_with_diagnostic(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [26 x i8] c"Unable to allocate buffer\00"
define noalias i8* @buffer_allocate(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @exit_with_diagnostic(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int PTHREAD_CANCEL_ASYNCHRONOUS;
int /*<<< orphan*/ __libc_read(int, void *, size_t);
int /*<<< orphan*/ pthread_setcanceltype(int, int *);
ssize_t __attribute__((weak)) read(int fd, void *buf, size_t count) {
  ssize_t result;
  int oldtype;
  pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);
  result = __libc_read(fd, buf, count);
  pthread_setcanceltype(oldtype, NULL);
  return result;
}


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    -0x20(%rbp),%rsi
call   1040 <pthread_setcanceltype@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <__libc_read@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_setcanceltype@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    0xc(%rsp),%rsi
call   1040 <pthread_setcanceltype@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <__libc_read@plt>
mov    %eax,%ebx
mov    0xc(%rsp),%edi
xor    %esi,%esi
call   1040 <pthread_setcanceltype@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@PTHREAD_CANCEL_ASYNCHRONOUS = global i32 0
define weak i32 @read(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%9 = load i32, i32* @PTHREAD_CANCEL_ASYNCHRONOUS
%10 = call i32 @pthread_setcanceltype(i32 %9, i32* %8)
%11 = load i32, i32* %4
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = call i32 @__libc_read(i32 %11, i8* %12, i64 %13)
store i32 %14, i32* %7
%15 = load i32, i32* %8
%16 = call i32 @pthread_setcanceltype(i32 %15, i32* null)
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
@PTHREAD_CANCEL_ASYNCHRONOUS = global i32 0
define weak i32 @read(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = load i32, i32* @PTHREAD_CANCEL_ASYNCHRONOUS
%7 = call i32 @pthread_setcanceltype(i32 %6, i32* %4)
%8 = call i32 @__libc_read(i32 %0, i8* %1, i64 %2)
%9 = load i32, i32* %4
%10 = call i32 @pthread_setcanceltype(i32 %9, i32* null)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ resize(char *);
void main(int argc, char **argv) { resize(argv[1]); }


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

x86 assembly (clang, -O2):
<main>:
mov    0x8(%rsi),%rdi
jmp    1030 <resize@plt>

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

LLVM IR (-O2):
define void @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @resize(i8* %4)
ret void
}
void g_date_valid_day() {}


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

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

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

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

/* Variables and functions */
int bbswap_32(int /*<<< orphan*/);
uint64_t bbswap_64(uint64_t x) {
  return (((uint64_t)bbswap_32((uint32_t)(x & 0xffffffffull))) << 32) |
         (bbswap_32((uint32_t)(x >> 32)));
}


x86 assembly (clang, -O0):
<bbswap_64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movabs $0xffffffff,%rcx
and    %rcx,%rax
mov    %eax,%edi
call   1030 <bbswap_32@plt>
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20,%ecx
sar    %cl,%edi
call   1030 <bbswap_32@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbswap_64>:
push   %rax
call   1030 <bbswap_32@plt>
pop    %rax
jmp    1030 <bbswap_32@plt>

LLVM IR (-O0):
define i32 @bbswap_64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = and i64 %4, 4294967295
%6 = trunc i64 %5 to i32
%7 = call i32 @bbswap_32(i32 %6)
%8 = shl i32 %7, 32
%9 = load i32, i32* %2
%10 = ashr i32 %9, 32
%11 = call i32 @bbswap_32(i32 %10)
%12 = or i32 %8, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @bbswap_64(i32 %0) {
%2 = tail call i32 @bbswap_32(i32 %0)
%3 = tail call i32 @bbswap_32(i32 poison)
ret i32 poison
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ masterAssignMapper();
int /*<<< orphan*/ masterAssignReducer();
int /*<<< orphan*/ masterWaitForMapper();
int /*<<< orphan*/ masterWaitForReducer();
int /*<<< orphan*/ masterWakeupUser();
int /*<<< orphan*/ printf(char *, int);
void masterRoutine() {
  masterAssignMapper();
  masterWaitForMapper();
  masterAssignReducer();
  masterWaitForReducer();
  masterWakeupUser();
  printf("master [PID: %d] process finished\n", getpid());
}


x86 assembly (clang, -O0):
<masterRoutine>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <masterAssignMapper@plt>
mov    $0x0,%al
call   1060 <masterWaitForMapper@plt>
mov    $0x0,%al
call   1090 <masterAssignReducer@plt>
mov    $0x0,%al
call   1070 <masterWaitForReducer@plt>
mov    $0x0,%al
call   1030 <masterWakeupUser@plt>
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %eax,%esi
lea    0xe59(%rip),%rdi
call   1050 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<masterRoutine>:
push   %rax
xor    %eax,%eax
call   1080 <masterAssignMapper@plt>
xor    %eax,%eax
call   1060 <masterWaitForMapper@plt>
xor    %eax,%eax
call   1090 <masterAssignReducer@plt>
xor    %eax,%eax
call   1070 <masterWaitForReducer@plt>
xor    %eax,%eax
call   1030 <masterWakeupUser@plt>
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xe5e(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"master [PID: %d] process finished\0A\00"
define void @masterRoutine() {
%1 = call i32 (...) @masterAssignMapper()
%2 = call i32 (...) @masterWaitForMapper()
%3 = call i32 (...) @masterAssignReducer()
%4 = call i32 (...) @masterWaitForReducer()
%5 = call i32 (...) @masterWakeupUser()
%6 = call i32 (...) @getpid()
%7 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"master [PID: %d] process finished\0A\00"
define void @masterRoutine() {
%1 = tail call i32 (...) @masterAssignMapper()
%2 = tail call i32 (...) @masterWaitForMapper()
%3 = tail call i32 (...) @masterAssignReducer()
%4 = tail call i32 (...) @masterWaitForReducer()
%5 = tail call i32 (...) @masterWakeupUser()
%6 = tail call i32 (...) @getpid()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}
/* Type definitions */
struct sudoku {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct sudoku *);
void sudoku_free(struct sudoku *s) { free(s); }


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

x86 assembly (clang, -O2):
<sudoku_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.sudoku = type { i32 }
define void @sudoku_free(%struct.sudoku* nocapture %0) {
%2 = tail call i32 @free(%struct.sudoku* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tohost_exit(long long);
long handle_trap(long cause, long epc, long long regs[32]) {
  if (cause != 0x8)
    tohost_exit(1337);
  else if (regs[17] == 93)
    tohost_exit(regs[10]);
  return epc + 4;
}


x86 assembly (clang, -O0):
<handle_trap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x8,-0x8(%rbp)
je     113e <handle_trap+0x2e>
mov    $0x539,%edi
call   1030 <tohost_exit@plt>
jmp    1162 <handle_trap+0x52>
mov    -0x18(%rbp),%rax
cmpq   $0x5d,0x88(%rax)
5d
jne    115d <handle_trap+0x4d>
mov    -0x18(%rbp),%rax
mov    0x50(%rax),%rdi
call   1030 <tohost_exit@plt>
jmp    1162 <handle_trap+0x52>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_trap>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rax
mov    $0x539,%edi
cmp    $0x8,%rax
jne    1130 <handle_trap+0x20>
cmpq   $0x5d,0x88(%rdx)
5d
jne    1135 <handle_trap+0x25>
mov    0x50(%rdx),%rdi
call   1030 <tohost_exit@plt>
add    $0x4,%rbx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @handle_trap(i64 %0, i64 %1, i64* nocapture %2) {
%4 = icmp eq i64 %0, 8
br i1 %4, label %5, label %12
5: ; preds = %3
%6 = getelementptr inbounds i64, i64* %2, i64 17
%7 = load i64, i64* %6
%8 = icmp eq i64 %7, 93
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = getelementptr inbounds i64, i64* %2, i64 10
%11 = load i64, i64* %10
br label %12
12: ; preds = %3, %9
%13 = phi i64 [ %11, %9 ], [ 1337, %3 ]
%14 = tail call i32 @tohost_exit(i64 %13)
br label %15
15: ; preds = %12, %5
%16 = add nsw i64 %1, 4
ret i64 %16
}
void handle_WIND(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_WIND(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(double *, int /*<<< orphan*/, int);
void zero_matrix(double *m, int n) { memset(m, 0, sizeof(double) * n * n); }


x86 assembly (clang, -O0):
<zero_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
movslq -0xc(%rbp),%rcx
imul   %rcx,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_matrix>:
imul   %esi,%esi
lea    0x0(,%rsi,8),%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @zero_matrix(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load double*, double** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = mul i64 8, %7
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = mul i64 %8, %10
%12 = trunc i64 %11 to i32
%13 = call i32 @memset(double* %5, i32 0, i32 %12)
ret void
}

LLVM IR (-O2):
define void @zero_matrix(double* %0, i32 %1) {
%3 = shl i32 %1, 3
%4 = mul i32 %3, %1
%5 = tail call i32 @memset(double* %0, i32 0, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void ctors2(void) {
  printf("ctors2\n");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<ctors2>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctors2>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"ctors2\0A\00"
@stdout = global i32 0
define void @ctors2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [7 x i8] c"ctors2\00"
define void @ctors2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _SC_PAGE_SIZE;
long sysconf(int /*<<< orphan*/);
long get_page_size() { return sysconf(_SC_PAGE_SIZE); }


x86 assembly (clang, -O0):
<get_page_size>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_page_size>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sysconf@plt>

LLVM IR (-O0):
@_SC_PAGE_SIZE = global i32 0
define i64 @get_page_size() {
%1 = load i32, i32* @_SC_PAGE_SIZE
%2 = call i64 @sysconf(i32 %1)
ret i64 %2
}

LLVM IR (-O2):
@_SC_PAGE_SIZE = global i32 0
define i64 @get_page_size() {
%1 = load i32, i32* @_SC_PAGE_SIZE
%2 = tail call i64 @sysconf(i32 %1)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
void readVector(int vec[], int size) {
  int i;
  for (i = 0; i < size; i++)
    scanf("%d", &vec[i]);
}


x86 assembly (clang, -O0):
<readVector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115b <readVector+0x4b>
mov    -0x8(%rbp),%rsi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeb8(%rip),%rdi
call   1030 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <readVector+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readVector>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1145 <readVector+0x35>
mov    %rdi,%rbx
mov    %esi,%r15d
lea    0xeda(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
add    $0x4,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <readVector+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @readVector(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %8)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear();
int /*<<< orphan*/ echo();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ resetty();
void uninitgame(int sig) {
  clear();
  (void)refresh();
  (void)resetty();
  (void)echo();
  (void)endwin();
  exit(sig);
}


x86 assembly (clang, -O0):
<uninitgame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1080 <clear@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
mov    $0x0,%al
call   1040 <resetty@plt>
mov    $0x0,%al
call   1030 <echo@plt>
mov    $0x0,%al
call   1060 <endwin@plt>
mov    -0x4(%rbp),%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<uninitgame>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1080 <clear@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
xor    %eax,%eax
call   1040 <resetty@plt>
xor    %eax,%eax
call   1030 <echo@plt>
xor    %eax,%eax
call   1060 <endwin@plt>
mov    %ebx,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
define void @uninitgame(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @clear()
%4 = call i32 (...) @refresh()
%5 = call i32 (...) @resetty()
%6 = call i32 (...) @echo()
%7 = call i32 (...) @endwin()
%8 = load i32, i32* %2
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
define void @uninitgame(i32 %0) {
%2 = tail call i32 (...) @clear()
%3 = tail call i32 (...) @refresh()
%4 = tail call i32 (...) @resetty()
%5 = tail call i32 (...) @echo()
%6 = tail call i32 (...) @endwin()
%7 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ saa7114_read_reg(int, unsigned char *);
unsigned char saa7114_get_decoder_saturation(void) {
  unsigned char saturation = 0;
  saa7114_read_reg(0x0C, &saturation);
  saturation <<= 1;
  return (saturation);
}


x86 assembly (clang, -O0):
<saa7114_get_decoder_saturation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
mov    $0xc,%edi
lea    -0x1(%rbp),%rsi
call   1030 <saa7114_read_reg@plt>
movzbl -0x1(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saa7114_get_decoder_saturation>:
push   %rax
movb   $0x0,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0xc,%edi
call   1030 <saa7114_read_reg@plt>
mov    0x7(%rsp),%al
add    %al,%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @saa7114_get_decoder_saturation() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 @saa7114_read_reg(i32 12, i8* %1)
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
%5 = shl i32 %4, 1
%6 = trunc i32 %5 to i8
store i8 %6, i8* %1
%7 = load i8, i8* %1
ret i8 %7
}

LLVM IR (-O2):
define zeroext i8 @saa7114_get_decoder_saturation() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 @saa7114_read_reg(i32 12, i8* %1)
%3 = load i8, i8* %1
%4 = shl i8 %3, 1
ret i8 %4
}