xunge/DecIR huggingface dataset:
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/);
int randint(int l, int u) {
  srand(time(0));
  return (rand() % (u - l + 1)) + l;
}


x86 assembly (clang, -O0):
<randint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randint>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @randint(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @time(i32 0)
%6 = call i32 @srand(i32 %5)
%7 = call i32 (...) @rand()
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = sub nsw i32 %8, %9
%11 = add nsw i32 %10, 1
%12 = srem i32 %7, %11
%13 = load i32, i32* %3
%14 = add nsw i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @randint(i32 %0, i32 %1) {
%3 = tail call i32 @time(i32 0)
%4 = tail call i32 @srand(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = sub i32 1, %0
%7 = add i32 %6, %1
%8 = srem i32 %5, %7
%9 = add nsw i32 %8, %0
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
char *strdup(char const *);
char *safe_strdup(const char *s) {
  char *r = strdup(s);
  if (r == NULL) {
    fprintf(stderr, "Out of memory in strdup()\n");
    exit(99);
  }
  return r;
}


x86 assembly (clang, -O0):
<safe_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <safe_strdup+0x43>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x63,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"Out of memory in strdup()\0A\00"
define i8* @safe_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 99)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"Out of memory in strdup()\0A\00"
define noalias i8* @safe_strdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 99)
unreachable
8: ; preds = %1
ret i8* %2
}
void foo796() {}


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

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

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

LLVM IR (-O2):
define void @foo796() {
ret void
}
/* Type definitions */
struct nlattr {
  int nla_len;
};

/* Variables and functions */
int nla_ok(const struct nlattr *nla, int remaining) {
  return remaining >= sizeof(*nla) && nla->nla_len >= sizeof(*nla) &&
         nla->nla_len <= remaining;
}


x86 assembly (clang, -O0):
<nla_ok>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rcx
xor    %eax,%eax
cmp    $0x4,%rcx
mov    %al,-0xd(%rbp)
jb     1143 <nla_ok+0x43>
mov    -0x8(%rbp),%rax
movslq (%rax),%rcx
xor    %eax,%eax
cmp    $0x4,%rcx
mov    %al,-0xd(%rbp)
jb     1143 <nla_ok+0x43>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cmp    -0xc(%rbp),%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nla_ok>:
xor    %eax,%eax
cmp    $0x4,%esi
jb     1115 <nla_ok+0x15>
mov    (%rdi),%ecx
cmp    $0x4,%ecx
jb     1115 <nla_ok+0x15>
xor    %eax,%eax
cmp    %esi,%ecx
setle  %al
ret

LLVM IR (-O0):
%struct.nlattr = type { i32 }
define i32 @nla_ok(%struct.nlattr* %0, i32 %1) {
%3 = alloca %struct.nlattr*
%4 = alloca i32
store %struct.nlattr* %0, %struct.nlattr** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = icmp uge i64 %6, 4
br i1 %7, label %8, label %20
8: ; preds = %2
%9 = load %struct.nlattr*, %struct.nlattr** %3
%10 = getelementptr inbounds %struct.nlattr, %struct.nlattr* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = sext i32 %11 to i64
%13 = icmp uge i64 %12, 4
br i1 %13, label %14, label %20
14: ; preds = %8
%15 = load %struct.nlattr*, %struct.nlattr** %3
%16 = getelementptr inbounds %struct.nlattr, %struct.nlattr* %15, i32 0, i32 0
%17 = load i32, i32* %16
%18 = load i32, i32* %4
%19 = icmp sle i32 %17, %18
br label %20
20: ; preds = %14, %8, %2
%21 = phi i1 [ false, %8 ], [ false, %2 ], [ %19, %14 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
%struct.nlattr = type { i32 }
define i32 @nla_ok(%struct.nlattr* nocapture %0, i32 %1) {
%3 = icmp ugt i32 %1, 3
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = getelementptr inbounds %struct.nlattr, %struct.nlattr* %0, i64 0, i32 0
%6 = load i32, i32* %5
%7 = icmp ugt i32 %6, 3
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = icmp sle i32 %6, %1
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %8, %4, %2
%12 = phi i32 [ 0, %4 ], [ 0, %2 ], [ %10, %8 ]
ret i32 %12
}
int is_pointer(char *x) {
  while (*x)
    if (*x++ == '*')
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_pointer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1141 <is_pointer+0x41>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x2a,%eax
jne    113c <is_pointer+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1148 <is_pointer+0x48>
jmp    1108 <is_pointer+0x8>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_pointer>:
movzbl (%rdi),%eax
test   %al,%al
je     1115 <is_pointer+0x15>
add    $0x1,%rdi
cmp    $0x2a,%al
jne    1100 <is_pointer>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_pointer(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = icmp eq i8 %4, 42
br i1 %8, label %9, label %2
9: ; preds = %2, %6
%10 = phi i32 [ 1, %6 ], [ 0, %2 ]
ret i32 %10
}
void omap_fbdev_init(struct drm_device *dev) {}


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

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

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

LLVM IR (-O2):
%struct.drm_device = type opaque
define void @omap_fbdev_init(%struct.drm_device* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emit_adc(int, int);
int /*<<< orphan*/ emit_shlimm(int, int, int);
int /*<<< orphan*/ emit_shrimm(int, int, int);
void emit_shlsr(int t, int sr) {
  emit_shrimm(sr, 1, sr);
  emit_shlimm(t, 1, t);
  emit_adc(sr, sr);
}


x86 assembly (clang, -O0):
<emit_shlsr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x1,%esi
call   1030 <emit_shrimm@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%edx
mov    $0x1,%esi
call   1050 <emit_shlimm@plt>
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <emit_adc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_shlsr>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
mov    $0x1,%esi
mov    %ebx,%edx
call   1030 <emit_shrimm@plt>
mov    %ebp,%edi
mov    $0x1,%esi
mov    %ebp,%edx
call   1050 <emit_shlimm@plt>
mov    %ebx,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <emit_adc@plt>

LLVM IR (-O0):
define void @emit_shlsr(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @emit_shrimm(i32 %5, i32 1, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @emit_shlimm(i32 %8, i32 1, i32 %9)
%11 = load i32, i32* %4
%12 = load i32, i32* %4
%13 = call i32 @emit_adc(i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @emit_shlsr(i32 %0, i32 %1) {
%3 = tail call i32 @emit_shrimm(i32 %1, i32 1, i32 %1)
%4 = tail call i32 @emit_shlimm(i32 %0, i32 1, i32 %0)
%5 = tail call i32 @emit_adc(i32 %1, i32 %1)
ret void
}
/* Type definitions */
typedef int const uint32_t;

/* Variables and functions */
uint32_t functionH(const uint32_t b, const uint32_t c, const uint32_t d) {
  return b ^ c ^ d;
}


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

x86 assembly (clang, -O2):
<functionH>:
mov    %edi,%eax
xor    %esi,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @functionH(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 = xor i32 %7, %8
%10 = load i32, i32* %6
%11 = xor i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @functionH(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %1, %0
%5 = xor i32 %4, %2
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
long ftell_and_rewind(FILE *f) {
  long size;
  fseek(f, 0, SEEK_END);
  size = ftell(f);
  rewind(f);
  return size;
}


x86 assembly (clang, -O0):
<ftell_and_rewind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1040 <ftell@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftell_and_rewind>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eaa(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <fseek@plt>
mov    %rbx,%rdi
call   1040 <ftell@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <rewind@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
define i64 @ftell_and_rewind(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* @SEEK_END
%6 = call i32 @fseek(i32* %4, i32 0, i32 %5)
%7 = load i32*, i32** %2
%8 = call i64 @ftell(i32* %7)
store i64 %8, i64* %3
%9 = load i32*, i32** %2
%10 = call i32 @rewind(i32* %9)
%11 = load i64, i64* %3
ret i64 %11
}

LLVM IR (-O2):
@SEEK_END = global i32 0
define i64 @ftell_and_rewind(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i32 @fseek(i32* %0, i32 0, i32 %2)
%4 = tail call i64 @ftell(i32* %0)
%5 = tail call i32 @rewind(i32* %0)
ret i64 %4
}
/* Variables and functions */
int _pause();
int pause(void) { return _pause(); }


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

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

LLVM IR (-O0):
define i32 @pause() {
%1 = call i32 (...) @_pause()
ret i32 %1
}

LLVM IR (-O2):
define i32 @pause() {
%1 = tail call i32 (...) @_pause()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char const *);
void handlerChangeHandler(const char *msgName, int numHandlers,
                          void *clientData) {
  printf("There are now %d handlers for message %s\n", numHandlers, msgName);
}


x86 assembly (clang, -O0):
<handlerChangeHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rdx
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [42 x i8] c"There are now %d handlers for message %s\0A\00"
define void @handlerChangeHandler(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = load i8*, i8** %4
%9 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"There are now %d handlers for message %s\0A\00"
define void @handlerChangeHandler(i8* %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %0)
ret void
}
void sdb_init_odbc(void) { ; }


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

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

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

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

/* Variables and functions */
long db_retrieval(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ free(char *);
char *sql_generate(char const *, char const *, long const);
long db_find_parent(sqlite3 *db, const char *board_id, const long id) {
  static const char *sql = "SELECT parent_id FROM posts "
                           "WHERE board_id = \"%s\" AND id = %ld;";
  char *cmd = sql_generate(sql, board_id, id);
  long parent_id = db_retrieval(db, cmd);
  free(cmd);
  return parent_id;
}


x86 assembly (clang, -O0):
<db_find_parent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eed(%rip),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <sql_generate@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <db_retrieval@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_find_parent>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xec2(%rip),%rdi
call   1040 <sql_generate@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1050 <db_retrieval@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@db_find_parent.sql = internal global i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i32 0, i32 0)
@.str = [64 x i8] c"SELECT parent_id FROM posts WHERE board_id = \22%s\22 AND id = %ld;\00"
define i64 @db_find_parent(i32* %0, i8* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i32* %0, i32** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%9 = load i8*, i8** @db_find_parent.sql
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = call i8* @sql_generate(i8* %9, i8* %10, i64 %11)
store i8* %12, i8** %7
%13 = load i32*, i32** %4
%14 = load i8*, i8** %7
%15 = call i64 @db_retrieval(i32* %13, i8* %14)
store i64 %15, i64* %8
%16 = load i8*, i8** %7
%17 = call i32 @free(i8* %16)
%18 = load i64, i64* %8
ret i64 %18
}

LLVM IR (-O2):
@.str = [64 x i8] c"SELECT parent_id FROM posts WHERE board_id = \22%s\22 AND id = %ld;\00"
define i64 @db_find_parent(i32* %0, i8* %1, i64 %2) {
%4 = tail call i8* @sql_generate(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i8* %1, i64 %2)
%5 = tail call i64 @db_retrieval(i32* %0, i8* %4)
%6 = tail call i32 @free(i8* %4)
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Sorry, the Nudds/Moeller Hand Controller Interface is not\n"
         "supported this platform.  The Hand Controller Interface is \n"
         "supported under Linux or Windows on a PC only at this time.\n");
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [179 x i8] c"Sorry, the Nudds/Moeller Hand Controller Interface is not\0Asupported this platform. The Hand Controller Interface is \0Asupported under Linux or Windows on a PC only at this time.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([179 x i8], [179 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [178 x i8] c"Sorry, the Nudds/Moeller Hand Controller Interface is not\0Asupported this platform. The Hand Controller Interface is \0Asupported under Linux or Windows on a PC only at this time.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([178 x i8], [178 x i8]* @str, i64 0, i64 0))
ret i32 1
}
long a_cas_l(volatile void *p, long t, long s) {
  return __sync_val_compare_and_swap((volatile long *)p, t, s);
}


x86 assembly (clang, -O0):
<a_cas_l>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rdx
lock cmpxchg %rdx,(%rcx)
sete   %cl
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_cas_l>:
mov    %rsi,%rax
lock cmpxchg %rdx,(%rdi)
ret

LLVM IR (-O0):
define i64 @a_cas_l(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i64*
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = cmpxchg i64* %8, i64 %9, i64 %10 seq_cst seq_cst
%12 = extractvalue { i64, i1 } %11, 0
ret i64 %12
}

LLVM IR (-O2):
define i64 @a_cas_l(i8* nocapture %0, i64 %1, i64 %2) {
%4 = bitcast i8* %0 to i64*
%5 = cmpxchg i64* %4, i64 %1, i64 %2 seq_cst seq_cst
%6 = extractvalue { i64, i1 } %5, 0
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void wpa_cli_msg_cb(char *msg, size_t len) { printf("%s\n", msg); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @wpa_cli_msg_cb(i8* %0, i64 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int u_int32_t;

/* Variables and functions */
u_int32_t bitvector_get(u_int32_t *b, u_int32_t n) {
  return b[n >> 5] & (1 << (n & 31));
}


x86 assembly (clang, -O0):
<bitvector_get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sar    $0x5,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0xc(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitvector_get>:
mov    %esi,%ecx
mov    %esi,%edx
mov    $0x1,%eax
shl    %cl,%eax
sar    $0x5,%edx
movslq %edx,%rcx
and    (%rdi,%rcx,4),%eax
ret

LLVM IR (-O0):
define i32 @bitvector_get(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 = ashr i32 %6, 5
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
%11 = load i32, i32* %4
%12 = and i32 %11, 31
%13 = shl i32 1, %12
%14 = and i32 %10, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @bitvector_get(i32* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 5
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = and i32 %1, 31
%8 = shl nuw i32 1, %7
%9 = and i32 %6, %8
ret i32 %9
}
void a_obj_dummy_free(void *obj) { return; }


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

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

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

LLVM IR (-O2):
define void @a_obj_dummy_free(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _sys_printf(char *, ...);
void vm_fatal_error(int intr_num) {
  _sys_printf("vm fatal error!!\n");
  _sys_printf("called interrupt handler %d\n", intr_num);
  for (;;) {
  }
}


x86 assembly (clang, -O0):
<vm_fatal_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <_sys_printf@plt>
mov    -0x4(%rbp),%esi
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1030 <_sys_printf@plt>
jmp    113a <vm_fatal_error+0x2a>

x86 assembly (clang, -O2):
<vm_fatal_error>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
xor    %eax,%eax
call   1030 <_sys_printf@plt>
lea    0xeea(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <_sys_printf@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
jmp    1140 <vm_fatal_error+0x30>

LLVM IR (-O0):
@.str = [18 x i8] c"vm fatal error!!\0A\00"
@.str.1 = [29 x i8] c"called interrupt handler %d\0A\00"
define void @vm_fatal_error(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @_sys_printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 (i8*, ...) @_sys_printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %4)
br label %6
6: ; preds = %6, %1
br label %6
}

LLVM IR (-O2):
@.str = [18 x i8] c"vm fatal error!!\0A\00"
@.str.1 = [29 x i8] c"called interrupt handler %d\0A\00"
define void @vm_fatal_error(i32 %0) {
%2 = tail call i32 (i8*, ...) @_sys_printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @_sys_printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %4
4: ; preds = %4, %1
br label %4
}
void error_diffuse(unsigned char *data, int pos, int depth, int offset, int mul,
                   int div) {
  int c;
  data += pos * depth;
  c = *data + offset * mul / div;
  if (c < 0) {
    c = 0;
  }
  if (c >= 1 << 8) {
    c = (1 << 8) - 1;
  }
  *data = (unsigned char)c;
}


x86 assembly (clang, -O0):
<error_diffuse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0xc(%rbp),%ecx
imul   -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
cltd
idivl  -0x1c(%rbp)
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    115e <error_diffuse+0x5e>
movl   $0x0,-0x20(%rbp)
cmpl   $0x100,-0x20(%rbp)
jl     1172 <error_diffuse+0x72>
movl   $0xff,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_diffuse>:
mov    %ecx,%eax
imul   %edx,%esi
movslq %esi,%rcx
movzbl (%rdi,%rcx,1),%esi
imul   %r8d,%eax
cltd
idiv   %r9d
xor    %edx,%edx
add    %esi,%eax
cmovs  %edx,%eax
cmp    $0xff,%eax
mov    $0xff,%edx
cmovb  %eax,%edx
mov    %dl,(%rdi,%rcx,1)
ret

LLVM IR (-O0):
define void @error_diffuse(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i8* %0, i8** %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
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = mul nsw i32 %14, %15
%17 = load i8*, i8** %7
%18 = sext i32 %16 to i64
%19 = getelementptr inbounds i8, i8* %17, i64 %18
store i8* %19, i8** %7
%20 = load i8*, i8** %7
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = load i32, i32* %10
%24 = load i32, i32* %11
%25 = mul nsw i32 %23, %24
%26 = load i32, i32* %12
%27 = sdiv i32 %25, %26
%28 = add nsw i32 %22, %27
store i32 %28, i32* %13
%29 = load i32, i32* %13
%30 = icmp slt i32 %29, 0
br i1 %30, label %31, label %32
31: ; preds = %6
store i32 0, i32* %13
br label %32
32: ; preds = %31, %6
%33 = load i32, i32* %13
%34 = icmp sge i32 %33, 256
br i1 %34, label %35, label %36
35: ; preds = %32
store i32 255, i32* %13
br label %36
36: ; preds = %35, %32
%37 = load i32, i32* %13
%38 = trunc i32 %37 to i8
%39 = load i8*, i8** %7
store i8 %38, i8* %39
ret void
}

LLVM IR (-O2):
define void @error_diffuse(i8* nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = mul nsw i32 %2, %1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = mul nsw i32 %4, %3
%13 = sdiv i32 %12, %5
%14 = add nsw i32 %13, %11
%15 = icmp sgt i32 %14, 0
%16 = select i1 %15, i32 %14, i32 0
%17 = icmp ult i32 %16, 255
%18 = select i1 %17, i32 %16, i32 255
%19 = trunc i32 %18 to i8
store i8 %19, i8* %9
ret void
}
/* Variables and functions */
int atan2f(float, float);
float uv2dir(float u, float v) {
  return 270 - (atan2f(v, u) * (180 / 3.14159265358979323846));
}


x86 assembly (clang, -O0):
<uv2dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
call   1030 <atan2f@plt>
cvtsi2sd %eax,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xeac(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea8(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uv2dir>:
push   %rax
movaps %xmm0,%xmm2
movaps %xmm1,%xmm0
movaps %xmm2,%xmm1
call   1030 <atan2f@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xed2(%rip),%xmm0
addsd  0xed2(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @uv2dir(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load float, float* %3
%7 = call i32 @atan2f(float %5, float %6)
%8 = sitofp i32 %7 to double
%9 = fneg double %8
%10 = call double @llvm.fmuladd.f64(double %9, double 0x404CA5DC1A63C1F8, double 2.700000e+02)
%11 = fptrunc double %10 to float
ret float %11
}

LLVM IR (-O2):
define float @uv2dir(float %0, float %1) {
%3 = tail call i32 @atan2f(float %1, float %0)
%4 = sitofp i32 %3 to double
%5 = fneg double %4
%6 = tail call double @llvm.fmuladd.f64(double %5, double 0x404CA5DC1A63C1F8, double 2.700000e+02)
%7 = fptrunc double %6 to float
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ *getenv(char *);
bool env_flag(char *name) { return getenv(name) != NULL; }


x86 assembly (clang, -O0):
<env_flag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<env_flag>:
push   %rax
call   1030 <getenv@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @env_flag(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32* @getenv(i8* %3)
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @env_flag(i8* nocapture %0) {
%2 = tail call i32* @getenv(i8* %0)
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fork();
int /*<<< orphan*/ fornecedor();
int /*<<< orphan*/ printf(char *);
void criar_novo_produtor() {
  int numero_novo_processo;
  numero_novo_processo = fork();
  if (numero_novo_processo == -1) {
    printf("Erro na criacao do processo produtor\n");
  } else {
    if (numero_novo_processo == 0) {
      fornecedor();
      exit(0);
    }
  }
  return;
}


x86 assembly (clang, -O0):
<criar_novo_produtor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <fork@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    116d <criar_novo_produtor+0x2d>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
jmp    118a <criar_novo_produtor+0x4a>
cmpl   $0x0,-0x4(%rbp)
jne    1185 <criar_novo_produtor+0x45>
mov    $0x0,%al
call   1050 <fornecedor@plt>
xor    %edi,%edi
call   1040 <exit@plt>
jmp    118a <criar_novo_produtor+0x4a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<criar_novo_produtor>:
push   %rax
xor    %eax,%eax
call   1060 <fork@plt>
cmp    $0xffffffff,%eax
je     1153 <criar_novo_produtor+0x13>
test   %eax,%eax
je     1160 <criar_novo_produtor+0x20>
pop    %rax
ret
lea    0xea6(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>
xor    %eax,%eax
call   1050 <fornecedor@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Erro na criacao do processo produtor\0A\00"
define void @criar_novo_produtor() {
%1 = alloca i32
%2 = call i32 (...) @fork()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %14
7: ; preds = %0
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = call i32 (...) @fornecedor()
%12 = call i32 @exit(i32 0)
unreachable
13: ; preds = %7
br label %14
14: ; preds = %13, %5
ret void
}

LLVM IR (-O2):
@str = [37 x i8] c"Erro na criacao do processo produtor\00"
define void @criar_novo_produtor() {
%1 = tail call i32 (...) @fork()
switch i32 %1, label %7 [
i32 -1, label %2
i32 0, label %4
]
2: ; preds = %0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
br label %7
4: ; preds = %0
%5 = tail call i32 (...) @fornecedor()
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %0, %2
ret void
}
/* Variables and functions */
int japi_componentlistener(int, int);
int j_componentlistener(int arg0, int arg1) {
  return (japi_componentlistener(arg0, arg1));
}


x86 assembly (clang, -O0):
<j_componentlistener>:
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 <japi_componentlistener@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j_componentlistener>:
jmp    1030 <japi_componentlistener@plt>

LLVM IR (-O0):
define i32 @j_componentlistener(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 @japi_componentlistener(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @j_componentlistener(i32 %0, i32 %1) {
%3 = tail call i32 @japi_componentlistener(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int core5_swap(char *, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int U_EMRNOTIMPLEMENTED_swap(char *record, int torev) {
  fprintf(stderr, "EMF WARNING:  could not swap data bytes on record because "
                  "that type has not been implemented!\n");
  return (core5_swap(record, torev));
}


x86 assembly (clang, -O0):
<U_EMRNOTIMPLEMENTED_swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <core5_swap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_EMRNOTIMPLEMENTED_swap>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    0xec8(%rip),%rsi
call   1030 <fprintf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <core5_swap@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [95 x i8] c"EMF WARNING: could not swap data bytes on record because that type has not been implemented!\0A\00"
define i32 @U_EMRNOTIMPLEMENTED_swap(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @core5_swap(i8* %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [95 x i8] c"EMF WARNING: could not swap data bytes on record because that type has not been implemented!\0A\00"
define i32 @U_EMRNOTIMPLEMENTED_swap(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @core5_swap(i8* %0, i32 %1)
ret i32 %5
}
int test_imm_DEint64_midword_reg(long long val) {
  return ((val >> 16) & (0xDE << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_DEint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0xde,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_DEint64_midword_reg>:
test   $0xde0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_DEint64_midword_reg(i64 %0) {
%2 = and i64 %0, 14548992
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void carriage(FILE *f, int m) {
  while (m-- > 0)
    fprintf(f, " ");
}


x86 assembly (clang, -O0):
<carriage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jle    1148 <carriage+0x38>
mov    -0x8(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
jmp    111f <carriage+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<carriage>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1135 <carriage+0x25>
mov    %esi,%ebx
mov    %rdi,%r14
add    $0x1,%ebx
mov    $0x20,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1120 <carriage+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @carriage(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %9, %2
%6 = load i32, i32* %4
%7 = add nsw i32 %6, -1
store i32 %7, i32* %4
%8 = icmp sgt i32 %6, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i32*, i32** %3
%11 = call i32 @fprintf(i32* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %5
12: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @carriage(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %1, %2 ]
%6 = add nsw i32 %5, -1
%7 = tail call i32 @fputc(i32 32, i32* %0)
%8 = icmp ugt i32 %5, 1
br i1 %8, label %4, label %9
9: ; preds = %4, %2
ret void
}
/* Type definitions */
struct SN_env {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SN_close_env(struct SN_env *, int /*<<< orphan*/);
extern void norwegian_UTF_8_close_env(struct SN_env *z) { SN_close_env(z, 0); }


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

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

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

LLVM IR (-O2):
%struct.SN_env = type { i32 }
define void @norwegian_UTF_8_close_env(%struct.SN_env* %0) {
%2 = tail call i32 @SN_close_env(%struct.SN_env* %0, i32 0)
ret void
}
void perfctr_ppc_init_tests(int have_mmcr1) {}


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

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

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

LLVM IR (-O2):
define void @perfctr_ppc_init_tests(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ util_copy_directory__(char const *, char const *, int,
                                         void *);
void *util_malloc(int);
void util_copy_directory_content(const char *src_path,
                                 const char *target_path) {
  int buffer_size = 16 * 1024 * 1024;
  void *buffer = util_malloc(buffer_size);
  util_copy_directory__(src_path, target_path, buffer_size, buffer);
  free(buffer);
}


x86 assembly (clang, -O0):
<util_copy_directory_content>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1000000,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <util_malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1040 <util_copy_directory__@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_copy_directory_content>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0x1000000,%edi
call   1050 <util_malloc@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x1000000,%edx
mov    %rax,%rcx
call   1040 <util_copy_directory__@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @util_copy_directory_content(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 16777216, i32* %5
%7 = load i32, i32* %5
%8 = call i8* @util_malloc(i32 %7)
store i8* %8, i8** %6
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = load i8*, i8** %6
%13 = call i32 @util_copy_directory__(i8* %9, i8* %10, i32 %11, i8* %12)
%14 = load i8*, i8** %6
%15 = call i32 @free(i8* %14)
ret void
}

LLVM IR (-O2):
define void @util_copy_directory_content(i8* %0, i8* %1) {
%3 = tail call i8* @util_malloc(i32 16777216)
%4 = tail call i32 @util_copy_directory__(i8* %0, i8* %1, i32 16777216, i8* %3)
%5 = tail call i32 @free(i8* %3)
ret void
}
/* Type definitions */
struct result {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ reset_scoreboard(struct result *);
void init_scoreboard(struct result *scoreboard) {
  reset_scoreboard(scoreboard);
}


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

x86 assembly (clang, -O2):
<init_scoreboard>:
jmp    1030 <reset_scoreboard@plt>

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

LLVM IR (-O2):
%struct.result = type { i32 }
define void @init_scoreboard(%struct.result* %0) {
%2 = tail call i32 @reset_scoreboard(%struct.result* %0)
ret void
}
int hash_int(void *p) { return *(int *)p; }


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

x86 assembly (clang, -O2):
<hash_int>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @hash_int(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
int main() {
  int a = 32;
  char b = '6';
  while (a < 10) {
    a = a + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x20,-0x8(%rbp)
movb   $0x36,-0x9(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    112e <main+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1116 <main+0x16>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
store i32 32, i32* %2
store i8 54, i8* %3
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
br label %4
10: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int fib(int);
int main(int argc, char **argv) {
  int n = fib(10);
  if (n != 55)
    exit(1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xa,%edi
call   1030 <fib@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x37,-0x14(%rbp)
je     1157 <main+0x37>
mov    $0x1,%edi
call   1040 <exit@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <fib@plt>
cmp    $0x37,%eax
jne    1134 <main+0x14>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @fib(i32 10)
%4 = icmp eq i32 %3, 55
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
ret i32 0
}
/* Type definitions */
struct BU_Struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ GFX_StructGfx(struct BU_Struct *, int /*<<< orphan*/,
                                 int /*<<< orphan*/);
void XML_code(struct BU_Struct *structure) { GFX_StructGfx(structure, 0, 0); }


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

x86 assembly (clang, -O2):
<XML_code>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <GFX_StructGfx@plt>

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

LLVM IR (-O2):
%struct.BU_Struct = type { i32 }
define void @XML_code(%struct.BU_Struct* %0) {
%2 = tail call i32 @GFX_StructGfx(%struct.BU_Struct* %0, i32 0, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ wait(int *);
pid_t cwait(int *status) { return wait(status); }


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

x86 assembly (clang, -O2):
<cwait>:
jmp    1030 <wait@plt>

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

LLVM IR (-O2):
define i32 @cwait(i32* %0) {
%2 = tail call i32 @wait(i32* %0)
ret i32 %2
}