xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ plcvm_get_bool(int /*<<< orphan*/);
int /*<<< orphan*/ plcvm_lpm_u16();
int /*<<< orphan*/ plcvm_push(int /*<<< orphan*/);
void cb_ldm_b1_c16(void) { plcvm_push(plcvm_get_bool(plcvm_lpm_u16())); }


x86 assembly (clang, -O0):
<cb_ldm_b1_c16>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <plcvm_lpm_u16@plt>
mov    %eax,%edi
call   1050 <plcvm_get_bool@plt>
mov    %eax,%edi
call   1040 <plcvm_push@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cb_ldm_b1_c16>:
push   %rax
xor    %eax,%eax
call   1030 <plcvm_lpm_u16@plt>
mov    %eax,%edi
call   1050 <plcvm_get_bool@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <plcvm_push@plt>

LLVM IR (-O0):
define void @cb_ldm_b1_c16() {
%1 = call i32 (...) @plcvm_lpm_u16()
%2 = call i32 @plcvm_get_bool(i32 %1)
%3 = call i32 @plcvm_push(i32 %2)
ret void
}

LLVM IR (-O2):
define void @cb_ldm_b1_c16() {
%1 = tail call i32 (...) @plcvm_lpm_u16()
%2 = tail call i32 @plcvm_get_bool(i32 %1)
%3 = tail call i32 @plcvm_push(i32 %2)
ret void
}
/* Variables and functions */
double surd(double, int);
double sqrt(double n) { return surd(n, 2); }


x86 assembly (clang, -O0):
<sqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <surd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrt>:
mov    $0x2,%edi
jmp    1030 <surd@plt>

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

LLVM IR (-O2):
define double @sqrt(double %0) {
%2 = tail call double @surd(double %0, i32 2)
ret double %2
}
/* Variables and functions */
void *compare_schar_context(void) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @compare_schar_context() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @compare_schar_context() {
ret i8* null
}
/* Variables and functions */
int fn1(int, int);
int fn2() {
  int x = 4, y = 5;
  int res = fn1(x, y);
  return res;
}


x86 assembly (clang, -O0):
<fn2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x4,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <fn1@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn2>:
mov    $0x4,%edi
mov    $0x5,%esi
jmp    1030 <fn1@plt>

LLVM IR (-O0):
define i32 @fn2() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 4, i32* %1
store i32 5, i32* %2
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = call i32 @fn1(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @fn2() {
%1 = tail call i32 @fn1(i32 4, i32 5)
ret i32 %1
}
const char *zlibVersion() { return "1.2.2.f-rsyncable"; }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"1.2.2.f-rsyncable\00"
define i8* @zlibVersion() {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [18 x i8] c"1.2.2.f-rsyncable\00"
define i8* @zlibVersion() {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
scalar_t__ has_valid_chars(char const *, char *);
scalar_t__ has_valid_length(char const *);
int semver_is_valid(const char *s) {
  return has_valid_length(s) &&
         has_valid_chars(s,
                         "0123456789"
                         "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
                         "."
                         "-"
                         "+");
}


x86 assembly (clang, -O0):
<semver_is_valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <has_valid_length@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     1161 <semver_is_valid+0x41>
mov    -0x8(%rbp),%rdi
lea    0xeae(%rip),%rsi
call   1030 <has_valid_chars@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<semver_is_valid>:
push   %rbx
mov    %rdi,%rbx
call   1040 <has_valid_length@plt>
test   %rax,%rax
je     114a <semver_is_valid+0x2a>
lea    0xecb(%rip),%rsi
mov    %rbx,%rdi
call   1030 <has_valid_chars@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [66 x i8] c"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-+\00"
define i32 @semver_is_valid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @has_valid_length(i8* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @has_valid_chars(i8* %7, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%9 = icmp ne i64 %8, 0
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):
@.str = [66 x i8] c"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-+\00"
define i32 @semver_is_valid(i8* %0) {
%2 = tail call i64 @has_valid_length(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @has_valid_chars(i8* %0, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ _gdbio_write_r(int /*<<< orphan*/ *, int, void const *,
                                  size_t);
int /*<<< orphan*/ errno;
ssize_t gdbio_write(int fd, const void *buf, size_t bytes) {
  return _gdbio_write_r(&errno, fd, buf, bytes);
}


x86 assembly (clang, -O0):
<gdbio_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    0x2eab(%rip),%rdi
call   1030 <_gdbio_write_r@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdbio_write>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ec1(%rip),%rdi
jmp    1030 <_gdbio_write_r@plt>

LLVM IR (-O0):
@errno = global i32 0
define i32 @gdbio_write(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @_gdbio_write_r(i32* @errno, i32 %7, i8* %8, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @gdbio_write(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @_gdbio_write_r(i32* @errno, i32 %0, i8* %1, i64 %2)
ret i32 %4
}
void rx_init(void) {}


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

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

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

LLVM IR (-O2):
define void @rx_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ freeMenu();
int /*<<< orphan*/ printf(char *);
void exitProgram() {
  freeMenu();
  printf("See you soon !\n\n");
  exit(0);
}


x86 assembly (clang, -O0):
<exitProgram>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <freeMenu@plt>
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<exitProgram>:
push   %rax
xor    %eax,%eax
call   1040 <freeMenu@plt>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"See you soon !\0A\0A\00"
define void @exitProgram() {
%1 = call i32 (...) @freeMenu()
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [16 x i8] c"See you soon !\0A\00"
define void @exitProgram() {
%1 = tail call i32 (...) @freeMenu()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ suture(int);
volatile int elf(int a) { suture(a); }


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

x86 assembly (clang, -O2):
<elf>:
jmp    1030 <suture@plt>

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

LLVM IR (-O2):
define i32 @elf(i32 %0) {
%2 = tail call i32 @suture(i32 %0)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ *malloc(size_t);
int wcslen(int /*<<< orphan*/ const *);
int /*<<< orphan*/ *wmemcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                            size_t);
wchar_t *wcsdup(const wchar_t *s) {
  wchar_t *copy;
  size_t len;
  len = wcslen(s) + 1;
  if ((copy = malloc(len * sizeof(wchar_t))) == NULL)
    return (NULL);
  return (wmemcpy(copy, s, len));
}


x86 assembly (clang, -O0):
<wcsdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <wcslen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
shl    $0x2,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1176 <wcsdup+0x46>
movq   $0x0,-0x8(%rbp)
jmp    118b <wcsdup+0x5b>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <wmemcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcsdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <wcslen@plt>
movslq %eax,%rbx
lea    0x4(,%rbx,4),%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     116a <wcsdup+0x3a>
add    $0x1,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <wmemcpy@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32* @wcsdup(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i64
store i32* %0, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @wcslen(i32* %6)
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = mul i64 %10, 4
%12 = call i32* @malloc(i64 %11)
store i32* %12, i32** %4
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %15
14: ; preds = %1
store i32* null, i32** %2
br label %20
15: ; preds = %1
%16 = load i32*, i32** %4
%17 = load i32*, i32** %3
%18 = load i64, i64* %5
%19 = call i32* @wmemcpy(i32* %16, i32* %17, i64 %18)
store i32* %19, i32** %2
br label %20
20: ; preds = %15, %14
%21 = load i32*, i32** %2
ret i32* %21
}

LLVM IR (-O2):
define i32* @wcsdup(i32* %0) {
%2 = tail call i32 @wcslen(i32* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = shl nsw i64 %4, 2
%6 = tail call i32* @malloc(i64 %5)
%7 = icmp eq i32* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = tail call i32* @wmemcpy(i32* %6, i32* %0, i64 %4)
br label %10
10: ; preds = %1, %8
%11 = phi i32* [ %9, %8 ], [ null, %1 ]
ret i32* %11
}
int SDL_imageFilterShiftLeftUintMMX(unsigned char *Src1, unsigned char *Dest,
                                    int length, unsigned char N) {
  return (0);
}


x86 assembly (clang, -O0):
<SDL_imageFilterShiftLeftUintMMX>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %al,-0x15(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @SDL_imageFilterShiftLeftUintMMX(i8* %0, i8* %1, i32 %2, i8 zeroext %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8 %3, i8* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @SDL_imageFilterShiftLeftUintMMX(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i8 zeroext %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void sapi_inet_udp_client_destroy(int sock) { close(sock); }


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

x86 assembly (clang, -O2):
<sapi_inet_udp_client_destroy>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @sapi_inet_udp_client_destroy(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int compare(int *, int *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 2;
  int b = 3;
  printf("%i", compare(&b, &a));
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x2,0x4(%rsp)
movl   $0x3,(%rsp)
mov    %rsp,%rdi
lea    0x4(%rsp),%rsi
call   1040 <compare@plt>
lea    0xebc(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 2, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 3, i32* %2
%5 = call i32 @compare(i32* %2, i32* %1)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
scalar_t__ sendAddress(int, unsigned int);
scalar_t__ sendCommand(int, int);
int jumpToAddress(int fd, unsigned addr) {
  if (sendCommand(fd, 0x21))
    return -1;
  if (sendAddress(fd, addr))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<jumpToAddress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x21,%esi
call   1030 <sendCommand@plt>
cmp    $0x0,%rax
je     1151 <jumpToAddress+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    1179 <jumpToAddress+0x59>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <sendAddress@plt>
cmp    $0x0,%rax
je     1172 <jumpToAddress+0x52>
movl   $0xffffffff,-0x4(%rbp)
jmp    1179 <jumpToAddress+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jumpToAddress>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x21,%esi
call   1030 <sendCommand@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
jne    114c <jumpToAddress+0x2c>
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <sendAddress@plt>
neg    %rax
sbb    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @jumpToAddress(i32 %0, i32 %1) {
%3 = tail call i64 @sendCommand(i32 %0, i32 33)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i64 @sendAddress(i32 %0, i32 %1)
%7 = icmp ne i64 %6, 0
%8 = sext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ -1, %2 ], [ %8, %5 ]
ret i32 %10
}
char set_even_parity(const char ch) {
  int x, p;
  char ch1;
  for (ch1 = ch, p = 0, x = 0; x < 7; x++) {
    if (((ch1 >> 1) & 0x01) == 1)
      p++;
  }
  ch1 = ((p & 0x01) == 1) ? ch | 0x80 : ch & 0x7f;
  return (ch1);
}


x86 assembly (clang, -O0):
<set_even_parity>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0xd(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x7,-0x8(%rbp)
jge    1157 <set_even_parity+0x57>
movsbl -0xd(%rbp),%eax
sar    $0x1,%eax
and    $0x1,%eax
cmp    $0x1,%eax
jne    1144 <set_even_parity+0x44>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1149 <set_even_parity+0x49>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111e <set_even_parity+0x1e>
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x1,%eax
jne    1177 <set_even_parity+0x77>
movsbl -0x1(%rbp),%eax
or     $0x80,%eax
mov    %eax,-0x14(%rbp)
jmp    1181 <set_even_parity+0x81>
movsbl -0x1(%rbp),%eax
and    $0x7f,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %al,-0xd(%rbp)
movsbl -0xd(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_even_parity>:
mov    %edi,%eax
and    $0x7f,%al
shl    $0x6,%dil
and    $0x80,%dil
or     %dil,%al
ret

LLVM IR (-O0):
define signext i8 @set_even_parity(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i8 %0, i8* %2
%6 = load i8, i8* %2
store i8 %6, i8* %5
store i32 0, i32* %4
store i32 0, i32* %3
br label %7
7: ; preds = %20, %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 7
br i1 %9, label %10, label %23
10: ; preds = %7
%11 = load i8, i8* %5
%12 = sext i8 %11 to i32
%13 = ashr i32 %12, 1
%14 = and i32 %13, 1
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %19
16: ; preds = %10
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %19
19: ; preds = %16, %10
br label %20
20: ; preds = %19
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %7
23: ; preds = %7
%24 = load i32, i32* %4
%25 = and i32 %24, 1
%26 = icmp eq i32 %25, 1
br i1 %26, label %27, label %31
27: ; preds = %23
%28 = load i8, i8* %2
%29 = sext i8 %28 to i32
%30 = or i32 %29, 128
br label %35
31: ; preds = %23
%32 = load i8, i8* %2
%33 = sext i8 %32 to i32
%34 = and i32 %33, 127
br label %35
35: ; preds = %31, %27
%36 = phi i32 [ %30, %27 ], [ %34, %31 ]
%37 = trunc i32 %36 to i8
store i8 %37, i8* %5
%38 = load i8, i8* %5
ret i8 %38
}

LLVM IR (-O2):
define signext i8 @set_even_parity(i8 signext %0) {
%2 = and i8 %0, 127
%3 = shl i8 %0, 6
%4 = and i8 %3, -128
%5 = or i8 %4, %2
ret i8 %5
}
void __attribute__((no)) HEX00_cookiesInit(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @HEX00_cookiesInit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t size) {
  register void *value = malloc(size);
  if (value == 0) {
    fputs("Virtual memory exhausted", stderr);
    exit(EXIT_FAILURE);
  }
  return value;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1177 <xmalloc+0x47>
mov    0x2e85(%rip),%rax
mov    (%rax),%esi
lea    0xe9c(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
lea    0xeb3(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Virtual memory exhausted\00"
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fputs(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [25 x i8] c"Virtual memory exhausted\00"
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fputs(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i8* %2
}
int print_binlog_event_header(struct event_header *header) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.event_header = type opaque
define i32 @print_binlog_event_header(%struct.event_header* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void uiVersion() { fprintf(stderr, "SolarMax Logger\n"); }


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"SolarMax Logger\0A\00"
define void @uiVersion() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"SolarMax Logger\0A\00"
define void @uiVersion() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syspool_dobldobl_create(int k) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(608, &k, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<syspool_dobldobl_create>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x260,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @syspool_dobldobl_create(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 608, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
/* Variables and functions */
int *return_first(int *, int, int *);
int *return_null(int **);
int *follow_value_by_ret_bad() {
  int *dummy1, dummy2;
  int *y = return_null(&dummy1);
  int *z = return_first(y, 12, &dummy2);
  *z = 42;
}


x86 assembly (clang, -O0):
<follow_value_by_ret_bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x10(%rbp),%rdi
call   1040 <return_null@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0xc,%esi
lea    -0x14(%rbp),%rdx
call   1030 <return_first@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movl   $0x2a,(%rax)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<follow_value_by_ret_bad>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rdi
call   1040 <return_null@plt>
lea    0xc(%rsp),%rdx
mov    %rax,%rdi
mov    $0xc,%esi
call   1030 <return_first@plt>
movl   $0x2a,(%rax)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32* @follow_value_by_ret_bad() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
%6 = call i32* @return_null(i32** %2)
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = call i32* @return_first(i32* %7, i32 12, i32* %3)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
store i32 42, i32* %9
%10 = load i32*, i32** %1
ret i32* %10
}

LLVM IR (-O2):
define noalias i32* @follow_value_by_ret_bad() {
%1 = alloca i32*
%2 = alloca i32
%3 = bitcast i32** %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32* @return_null(i32** %1)
%6 = call i32* @return_first(i32* %5, i32 12, i32* %2)
store i32 42, i32* %6
ret i32* undef
}
/* Variables and functions */
char *strchr(char const *, char);
char *strchrnul(const char *s, int c) {
  char *p = strchr(s, c);
  return p != NULL ? p : strchr(s, '\0');
}


x86 assembly (clang, -O0):
<strchrnul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
movsbl %al,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114a <strchrnul+0x3a>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1159 <strchrnul+0x49>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchrnul>:
push   %rbx
mov    %rdi,%rbx
movsbl %sil,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1134 <strchrnul+0x14>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <strlen@plt>
add    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @strchrnul(i8* %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%8 = getelementptr i8, i8* %0, i64 %7
br label %9
9: ; preds = %2, %6
%10 = phi i8* [ %8, %6 ], [ %4, %2 ]
ret i8* %10
}
int re_espalhar(int entrada, int pos_atual) { return (pos_atual + 1) % 100; }


x86 assembly (clang, -O0):
<re_espalhar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<re_espalhar>:
add    $0x1,%esi
movslq %esi,%rax
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @re_espalhar(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 = add nsw i32 %5, 1
%7 = srem i32 %6, 100
ret i32 %7
}

LLVM IR (-O2):
define i32 @re_espalhar(i32 %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = srem i32 %3, 100
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int read(int, void *, int);
int /*<<< orphan*/ stderr;
void readin(int rawfd, void *buf, int size) {
  if (read(rawfd, buf, size) < size) {
    fprintf(stderr, "can not read raw file\n");
    close(rawfd);
    exit(9);
  }
}


x86 assembly (clang, -O0):
<readin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <read@plt>
cmp    -0x14(%rbp),%eax
jge    1191 <readin+0x51>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
lea    0xe86(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    $0x9,%edi
call   1060 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readin>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %edi,%ebx
call   1040 <read@plt>
cmp    %ebp,%eax
jl     1157 <readin+0x17>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
lea    0xe99(%rip),%rsi
call   1050 <fprintf@plt>
mov    %ebx,%edi
call   1030 <close@plt>
mov    $0x9,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"can not read raw file\0A\00"
define void @readin(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @read(i32 %7, i8* %8, i32 %9)
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %19
13: ; preds = %3
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%16 = load i32, i32* %4
%17 = call i32 @close(i32 %16)
%18 = call i32 @exit(i32 9)
unreachable
19: ; preds = %3
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"can not read raw file\0A\00"
define void @readin(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
%5 = icmp slt i32 %4, %2
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @close(i32 %0)
%10 = tail call i32 @exit(i32 9)
unreachable
11: ; preds = %3
ret void
}
/* Variables and functions */
unsigned short swap16(unsigned short);
unsigned short htons(unsigned short val) { return swap16(val); }


x86 assembly (clang, -O0):
<htons>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <swap16@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htons>:
jmp    1030 <swap16@plt>

LLVM IR (-O0):
define zeroext i16 @htons(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call zeroext i16 @swap16(i16 zeroext %3)
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @htons(i16 zeroext %0) {
%2 = tail call zeroext i16 @swap16(i16 zeroext %0)
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
void print_help(const char *progname) {
  printf("Usage:\n%s [-d] [-c FILE] COMMAND\n\nOptions:\n\n-d: Do not fork "
         "(for debugging)\n-c FILE: Use FILE as the config file instead of "
         "/etc/piphoned.conf\n-l LEVEL: Use LEVEL as the log level. 7 is "
         "debug, 0 is basically silence.\n\nCOMMAND may be 'start', 'stop', or "
         "'restart'.\n",
         progname);
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [265 x i8] c"Usage:\0A%s [-d] [-c FILE] COMMAND\0A\0AOptions:\0A\0A-d: Do not fork (for debugging)\0A-c FILE: Use FILE as the config file instead of /etc/piphoned.conf\0A-l LEVEL: Use LEVEL as the log level. 7 is debug, 0 is basically silence.\0A\0ACOMMAND may be 'start', 'stop', or 'restart'.\0A\00"
define void @print_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([265 x i8], [265 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [265 x i8] c"Usage:\0A%s [-d] [-c FILE] COMMAND\0A\0AOptions:\0A\0A-d: Do not fork (for debugging)\0A-c FILE: Use FILE as the config file instead of /etc/piphoned.conf\0A-l LEVEL: Use LEVEL as the log level. 7 is debug, 0 is basically silence.\0A\0ACOMMAND may be 'start', 'stop', or 'restart'.\0A\00"
define void @print_help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([265 x i8], [265 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void disconnect(int fd) {
  if (fd >= 0)
    close(fd);
}


x86 assembly (clang, -O0):
<disconnect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     112d <disconnect+0x1d>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disconnect>:
test   %edi,%edi
js     1119 <disconnect+0x9>
jmp    1030 <close@plt>
ret

LLVM IR (-O0):
define void @disconnect(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @close(i32 %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @disconnect(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
double erf(double);
double const sqrt(double);
double pnorm(const double x, const double mu, const double sigma) {
  double a = (x - mu) / (sigma * sqrt(2.0));
  return 0.5 * (1.0 + erf(a));
}


x86 assembly (clang, -O0):
<pnorm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xeb8(%rip),%xmm0
call   1030 <sqrt@plt>
movsd  -0x30(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1040 <erf@plt>
movsd  0xe7f(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xe6b(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pnorm>:
push   %rax
subsd  %xmm1,%xmm0
mulsd  0xee3(%rip),%xmm2
divsd  %xmm2,%xmm0
call   1030 <erf@plt>
addsd  0xeda(%rip),%xmm0
mulsd  0xeda(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @pnorm(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
%9 = load double, double* %5
%10 = fsub double %8, %9
%11 = load double, double* %6
%12 = call double @sqrt(double 2.000000e+00)
%13 = fmul double %11, %12
%14 = fdiv double %10, %13
store double %14, double* %7
%15 = load double, double* %7
%16 = call double @erf(double %15)
%17 = fadd double 1.000000e+00, %16
%18 = fmul double 5.000000e-01, %17
ret double %18
}

LLVM IR (-O2):
define double @pnorm(double %0, double %1, double %2) {
%4 = fsub double %0, %1
%5 = fmul double %2, 0x3FF6A09E667F3BCD
%6 = fdiv double %4, %5
%7 = tail call double @erf(double %6)
%8 = fadd double %7, 1.000000e+00
%9 = fmul double %8, 5.000000e-01
ret double %9
}
void gtk_menu_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_menu_new() {
ret void
}
double circle_event_scan(double t, double *Y, int n, double *pars,
                         double *res) {
  *res = Y[0] + pars[0];
}


x86 assembly (clang, -O0):
<circle_event_scan>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %esi,-0x1c(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
addsd  (%rax),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<circle_event_scan>:
movsd  (%rdi),%xmm0
addsd  (%rdx),%xmm0
movsd  %xmm0,(%rcx)
ret

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

LLVM IR (-O2):
define double @circle_event_scan(double %0, double* nocapture %1, i32 %2, double* nocapture %3, double* nocapture writeonly %4) {
%6 = load double, double* %1
%7 = load double, double* %3
%8 = fadd double %6, %7
store double %8, double* %4
ret double undef
}
/* Variables and functions */
char *crypt1_p(char const *, char const *, unsigned char *);
char *ytht_crypt_crypt1(const char *buf, const char *salt) {
  static unsigned char buff[20];
  return crypt1_p(buf, salt, buff);
}


x86 assembly (clang, -O0):
<ytht_crypt_crypt1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0x2f11(%rip),%rdx
call   1030 <crypt1_p@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ytht_crypt_crypt1>:
lea    0x2f29(%rip),%rdx
jmp    1030 <crypt1_p@plt>

LLVM IR (-O0):
@ytht_crypt_crypt1.buff = internal global [20 x i8] zeroinitializer
define i8* @ytht_crypt_crypt1(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i8* @crypt1_p(i8* %5, i8* %6, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @ytht_crypt_crypt1.buff, i64 0, i64 0))
ret i8* %7
}

LLVM IR (-O2):
@ytht_crypt_crypt1.buff = internal global [20 x i8] zeroinitializer
define i8* @ytht_crypt_crypt1(i8* %0, i8* %1) {
%3 = tail call i8* @crypt1_p(i8* %0, i8* %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @ytht_crypt_crypt1.buff, i64 0, i64 0))
ret i8* %3
}
short __ocl_convert_short_int(int src) { return (short)src; }


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

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

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

LLVM IR (-O2):
define signext i16 @__ocl_convert_short_int(i32 %0) {
%2 = trunc i32 %0 to i16
ret i16 %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int y;
};
typedef TYPE_1__ XPointerMovedEvent;

/* Variables and functions */
void set_XPointerMovedEvent_y(void *_p, int _v) {
  ((XPointerMovedEvent *)_p)->y = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XPointerMovedEvent_y>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XPointerMovedEvent_y(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
char *uart_getsn(char *, int);
char *uart_gets(char *str) { return uart_getsn(str, 50); }


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

x86 assembly (clang, -O2):
<uart_gets>:
mov    $0x32,%esi
jmp    1030 <uart_getsn@plt>

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

LLVM IR (-O2):
define i8* @uart_gets(i8* %0) {
%2 = tail call i8* @uart_getsn(i8* %0, i32 50)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ dbg_channel_read(char *, int);
int _read(int fd, char *ptr, int len) {
  dbg_channel_read(ptr, len);
  return len;
}


x86 assembly (clang, -O0):
<_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <dbg_channel_read@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_read>:
push   %rbx
mov    %edx,%ebx
mov    %rsi,%rdi
mov    %edx,%esi
call   1030 <dbg_channel_read@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @_read(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = call i32 @dbg_channel_read(i8* %7, i32 %8)
%10 = load i32, i32* %6
ret i32 %10
}

LLVM IR (-O2):
define i32 @_read(i32 %0, i8* %1, i32 returned %2) {
%4 = tail call i32 @dbg_channel_read(i8* %1, i32 %2)
ret i32 %2
}
/* Type definitions */
struct dirent {
  int dummy;
};

/* Variables and functions */
int totalFiles(struct dirent **allFiles) {
  struct dirent **fileHolder;
  int i = 0;
  for (fileHolder = allFiles; *fileHolder != NULL; ++fileHolder)
    ++i;
  return i;
}


x86 assembly (clang, -O0):
<totalFiles>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     113f <totalFiles+0x3f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1117 <totalFiles+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<totalFiles>:
cmpq   $0x0,(%rdi)
je     111d <totalFiles+0x1d>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmpq   $0x0,0x8(%rdi,%rax,8)
lea    0x1(%rax),%rax
jne    1110 <totalFiles+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
%struct.dirent = type { i32 }
define i32 @totalFiles(%struct.dirent** nocapture %0) {
%2 = load %struct.dirent*, %struct.dirent** %0
%3 = icmp eq %struct.dirent* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi %struct.dirent** [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds %struct.dirent*, %struct.dirent** %6, i64 1
%9 = load %struct.dirent*, %struct.dirent** %8
%10 = icmp eq %struct.dirent* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
long long __attribute__((no, noclone)) foo(long long t) {
  while (t > -4)
    t -= 2;
  return t;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0xfffffffffffffffc,-0x8(%rbp)
jle    1124 <foo+0x24>
mov    -0x8(%rbp),%rax
sub    $0x2,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <foo+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %rdi,%rax
cmp    $0xfffffffffffffffc,%rdi
mov    $0xfffffffffffffffc,%rcx
cmovl  %rdi,%rcx
neg    %rcx
add    %rdi,%rcx
add    $0x1,%rcx
and    $0xfffffffffffffffe,%rcx
sub    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @foo(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
br label %3
3: ; preds = %6, %1
%4 = load i64, i64* %2
%5 = icmp sgt i64 %4, -4
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i64, i64* %2
%8 = sub nsw i64 %7, 2
store i64 %8, i64* %2
br label %3
9: ; preds = %3
%10 = load i64, i64* %2
ret i64 %10
}

LLVM IR (-O2):
define i64 @foo(i64 %0) {
%2 = add i64 %0, 1
%3 = call i64 @llvm.smin.i64(i64 %0, i64 -4)
%4 = sub i64 %2, %3
%5 = and i64 %4, -2
%6 = sub i64 %0, %5
ret i64 %6
}