xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int /*<<< orphan*/ do_evil_stuff();
int /*<<< orphan*/ geteuid();
uid_t getuid(void) {
  do_evil_stuff();
  return geteuid();
}


x86 assembly (clang, -O0):
<getuid>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <do_evil_stuff@plt>
mov    $0x0,%al
call   1040 <geteuid@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getuid>:
push   %rax
xor    %eax,%eax
call   1030 <do_evil_stuff@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <geteuid@plt>

LLVM IR (-O0):
define i32 @getuid() {
%1 = call i32 (...) @do_evil_stuff()
%2 = call i32 (...) @geteuid()
ret i32 %2
}

LLVM IR (-O2):
define i32 @getuid() {
%1 = tail call i32 (...) @do_evil_stuff()
%2 = tail call i32 (...) @geteuid()
ret i32 %2
}
void HCopyArea(int srcx, int srcy, int width, int height, int destx,
               int desty) {}


x86 assembly (clang, -O0):
<HCopyArea>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @HCopyArea(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
ret void
}

LLVM IR (-O2):
define void @HCopyArea(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
ret void
}
/* Variables and functions */
unsigned long BIT_MASK(int);
int BIT_WORD(int);
int __test_and_set_bit(int nr, volatile unsigned long *addr) {
  unsigned long mask = BIT_MASK(nr);
  unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
  unsigned long old = *p;
  *p = old | mask;
  return (old & mask) != 0;
}


x86 assembly (clang, -O0):
<__test_and_set_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <BIT_MASK@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <BIT_WORD@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rcx
or     -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
and    -0x18(%rbp),%rax
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__test_and_set_bit>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
call   1030 <BIT_MASK@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1040 <BIT_WORD@plt>
cltq
mov    (%r14,%rax,8),%rcx
mov    %rcx,%rdx
or     %rbx,%rdx
mov    %rdx,(%r14,%rax,8)
xor    %eax,%eax
test   %rbx,%rcx
setne  %al
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @__test_and_set_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64*
%7 = alloca i64
store i32 %0, i32* %3
store i64* %1, i64** %4
%8 = load i32, i32* %3
%9 = call i64 @BIT_MASK(i32 %8)
store i64 %9, i64* %5
%10 = load i64*, i64** %4
%11 = load i32, i32* %3
%12 = call i32 @BIT_WORD(i32 %11)
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i64, i64* %10, i64 %13
store i64* %14, i64** %6
%15 = load i64*, i64** %6
%16 = load i64, i64* %15
store i64 %16, i64* %7
%17 = load i64, i64* %7
%18 = load i64, i64* %5
%19 = or i64 %17, %18
%20 = load i64*, i64** %6
store i64 %19, i64* %20
%21 = load i64, i64* %7
%22 = load i64, i64* %5
%23 = and i64 %21, %22
%24 = icmp ne i64 %23, 0
%25 = zext i1 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @__test_and_set_bit(i32 %0, i64* nocapture %1) {
%3 = tail call i64 @BIT_MASK(i32 %0)
%4 = tail call i32 @BIT_WORD(i32 %0)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i64, i64* %1, i64 %5
%7 = load i64, i64* %6
%8 = or i64 %7, %3
store i64 %8, i64* %6
%9 = and i64 %7, %3
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}
unsigned ctime(void) {
  unsigned cycles;
  cycles = *((volatile unsigned *)0x20000100);
  return cycles;
}


x86 assembly (clang, -O0):
<ctime>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20000100,%eax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctime>:
mov    0x20000100,%eax
ret

LLVM IR (-O0):
define i32 @ctime() {
%1 = alloca i32
%2 = load volatile i32, i32* inttoptr (i64 536871168 to i32*)
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @ctime() {
%1 = load volatile i32, i32* inttoptr (i64 536871168 to i32*)
ret i32 %1
}
/* Type definitions */
struct tms {
  int dummy;
};
typedef int clock_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
clock_t times(struct tms *buffer) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<times>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.tms = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @times(%struct.tms* %0) {
%2 = alloca %struct.tms*
store %struct.tms* %0, %struct.tms** %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.tms = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @times(%struct.tms* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ gAnd(int, int);
int gNot(int);
int gOr(int /*<<< orphan*/, int /*<<< orphan*/);
int gXor(int a, int b) { return gOr(gAnd(a, gNot(b)), gAnd(gNot(a), b)); }


x86 assembly (clang, -O0):
<gXor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <gNot@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1050 <gAnd@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <gNot@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%esi
call   1050 <gAnd@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1030 <gOr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gXor>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
call   1040 <gNot@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1050 <gAnd@plt>
mov    %eax,%r14d
mov    %ebp,%edi
call   1040 <gNot@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1050 <gAnd@plt>
mov    %r14d,%edi
mov    %eax,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <gOr@plt>

LLVM IR (-O0):
define i32 @gXor(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @gNot(i32 %6)
%8 = call i32 @gAnd(i32 %5, i32 %7)
%9 = load i32, i32* %3
%10 = call i32 @gNot(i32 %9)
%11 = load i32, i32* %4
%12 = call i32 @gAnd(i32 %10, i32 %11)
%13 = call i32 @gOr(i32 %8, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @gXor(i32 %0, i32 %1) {
%3 = tail call i32 @gNot(i32 %1)
%4 = tail call i32 @gAnd(i32 %0, i32 %3)
%5 = tail call i32 @gNot(i32 %0)
%6 = tail call i32 @gAnd(i32 %5, i32 %1)
%7 = tail call i32 @gOr(i32 %4, i32 %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int const);
int /*<<< orphan*/ stderr;
void line_notification(const int line_num) {
  fprintf(stderr, "ERROR FOUND ON LINE: %d\n", line_num);
}


x86 assembly (clang, -O0):
<line_notification>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<line_notification>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"ERROR FOUND ON LINE: %d\0A\00"
define void @line_notification(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"ERROR FOUND ON LINE: %d\0A\00"
define void @line_notification(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int rating_change_win(int, int);
int rating_change_loss(int engine_rating, int opponent_rating) {
  return -(32 - rating_change_win(engine_rating, opponent_rating));
}


x86 assembly (clang, -O0):
<rating_change_loss>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <rating_change_win@plt>
mov    $0x20,%ecx
sub    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rating_change_loss>:
push   %rax
call   1030 <rating_change_win@plt>
add    $0xffffffe0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rating_change_loss(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @rating_change_win(i32 %5, i32 %6)
%8 = sub nsw i32 32, %7
%9 = sub nsw i32 0, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @rating_change_loss(i32 %0, i32 %1) {
%3 = tail call i32 @rating_change_win(i32 %0, i32 %1)
%4 = add i32 %3, -32
ret i32 %4
}
/* Type definitions */
struct stat {
  int st_mode;
};

/* Variables and functions */
int /*<<< orphan*/ ENOENT;
int /*<<< orphan*/ errno;
scalar_t__ stat(char const *, struct stat *);
int getfattr(const char *filename) {
  struct stat st;
  if (stat(filename, &st) != 0) {
    errno = ENOENT;
    return (-1L);
  }
  return (st.st_mode);
}


x86 assembly (clang, -O0):
<getfattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     1151 <getfattr+0x41>
mov    0x2e96(%rip),%rax
mov    (%rax),%ecx
mov    0x2e9d(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1157 <getfattr+0x47>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getfattr>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %rax,%rax
je     1137 <getfattr+0x27>
mov    0x2eab(%rip),%rax
mov    (%rax),%eax
mov    0x2eb2(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@ENOENT = global i32 0
@errno = global i32 0
define i32 @getfattr(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* @ENOENT
store i32 %9, i32* @errno
store i32 -1, i32* %2
br label %13
10: ; preds = %1
%11 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%12 = load i32, i32* %11
store i32 %12, i32* %2
br label %13
13: ; preds = %10, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@ENOENT = global i32 0
@errno = global i32 0
define i32 @getfattr(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = load i32, i32* @ENOENT
store i32 %7, i32* @errno
br label %11
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%10 = load i32, i32* %9
br label %11
11: ; preds = %8, %6
%12 = phi i32 [ -1, %6 ], [ %10, %8 ]
ret i32 %12
}
/* Variables and functions */
int strcmp(char const *, char const *);
int str_compare(const void *_a, const void *_b) {
  const char **a = (const char **)_a, **b = (const char **)_b;
  return strcmp(*a, *b);
}


x86 assembly (clang, -O0):
<str_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
call   1030 <strcmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_compare>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @str_compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
store i8** %8, i8*** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i8**
store i8** %10, i8*** %6
%11 = load i8**, i8*** %5
%12 = load i8*, i8** %11
%13 = load i8**, i8*** %6
%14 = load i8*, i8** %13
%15 = call i32 @strcmp(i8* %12, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @str_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int print_version() {
  fprintf(stderr, "Version lol\n");
  return -1;
}


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

x86 assembly (clang, -O2):
<print_version>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"Version lol\0A\00"
define i32 @print_version() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
int planet_motion_analytic(void) { return (1); }


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

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

LLVM IR (-O0):
define i32 @planet_motion_analytic() {
ret i32 1
}

LLVM IR (-O2):
define i32 @planet_motion_analytic() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void foo1() {
  int x = 0;
  goto l1;
l3:
  assert(x == 2);
  x = 3;
  return;
l2:
  assert(x == 1);
  x = 2;
  goto l3;
l1:
  assert(x == 0);
  x = 1;
  goto l2;
}


x86 assembly (clang, -O0):
<foo1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
jmp    115f <foo1+0x4f>
cmpl   $0x2,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x3,-0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret
cmpl   $0x1,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x2,-0x4(%rbp)
jmp    1124 <foo1+0x14>
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x1,-0x4(%rbp)
jmp    1142 <foo1+0x32>

x86 assembly (clang, -O2):
<foo1>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <assert@plt>

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

LLVM IR (-O2):
define void @foo1() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 1)
ret void
}
/* Variables and functions */
int __internal_syscall(int, long, long, long, long);
int _link(const char *old_name, const char *new_name) {
  return __internal_syscall(1025, (long)(old_name), (long)(new_name), (long)(0),
                            (long)(0));
}


x86 assembly (clang, -O0):
<_link>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x401,%edi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rcx
call   1030 <__internal_syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_link>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x401,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <__internal_syscall@plt>

LLVM IR (-O0):
define i32 @_link(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i64
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i64
%9 = call i32 @__internal_syscall(i32 1025, i64 %6, i64 %8, i64 0, i64 0)
ret i32 %9
}

LLVM IR (-O2):
define i32 @_link(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = tail call i32 @__internal_syscall(i32 1025, i64 %3, i64 %4, i64 0, i64 0)
ret i32 %5
}
/* Type definitions */
struct scsi_cmnd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ata_scsi_badcmd(struct scsi_cmnd *,
                                   void (*)(struct scsi_cmnd *), unsigned char,
                                   unsigned char);
void(ata_bad_scsiop)(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) {
  {
    ata_scsi_badcmd(cmd, done, (unsigned char)32, (unsigned char)0);
    return;
  }
}


x86 assembly (clang, -O0):
<ata_bad_scsiop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x20,%edx
xor    %ecx,%ecx
call   1030 <ata_scsi_badcmd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ata_bad_scsiop>:
mov    $0x20,%edx
xor    %ecx,%ecx
jmp    1030 <ata_scsi_badcmd@plt>

LLVM IR (-O0):
%struct.scsi_cmnd = type { i32 }
define void @ata_bad_scsiop(%struct.scsi_cmnd* %0, void (%struct.scsi_cmnd*)* %1) {
%3 = alloca %struct.scsi_cmnd*
%4 = alloca void (%struct.scsi_cmnd*)*
store %struct.scsi_cmnd* %0, %struct.scsi_cmnd** %3
store void (%struct.scsi_cmnd*)* %1, void (%struct.scsi_cmnd*)** %4
%5 = load %struct.scsi_cmnd*, %struct.scsi_cmnd** %3
%6 = load void (%struct.scsi_cmnd*)*, void (%struct.scsi_cmnd*)** %4
%7 = call i32 @ata_scsi_badcmd(%struct.scsi_cmnd* %5, void (%struct.scsi_cmnd*)* %6, i8 zeroext 32, i8 zeroext 0)
ret void
}

LLVM IR (-O2):
%struct.scsi_cmnd = type { i32 }
define void @ata_bad_scsiop(%struct.scsi_cmnd* %0, void (%struct.scsi_cmnd*)* %1) {
%3 = tail call i32 @ata_scsi_badcmd(%struct.scsi_cmnd* %0, void (%struct.scsi_cmnd*)* %1, i8 zeroext 32, i8 zeroext 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ add_label_ref(char *);
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ store(int /*<<< orphan*/);
void process_data(char *str) {
  int32_t value;
  if (str[0] == '@')
    add_label_ref(&str[1]);
  else
    store(atoi(str));
}


x86 assembly (clang, -O0):
<process_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x40,%eax
jne    115e <process_data+0x2e>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1040 <add_label_ref@plt>
jmp    116e <process_data+0x3e>
mov    -0x8(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1030 <store@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_data>:
push   %rax
cmpb   $0x40,(%rdi)
jne    1140 <process_data+0x10>
add    $0x1,%rdi
pop    %rax
jmp    1040 <add_label_ref@plt>
call   1050 <atoi@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <store@plt>

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

LLVM IR (-O2):
define void @process_data(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 64
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = tail call i32 @add_label_ref(i8* %5)
br label %10
7: ; preds = %1
%8 = tail call i32 @atoi(i8* %0)
%9 = tail call i32 @store(i32 %8)
br label %10
10: ; preds = %7, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ o_set_log(int /*<<< orphan*/ *);
void o_set_simplified_logging(void) { o_set_log(NULL); }


x86 assembly (clang, -O0):
<o_set_simplified_logging>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <o_set_log@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<o_set_simplified_logging>:
xor    %edi,%edi
jmp    1030 <o_set_log@plt>

LLVM IR (-O0):
define void @o_set_simplified_logging() {
%1 = call i32 @o_set_log(i32* null)
ret void
}

LLVM IR (-O2):
define void @o_set_simplified_logging() {
%1 = tail call i32 @o_set_log(i32* null)
ret void
}
/* Type definitions */
struct nlattr {
  int dummy;
};
struct nla_policy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ nla_data(struct nlattr *);
int /*<<< orphan*/ nla_len(struct nlattr *);
int nla_validate(int /*<<< orphan*/, int /*<<< orphan*/, int,
                 struct nla_policy const *);
int nla_validate_nested(struct nlattr *start, int maxtype,
                        const struct nla_policy *policy) {
  return nla_validate(nla_data(start), nla_len(start), maxtype, policy);
}


x86 assembly (clang, -O0):
<nla_validate_nested>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <nla_data@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <nla_len@plt>
mov    -0x1c(%rbp),%edi
mov    %eax,%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1050 <nla_validate@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nla_validate_nested>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %esi,%r15d
mov    %rdi,%rbx
call   1040 <nla_data@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <nla_len@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %r15d,%edx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <nla_validate@plt>

LLVM IR (-O0):
%struct.nlattr = type { i32 }
%struct.nla_policy = type { i32 }
define i32 @nla_validate_nested(%struct.nlattr* %0, i32 %1, %struct.nla_policy* %2) {
%4 = alloca %struct.nlattr*
%5 = alloca i32
%6 = alloca %struct.nla_policy*
store %struct.nlattr* %0, %struct.nlattr** %4
store i32 %1, i32* %5
store %struct.nla_policy* %2, %struct.nla_policy** %6
%7 = load %struct.nlattr*, %struct.nlattr** %4
%8 = call i32 @nla_data(%struct.nlattr* %7)
%9 = load %struct.nlattr*, %struct.nlattr** %4
%10 = call i32 @nla_len(%struct.nlattr* %9)
%11 = load i32, i32* %5
%12 = load %struct.nla_policy*, %struct.nla_policy** %6
%13 = call i32 @nla_validate(i32 %8, i32 %10, i32 %11, %struct.nla_policy* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.nlattr = type { i32 }
%struct.nla_policy = type { i32 }
define i32 @nla_validate_nested(%struct.nlattr* %0, i32 %1, %struct.nla_policy* %2) {
%4 = tail call i32 @nla_data(%struct.nlattr* %0)
%5 = tail call i32 @nla_len(%struct.nlattr* %0)
%6 = tail call i32 @nla_validate(i32 %4, i32 %5, i32 %1, %struct.nla_policy* %2)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ term();
void sigterm(int sig) { term(); }


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

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

LLVM IR (-O0):
define void @sigterm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @term()
ret void
}

LLVM IR (-O2):
define void @sigterm(i32 %0) {
%2 = tail call i32 (...) @term()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xb7() {
  Assert_real((ispunct(183) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_ispunct.c",
              920, ("ispunct should be 0 for 0xb7"));
}


x86 assembly (clang, -O0):
<t_ispunct_0xb7>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb7,%edi
call   1030 <ispunct@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x398,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_ispunct_0xb7>:
push   %rax
mov    $0xb7,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x398,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xb7\00"
define void @t_ispunct_0xb7() {
%1 = call i64 @ispunct(i32 183)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 920, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xb7\00"
define void @t_ispunct_0xb7() {
%1 = tail call i64 @ispunct(i32 183)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 920, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
const char *db_all_jes_report_sql(void) {
  static const char *query = "SELECT * FROM all_jes";
  return query;
}


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

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

LLVM IR (-O0):
@db_all_jes_report_sql.query = internal global i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i32 0, i32 0)
@.str = [22 x i8] c"SELECT * FROM all_jes\00"
define i8* @db_all_jes_report_sql() {
%1 = load i8*, i8** @db_all_jes_report_sql.query
ret i8* %1
}

LLVM IR (-O2):
@.str = [22 x i8] c"SELECT * FROM all_jes\00"
define i8* @db_all_jes_report_sql() {
ret i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
void *calloc(size_t, size_t);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *scalloc(size_t nmemb, size_t n) {
  void *p;
  p = calloc(nmemb, n);
  if (p == NULL) {
    fprintf(stderr, "cannot calloc()\n");
    exit(EXIT_FAILURE);
  }
  return (p);
}


x86 assembly (clang, -O0):
<scalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117f <scalloc+0x4f>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"cannot calloc()\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @scalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret i8* %3
}
void PWM_device_channel_start(unsigned int channel) {}


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

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

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

LLVM IR (-O2):
define void @PWM_device_channel_start(i32 %0) {
ret void
}
int primitiveSmallInteger_Equal_(int receiver, int *arguments) {
  if ((receiver & 1) && (arguments[0] & 1)) {
    return receiver == arguments[0] ? (10 << 2) : (20 << 2);
  }
  return (1 << 2);
}


x86 assembly (clang, -O0):
<primitiveSmallInteger_Equal_>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     114c <primitiveSmallInteger_Equal_+0x4c>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     114c <primitiveSmallInteger_Equal_+0x4c>
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    $0x50,%eax
mov    $0x28,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <primitiveSmallInteger_Equal_+0x53>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitiveSmallInteger_Equal_>:
mov    $0x4,%eax
test   $0x1,%dil
je     1121 <primitiveSmallInteger_Equal_+0x21>
mov    (%rsi),%ecx
test   $0x1,%cl
je     1121 <primitiveSmallInteger_Equal_+0x21>
cmp    %edi,%ecx
mov    $0x28,%ecx
mov    $0x50,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @primitiveSmallInteger_Equal_(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 = and i32 %6, 1
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %23
9: ; preds = %2
%10 = load i32*, i32** %5
%11 = getelementptr inbounds i32, i32* %10, i64 0
%12 = load i32, i32* %11
%13 = and i32 %12, 1
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %23
15: ; preds = %9
%16 = load i32, i32* %4
%17 = load i32*, i32** %5
%18 = getelementptr inbounds i32, i32* %17, i64 0
%19 = load i32, i32* %18
%20 = icmp eq i32 %16, %19
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 40, i32 80
store i32 %22, i32* %3
br label %24
23: ; preds = %9, %2
store i32 4, i32* %3
br label %24
24: ; preds = %23, %15
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @primitiveSmallInteger_Equal_(i32 %0, i32* nocapture %1) {
%3 = and i32 %0, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = load i32, i32* %1
%7 = and i32 %6, 1
%8 = icmp eq i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %5
%10 = icmp eq i32 %6, %0
%11 = select i1 %10, i32 40, i32 80
br label %12
12: ; preds = %2, %5, %9
%13 = phi i32 [ %11, %9 ], [ 4, %5 ], [ 4, %2 ]
ret i32 %13
}
double modf(x, pint)
double x;
double *pint;
{
  if (x >= 0)
    *pint = floor(x);
  else
    *pint = ceil(x);
  return x - *pint;
}


x86 assembly (clang, -O0):
<modf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     115a <modf+0x3a>
movsd  -0x8(%rbp),%xmm0
call   1040 <floor@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    116c <modf+0x4c>
movsd  -0x8(%rbp),%xmm0
call   1030 <ceil@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modf>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
jae    113f <modf+0x1f>
call   1030 <ceil@plt>
jmp    1144 <modf+0x24>
call   1040 <floor@plt>
movsd  %xmm0,(%rbx)
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @modf(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
store double %0, double* %3
store double* %1, double** %4
%5 = load double, double* %3
%6 = fcmp oge double %5, 0.000000e+00
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load double, double* %3
%9 = call double @llvm.floor.f64(double %8)
%10 = load double*, double** %4
store double %9, double* %10
br label %15
11: ; preds = %2
%12 = load double, double* %3
%13 = call double @llvm.ceil.f64(double %12)
%14 = load double*, double** %4
store double %13, double* %14
br label %15
15: ; preds = %11, %7
%16 = load double, double* %3
%17 = load double*, double** %4
%18 = load double, double* %17
%19 = fsub double %16, %18
ret double %19
}

LLVM IR (-O2):
define double @modf(double %0, double* nocapture writeonly %1) {
%3 = fcmp ult double %0, 0.000000e+00
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call double @llvm.floor.f64(double %0)
br label %8
6: ; preds = %2
%7 = tail call double @llvm.ceil.f64(double %0)
br label %8
8: ; preds = %6, %4
%9 = phi double [ %7, %6 ], [ %5, %4 ]
store double %9, double* %1
%10 = fsub double %0, %9
ret double %10
}
int f_rgb(float fr, float fg, float fb) {
  int r = (int)fr;
  int g = (int)fg;
  int b = (int)fb;
  return (r + (g << 5) + (b << 10));
}


x86 assembly (clang, -O0):
<f_rgb>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
cvttss2si -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
cvttss2si -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
cvttss2si -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x14(%rbp),%ecx
shl    $0x5,%ecx
add    %ecx,%eax
mov    -0x18(%rbp),%ecx
shl    $0xa,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_rgb>:
cvttss2si %xmm0,%ecx
cvttss2si %xmm1,%edx
cvttss2si %xmm2,%eax
shl    $0x5,%edx
add    %ecx,%edx
shl    $0xa,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @f_rgb(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%10 = load float, float* %4
%11 = fptosi float %10 to i32
store i32 %11, i32* %7
%12 = load float, float* %5
%13 = fptosi float %12 to i32
store i32 %13, i32* %8
%14 = load float, float* %6
%15 = fptosi float %14 to i32
store i32 %15, i32* %9
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = shl i32 %17, 5
%19 = add nsw i32 %16, %18
%20 = load i32, i32* %9
%21 = shl i32 %20, 10
%22 = add nsw i32 %19, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @f_rgb(float %0, float %1, float %2) {
%4 = fptosi float %0 to i32
%5 = fptosi float %1 to i32
%6 = fptosi float %2 to i32
%7 = shl i32 %5, 5
%8 = add nsw i32 %7, %4
%9 = shl i32 %6, 10
%10 = add nsw i32 %8, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int si_expect_yn(int);
void expect_y(int fd) {
  if (si_expect_yn(fd) != 1)
    printf("ERROR expected yes got no from uart\n");
}


x86 assembly (clang, -O0):
<expect_y>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <si_expect_yn@plt>
cmp    $0x1,%eax
je     1148 <expect_y+0x28>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expect_y>:
push   %rax
call   1040 <si_expect_yn@plt>
cmp    $0x1,%eax
jne    112d <expect_y+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"ERROR expected yes got no from uart\0A\00"
define void @expect_y(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @si_expect_yn(i32 %3)
%5 = icmp ne i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@str = [36 x i8] c"ERROR expected yes got no from uart\00"
define void @expect_y(i32 %0) {
%2 = tail call i32 @si_expect_yn(i32 %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
scalar_t__ emalloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strsav(const char *s) {
  char *p;
  if (NULL == s)
    s = "";
  p = (char *)emalloc(strlen(s) + 1);
  strcpy(p, s);
  return p;
}


x86 assembly (clang, -O0):
<strsav>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
jne    1153 <strsav+0x23>
lea    0xeb1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <emalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strsav>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
lea    0xec2(%rip),%rbx
cmovne %rdi,%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <emalloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @strsav(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp eq i8* null, %4
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %7
7: ; preds = %6, %1
%8 = load i8*, i8** %2
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %9, 1
%11 = call i64 @emalloc(i64 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %3
%13 = load i8*, i8** %3
%14 = load i8*, i8** %2
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @strsav(i8* %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0
%4 = tail call i64 @strlen(i8* dereferenceable(1) %3)
%5 = add nsw i64 %4, 1
%6 = tail call i64 @emalloc(i64 %5)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @strcpy(i8* %7, i8* %3)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ addFoncT(char *, void (*)(), int /*<<< orphan*/, int);
void addFonN(char *l, void (*f)(void)) { addFoncT(l, f, 0, 32); }


x86 assembly (clang, -O0):
<addFonN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
mov    $0x20,%ecx
call   1030 <addFoncT@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addFonN>:
xor    %edx,%edx
mov    $0x20,%ecx
jmp    1030 <addFoncT@plt>

LLVM IR (-O0):
define void @addFonN(i8* %0, void ()* %1) {
%3 = alloca i8*
%4 = alloca void ()*
store i8* %0, i8** %3
store void ()* %1, void ()** %4
%5 = load i8*, i8** %3
%6 = load void ()*, void ()** %4
%7 = bitcast void ()* %6 to void (...)*
%8 = call i32 @addFoncT(i8* %5, void (...)* %7, i32 0, i32 32)
ret void
}

LLVM IR (-O2):
define void @addFonN(i8* %0, void ()* %1) {
%3 = bitcast void ()* %1 to void (...)*
%4 = tail call i32 @addFoncT(i8* %0, void (...)* %3, i32 0, i32 32)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ step_hash(int);
int *func_35(unsigned p_36, unsigned p_37, int *p_38, int *p_39, short p_40) {
  step_hash(211);
  return p_38;
}


x86 assembly (clang, -O0):
<func_35>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %r8w,%ax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %ax,-0x1a(%rbp)
mov    $0xd3,%edi
call   1030 <step_hash@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_35>:
push   %rbx
mov    %rdx,%rbx
mov    $0xd3,%edi
call   1030 <step_hash@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @func_35(i32 %0, i32 %1, i32* %2, i32* %3, i16 signext %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i16
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i16 %4, i16* %10
%11 = call i32 @step_hash(i32 211)
%12 = load i32*, i32** %8
ret i32* %12
}

LLVM IR (-O2):
define i32* @func_35(i32 %0, i32 %1, i32* readnone returned %2, i32* nocapture readnone %3, i16 signext %4) {
%6 = tail call i32 @step_hash(i32 211)
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ runner_crash(int);
void asserter_crash_if(int condition, int return_code) {
  if (condition)
    runner_crash(return_code);
}


x86 assembly (clang, -O0):
<asserter_crash_if>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1130 <asserter_crash_if+0x20>
mov    -0x8(%rbp),%edi
call   1030 <runner_crash@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asserter_crash_if>:
test   %edi,%edi
je     111b <asserter_crash_if+0xb>
mov    %esi,%edi
jmp    1030 <runner_crash@plt>
ret

LLVM IR (-O0):
define void @asserter_crash_if(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 ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = call i32 @runner_crash(i32 %8)
br label %10
10: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @asserter_crash_if(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @runner_crash(i32 %1)
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
char *strdup(char *);
char *strtok(char *, char *);
char *parser_get_host(char *data) {
  char *buf;
  char *delimit = " ";
  char *buf1 = strdup(data);
  buf = strtok(buf1, ":!");
  buf = strtok(NULL, "~@");
  buf = strtok(NULL, delimit);
  return (char *)buf;
}


x86 assembly (clang, -O0):
<parser_get_host>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xeb3(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xea2(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1030 <strtok@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parser_get_host>:
push   %rax
call   1040 <strdup@plt>
lea    0xed5(%rip),%rsi
mov    %rax,%rdi
call   1030 <strtok@plt>
lea    0xec9(%rip),%rsi
xor    %edi,%edi
call   1030 <strtok@plt>
lea    0xeb6(%rip),%rsi
xor    %edi,%edi
pop    %rax
jmp    1030 <strtok@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [3 x i8] c":!\00"
@.str.2 = [3 x i8] c"~@\00"
define i8* @parser_get_host(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %4
%6 = load i8*, i8** %2
%7 = call i8* @strdup(i8* %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = call i8* @strtok(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i8* %9, i8** %3
%10 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i8* %10, i8** %3
%11 = load i8*, i8** %4
%12 = call i8* @strtok(i8* null, i8* %11)
store i8* %12, i8** %3
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [3 x i8] c":!\00"
@.str.2 = [3 x i8] c"~@\00"
define i8* @parser_get_host(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = tail call i8* @strtok(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_vtab;

/* Variables and functions */
int cXRelease(int /*<<< orphan*/ *, int /*<<< orphan*/);
int cXDisconnect(sqlite3_vtab *pVTab) { return cXRelease(pVTab, 0); }


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

x86 assembly (clang, -O2):
<cXDisconnect>:
xor    %esi,%esi
jmp    1030 <cXRelease@plt>

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

LLVM IR (-O2):
define i32 @cXDisconnect(i32* %0) {
%2 = tail call i32 @cXRelease(i32* %0, i32 0)
ret i32 %2
}
int test_imm_21int32_reg(int val) { return ((val) & (0x21 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_21int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x21,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_21int32_reg>:
test   $0x21,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_21int32_reg(i32 %0) {
%2 = and i32 %0, 33
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}