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

/* Variables and functions */
int /*<<< orphan*/ ofpbuf_resize_tailroom__(struct ofpbuf *,
                                            int /*<<< orphan*/);
scalar_t__ ofpbuf_tailroom(struct ofpbuf *);
void ofpbuf_trim(struct ofpbuf *b) {
  if (ofpbuf_tailroom(b) > 0) {
    ofpbuf_resize_tailroom__(b, 0);
  }
}


x86 assembly (clang, -O0):
<ofpbuf_trim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ofpbuf_tailroom@plt>
cmp    $0x0,%rax
jle    114a <ofpbuf_trim+0x2a>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <ofpbuf_resize_tailroom__@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ofpbuf_trim>:
push   %rbx
mov    %rdi,%rbx
call   1040 <ofpbuf_tailroom@plt>
test   %rax,%rax
jle    1139 <ofpbuf_trim+0x19>
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1030 <ofpbuf_resize_tailroom__@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.ofpbuf = type { i32 }
define void @ofpbuf_trim(%struct.ofpbuf* %0) {
%2 = alloca %struct.ofpbuf*
store %struct.ofpbuf* %0, %struct.ofpbuf** %2
%3 = load %struct.ofpbuf*, %struct.ofpbuf** %2
%4 = call i64 @ofpbuf_tailroom(%struct.ofpbuf* %3)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load %struct.ofpbuf*, %struct.ofpbuf** %2
%8 = call i32 @ofpbuf_resize_tailroom__(%struct.ofpbuf* %7, i32 0)
br label %9
9: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct.ofpbuf = type { i32 }
define void @ofpbuf_trim(%struct.ofpbuf* %0) {
%2 = tail call i64 @ofpbuf_tailroom(%struct.ofpbuf* %0)
%3 = icmp sgt i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @ofpbuf_resize_tailroom__(%struct.ofpbuf* %0, i32 0)
br label %6
6: ; preds = %4, %1
ret void
}
void off(int motor) {}


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

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

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

LLVM IR (-O2):
define void @off(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ curs_set(int /*<<< orphan*/);
int /*<<< orphan*/ init_colors();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ refresh();
void init_ncurses(void) {
  initscr();
  cbreak();
  noecho();
  curs_set(0);
  refresh();
  init_colors();
}


x86 assembly (clang, -O0):
<init_ncurses>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <initscr@plt>
mov    $0x0,%al
call   1030 <cbreak@plt>
mov    $0x0,%al
call   1060 <noecho@plt>
xor    %edi,%edi
call   1080 <curs_set@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
mov    $0x0,%al
call   1070 <init_colors@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_ncurses>:
push   %rax
xor    %eax,%eax
call   1040 <initscr@plt>
xor    %eax,%eax
call   1030 <cbreak@plt>
xor    %eax,%eax
call   1060 <noecho@plt>
xor    %edi,%edi
call   1080 <curs_set@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <init_colors@plt>

LLVM IR (-O0):
define void @init_ncurses() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @cbreak()
%3 = call i32 (...) @noecho()
%4 = call i32 @curs_set(i32 0)
%5 = call i32 (...) @refresh()
%6 = call i32 (...) @init_colors()
ret void
}

LLVM IR (-O2):
define void @init_ncurses() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @cbreak()
%3 = tail call i32 (...) @noecho()
%4 = tail call i32 @curs_set(i32 0)
%5 = tail call i32 (...) @refresh()
%6 = tail call i32 (...) @init_colors()
ret void
}
__attribute__((unused)) _Noreturn void dummy_handler() {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<dummy_handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <dummy_handler+0x9>
jmp    1109 <dummy_handler+0x9>

x86 assembly (clang, -O2):
<dummy_handler>:
jmp    1100 <dummy_handler>

LLVM IR (-O0):
define void @dummy_handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @dummy_handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int find_path_aux(int /*<<< orphan*/, int /*<<< orphan*/, size_t, size_t,
                  unsigned char **, char *, int);
int sprintf(char *, char *);
int find_path(size_t x, size_t y, unsigned char bad_pos[x][y],
              char *path_buff) {
  int written = sprintf(path_buff, "(0, 0)");
  return find_path_aux(0, 0, x, y, bad_pos, path_buff, written);
}


x86 assembly (clang, -O0):
<find_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xebd(%rip),%rsi
call   1040 <sprintf@plt>
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
mov    -0x24(%rbp),%eax
xor    %esi,%esi
mov    %esi,%edi
mov    %eax,(%rsp)
call   1030 <find_path_aux@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_path>:
push   %rax
mov    %rcx,%r9
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
movl   $0x293020,0x3(%r9)
movl   $0x202c3028,(%r9)
movl   $0x6,(%rsp)
xor    %edi,%edi
xor    %esi,%esi
call   1030 <find_path_aux@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"(0, 0)\00"
define i32 @find_path(i64 %0, i64 %1, i8* %2, i8* %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
store i64 %0, i64* %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = load i64, i64* %5
%11 = load i64, i64* %6
%12 = load i8*, i8** %8
%13 = call i32 @sprintf(i8* %12, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32 %13, i32* %9
%14 = load i64, i64* %5
%15 = load i64, i64* %6
%16 = load i8*, i8** %7
%17 = bitcast i8* %16 to i8**
%18 = load i8*, i8** %8
%19 = load i32, i32* %9
%20 = call i32 @find_path_aux(i32 0, i32 0, i64 %14, i64 %15, i8** %17, i8* %18, i32 %19)
ret i32 %20
}

LLVM IR (-O2):
@.str = [7 x i8] c"(0, 0)\00"
define i32 @find_path(i64 %0, i64 %1, i8* %2, i8* %3) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(7) %3, i8* align 1 dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 7, i1 false)
%5 = bitcast i8* %2 to i8**
%6 = tail call i32 @find_path_aux(i32 0, i32 0, i64 %0, i64 %1, i8** %5, i8* %3, i32 6)
ret i32 %6
}
float bias(float x) { return x * 0.5 + 0.5; }


x86 assembly (clang, -O0):
<bias>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<bias>:
cvtss2sd %xmm0,%xmm0
movsd  0xef4(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @bias(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call double @llvm.fmuladd.f64(double %4, double 5.000000e-01, double 5.000000e-01)
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @bias(float %0) {
%2 = fpext float %0 to double
%3 = tail call double @llvm.fmuladd.f64(double %2, double 5.000000e-01, double 5.000000e-01)
%4 = fptrunc double %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int _open(const char *name, int flags, int mode) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<_open>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    0x2ed3(%rip),%rax
mov    (%rax),%ecx
mov    0x2eba(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @_open(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @ENOSYS
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @_open(i8* nocapture readnone %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ENOSYS
store i32 %4, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void html_invoice_output_header(FILE *output_stream) {
  fprintf(output_stream, "<style type=\"text/css\">			\n"
                         "<!--						\n"
                         "table {page-break-after: always;		\n"
                         "	page-break-before: avoid; }		\n"
                         "-->						\n"
                         "</style>					\n");
}


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

x86 assembly (clang, -O2):
<html_invoice_output_header>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x80,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [129 x i8] c"<style type=\22text/css\22>\09\09\09\0A<!--\09\09\09\09\09\09\0Atable {page-break-after: always;\09\09\0A\09page-break-before: avoid; }\09\09\0A-->\09\09\09\09\09\09\0A</style>\09\09\09\09\09\0A\00"
define void @html_invoice_output_header(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [129 x i8] c"<style type=\22text/css\22>\09\09\09\0A<!--\09\09\09\09\09\09\0Atable {page-break-after: always;\09\09\0A\09page-break-before: avoid; }\09\09\0A-->\09\09\09\09\09\09\0A</style>\09\09\09\09\09\0A\00"
define void @html_invoice_output_header(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0), i64 128, i64 1, i32* %0)
ret void
}
extern int _lseek(int file, int ptr, int dir) {
  (void)file, (void)ptr, (void)dir;
  return 0;
}


x86 assembly (clang, -O0):
<_lseek>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_lseek(i32 %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rate(long long, int);
int /*<<< orphan*/ scanf(char *, long long *);
void migrate_query0() {
  long long t;
  scanf("%lld", &t);
  printf("%d\n", rate(t, 1));
}


x86 assembly (clang, -O0):
<migrate_query0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <rate@plt>
mov    %eax,%esi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<migrate_query0>:
push   %rax
lea    0xec8(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
mov    (%rsp),%rdi
mov    $0x1,%esi
call   1030 <rate@plt>
lea    0xeb0(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @migrate_query0() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = load i64, i64* %1
%5 = call i32 @rate(i64 %4, i32 1)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
__attribute__((visibility("default"))) int osal_path_existsA(const char *path) {
  struct stat fileinfo;
  return stat(path, &fileinfo) == 0 ? 1 : 0;
}


x86 assembly (clang, -O0):
<osal_path_existsA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<osal_path_existsA>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @osal_path_existsA(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 1, i32 0
ret i32 %8
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @osal_path_existsA(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
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
scalar_t__ EPERM;
scalar_t__ errno;
int kill(int, int /*<<< orphan*/);
int probe(int pid) {
  int rc = kill(pid, 0);
  return rc == 0 || errno == EPERM;
}


x86 assembly (clang, -O0):
<probe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <kill@plt>
mov    %eax,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1151 <probe+0x41>
mov    0x2ea2(%rip),%rax
mov    (%rax),%rax
mov    0x2e88(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<probe>:
push   %rax
xor    %esi,%esi
call   1030 <kill@plt>
test   %eax,%eax
sete   %al
mov    0x2ebc(%rip),%rcx
mov    (%rcx),%rcx
mov    0x2ea2(%rip),%rdx
cmp    (%rdx),%rcx
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i64 0
@EPERM = global i64 0
define i32 @probe(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @kill(i32 %4, i32 0)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i64, i64* @errno
%10 = load i64, i64* @EPERM
%11 = icmp eq i64 %9, %10
br label %12
12: ; preds = %8, %1
%13 = phi i1 [ true, %1 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
@errno = global i64 0
@EPERM = global i64 0
define i32 @probe(i32 %0) {
%2 = tail call i32 @kill(i32 %0, i32 0)
%3 = icmp eq i32 %2, 0
%4 = load i64, i64* @errno
%5 = load i64, i64* @EPERM
%6 = icmp eq i64 %4, %5
%7 = select i1 %3, i1 true, i1 %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int is2pow(int64_t x) { return x && !(x & (x - 1)) != 0; }


x86 assembly (clang, -O0):
<is2pow>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1137 <is2pow+0x37>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is2pow>:
test   %edi,%edi
je     110f <is2pow+0xf>
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is2pow(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %14
5: ; preds = %1
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
%9 = and i32 %6, %8
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
%13 = icmp ne i32 %12, 0
br label %14
14: ; preds = %5, %1
%15 = phi i1 [ false, %1 ], [ %13, %5 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is2pow(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.ctpop.i32(i32 %0)
%5 = icmp ult i32 %4, 2
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Type definitions */
struct lock {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __coverity_exclusive_lock_acquire__(struct lock *);
void lock(struct lock *l) { __coverity_exclusive_lock_acquire__(l); }


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

x86 assembly (clang, -O2):
<lock>:
jmp    1030 <__coverity_exclusive_lock_acquire__@plt>

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

LLVM IR (-O2):
%struct.lock = type { i32 }
define void @lock(%struct.lock* %0) {
%2 = tail call i32 @__coverity_exclusive_lock_acquire__(%struct.lock* %0)
ret void
}
int c021(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @c021() {
ret i32 0
}

LLVM IR (-O2):
define i32 @c021() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ header_function();
int main() {
  header_function();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @header_function()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
struct tm {
  int dummy;
};

/* Variables and functions */
size_t strftime(char *, size_t, char const *, struct tm const *);
size_t wcsftime(wchar_t *wcs, size_t maxsize, const wchar_t *format,
                const struct tm *timptr) {
  return strftime((char *)wcs, maxsize, (const char *)format, timptr);
}


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

x86 assembly (clang, -O2):
<wcsftime>:
jmp    1030 <strftime@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define i64 @wcsftime(i32* %0, i64 %1, i32* %2, %struct.tm* %3) {
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i32*
%8 = alloca %struct.tm*
store i32* %0, i32** %5
store i64 %1, i64* %6
store i32* %2, i32** %7
store %struct.tm* %3, %struct.tm** %8
%9 = load i32*, i32** %5
%10 = bitcast i32* %9 to i8*
%11 = load i64, i64* %6
%12 = load i32*, i32** %7
%13 = bitcast i32* %12 to i8*
%14 = load %struct.tm*, %struct.tm** %8
%15 = call i64 @strftime(i8* %10, i64 %11, i8* %13, %struct.tm* %14)
ret i64 %15
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i64 @wcsftime(i32* %0, i64 %1, i32* %2, %struct.tm* %3) {
%5 = bitcast i32* %0 to i8*
%6 = bitcast i32* %2 to i8*
%7 = tail call i64 @strftime(i8* %5, i64 %1, i8* %6, %struct.tm* %3)
ret i64 %7
}
/* Type definitions */
struct rusage {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ _wait4(int /*<<< orphan*/, int *, int, struct rusage *);
pid_t __waitpid(pid_t pid, int *istat, int options) {
  return (_wait4(pid, istat, options, (struct rusage *)0));
}


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

x86 assembly (clang, -O2):
<__waitpid>:
xor    %ecx,%ecx
jmp    1030 <_wait4@plt>

LLVM IR (-O0):
%struct.rusage = type { i32 }
define i32 @__waitpid(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %6
%10 = call i32 @_wait4(i32 %7, i32* %8, i32 %9, %struct.rusage* null)
ret i32 %10
}

LLVM IR (-O2):
%struct.rusage = type { i32 }
define i32 @__waitpid(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @_wait4(i32 %0, i32* %1, i32 %2, %struct.rusage* null)
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int testBit_fun_uint8_t(uint8_t x, uint32_t i) { return (x & 1 << i) != 0; }


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

x86 assembly (clang, -O2):
<testBit_fun_uint8_t>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @testBit_fun_uint8_t(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 = shl i32 1, %6
%8 = and i32 %5, %7
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @testBit_fun_uint8_t(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = and i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _usage(void) {
  fputs("Usage: start arg1 arg2\n", stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Usage: start arg1 arg2\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [24 x i8] c"Usage: start arg1 arg2\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
int save_SRAM(const char *file_path, const unsigned char *data,
              unsigned long size) {
  return 1;
}


x86 assembly (clang, -O0):
<save_SRAM>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @save_SRAM(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
ret i32 1
}

LLVM IR (-O2):
define i32 @save_SRAM(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i32 1
}
int test_imm_DEint32_reg(int val) { return ((val) & (0xDE << 0)) ? -20 : -40; }


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

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

LLVM IR (-O0):
define i32 @test_imm_DEint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 222
%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_DEint32_reg(i32 %0) {
%2 = and i32 %0, 222
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
START_NVRAM_VAR_STRUCT(S2_boxee_0_1) {}


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

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

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

LLVM IR (-O2):
define i32 @START_NVRAM_VAR_STRUCT(i32 %0) {
ret i32 undef
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ INIT_LIST_HEAD(struct list_head *);
int /*<<< orphan*/ list_replace(struct list_head *, struct list_head *);
void list_replace_init(struct list_head *old, struct list_head *_new) {
  list_replace(old, _new);
  INIT_LIST_HEAD(old);
}


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

x86 assembly (clang, -O2):
<list_replace_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <list_replace@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <INIT_LIST_HEAD@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_replace_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = load %struct.list_head*, %struct.list_head** %4
%7 = call i32 @list_replace(%struct.list_head* %5, %struct.list_head* %6)
%8 = load %struct.list_head*, %struct.list_head** %3
%9 = call i32 @INIT_LIST_HEAD(%struct.list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_replace_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @list_replace(%struct.list_head* %0, %struct.list_head* %1)
%4 = tail call i32 @INIT_LIST_HEAD(%struct.list_head* %0)
ret void
}
int first_one12(unsigned int u1, unsigned int u2) {
  if (u1) {
    return __builtin_clz(u1) + 22;
  }
  return __builtin_clz(u2) + 49;
}


x86 assembly (clang, -O0):
<first_one12>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1128 <first_one12+0x28>
mov    -0x8(%rbp),%eax
bsr    %eax,%eax
xor    $0x1f,%eax
add    $0x16,%eax
mov    %eax,-0x4(%rbp)
jmp    1137 <first_one12+0x37>
mov    -0xc(%rbp),%eax
bsr    %eax,%eax
xor    $0x1f,%eax
add    $0x31,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<first_one12>:
test   %edi,%edi
cmovne %edi,%esi
bsr    %esi,%eax
xor    $0x1f,%eax
lea    0x31(%rax),%ecx
add    $0x16,%eax
test   %edi,%edi
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @first_one12(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 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %4
%10 = call i32 @llvm.ctlz.i32(i32 %9, i1 true)
%11 = add nsw i32 %10, 22
store i32 %11, i32* %3
br label %16
12: ; preds = %2
%13 = load i32, i32* %5
%14 = call i32 @llvm.ctlz.i32(i32 %13, i1 true)
%15 = add nsw i32 %14, 49
store i32 %15, i32* %3
br label %16
16: ; preds = %12, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @first_one12(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i32 %1, i32 %0
%5 = select i1 %3, i32 49, i32 22
%6 = tail call i32 @llvm.ctlz.i32(i32 %4, i1 true)
%7 = add nuw nsw i32 %6, %5
ret i32 %7
}
void XDeleteModifiermapEntry() {}


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

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

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

LLVM IR (-O2):
define void @XDeleteModifiermapEntry() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M851_f(char *s) {
  debug("M851_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


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

x86 assembly (clang, -O2):
<M851_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M851_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M851_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M851_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M851_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  scanf("%d", &a);
  if (a % 2 != 0) {
    printf("%d\n", a - 1);
  } else {
    printf("%d\n", a);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     116a <main+0x4a>
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
jmp    1179 <main+0x59>
mov    -0x8(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
and    $0xfffffffe,%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = srem i32 %4, 2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 1
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
br label %14
11: ; preds = %0
%12 = load i32, i32* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %11, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = and i32 %4, -2
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
void virtual_mcu_ConsolePrint_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @virtual_mcu_ConsolePrint_targetInit__I() {
ret void
}
void putuserdata(char *userdata) {
  alignbits();
  putbits((signed int)434l, 32);
  char *tmp_post$1;
  while (!(*userdata == 0)) {
    tmp_post$1 = userdata;
    userdata = userdata + 1l;
    putbits((signed int)*tmp_post$1, 8);
  }
}


x86 assembly (clang, -O0):
<putuserdata>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <alignbits@plt>
mov    $0x1b2,%edi
mov    $0x20,%esi
mov    $0x0,%al
call   1040 <putbits@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
xor    $0xff,%al
test   $0x1,%al
jne    1160 <putuserdata+0x40>
jmp    118c <putuserdata+0x6c>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
mov    $0x8,%esi
mov    $0x0,%al
call   1040 <putbits@plt>
jmp    1144 <putuserdata+0x24>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putuserdata>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <alignbits@plt>
mov    $0x1b2,%edi
mov    $0x20,%esi
xor    %eax,%eax
call   1040 <putbits@plt>
mov    (%rbx),%al
test   %al,%al
je     116a <putuserdata+0x4a>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
movsbl %al,%edi
mov    $0x8,%esi
xor    %eax,%eax
call   1040 <putbits@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1150 <putuserdata+0x30>
pop    %rbx
ret

LLVM IR (-O0):
define void @putuserdata(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i32 (...) @alignbits()
%5 = call i32 (i32, i32, ...) bitcast (i32 (...)* @putbits to i32 (i32, i32, ...)*)(i32 434, i32 32)
br label %6
6: ; preds = %12, %1
%7 = load i8*, i8** %2
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 0
%11 = xor i1 %10, true
br i1 %11, label %12, label %20
12: ; preds = %6
%13 = load i8*, i8** %2
store i8* %13, i8** %3
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8* %15, i8** %2
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = call i32 (i32, i32, ...) bitcast (i32 (...)* @putbits to i32 (i32, i32, ...)*)(i32 %18, i32 8)
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @putuserdata(i8* nocapture %0) {
%2 = tail call i32 (...) @alignbits()
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @putbits to i32 (i32, i32, ...)*)(i32 434, i32 32)
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1, %6
%7 = phi i8 [ %12, %6 ], [ %4, %1 ]
%8 = phi i8* [ %10, %6 ], [ %0, %1 ]
%9 = sext i8 %7 to i32
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @putbits to i32 (i32, i32, ...)*)(i32 %9, i32 8)
%12 = load i8, i8* %10
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %1
ret void
}
/* Variables and functions */
int validate_data(int, int);
int main(int argc, const char *argv[]) {
  if (validate_data(8, 37) == 1)
    return 0;
  else
    return 1;
}


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    $0x8,%edi
mov    $0x25,%esi
call   1030 <validate_data@plt>
cmp    $0x1,%eax
jne    114a <main+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1151 <main+0x41>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x8,%edi
mov    $0x25,%esi
call   1030 <validate_data@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @validate_data(i32 8, i32 37)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %10
9: ; preds = %2
store i32 1, i32* %3
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @validate_data(i32 8, i32 37)
%4 = icmp ne i32 %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct forf_env {
  int dummy;
};

/* Variables and functions */
long forf_pop_num(struct forf_env *);
int /*<<< orphan*/ forf_push_num(struct forf_env *, long);
void forf_proc_or(struct forf_env *env) {
  long a = forf_pop_num(env);
  long b = forf_pop_num(env);
  forf_push_num(env, b | a);
}


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

x86 assembly (clang, -O2):
<forf_proc_or>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <forf_pop_num@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <forf_pop_num@plt>
or     %rax,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <forf_push_num@plt>

LLVM IR (-O0):
%struct.forf_env = type { i32 }
define void @forf_proc_or(%struct.forf_env* %0) {
%2 = alloca %struct.forf_env*
%3 = alloca i64
%4 = alloca i64
store %struct.forf_env* %0, %struct.forf_env** %2
%5 = load %struct.forf_env*, %struct.forf_env** %2
%6 = call i64 @forf_pop_num(%struct.forf_env* %5)
store i64 %6, i64* %3
%7 = load %struct.forf_env*, %struct.forf_env** %2
%8 = call i64 @forf_pop_num(%struct.forf_env* %7)
store i64 %8, i64* %4
%9 = load %struct.forf_env*, %struct.forf_env** %2
%10 = load i64, i64* %4
%11 = load i64, i64* %3
%12 = or i64 %10, %11
%13 = call i32 @forf_push_num(%struct.forf_env* %9, i64 %12)
ret void
}

LLVM IR (-O2):
%struct.forf_env = type { i32 }
define void @forf_proc_or(%struct.forf_env* %0) {
%2 = tail call i64 @forf_pop_num(%struct.forf_env* %0)
%3 = tail call i64 @forf_pop_num(%struct.forf_env* %0)
%4 = or i64 %3, %2
%5 = tail call i32 @forf_push_num(%struct.forf_env* %0, i64 %4)
ret void
}
int fd(int a) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fd(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_racket_doc_string() {
  test_parser_verify_parse(
      test_parser_sourcefile("racket", " \"\"\" comment \"\"\""), "racket", "",
      "\"\"\" comment \"\"\"", 0);
}


x86 assembly (clang, -O0):
<test_racket_doc_string>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xed0(%rip),%rdx
lea    0xeba(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_racket_doc_string>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xed9(%rip),%rdx
lea    0xec3(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"racket\00"
@.str.1 = [17 x i8] c" \22\22\22 comment \22\22\22\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [16 x i8] c"\22\22\22 comment \22\22\22\00"
define void @test_racket_doc_string() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"racket\00"
@.str.1 = [17 x i8] c" \22\22\22 comment \22\22\22\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [16 x i8] c"\22\22\22 comment \22\22\22\00"
define void @test_racket_doc_string() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
void ExttStatusAuxTable(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @xSchedule() {
ret void
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int len = 0;
  printf("Enter a message: ");
  while (getchar() != '\n') {
    len += 1;
  }
  printf("You message was: %d character(s) long.\n", len);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1165 <main+0x45>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <main+0x24>
mov    -0x8(%rbp),%esi
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xffffffff,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%ebx
cmp    $0xa,%al
jne    1140 <main+0x20>
lea    0xebd(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Enter a message: \00"
@.str.1 = [40 x i8] c"You message was: %d character(s) long.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %8, %0
%5 = call signext i8 (...) @getchar()
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 10
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %4
11: ; preds = %4
%12 = load i32, i32* %2
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Enter a message: \00"
@.str.1 = [40 x i8] c"You message was: %d character(s) long.\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
%3 = phi i32 [ 0, %0 ], [ %6, %2 ]
%4 = tail call signext i8 (...) @getchar()
%5 = icmp eq i8 %4, 10
%6 = add nuw nsw i32 %3, 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
int pvCancelCaptureWithTimeStamp(char byBoardNum, long long *pTime) {
  notify_pvcall("f");
  return (0);
}


x86 assembly (clang, -O0):
<pvCancelCaptureWithTimeStamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed7(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pvCancelCaptureWithTimeStamp>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define i32 @pvCancelCaptureWithTimeStamp(i8 signext %0, i64* nocapture readnone %1) {
%3 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ GLsizei;

/* Variables and functions */
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ make_viewpoint();
void reshape(GLsizei w, GLsizei h) {
  glViewport(0, 0, w, h);
  make_viewpoint();
}


x86 assembly (clang, -O0):
<reshape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1040 <glViewport@plt>
mov    $0x0,%al
call   1030 <make_viewpoint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reshape>:
push   %rax
mov    %esi,%ecx
mov    %edi,%edx
xor    %edi,%edi
xor    %esi,%esi
call   1040 <glViewport@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <make_viewpoint@plt>

LLVM IR (-O0):
define void @reshape(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 @glViewport(i32 0, i32 0, i32 %5, i32 %6)
%8 = call i32 (...) @make_viewpoint()
ret void
}

LLVM IR (-O2):
define void @reshape(i32 %0, i32 %1) {
%3 = tail call i32 @glViewport(i32 0, i32 0, i32 %0, i32 %1)
%4 = tail call i32 (...) @make_viewpoint()
ret void
}