xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int abs(int);
void abs_small_positive() {
  Assert_real((abs(133) == 133),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/abs.c",
              27, ("Should be == 133"));
}


x86 assembly (clang, -O0):
<abs_small_positive>:
push   %rbp
mov    %rsp,%rbp
mov    $0x85,%edi
call   1030 <abs@plt>
cmp    $0x85,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebe(%rip),%rsi
mov    $0x1b,%edx
lea    0xf52(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_small_positive>:
lea    0xee9(%rip),%rsi
lea    0xf82(%rip),%rcx
mov    $0x1,%edi
mov    $0x1b,%edx
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/abs.c\00"
@.str.1 = [17 x i8] c"Should be == 133\00"
define void @abs_small_positive() {
%1 = call i32 @abs(i32 133)
%2 = icmp eq i32 %1, 133
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 27, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/abs.c\00"
@.str.1 = [17 x i8] c"Should be == 133\00"
define void @abs_small_positive() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 27, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool mp2vseqx_get_lowdelay(const uint8_t *p_mp2vseqx) {
  return !!(p_mp2vseqx[9] & 0x8);
}


x86 assembly (clang, -O0):
<mp2vseqx_get_lowdelay>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x24(%rax),%eax
and    $0x8,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vseqx_get_lowdelay>:
mov    0x24(%rdi),%eax
shr    $0x3,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @mp2vseqx_get_lowdelay(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 9
%5 = load i32, i32* %4
%6 = and i32 %5, 8
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @mp2vseqx_get_lowdelay(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 9
%3 = load i32, i32* %2
%4 = lshr i32 %3, 3
%5 = and i32 %4, 1
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
int sqlite3_close(int /*<<< orphan*/ *);
int sqlite_close(sqlite3 *database) { return sqlite3_close(database); }


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

x86 assembly (clang, -O2):
<sqlite_close>:
jmp    1030 <sqlite3_close@plt>

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

LLVM IR (-O2):
define i32 @sqlite_close(i32* %0) {
%2 = tail call i32 @sqlite3_close(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int a = 147;
  int *ptr_a = &a;
  printf("*ptr_a = %i\n", *ptr_a);
  printf("address of ptr_a = %p\n", ptr_a);
  printf("address of a(&a) = %p\n", &a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x93,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x93,0xc(%rsp)
lea    0xedc(%rip),%rdi
mov    $0x93,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"*ptr_a = %i\0A\00"
@.str.1 = [23 x i8] c"address of ptr_a = %p\0A\00"
@.str.2 = [23 x i8] c"address of a(&a) = %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32 147, i32* %2
store i32* %2, i32** %3
%4 = load i32*, i32** %3
%5 = load i32, i32* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32*, i32** %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32* %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"*ptr_a = %i\0A\00"
@.str.1 = [23 x i8] c"address of ptr_a = %p\0A\00"
@.str.2 = [23 x i8] c"address of a(&a) = %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 147, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 147)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32* %1)
ret i32 0
}
void set_curr_task_stop(struct rq *rq) {}


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

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

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

LLVM IR (-O2):
%struct.rq = type opaque
define void @set_curr_task_stop(%struct.rq* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ok(int, char const *);
void pass(const char *description) { ok(1, description); }


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

x86 assembly (clang, -O2):
<pass>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <ok@plt>

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

LLVM IR (-O2):
define void @pass(i8* %0) {
%2 = tail call i32 @ok(i32 1, i8* %0)
ret void
}
/* Type definitions */
struct tdb_context {
  int dummy;
};
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
struct tdb_context *ext2fs_tdb_open_ex(char const *, int, int, int,
                                       int /*<<< orphan*/, int /*<<< orphan*/ *,
                                       int /*<<< orphan*/ *);
struct tdb_context *ext2fs_tdb_open(const char *name, int hash_size,
                                    int tdb_flags, int open_flags,
                                    mode_t mode) {
  return ext2fs_tdb_open_ex(name, hash_size, tdb_flags, open_flags, mode, NULL,
                            NULL);
}


x86 assembly (clang, -O0):
<ext2fs_tdb_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%r9d
movq   $0x0,(%rsp)
call   1030 <ext2fs_tdb_open_ex@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ext2fs_tdb_open>:
push   %rax
movq   $0x0,(%rsp)
xor    %r9d,%r9d
call   1030 <ext2fs_tdb_open_ex@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.tdb_context = type { i32 }
define %struct.tdb_context* @ext2fs_tdb_open(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call %struct.tdb_context* @ext2fs_tdb_open_ex(i8* %11, i32 %12, i32 %13, i32 %14, i32 %15, i32* null, i32* null)
ret %struct.tdb_context* %16
}

LLVM IR (-O2):
%struct.tdb_context = type { i32 }
define %struct.tdb_context* @ext2fs_tdb_open(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call %struct.tdb_context* @ext2fs_tdb_open_ex(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32* null, i32* null)
ret %struct.tdb_context* %6
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void debug_abort(const char *str) {
  fprintf(stderr, "Exception handling error: %s\n", str);
  fflush(stderr);
  abort();
}


x86 assembly (clang, -O0):
<debug_abort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb0(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<debug_abort>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ea5(%rip),%rbx
mov    (%rbx),%edi
lea    0xebc(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"Exception handling error: %s\0A\00"
define void @debug_abort(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fflush(i32 %6)
%8 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"Exception handling error: %s\0A\00"
define void @debug_abort(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_NAME_ENTRY;

/* Variables and functions */
scalar_t__ ASN1_item_new(int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_NAME_ENTRY_it;
X509_NAME_ENTRY *X509_NAME_ENTRY_new(void) {
  return (X509_NAME_ENTRY *)ASN1_item_new(&X509_NAME_ENTRY_it);
}


x86 assembly (clang, -O0):
<X509_NAME_ENTRY_new>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rdi
call   1030 <ASN1_item_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<X509_NAME_ENTRY_new>:
mov    0x2ed1(%rip),%rdi
jmp    1030 <ASN1_item_new@plt>

LLVM IR (-O0):
@X509_NAME_ENTRY_it = global i32 0
define i32* @X509_NAME_ENTRY_new() {
%1 = call i64 @ASN1_item_new(i32* @X509_NAME_ENTRY_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
@X509_NAME_ENTRY_it = global i32 0
define i32* @X509_NAME_ENTRY_new() {
%1 = tail call i64 @ASN1_item_new(i32* @X509_NAME_ENTRY_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
int count_characters(const char *str, char character) {
  if (str == 0)
    return 0;
  const char *p = str;
  int count = 0;
  do {
    if (*p == character)
      count++;
  } while (*(p++));
  return count;
}


x86 assembly (clang, -O0):
<count_characters>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1125 <count_characters+0x25>
movl   $0x0,-0x4(%rbp)
jmp    1173 <count_characters+0x73>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1150 <count_characters+0x50>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1155 <count_characters+0x55>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
cmpb   $0x0,(%rax)
jne    1134 <count_characters+0x34>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_characters>:
xor    %eax,%eax
test   %rdi,%rdi
je     1125 <count_characters+0x25>
nopw   0x0(%rax,%rax,1)
movzbl (%rdi),%ecx
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <count_characters+0x10>
ret

LLVM IR (-O0):
define i32 @count_characters(i8* %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i8 %1, i8* %5
%8 = load i8*, i8** %4
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 0, i32* %3
br label %31
11: ; preds = %2
%12 = load i8*, i8** %4
store i8* %12, i8** %6
store i32 0, i32* %7
br label %13
13: ; preds = %24, %11
%14 = load i8*, i8** %6
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = load i8, i8* %5
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %16, %18
br i1 %19, label %20, label %23
20: ; preds = %13
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
store i32 %22, i32* %7
br label %23
23: ; preds = %20, %13
br label %24
24: ; preds = %23
%25 = load i8*, i8** %6
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %6
%27 = load i8, i8* %25
%28 = icmp ne i8 %27, 0
br i1 %28, label %13, label %29
29: ; preds = %24
%30 = load i32, i32* %7
store i32 %30, i32* %3
br label %31
31: ; preds = %29, %10
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
define i32 @count_characters(i8* %0, i8 signext %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i8* [ %11, %4 ], [ %0, %2 ]
%6 = phi i32 [ %10, %4 ], [ 0, %2 ]
%7 = load i8, i8* %5
%8 = icmp eq i8 %7, %1
%9 = zext i1 %8 to i32
%10 = add nuw nsw i32 %6, %9
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = icmp eq i8 %7, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = phi i32 [ 0, %2 ], [ %10, %4 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ streamtoread(int, void *, int /*<<< orphan*/,
                                int /*<<< orphan*/);
int32_t univtoread(int fd, void *buff, uint32_t leng, uint32_t msecto) {
  return streamtoread(fd, buff, leng, msecto);
}


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

x86 assembly (clang, -O2):
<univtoread>:
jmp    1030 <streamtoread@plt>

LLVM IR (-O0):
define i32 @univtoread(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @streamtoread(i32 %9, i8* %10, i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @univtoread(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @streamtoread(i32 %0, i8* %1, i32 %2, i32 %3)
ret i32 %5
}
unsigned char nibble_to_hex(unsigned char n) {
  if (n < 10)
    return n + '0';
  else
    return n - 10 + 'a';
}


x86 assembly (clang, -O0):
<nibble_to_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0xa,%eax
jge    1126 <nibble_to_hex+0x26>
movzbl -0x2(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1133 <nibble_to_hex+0x33>
movzbl -0x2(%rbp),%eax
sub    $0xa,%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nibble_to_hex>:
cmp    $0xa,%dil
mov    $0x30,%ecx
mov    $0x57,%eax
cmovb  %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define zeroext i8 @nibble_to_hex(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = add nsw i32 %9, 48
%11 = trunc i32 %10 to i8
store i8 %11, i8* %2
br label %18
12: ; preds = %1
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = sub nsw i32 %14, 10
%16 = add nsw i32 %15, 97
%17 = trunc i32 %16 to i8
store i8 %17, i8* %2
br label %18
18: ; preds = %12, %7
%19 = load i8, i8* %2
ret i8 %19
}

LLVM IR (-O2):
define zeroext i8 @nibble_to_hex(i8 zeroext %0) {
%2 = icmp ult i8 %0, 10
%3 = select i1 %2, i8 48, i8 87
%4 = add i8 %3, %0
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ kernel_dgemv_n_8_vs_lib4(int, int, double *, int, double *,
                                            double *, double *, int);
void kernel_dgemv_n_8_lib4(int kmax, double *A0, int sda, double *x, double *y,
                           double *z, int alg) {
  if (kmax <= 0)
    return;
  kernel_dgemv_n_8_vs_lib4(8, kmax, A0, sda, x, y, z, alg);
}


x86 assembly (clang, -O0):
<kernel_dgemv_n_8_lib4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     1140 <kernel_dgemv_n_8_lib4+0x30>
jmp    116b <kernel_dgemv_n_8_lib4+0x5b>
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%r10
mov    0x10(%rbp),%eax
mov    $0x8,%edi
mov    %r10,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <kernel_dgemv_n_8_vs_lib4@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_dgemv_n_8_lib4>:
test   %edi,%edi
jle    113c <kernel_dgemv_n_8_lib4+0x2c>
push   %rax
mov    %r9,%rax
mov    %r8,%r9
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x10(%rsp),%r10d
mov    $0x8,%edi
push   %r10
push   %rax
call   1030 <kernel_dgemv_n_8_vs_lib4@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
define void @kernel_dgemv_n_8_lib4(i32 %0, double* %1, i32 %2, double* %3, double* %4, double* %5, i32 %6) {
%8 = alloca i32
%9 = alloca double*
%10 = alloca i32
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca i32
store i32 %0, i32* %8
store double* %1, double** %9
store i32 %2, i32* %10
store double* %3, double** %11
store double* %4, double** %12
store double* %5, double** %13
store i32 %6, i32* %14
%15 = load i32, i32* %8
%16 = icmp sle i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %7
br label %27
18: ; preds = %7
%19 = load i32, i32* %8
%20 = load double*, double** %9
%21 = load i32, i32* %10
%22 = load double*, double** %11
%23 = load double*, double** %12
%24 = load double*, double** %13
%25 = load i32, i32* %14
%26 = call i32 @kernel_dgemv_n_8_vs_lib4(i32 8, i32 %19, double* %20, i32 %21, double* %22, double* %23, double* %24, i32 %25)
br label %27
27: ; preds = %18, %17
ret void
}

LLVM IR (-O2):
define void @kernel_dgemv_n_8_lib4(i32 %0, double* %1, i32 %2, double* %3, double* %4, double* %5, i32 %6) {
%8 = icmp slt i32 %0, 1
br i1 %8, label %11, label %9
9: ; preds = %7
%10 = tail call i32 @kernel_dgemv_n_8_vs_lib4(i32 8, i32 %0, double* %1, i32 %2, double* %3, double* %4, double* %5, i32 %6)
br label %11
11: ; preds = %7, %9
ret void
}
void symmetrize_gcov(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @placeBlock() {
ret void
}
void ADCExtiEventReguTrigger(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000008))) |= 0x00100000;
}


x86 assembly (clang, -O0):
<ADCExtiEventReguTrigger>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rcx
or     $0x100000,%rcx
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCExtiEventReguTrigger>:
orq    $0x100000,0x8(%rdi)
ret

LLVM IR (-O0):
define void @ADCExtiEventReguTrigger(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 8
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 1048576
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @ADCExtiEventReguTrigger(i64 %0) {
%2 = add i64 %0, 8
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = or i64 %4, 1048576
store volatile i64 %5, i64* %3
ret void
}
/* Variables and functions */
int isalpha(char);
int isdigit(char);
int isupper(char);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  char a = 'A', b = 'b', c = '6';
  printf("%i\n", isupper(a));
  printf("%i\n", isalpha(b));
  printf("%i\n", isdigit(c));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x41,-0x5(%rbp)
movb   $0x62,-0x6(%rbp)
movb   $0x36,-0x7(%rbp)
movsbl -0x5(%rbp),%edi
call   1060 <isupper@plt>
mov    %eax,%esi
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
movsbl -0x6(%rbp),%edi
call   1050 <isalpha@plt>
mov    %eax,%esi
lea    0xe7c(%rip),%rdi
call   1040 <printf@plt>
movsbl -0x7(%rbp),%edi
call   1030 <isdigit@plt>
mov    %eax,%esi
lea    0xe65(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x41,%edi
call   1060 <isupper@plt>
lea    0xeae(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x62,%edi
call   1050 <isalpha@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x36,%edi
call   1030 <isdigit@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i32 0, i32* %1
store i8 65, i8* %2
store i8 98, i8* %3
store i8 54, i8* %4
%5 = load i8, i8* %2
%6 = call i32 @isupper(i8 signext %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i8, i8* %3
%9 = call i32 @isalpha(i8 signext %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i8, i8* %4
%12 = call i32 @isdigit(i8 signext %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = tail call i32 @isupper(i8 signext 65)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @isalpha(i8 signext 98)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @isdigit(i8 signext 54)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
void foo128(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo128(i32 %0) {
ret void
}
int ft_isdigit(int c) {
  if (c > 47 && c < 58)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2f,-0x8(%rbp)
jle    1127 <ft_isdigit+0x27>
cmpl   $0x3a,-0x8(%rbp)
jge    1127 <ft_isdigit+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <ft_isdigit+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isdigit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 47
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 58
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @ft_isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *strerror(int);
char *errmsg_c(int n) {
  if (n == -1)
    return "End of file detected";
  return strerror(n);
}


x86 assembly (clang, -O0):
<errmsg_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1135 <errmsg_c+0x25>
lea    0xed4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1141 <errmsg_c+0x31>
mov    -0xc(%rbp),%edi
call   1030 <strerror@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errmsg_c>:
cmp    $0xffffffff,%edi
je     111a <errmsg_c+0xa>
jmp    1030 <strerror@plt>
lea    0xedf(%rip),%rax
ret

LLVM IR (-O0):
@.str = [21 x i8] c"End of file detected\00"
define i8* @errmsg_c(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8** %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i8* @strerror(i32 %8)
store i8* %9, i8** %2
br label %10
10: ; preds = %7, %6
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@.str = [21 x i8] c"End of file detected\00"
define i8* @errmsg_c(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @strerror(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ WRITETEST(char *);
void SetInsertMode() { WRITETEST("\033[4h"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[4h\00"
define void @SetInsertMode() {
%1 = call i32 @WRITETEST(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[4h\00"
define void @SetInsertMode() {
%1 = tail call i32 @WRITETEST(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int ksft_exit_pass();
int /*<<< orphan*/ ksft_print_header();
int /*<<< orphan*/ ksft_set_plan(int);
int /*<<< orphan*/ test_membarrier();
int /*<<< orphan*/ test_membarrier_query();
int main(int argc, char **argv) {
  ksft_print_header();
  ksft_set_plan(13);
  test_membarrier_query();
  test_membarrier();
  return ksft_exit_pass();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1070 <ksft_print_header@plt>
mov    $0xd,%edi
call   1030 <ksft_set_plan@plt>
mov    $0x0,%al
call   1050 <test_membarrier_query@plt>
mov    $0x0,%al
call   1060 <test_membarrier@plt>
mov    $0x0,%al
call   1040 <ksft_exit_pass@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <ksft_print_header@plt>
mov    $0xd,%edi
call   1030 <ksft_set_plan@plt>
xor    %eax,%eax
call   1050 <test_membarrier_query@plt>
xor    %eax,%eax
call   1060 <test_membarrier@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ksft_exit_pass@plt>

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 (...) @ksft_print_header()
%7 = call i32 @ksft_set_plan(i32 13)
%8 = call i32 (...) @test_membarrier_query()
%9 = call i32 (...) @test_membarrier()
%10 = call i32 (...) @ksft_exit_pass()
ret i32 %10
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @ksft_print_header()
%4 = tail call i32 @ksft_set_plan(i32 13)
%5 = tail call i32 (...) @test_membarrier_query()
%6 = tail call i32 (...) @test_membarrier()
%7 = tail call i32 (...) @ksft_exit_pass()
ret i32 %7
}
int test_imm_ABuint8_reg(unsigned char val) {
  return ((val) & (-0xAB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_ABuint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff55,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_ABuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 85
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
void main(void) {
  char s[30];
  scanf("%s", s);
  printf("%s", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rsi
lea    0xecd(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x20(%rbp),%rsi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
lea    0xed2(%rip),%rbx
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @main() {
%1 = alloca [30 x i8]
%2 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ uart_putchar(char);
void uart_puts(char *c) {
  while (*c) {
    uart_putchar(*c);
    c++;
  }
}


x86 assembly (clang, -O0):
<uart_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <uart_puts+0x36>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <uart_putchar@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <uart_puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <uart_puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <uart_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <uart_puts+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @uart_puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @uart_putchar(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
void HAL_RNG_Configuration(void) {}


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

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

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

LLVM IR (-O2):
define void @HAL_RNG_Configuration() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ irqHandler();
void secure_irq() { irqHandler(); }


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

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

LLVM IR (-O0):
define void @secure_irq() {
%1 = call i32 (...) @irqHandler()
ret void
}

LLVM IR (-O2):
define void @secure_irq() {
%1 = tail call i32 (...) @irqHandler()
ret void
}
/* Variables and functions */
int __reclaim(char **, int, int);
int reclaim_unknown(char **args, int num_args) {
  return __reclaim(args, num_args, 0x00 | 0x80);
}


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

x86 assembly (clang, -O2):
<reclaim_unknown>:
mov    $0x80,%edx
jmp    1030 <__reclaim@plt>

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

LLVM IR (-O2):
define i32 @reclaim_unknown(i8** %0, i32 %1) {
%3 = tail call i32 @__reclaim(i8** %0, i32 %1, i32 128)
ret i32 %3
}
void pool_free(unsigned char *s) {}


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

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

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

LLVM IR (-O2):
define void @pool_free(i8* nocapture %0) {
ret void
}
/* Variables and functions */
char const *UI_AIFromName(char const *);
char *UI_OpponentLeaderName();
const char *UI_OpponentLeaderHead(void) {
  const char *leader = UI_OpponentLeaderName();
  return UI_AIFromName(leader);
}


x86 assembly (clang, -O0):
<UI_OpponentLeaderHead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <UI_OpponentLeaderName@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <UI_AIFromName@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UI_OpponentLeaderHead>:
push   %rax
xor    %eax,%eax
call   1030 <UI_OpponentLeaderName@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <UI_AIFromName@plt>

LLVM IR (-O0):
define i8* @UI_OpponentLeaderHead() {
%1 = alloca i8*
%2 = call i8* (...) @UI_OpponentLeaderName()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i8* @UI_AIFromName(i8* %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @UI_OpponentLeaderHead() {
%1 = tail call i8* (...) @UI_OpponentLeaderName()
%2 = tail call i8* @UI_AIFromName(i8* %1)
ret i8* %2
}
/* Variables and functions */
scalar_t__ pow(double, double);
unsigned int SYS32_SetBit(unsigned short bit, unsigned int value) {
  return (value | (unsigned int)(pow(2.0, (double)bit)));
}


x86 assembly (clang, -O0):
<SYS32_SetBit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movzwl -0x2(%rbp),%eax
cvtsi2sd %eax,%xmm1
movsd  0xec8(%rip),%xmm0
call   1030 <pow@plt>
mov    %rax,%rcx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SYS32_SetBit>:
push   %rbx
mov    %esi,%ebx
cvtsi2sd %edi,%xmm1
movsd  0xee1(%rip),%xmm0
call   1030 <pow@plt>
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @SYS32_SetBit(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i16, i16* %3
%7 = uitofp i16 %6 to double
%8 = call i64 @pow(double 2.000000e+00, double %7)
%9 = trunc i64 %8 to i32
%10 = or i32 %5, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @SYS32_SetBit(i16 zeroext %0, i32 %1) {
%3 = uitofp i16 %0 to double
%4 = tail call i64 @pow(double 2.000000e+00, double %3)
%5 = trunc i64 %4 to i32
%6 = or i32 %5, %1
ret i32 %6
}
/* Variables and functions */
double sqrt(double);
double hyoptenuse(double n, double m) {
  double d;
  d = sqrt(n * n + m * m);
  return d;
}


x86 assembly (clang, -O0):
<hyoptenuse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hyoptenuse>:
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112b <hyoptenuse+0x1b>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @hyoptenuse(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %3
%8 = load double, double* %4
%9 = load double, double* %4
%10 = fmul double %8, %9
%11 = call double @llvm.fmuladd.f64(double %6, double %7, double %10)
%12 = call double @sqrt(double %11)
store double %12, double* %5
%13 = load double, double* %5
ret double %13
}

LLVM IR (-O2):
define double @hyoptenuse(double %0, double %1) {
%3 = fmul double %1, %1
%4 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %3)
%5 = tail call double @sqrt(double %4)
ret double %5
}
void start(int vetor[], int i) {
  int j;
  for (j = 0; j < 1; j++)
    vetor[j] == i;
}


x86 assembly (clang, -O0):
<start>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jge    112a <start+0x2a>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <start+0x12>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @start(i32* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ desa_uhexacat(unsigned int, int, char);
void desa_label(unsigned int v) { desa_uhexacat(v, 6, 'L'); }


x86 assembly (clang, -O0):
<desa_label>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x6,%esi
mov    $0x4c,%edx
call   1030 <desa_uhexacat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<desa_label>:
mov    $0x6,%esi
mov    $0x4c,%edx
jmp    1030 <desa_uhexacat@plt>

LLVM IR (-O0):
define void @desa_label(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @desa_uhexacat(i32 %3, i32 6, i8 signext 76)
ret void
}

LLVM IR (-O2):
define void @desa_label(i32 %0) {
%2 = tail call i32 @desa_uhexacat(i32 %0, i32 6, i8 signext 76)
ret void
}
void sdb_init_gdbm(void) { ; }


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

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

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

LLVM IR (-O2):
define void @sdb_init_gdbm() {
ret void
}
void loop(int a, int b) {
  if (a > 0) {
    a = a + b;
    b = b - 1;
    loop(a, b);
  }
}


x86 assembly (clang, -O0):
<loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1145 <loop+0x35>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <loop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop>:
test   %edi,%edi
jle    1119 <loop+0x19>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x1(%rsi),%eax
add    %esi,%edi
mov    %eax,%esi
jg     1110 <loop+0x10>
ret

LLVM IR (-O0):
define void @loop(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = add nsw i32 %8, %9
store i32 %10, i32* %3
%11 = load i32, i32* %4
%12 = sub nsw i32 %11, 1
store i32 %12, i32* %4
%13 = load i32, i32* %3
%14 = load i32, i32* %4
br label %15
15: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @loop(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ %1, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = add nsw i32 %5, %6
%8 = add nsw i32 %5, -1
%9 = icmp sgt i32 %7, 0
br i1 %9, label %4, label %10
10: ; preds = %4, %2
ret void
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *_strdup(const char *str) {
  char *dup = malloc(strlen(str) + 1);
  if (dup)
    strcpy(dup, str);
  else
    perror("Error -> strdup(..) can't malloc");
  return dup;
}


x86 assembly (clang, -O0):
<_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1182 <_strdup+0x42>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    118e <_strdup+0x4e>
lea    0xe77(%rip),%rdi
call   1060 <perror@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1173 <_strdup+0x33>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe86(%rip),%rdi
call   1060 <perror@plt>
jmp    1168 <_strdup+0x28>

LLVM IR (-O0):
@.str = [33 x i8] c"Error -> strdup(..) can't malloc\00"
define i8* @_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = call i32 @strcpy(i8* %11, i8* %12)
br label %16
14: ; preds = %1
%15 = call i32 @perror(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %10
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
@.str = [33 x i8] c"Error -> strdup(..) can't malloc\00"
define i8* @_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %10
8: ; preds = %1
%9 = tail call i32 @perror(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
ret i8* %4
}
int pipe(filedes)
int filedes[2];
{ return (0); }


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

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

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

LLVM IR (-O2):
define i32 @pipe(i32* nocapture readnone %0) {
ret i32 0
}
__attribute__((always_)) void writew(unsigned short val, volatile void *addr) {
  asm volatile("mov"
               "w"
               " %0,%1"
               :
               : "r"(val), "m"(*(volatile unsigned short *)addr)
               : "memory");
}


x86 assembly (clang, -O0):
<writew>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x10(%rbp),%rcx
mov    %ax,(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<writew>:
mov    %di,(%rsi)
ret

LLVM IR (-O0):
define void @writew(i16 zeroext %0, i8* %1) {
%3 = alloca i16
%4 = alloca i8*
store i16 %0, i16* %3
store i8* %1, i8** %4
%5 = load i16, i16* %3
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i16*
ret void
}

LLVM IR (-O2):
define void @writew(i16 zeroext %0, i8* %1) {
%3 = bitcast i8* %1 to i16*
tail call void asm sideeffect "movw $0,$1", "r,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i16 %0, i16* elementtype(i16) %3)
ret void
}