xunge/DecIR huggingface dataset:
/* Type definitions */
struct sexpr {
  int dummy;
};

/* Variables and functions */
struct sexpr *_string2sexpr(char const *, size_t *);
struct sexpr *string2sexpr(const char *buffer) {
  size_t dummy = 0;
  return _string2sexpr(buffer, &dummy);
}


x86 assembly (clang, -O0):
<string2sexpr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <_string2sexpr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string2sexpr>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rsi
call   1030 <_string2sexpr@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.sexpr = type { i32 }
define %struct.sexpr* @string2sexpr(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
%4 = load i8*, i8** %2
%5 = call %struct.sexpr* @_string2sexpr(i8* %4, i64* %3)
ret %struct.sexpr* %5
}

LLVM IR (-O2):
%struct.sexpr = type { i32 }
define %struct.sexpr* @string2sexpr(i8* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%4 = call %struct.sexpr* @_string2sexpr(i8* %0, i64* %2)
ret %struct.sexpr* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int fileno(int /*<<< orphan*/ *);
void set_fd(fd_set *s, int *maxfd, FILE *f) {
  int fd = fileno(f);
  FD_SET(fd, s);
  if (*maxfd < fd)
    *maxfd = fd;
}


x86 assembly (clang, -O0):
<set_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <fileno@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1040 <FD_SET@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cmp    -0x1c(%rbp),%eax
jge    1164 <set_fd+0x44>
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_fd>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rdx,%rdi
call   1030 <fileno@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
call   1040 <FD_SET@plt>
cmp    %ebp,(%r14)
jge    1146 <set_fd+0x26>
mov    %ebp,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @set_fd(i32* %0, i32* nocapture %1, i32* nocapture %2) {
%4 = tail call i32 @fileno(i32* %2)
%5 = tail call i32 @FD_SET(i32 %4, i32* %0)
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, %4
br i1 %7, label %8, label %9
8: ; preds = %3
store i32 %4, i32* %1
br label %9
9: ; preds = %8, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void say_something(const char *str) { printf("%s\n", str); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @say_something(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
const char *Range_Description(void) {
  return "The `Range` type is a basic iterable which acts as a virtual "
         "sequence of integers, starting from some value, stopping at some "
         "value "
         "and incrementing by some step."
         "\n\n"
         "This can be a useful replacement for the standard C `for` loop with "
         "decent performance but returning a Cello `Int`. It is constructable "
         "on "
         "the stack with the `range` macro which makes it practical and easy "
         "to "
         "use.";
}


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

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

LLVM IR (-O0):
@.str = [378 x i8] c"The `Range` type is a basic iterable which acts as a virtual sequence of integers, starting from some value, stopping at some value and incrementing by some step.\0A\0AThis can be a useful replacement for the standard C `for` loop with decent performance but returning a Cello `Int`. It is constructable on the stack with the `range` macro which makes it practical and easy to use.\00"
define i8* @Range_Description() {
ret i8* getelementptr inbounds ([378 x i8], [378 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [378 x i8] c"The `Range` type is a basic iterable which acts as a virtual sequence of integers, starting from some value, stopping at some value and incrementing by some step.\0A\0AThis can be a useful replacement for the standard C `for` loop with decent performance but returning a Cello `Int`. It is constructable on the stack with the `range` macro which makes it practical and easy to use.\00"
define i8* @Range_Description() {
ret i8* getelementptr inbounds ([378 x i8], [378 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ cgsmc_async_connection_free(void *);
void cgsmc_async_connection_delete(void *this) {
  cgsmc_async_connection_free(this);
}


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

x86 assembly (clang, -O2):
<cgsmc_async_connection_delete>:
jmp    1030 <cgsmc_async_connection_free@plt>

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

LLVM IR (-O2):
define void @cgsmc_async_connection_delete(i8* %0) {
%2 = tail call i32 @cgsmc_async_connection_free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WRITE(int /*<<< orphan*/);
void test_exit_child() {
  WRITE(0);
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<test_exit_child>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <WRITE@plt>
jmp    111b <test_exit_child+0xb>

x86 assembly (clang, -O2):
<test_exit_child>:
push   %rax
xor    %edi,%edi
call   1030 <WRITE@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <test_exit_child+0x10>

LLVM IR (-O0):
define void @test_exit_child() {
%1 = call i32 @WRITE(i32 0)
br label %2
2: ; preds = %2, %0
br label %2
}

LLVM IR (-O2):
define void @test_exit_child() {
%1 = tail call i32 @WRITE(i32 0)
br label %2
2: ; preds = %2, %0
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ say_stop(char *, int);
int /*<<< orphan*/ wait(int);
void talk(void) {
  say_stop("Hey, that's an AlkTree.", 1);
  wait(250);
}


x86 assembly (clang, -O0):
<talk>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x1,%esi
call   1030 <say_stop@plt>
mov    $0xfa,%edi
call   1040 <wait@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<talk>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x1,%esi
call   1030 <say_stop@plt>
mov    $0xfa,%edi
pop    %rax
jmp    1040 <wait@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Hey, that's an AlkTree.\00"
define void @talk() {
%1 = call i32 @say_stop(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = call i32 @wait(i32 250)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Hey, that's an AlkTree.\00"
define void @talk() {
%1 = tail call i32 @say_stop(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @wait(i32 250)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int write(int, char const *, int /*<<< orphan*/);
int write_string(int fd, const char *str) {
  return write(fd, str, strlen(str));
}


x86 assembly (clang, -O0):
<write_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_string>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
define i32 @write_string(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @write(i32 %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @write_string(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ do_csi(char *, int, int, int, int, int);
void decfra(int c, int top, int left, int bottom, int right) {
  do_csi("%d;%d;%d;%d;%d$x", c, top, left, bottom, right);
}


x86 assembly (clang, -O0):
<decfra>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r9d
lea    0xec0(%rip),%rdi
call   1030 <do_csi@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decfra>:
mov    %r8d,%r9d
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xedd(%rip),%rdi
jmp    1030 <do_csi@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"%d;%d;%d;%d;%d$x\00"
define void @decfra(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @do_csi(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12, i32 %13, i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"%d;%d;%d;%d;%d$x\00"
define void @decfra(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @do_csi(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2, i32 %3, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_num(unsigned long long, int, char *);
void print_dec(unsigned long long n) { print_num(n, 10, "%s\n"); }


x86 assembly (clang, -O0):
<print_dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
lea    0xed4(%rip),%rdx
call   1030 <print_num@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_dec>:
lea    0xee9(%rip),%rdx
mov    $0xa,%esi
jmp    1030 <print_num@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @print_dec(i64 %0) {
%2 = tail call i32 @print_num(i64 %0, i32 10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ C(int);
void D(void) { C(23); }


x86 assembly (clang, -O0):
<D>:
push   %rbp
mov    %rsp,%rbp
mov    $0x17,%edi
call   1030 <C@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<D>:
mov    $0x17,%edi
jmp    1030 <C@plt>

LLVM IR (-O0):
define void @D() {
%1 = call i32 @C(i32 23)
ret void
}

LLVM IR (-O2):
define void @D() {
%1 = tail call i32 @C(i32 23)
ret void
}
/* Variables and functions */
int ig_indirect_table_get(unsigned int, int, unsigned int, int, unsigned int *);
int ig_sak_table_get(unsigned int dev_id, unsigned int index,
                     unsigned int *pentry) {
  if ((index < 32) || (index > 63)) {
    return -1;
  }
  return ig_indirect_table_get(dev_id, 2, index, 4, pentry);
}


x86 assembly (clang, -O0):
<ig_sak_table_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x20,-0xc(%rbp)
jb     1136 <ig_sak_table_get+0x26>
cmpl   $0x3f,-0xc(%rbp)
jbe    1142 <ig_sak_table_get+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <ig_sak_table_get+0x4e>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%r8
mov    $0x2,%esi
mov    $0x4,%ecx
call   1030 <ig_indirect_table_get@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ig_sak_table_get>:
mov    %esi,%eax
and    $0xffffffe0,%eax
cmp    $0x20,%eax
jne    112e <ig_sak_table_get+0x1e>
mov    %rdx,%r8
mov    %esi,%edx
mov    $0x2,%esi
mov    $0x4,%ecx
jmp    1030 <ig_indirect_table_get@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @ig_sak_table_get(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 ult i32 %8, 32
br i1 %9, label %13, label %10
10: ; preds = %3
%11 = load i32, i32* %6
%12 = icmp ugt i32 %11, 63
br i1 %12, label %13, label %14
13: ; preds = %10, %3
store i32 -1, i32* %4
br label %19
14: ; preds = %10
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = load i32*, i32** %7
%18 = call i32 @ig_indirect_table_get(i32 %15, i32 2, i32 %16, i32 4, i32* %17)
store i32 %18, i32* %4
br label %19
19: ; preds = %14, %13
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @ig_sak_table_get(i32 %0, i32 %1, i32* %2) {
%4 = and i32 %1, -32
%5 = icmp eq i32 %4, 32
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @ig_indirect_table_get(i32 %0, i32 2, i32 %1, i32 4, i32* %2)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ -1, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ findin(int /*<<< orphan*/, char *);
void find(char **dirs, char *cp) {
  while (*dirs)
    findin(*dirs++, cp);
}


x86 assembly (clang, -O0):
<find>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1150 <find+0x40>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%rax
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1030 <findin@plt>
jmp    1120 <find+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1144 <find+0x34>
mov    %rsi,%r14
add    $0x8,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rsi
call   1030 <findin@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <find+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @find(i8** nocapture %0, i8* %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %12, %5 ], [ %3, %2 ]
%7 = phi i8** [ %8, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = ptrtoint i8* %6 to i64
%10 = trunc i64 %9 to i32
%11 = tail call i32 @findin(i32 %10, i8* %1)
%12 = load i8*, i8** %8
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %5
14: ; preds = %5, %2
ret void
}
int tgetnum(id)
char *id;
{
  switch (((((id)[0]) << 8) + (((id)[1]) & 0xff))) {
  case ((('l') << 8) + (('i') & 0xff)):
    return 25;
  case ((('c') << 8) + (('o') & 0xff)):
    return 80;
  case ((('s') << 8) + (('g') & 0xff)):
    return 0;
  case ((('u') << 8) + (('g') & 0xff)):
    return 0;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<tgetnum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%eax
shl    $0x8,%eax
movzbl 0x1(%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
sub    $0x636f,%eax
je     1170 <tgetnum+0x70>
jmp    112b <tgetnum+0x2b>
mov    -0x14(%rbp),%eax
sub    $0x6c69,%eax
je     1164 <tgetnum+0x64>
jmp    113e <tgetnum+0x3e>
mov    -0x14(%rbp),%eax
sub    $0x7367,%eax
je     117c <tgetnum+0x7c>
jmp    1151 <tgetnum+0x51>
mov    -0x14(%rbp),%eax
sub    $0x7567,%eax
je     1188 <tgetnum+0x88>
jmp    1194 <tgetnum+0x94>
movl   $0x19,-0x4(%rbp)
jmp    119b <tgetnum+0x9b>
movl   $0x50,-0x4(%rbp)
jmp    119b <tgetnum+0x9b>
movl   $0x0,-0x4(%rbp)
jmp    119b <tgetnum+0x9b>
movl   $0x0,-0x4(%rbp)
jmp    119b <tgetnum+0x9b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tgetnum>:
movsbl (%rdi),%eax
shl    $0x8,%eax
movzbl 0x1(%rdi),%ecx
or     %eax,%ecx
cmp    $0x7366,%ecx
jg     112a <tgetnum+0x2a>
cmp    $0x636f,%ecx
je     1143 <tgetnum+0x43>
mov    $0x19,%eax
cmp    $0x6c69,%ecx
jne    113d <tgetnum+0x3d>
ret
cmp    $0x7367,%ecx
je     113a <tgetnum+0x3a>
cmp    $0x7567,%ecx
jne    113d <tgetnum+0x3d>
xor    %eax,%eax
ret
mov    $0xffffffff,%eax
ret
mov    $0x50,%eax
ret

LLVM IR (-O0):
define i32 @tgetnum(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = shl i32 %7, 8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = and i32 %12, 255
%14 = add nsw i32 %8, %13
switch i32 %14, label %19 [
i32 27753, label %15
i32 25455, label %16
i32 29543, label %17
i32 30055, label %18
]
15: ; preds = %1
store i32 25, i32* %2
br label %20
16: ; preds = %1
store i32 80, i32* %2
br label %20
17: ; preds = %1
store i32 0, i32* %2
br label %20
18: ; preds = %1
store i32 0, i32* %2
br label %20
19: ; preds = %1
store i32 -1, i32* %2
br label %20
20: ; preds = %19, %18, %17, %16, %15
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @tgetnum(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = shl nsw i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = or i32 %4, %7
switch i32 %8, label %12 [
i32 27753, label %13
i32 25455, label %9
i32 29543, label %10
i32 30055, label %11
]
9: ; preds = %1
br label %13
10: ; preds = %1
br label %13
11: ; preds = %1
br label %13
12: ; preds = %1
br label %13
13: ; preds = %1, %12, %11, %10, %9
%14 = phi i32 [ -1, %12 ], [ 0, %11 ], [ 0, %10 ], [ 80, %9 ], [ 25, %1 ]
ret i32 %14
}
/* Variables and functions */
int chdir(char const *);
int lace_compat_sh_chdir(const char *directory) {
  int istat = -1;
  istat = chdir(directory);
  return istat;
}


x86 assembly (clang, -O0):
<lace_compat_sh_chdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <chdir@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lace_compat_sh_chdir>:
jmp    1030 <chdir@plt>

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

LLVM IR (-O2):
define i32 @lace_compat_sh_chdir(i8* %0) {
%2 = tail call i32 @chdir(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int log(double);
int /*<<< orphan*/ printf(char *);
int logarithm(int a, int b) {
  if (a <= 0 || b <= 0 || a == 1) {
    printf("Logarithms domain invaded. Corn dumped.\n");
    exit(1);
  }
  return (int)(log((double)a) / log((double)b));
}


x86 assembly (clang, -O0):
<logarithm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    115c <logarithm+0x2c>
cmpl   $0x0,-0x8(%rbp)
jle    115c <logarithm+0x2c>
cmpl   $0x1,-0x4(%rbp)
jne    1172 <logarithm+0x42>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
cvtsi2sdl -0x4(%rbp),%xmm0
call   1040 <log@plt>
mov    %eax,-0xc(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
call   1040 <log@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logarithm>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     1163 <logarithm+0x33>
mov    %esi,%ebx
test   %esi,%esi
jle    1163 <logarithm+0x33>
cvtsi2sd %edi,%xmm0
call   1040 <log@plt>
mov    %eax,%ebp
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
call   1040 <log@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe96(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"Logarithms domain invaded. Corn dumped.\0A\00"
define i32 @logarithm(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 = icmp sle i32 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp sle i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %16
13: ; preds = %10, %7, %2
%14 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %10
%17 = load i32, i32* %3
%18 = sitofp i32 %17 to double
%19 = call i32 @log(double %18)
%20 = load i32, i32* %4
%21 = sitofp i32 %20 to double
%22 = call i32 @log(double %21)
%23 = sdiv i32 %19, %22
ret i32 %23
}

LLVM IR (-O2):
@str = [40 x i8] c"Logarithms domain invaded. Corn dumped.\00"
define i32 @logarithm(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 1
%4 = icmp slt i32 %0, 2
%5 = or i1 %4, %3
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
%10 = sitofp i32 %0 to double
%11 = tail call i32 @log(double %10)
%12 = sitofp i32 %1 to double
%13 = tail call i32 @log(double %12)
%14 = sdiv i32 %11, %13
ret i32 %14
}
double time_reverse_convert_minute(int sixtieth) { return sixtieth / 60.0; }


x86 assembly (clang, -O0):
<time_reverse_convert_minute>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeec(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_reverse_convert_minute>:
cvtsi2sd %edi,%xmm0
divsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @time_reverse_convert_minute(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 6.000000e+01
ret double %5
}

LLVM IR (-O2):
define double @time_reverse_convert_minute(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fdiv double %2, 6.000000e+01
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void output(int pos) {
  static int matches = 0;
  printf("match %d found at position %d\n", ++matches, pos);
}


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

x86 assembly (clang, -O2):
<output>:
mov    %edi,%edx
mov    0x2f14(%rip),%esi
add    $0x1,%esi
mov    %esi,0x2f0b(%rip)
lea    0xed8(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@output.matches = internal global i32 0
@.str = [31 x i8] c"match %d found at position %d\0A\00"
define void @output(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @output.matches
%4 = add nsw i32 %3, 1
store i32 %4, i32* @output.matches
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@output.matches = internal unnamed_addr global i32 0
@.str = [31 x i8] c"match %d found at position %d\0A\00"
define void @output(i32 %0) {
%2 = load i32, i32* @output.matches
%3 = add nsw i32 %2, 1
store i32 %3, i32* @output.matches
%4 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %0)
ret void
}
/* Variables and functions */
void *memset_timec(void *s, int c, size_t n) {
  unsigned char *d = s;
  while (n--)
    d[n] = (unsigned char)c;
  return s;
}


x86 assembly (clang, -O0):
<memset_timec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     1145 <memset_timec+0x45>
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1117 <memset_timec+0x17>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset_timec>:
push   %rbx
mov    %rdi,%rbx
test   %rdx,%rdx
je     1121 <memset_timec+0x11>
mov    %rbx,%rdi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @memset_timec(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %3
ret i8* %0
}
void ordenaryeliminarepetidos() {}


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

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

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

LLVM IR (-O2):
define void @ordenaryeliminarepetidos() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ little_endian_read_16(int /*<<< orphan*/ const *, int);
uint16_t sdp_event_query_attribute_byte_get_data_offset(const uint8_t *event) {
  return little_endian_read_16(event, 8);
}


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

x86 assembly (clang, -O2):
<sdp_event_query_attribute_byte_get_data_offset>:
mov    $0x8,%esi
jmp    1030 <little_endian_read_16@plt>

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

LLVM IR (-O2):
define i32 @sdp_event_query_attribute_byte_get_data_offset(i32* %0) {
%2 = tail call i32 @little_endian_read_16(i32* %0, i32 8)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void argentina() { printf("I am in argentina\n"); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"I am in argentina\0A\00"
define void @argentina() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"I am in argentina\00"
define void @argentina() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
int h(double ccc, float ddd) {
  int xc = __builtin_isunordered(ccc, ccc);
  int xd = __builtin_isunordered(ddd, ddd);
  return xc | xd;
}


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
setp   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
setp   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
or     -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
ucomisd %xmm0,%xmm0
setp   %al
ucomiss %xmm1,%xmm1
setp   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @h(double %0, float %1) {
%3 = alloca double
%4 = alloca float
%5 = alloca i32
%6 = alloca i32
store double %0, double* %3
store float %1, float* %4
%7 = load double, double* %3
%8 = load double, double* %3
%9 = fcmp uno double %7, %8
%10 = zext i1 %9 to i32
store i32 %10, i32* %5
%11 = load float, float* %4
%12 = load float, float* %4
%13 = fcmp uno float %11, %12
%14 = zext i1 %13 to i32
store i32 %14, i32* %6
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = or i32 %15, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @h(double %0, float %1) {
%3 = fcmp uno double %0, 0.000000e+00
%4 = fcmp uno float %1, 0.000000e+00
%5 = or i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ editorOpen(char *);
int /*<<< orphan*/ editorProcessKeypress();
int /*<<< orphan*/ editorRefreshScreen();
int /*<<< orphan*/ enableRawMode();
int /*<<< orphan*/ initEditor();
int main(int argc, char *argv[]) {
  initEditor();
  enableRawMode();
  if (argc >= 2) {
    editorOpen(argv[1]);
  }
  while (1) {
    editorRefreshScreen();
    editorProcessKeypress();
  }
  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   1070 <initEditor@plt>
mov    $0x0,%al
call   1030 <enableRawMode@plt>
cmpl   $0x2,-0x8(%rbp)
jl     118b <main+0x3b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <editorOpen@plt>
jmp    1190 <main+0x40>
mov    $0x0,%al
call   1050 <editorRefreshScreen@plt>
mov    $0x0,%al
call   1060 <editorProcessKeypress@plt>
jmp    1190 <main+0x40>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1070 <initEditor@plt>
xor    %eax,%eax
call   1030 <enableRawMode@plt>
cmp    $0x2,%ebp
jl     1180 <main+0x30>
mov    0x8(%rbx),%rdi
call   1040 <editorOpen@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1050 <editorRefreshScreen@plt>
xor    %eax,%eax
call   1060 <editorProcessKeypress@plt>
jmp    1180 <main+0x30>

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 (...) @initEditor()
%7 = call i32 (...) @enableRawMode()
%8 = load i32, i32* %4
%9 = icmp sge i32 %8, 2
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @editorOpen(i8* %13)
br label %15
15: ; preds = %10, %2
br label %16
16: ; preds = %15, %16
%17 = call i32 (...) @editorRefreshScreen()
%18 = call i32 (...) @editorProcessKeypress()
br label %16
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @initEditor()
%4 = tail call i32 (...) @enableRawMode()
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @editorOpen(i8* %8)
br label %10
10: ; preds = %6, %2
br label %11
11: ; preds = %10, %11
%12 = tail call i32 (...) @editorRefreshScreen()
%13 = tail call i32 (...) @editorProcessKeypress()
br label %11
}
int apply(int (*op)(int), int x) { return op(x); }


x86 assembly (clang, -O0):
<apply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<apply>:
mov    %rdi,%rax
mov    %esi,%edi
jmp    *%rax

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

LLVM IR (-O2):
define i32 @apply(i32 (i32)* nocapture %0, i32 %1) {
%3 = tail call i32 %0(i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ LC_CTYPE;
int /*<<< orphan*/ run_inspector();
int run_with_params(int, char **);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int main(int argc, char *argv[]) {
  setlocale(LC_CTYPE, "");
  if (argc > 1) {
    return run_with_params(argc, argv);
  }
  run_inspector();
  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    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xeaa(%rip),%rsi
call   1050 <setlocale@plt>
cmpl   $0x1,-0x8(%rbp)
jle    1179 <main+0x49>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <run_with_params@plt>
mov    %eax,-0x4(%rbp)
jmp    1187 <main+0x57>
mov    $0x0,%al
call   1040 <run_inspector@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xeb8(%rip),%rsi
call   1050 <setlocale@plt>
cmp    $0x2,%ebp
jl     1162 <main+0x32>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <run_with_params@plt>
xor    %eax,%eax
call   1040 <run_inspector@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@LC_CTYPE = global i32 0
@.str = [1 x i8] zeroinitializer
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 = load i32, i32* @LC_CTYPE
%7 = call i32 @setlocale(i32 %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 1
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i8**, i8*** %5
%13 = call i32 @run_with_params(i32 %11, i8** %12)
store i32 %13, i32* %3
br label %16
14: ; preds = %2
%15 = call i32 (...) @run_inspector()
store i32 0, i32* %3
br label %16
16: ; preds = %14, %10
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@LC_CTYPE = global i32 0
@.str = [1 x i8] zeroinitializer
define i32 @main(i32 %0, i8** %1) {
%3 = load i32, i32* @LC_CTYPE
%4 = tail call i32 @setlocale(i32 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @run_with_params(i32 %0, i8** %1)
br label %10
8: ; preds = %2
%9 = tail call i32 (...) @run_inspector()
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ 0, %8 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
scalar_t__ strncmp(char const *, char const *, int /*<<< orphan*/);
bool startswith(const char *s, const char *prefix) {
  if (strncmp(s, prefix, strlen(prefix)) == 0) {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<startswith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    116e <startswith+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1175 <startswith+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startswith>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @startswith(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
void foo364(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo364(i32 %0) {
ret void
}
void freeImageDocumentLine(struct imageDocumentLine *targetLine) {
  if (targetLine) {
  }
}


x86 assembly (clang, -O0):
<freeImageDocumentLine>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1118 <freeImageDocumentLine+0x18>
jmp    1118 <freeImageDocumentLine+0x18>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.imageDocumentLine = type opaque
define void @freeImageDocumentLine(%struct.imageDocumentLine* %0) {
%2 = alloca %struct.imageDocumentLine*
store %struct.imageDocumentLine* %0, %struct.imageDocumentLine** %2
%3 = load %struct.imageDocumentLine*, %struct.imageDocumentLine** %2
%4 = icmp ne %struct.imageDocumentLine* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %6
6: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.imageDocumentLine = type opaque
define void @freeImageDocumentLine(%struct.imageDocumentLine* nocapture %0) {
ret void
}
int reverseByte(int a) {
  return ((a << 7) & 128) | ((a << 5) & 64) | ((a << 3) & 32) |
         ((a << 1) & 16) | ((a >> 1) & 8) | ((a >> 3) & 4) | ((a >> 5) & 2) |
         ((a >> 7) & 1);
}


x86 assembly (clang, -O0):
<reverseByte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x7,%eax
and    $0x80,%eax
mov    -0x4(%rbp),%ecx
shl    $0x5,%ecx
and    $0x40,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x3,%ecx
and    $0x20,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
and    $0x10,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x1,%ecx
and    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x3,%ecx
and    $0x4,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x5,%ecx
and    $0x2,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x7,%ecx
and    $0x1,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverseByte>:
rol    $0x4,%dil
mov    %edi,%eax
and    $0x33,%al
shl    $0x2,%al
shr    $0x2,%dil
and    $0x33,%dil
or     %al,%dil
mov    %edi,%eax
and    $0x55,%al
add    %al,%al
shr    %dil
and    $0x55,%dil
or     %al,%dil
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @reverseByte(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 7
%5 = and i32 %4, 128
%6 = load i32, i32* %2
%7 = shl i32 %6, 5
%8 = and i32 %7, 64
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = shl i32 %10, 3
%12 = and i32 %11, 32
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = shl i32 %14, 1
%16 = and i32 %15, 16
%17 = or i32 %13, %16
%18 = load i32, i32* %2
%19 = ashr i32 %18, 1
%20 = and i32 %19, 8
%21 = or i32 %17, %20
%22 = load i32, i32* %2
%23 = ashr i32 %22, 3
%24 = and i32 %23, 4
%25 = or i32 %21, %24
%26 = load i32, i32* %2
%27 = ashr i32 %26, 5
%28 = and i32 %27, 2
%29 = or i32 %25, %28
%30 = load i32, i32* %2
%31 = ashr i32 %30, 7
%32 = and i32 %31, 1
%33 = or i32 %29, %32
ret i32 %33
}

LLVM IR (-O2):
define i32 @reverseByte(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = tail call i8 @llvm.bitreverse.i8(i8 %2)
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
__attribute__((visibility("default"))) void *sd_bus_slot_get_bus(void *slot) {
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @sd_bus_slot_get_bus(i8* nocapture readnone %0) {
ret i8* null
}
int test_imm_4Buint32_mem(unsigned int *val) {
  return ((*val) & (0x4B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Buint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0x4b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Buint32_mem>:
testb  $0x4b,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_4Buint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 75
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void target_startup() { return; }


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

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

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

LLVM IR (-O2):
define void @target_startup() {
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  unsigned int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned int GetTimer(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (tv.tv_sec * 1000000 + tv.tv_usec);
}


x86 assembly (clang, -O0):
<GetTimer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x8(%rbp),%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetTimer>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,(%rsp),%eax
add    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @GetTimer() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = add i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @GetTimer() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = add i32 %6, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stdout;
void print_version() { fprintf(stdout, "%s: %s\n\n", "tcp_tool", "0.1.0"); }


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

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

LLVM IR (-O0):
@stdout = global i32 0
@.str = [9 x i8] c"%s: %s\0A\0A\00"
@.str.1 = [9 x i8] c"tcp_tool\00"
@.str.2 = [6 x i8] c"0.1.0\00"
define void @print_version() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [9 x i8] c"%s: %s\0A\0A\00"
@.str.1 = [9 x i8] c"tcp_tool\00"
@.str.2 = [6 x i8] c"0.1.0\00"
define void @print_version() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret void
}
putchar(c) { write(1, &c, 1); }


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x1,%edx
lea    -0x8(%rbp),%rsi
mov    %edx,%edi
mov    $0x0,%al
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <write@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i32, i32*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i32*, i32, ...)*)(i32 1, i32* %2, i32 1)
ret i32 undef
}
void testcase_assertion_startup() {}


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

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

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

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