xunge/DecIR huggingface dataset:
/* Variables and functions */
void *func(void *p) { return (NULL); }


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

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

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

LLVM IR (-O2):
define noalias i8* @func(i8* nocapture readnone %0) {
ret i8* null
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t GET_R(const uint32_t value) {
  return (((uint32_t)value & 0xff0000) >> 16);
}


x86 assembly (clang, -O0):
<GET_R>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff0000,%eax
sar    $0x10,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GET_R>:
shr    $0x10,%edi
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @GET_R(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 16711680
%5 = ashr i32 %4, 16
ret i32 %5
}

LLVM IR (-O2):
define i32 @GET_R(i32 %0) {
%2 = lshr i32 %0, 16
%3 = and i32 %2, 255
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void ethernet_set_lentype(uint8_t *p_ethernet, uint16_t lentype) {
  p_ethernet[12] = (lentype & 0xff00) >> 8;
  p_ethernet[13] = (lentype & 0xff);
}


x86 assembly (clang, -O0):
<ethernet_set_lentype>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x30(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x34(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ethernet_set_lentype>:
mov    %esi,%eax
movzbl %ah,%ecx
mov    %ecx,0x30(%rdi)
movzbl %al,%eax
mov    %eax,0x34(%rdi)
ret

LLVM IR (-O0):
define void @ethernet_set_lentype(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 = and i32 %5, 65280
%7 = ashr i32 %6, 8
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 12
store i32 %7, i32* %9
%10 = load i32, i32* %4
%11 = and i32 %10, 255
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 13
store i32 %11, i32* %13
ret void
}

LLVM IR (-O2):
define void @ethernet_set_lentype(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = and i32 %3, 255
%5 = getelementptr inbounds i32, i32* %0, i64 12
store i32 %4, i32* %5
%6 = and i32 %1, 255
%7 = getelementptr inbounds i32, i32* %0, i64 13
store i32 %6, i32* %7
ret void
}
void ExttServerAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttServerAuxTable() {
ret void
}
char *globalvar_get_match(const char *match, const char *separator) {
  return ((void *)0);
}


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

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

LLVM IR (-O0):
define i8* @globalvar_get_match(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @globalvar_get_match(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(int argc, char *argv[]) {
  (void)argc;
  fprintf(stderr,
          "Extracts a Subject Information Access URI from a certificate "
          "and writes it to stdout.\n"
          "\n"
          "Usage: %s [options] <certificate_file>\n"
          "\n"
          "Options:\n"
          "    -d\tRetrieve SIA directory URI (default)\n"
          "    -m\tRetrieve SIA manifest URI\n",
          argv[0]);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [214 x i8] c"Extracts a Subject Information Access URI from a certificate and writes it to stdout.\0A\0AUsage: %s [options] <certificate_file>\0A\0AOptions:\0A -d\09Retrieve SIA directory URI (default)\0A -m\09Retrieve SIA manifest URI\0A\00"
define void @usage(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = load i32, i32* @stderr
%7 = load i8**, i8*** %4
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([214 x i8], [214 x i8]* @.str, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [214 x i8] c"Extracts a Subject Information Access URI from a certificate and writes it to stdout.\0A\0AUsage: %s [options] <certificate_file>\0A\0AOptions:\0A -d\09Retrieve SIA directory URI (default)\0A -m\09Retrieve SIA manifest URI\0A\00"
define void @usage(i32 %0, i8** nocapture %1) {
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %1
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([214 x i8], [214 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test61_AvrPin_set__E();
void test61_Led_on__E() { test61_AvrPin_set__E(); }


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

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

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

LLVM IR (-O2):
define void @test61_Led_on__E() {
%1 = tail call i32 (...) @test61_AvrPin_set__E()
ret void
}
/* Variables and functions */
char *strstr(char *, char *);
char *getHTTPContent(char *response) {
  char *re;
  re = strstr(response, "\r\n\r\n");
  re += 4;
  return re;
}


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

x86 assembly (clang, -O2):
<getHTTPContent>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strstr@plt>
add    $0x4,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\0D\0A\0D\0A\00"
define i8* @getHTTPContent(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strstr(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 4
store i8* %7, i8** %3
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
@.str = [5 x i8] c"\0D\0A\0D\0A\00"
define i8* @getHTTPContent(i8* %0) {
%2 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds i8, i8* %2, i64 4
ret i8* %3
}
void fn_pragma_1_default(void) {}


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

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

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

LLVM IR (-O2):
define void @fn_pragma_1_default() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ font_init_8x8();
void font_init() { font_init_8x8(); }


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

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

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

LLVM IR (-O2):
define void @font_init() {
%1 = tail call i32 (...) @font_init_8x8()
ret void
}
void task_chr_io_accounting_add(struct task_io_accounting *dst,
                                struct task_io_accounting *src) {}


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

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

LLVM IR (-O0):
%struct.task_io_accounting = type opaque
define void @task_chr_io_accounting_add(%struct.task_io_accounting* %0, %struct.task_io_accounting* %1) {
%3 = alloca %struct.task_io_accounting*
%4 = alloca %struct.task_io_accounting*
store %struct.task_io_accounting* %0, %struct.task_io_accounting** %3
store %struct.task_io_accounting* %1, %struct.task_io_accounting** %4
ret void
}

LLVM IR (-O2):
%struct.task_io_accounting = type opaque
define void @task_chr_io_accounting_add(%struct.task_io_accounting* nocapture %0, %struct.task_io_accounting* nocapture %1) {
ret void
}
/* Type definitions */
struct passwd {
  char *pw_dir;
};

/* Variables and functions */
int /*<<< orphan*/ free(char *);
struct passwd *getpwnam(char *);
char *mem2str(char *, int);
char *home_dir(char *username, int len) {
  char *str = mem2str(username, len);
  struct passwd *pw = getpwnam(str);
  free(str);
  return (pw ? pw->pw_dir : NULL);
}


x86 assembly (clang, -O0):
<home_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <mem2str@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <getpwnam@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x20(%rbp)
je     1180 <home_dir+0x50>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
jmp    118b <home_dir+0x5b>
xor    %eax,%eax
mov    %rax,-0x28(%rbp)
jmp    118b <home_dir+0x5b>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<home_dir>:
push   %r14
push   %rbx
push   %rax
call   1050 <mem2str@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <getpwnam@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
test   %r14,%r14
je     1159 <home_dir+0x29>
mov    (%r14),%rax
jmp    115b <home_dir+0x2b>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.passwd = type { i8* }
define i8* @home_dir(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.passwd*
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i8* @mem2str(i8* %7, i32 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = call %struct.passwd* @getpwnam(i8* %10)
store %struct.passwd* %11, %struct.passwd** %6
%12 = load i8*, i8** %5
%13 = call i32 @free(i8* %12)
%14 = load %struct.passwd*, %struct.passwd** %6
%15 = icmp ne %struct.passwd* %14, null
br i1 %15, label %16, label %20
16: ; preds = %2
%17 = load %struct.passwd*, %struct.passwd** %6
%18 = getelementptr inbounds %struct.passwd, %struct.passwd* %17, i32 0, i32 0
%19 = load i8*, i8** %18
br label %21
20: ; preds = %2
br label %21
21: ; preds = %20, %16
%22 = phi i8* [ %19, %16 ], [ null, %20 ]
ret i8* %22
}

LLVM IR (-O2):
%struct.passwd = type { i8* }
define i8* @home_dir(i8* %0, i32 %1) {
%3 = tail call i8* @mem2str(i8* %0, i32 %1)
%4 = tail call %struct.passwd* @getpwnam(i8* %3)
%5 = tail call i32 @free(i8* %3)
%6 = icmp eq %struct.passwd* %4, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = getelementptr inbounds %struct.passwd, %struct.passwd* %4, i64 0, i32 0
%9 = load i8*, i8** %8
br label %10
10: ; preds = %2, %7
%11 = phi i8* [ %9, %7 ], [ null, %2 ]
ret i8* %11
}
int test_imm_27uint16_reg(unsigned short val) {
  return ((val) & (-0x27 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_27uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffffd9,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_27uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -39
%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_27uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -39
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
scalar_t__ memmove(char *, char const *, size_t);
wchar_t *wmemmove(wchar_t *d, const wchar_t *s, size_t n) {
  return (wchar_t *)memmove((char *)d, (const char *)s, n * sizeof(wchar_t));
}


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

x86 assembly (clang, -O2):
<wmemmove>:
shl    $0x2,%rdx
jmp    1030 <memmove@plt>

LLVM IR (-O0):
define i32* @wmemmove(i32* %0, i32* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i64
store i32* %0, i32** %4
store i32* %1, i32** %5
store i64 %2, i64* %6
%7 = load i32*, i32** %4
%8 = bitcast i32* %7 to i8*
%9 = load i32*, i32** %5
%10 = bitcast i32* %9 to i8*
%11 = load i64, i64* %6
%12 = mul i64 %11, 4
%13 = call i64 @memmove(i8* %8, i8* %10, i64 %12)
%14 = inttoptr i64 %13 to i32*
ret i32* %14
}

LLVM IR (-O2):
define i32* @wmemmove(i32* %0, i32* %1, i64 %2) {
%4 = bitcast i32* %0 to i8*
%5 = bitcast i32* %1 to i8*
%6 = shl i64 %2, 2
%7 = tail call i64 @memmove(i8* %4, i8* %5, i64 %6)
%8 = inttoptr i64 %7 to i32*
ret i32* %8
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *);
void _hybris_stack_stack_chk_fail() {
  printf("__stack_chk_fail\n");
  abort();
}


x86 assembly (clang, -O0):
<_hybris_stack_stack_chk_fail>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<_hybris_stack_stack_chk_fail>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"__stack_chk_fail\0A\00"
define void @_hybris_stack_stack_chk_fail() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@str = [17 x i8] c"__stack_chk_fail\00"
define void @_hybris_stack_stack_chk_fail() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_CIPHER_CTX;
typedef int /*<<< orphan*/ EVP_CIPHER;
typedef int /*<<< orphan*/ ENGINE;

/* Variables and functions */
int EVP_CipherInit_ex(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                      int /*<<< orphan*/ *, unsigned char const *,
                      unsigned char const *, int /*<<< orphan*/);
int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
                       ENGINE *impl, const unsigned char *key,
                       const unsigned char *iv) {
  return EVP_CipherInit_ex(ctx, cipher, impl, key, iv, 0);
}


x86 assembly (clang, -O0):
<EVP_DecryptInit_ex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
xor    %r9d,%r9d
call   1030 <EVP_CipherInit_ex@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EVP_DecryptInit_ex>:
xor    %r9d,%r9d
jmp    1030 <EVP_CipherInit_ex@plt>

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

LLVM IR (-O2):
define i32 @EVP_DecryptInit_ex(i32* %0, i32* %1, i32* %2, i8* %3, i8* %4) {
%6 = tail call i32 @EVP_CipherInit_ex(i32* %0, i32* %1, i32* %2, i8* %3, i8* %4, i32 0)
ret i32 %6
}
int __mp_readcontents(char *s, void *p) { return 0; }


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

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

LLVM IR (-O0):
define i32 @__mp_readcontents(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @__mp_readcontents(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SysCtlDelay(int);
void EEPROMSetSectorMask(unsigned long ulAddress) {
  unsigned long ulMask;
  ulMask = ~(1 << (ulAddress >> 7));
  SysCtlDelay(10);
  (*((volatile unsigned long *)(0x400FD0FC))) = 3;
  SysCtlDelay(10);
  (*((volatile unsigned long *)(0x400AE2C0))) = ulMask;
  SysCtlDelay(10);
  (*((volatile unsigned long *)(0x400FD0FC))) = 0;
  SysCtlDelay(10);
}


x86 assembly (clang, -O0):
<EEPROMSetSectorMask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x7,%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
mov    $0x400fd0fc,%eax
movq   $0x3,(%rax)
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
mov    -0x10(%rbp),%rcx
mov    $0x400ae2c0,%eax
mov    %rcx,(%rax)
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
mov    $0x400fd0fc,%eax
movq   $0x0,(%rax)
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EEPROMSetSectorMask>:
push   %rbx
mov    %rdi,%rcx
shr    $0x7,%rcx
mov    $0xfffffffe,%eax
rol    %cl,%eax
movslq %eax,%rbx
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
movq   $0x3,0x400fd0fc
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
mov    %rbx,0x400ae2c0
40
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
movq   $0x0,0x400fd0fc
mov    $0xa,%edi
pop    %rbx
jmp    1030 <SysCtlDelay@plt>

LLVM IR (-O0):
define void @EEPROMSetSectorMask(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = lshr i64 %4, 7
%6 = trunc i64 %5 to i32
%7 = shl i32 1, %6
%8 = xor i32 %7, -1
%9 = sext i32 %8 to i64
store i64 %9, i64* %3
%10 = call i32 @SysCtlDelay(i32 10)
store volatile i64 3, i64* inttoptr (i64 1074778364 to i64*)
%11 = call i32 @SysCtlDelay(i32 10)
%12 = load i64, i64* %3
store volatile i64 %12, i64* inttoptr (i64 1074455232 to i64*)
%13 = call i32 @SysCtlDelay(i32 10)
store volatile i64 0, i64* inttoptr (i64 1074778364 to i64*)
%14 = call i32 @SysCtlDelay(i32 10)
ret void
}

LLVM IR (-O2):
define void @EEPROMSetSectorMask(i64 %0) {
%2 = lshr i64 %0, 7
%3 = trunc i64 %2 to i32
%4 = shl nuw i32 1, %3
%5 = xor i32 %4, -1
%6 = sext i32 %5 to i64
%7 = tail call i32 @SysCtlDelay(i32 10)
store volatile i64 3, i64* inttoptr (i64 1074778364 to i64*)
%8 = tail call i32 @SysCtlDelay(i32 10)
store volatile i64 %6, i64* inttoptr (i64 1074455232 to i64*)
%9 = tail call i32 @SysCtlDelay(i32 10)
store volatile i64 0, i64* inttoptr (i64 1074778364 to i64*)
%10 = tail call i32 @SysCtlDelay(i32 10)
ret void
}
regx0imm1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((p0[x0]) <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<regx0imm1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  0xed4(%rip),%xmm0
ucomisd (%rax,%rcx,8),%xmm0
jb     1143 <regx0imm1+0x43>
movl   $0x1,-0x4(%rbp)
jmp    114a <regx0imm1+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regx0imm1>:
movslq %edi,%rcx
movsd  0xef5(%rip),%xmm0
xor    %eax,%eax
ucomisd (%rdx,%rcx,8),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @regx0imm1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load double*, double** %12
%15 = load i32, i32* %10
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* %14, i64 %16
%18 = load double, double* %17
%19 = fcmp ole double %18, 3.300000e+01
br i1 %19, label %20, label %21
20: ; preds = %6
store i32 1, i32* %7
br label %22
21: ; preds = %6
store i32 0, i32* %7
br label %22
22: ; preds = %21, %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
define i32 @regx0imm1(double %0, double %1, i32 %2, i32 %3, double* nocapture %4, double* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds double, double* %4, i64 %7
%9 = load double, double* %8
%10 = fcmp ole double %9, 3.300000e+01
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int umount2(char const *, int);
int xumount2(const char *target, int flags) {
  int ret = umount2(target, flags);
  if (ret == -1) {
    ;
  }
  return ret;
}


x86 assembly (clang, -O0):
<xumount2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <umount2@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    113d <xumount2+0x2d>
jmp    113d <xumount2+0x2d>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xumount2>:
jmp    1030 <umount2@plt>

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

LLVM IR (-O2):
define i32 @xumount2(i8* %0, i32 %1) {
%3 = tail call i32 @umount2(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int get_cursor_offset();
int get_offset_col(int);
int get_offset_row(int);
int /*<<< orphan*/ print_char(int, int, int, int);
void kprint_backspace() {
  int offset = get_cursor_offset() - 2;
  int row = get_offset_row(offset);
  int col = get_offset_col(offset);
  if (col <= 1)
    return;
  print_char(0x08, col, row, 0x0f);
}


x86 assembly (clang, -O0):
<kprint_backspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <get_cursor_offset@plt>
sub    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1060 <get_offset_row@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <get_offset_col@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jg     117a <kprint_backspace+0x3a>
jmp    118f <kprint_backspace+0x4f>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0x8,%edi
mov    $0xf,%ecx
call   1050 <print_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kprint_backspace>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <get_cursor_offset@plt>
lea    -0x2(%rax),%ebp
mov    %ebp,%edi
call   1060 <get_offset_row@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1030 <get_offset_col@plt>
cmp    $0x2,%eax
jge    1169 <kprint_backspace+0x29>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    $0x8,%edi
mov    %eax,%esi
mov    %ebx,%edx
mov    $0xf,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <print_char@plt>

LLVM IR (-O0):
define void @kprint_backspace() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @get_cursor_offset()
%5 = sub nsw i32 %4, 2
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @get_offset_row(i32 %6)
store i32 %7, i32* %2
%8 = load i32, i32* %1
%9 = call i32 @get_offset_col(i32 %8)
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = icmp sle i32 %10, 1
br i1 %11, label %12, label %13
12: ; preds = %0
br label %17
13: ; preds = %0
%14 = load i32, i32* %3
%15 = load i32, i32* %2
%16 = call i32 @print_char(i32 8, i32 %14, i32 %15, i32 15)
br label %17
17: ; preds = %13, %12
ret void
}

LLVM IR (-O2):
define void @kprint_backspace() {
%1 = tail call i32 (...) @get_cursor_offset()
%2 = add nsw i32 %1, -2
%3 = tail call i32 @get_offset_row(i32 %2)
%4 = tail call i32 @get_offset_col(i32 %2)
%5 = icmp slt i32 %4, 2
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = tail call i32 @print_char(i32 8, i32 %4, i32 %3, i32 15)
br label %8
8: ; preds = %0, %6
ret void
}
unsigned int htable_word_to_int(char const *word) {
  unsigned int result = 0;
  while (*word != '\0')
    result = (*word++ + 31 * result);
  return result;
}


x86 assembly (clang, -O0):
<htable_word_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113f <htable_word_to_int+0x3f>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
imul   $0x1f,-0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <htable_word_to_int+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<htable_word_to_int>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <htable_word_to_int+0x28>
add    $0x1,%rdi
xor    %edx,%edx
mov    %edx,%eax
xchg   %ax,%ax
movsbl %cl,%ecx
shl    $0x5,%eax
sub    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1110 <htable_word_to_int+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @htable_word_to_int(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = mul i32 %6, 31
%11 = add i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int pthread_mutex_unlock(pthread_mutex_t *__mutex) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pthread_mutex_unlock(i32* nocapture readnone %0) {
ret i32 0
}
void i2c_init() {}


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

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

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

LLVM IR (-O2):
define void @i2c_init() {
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void RFCCpe0IntSelect(uint32_t ui32Mask) {
  (*((volatile unsigned long *)(0x40041000 + 0x00000018))) &= ~ui32Mask;
}


x86 assembly (clang, -O0):
<RFCCpe0IntSelect>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    $0x40041018,%ecx
mov    (%rcx),%rcx
and    %rax,%rcx
mov    $0x40041018,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RFCCpe0IntSelect>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
not    %rax
and    %rax,0x40041018
40
ret

LLVM IR (-O0):
define void @RFCCpe0IntSelect(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = xor i64 %3, -1
%5 = load volatile i64, i64* inttoptr (i64 1074008088 to i64*)
%6 = and i64 %5, %4
store volatile i64 %6, i64* inttoptr (i64 1074008088 to i64*)
ret void
}

LLVM IR (-O2):
define void @RFCCpe0IntSelect(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = xor i64 %3, -1
%5 = load volatile i64, i64* inttoptr (i64 1074008088 to i64*)
%6 = and i64 %5, %4
store volatile i64 %6, i64* inttoptr (i64 1074008088 to i64*)
ret void
}
void k_clts() { asm("clts"); }


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

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

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

LLVM IR (-O2):
define void @k_clts() {
tail call void asm sideeffect "clts", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
double modjhlabs(double a, double b) {
  int n = (int)(a / b);
  a -= n * b;
  if (a < 0)
    return a + b;
  return a;
}


x86 assembly (clang, -O0):
<modjhlabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x1c(%rbp)
cvtsi2sdl -0x1c(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1174 <modjhlabs+0x74>
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    117e <modjhlabs+0x7e>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<modjhlabs>:
movapd %xmm0,%xmm2
divsd  %xmm1,%xmm2
cvttpd2dq %xmm2,%xmm2
cvtdq2pd %xmm2,%xmm2
mulsd  %xmm1,%xmm2
subsd  %xmm2,%xmm0
xorpd  %xmm2,%xmm2
movapd %xmm0,%xmm3
cmpltsd %xmm2,%xmm3
andpd  %xmm3,%xmm1
movsd  0xecf(%rip),%xmm2
andnpd %xmm2,%xmm3
orpd   %xmm1,%xmm3
addsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @modjhlabs(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca i32
store double %0, double* %4
store double %1, double* %5
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fdiv double %7, %8
%10 = fptosi double %9 to i32
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = sitofp i32 %11 to double
%13 = load double, double* %5
%14 = load double, double* %4
%15 = fneg double %12
%16 = call double @llvm.fmuladd.f64(double %15, double %13, double %14)
store double %16, double* %4
%17 = load double, double* %4
%18 = fcmp olt double %17, 0.000000e+00
br i1 %18, label %19, label %23
19: ; preds = %2
%20 = load double, double* %4
%21 = load double, double* %5
%22 = fadd double %20, %21
store double %22, double* %3
br label %25
23: ; preds = %2
%24 = load double, double* %4
store double %24, double* %3
br label %25
25: ; preds = %23, %19
%26 = load double, double* %3
ret double %26
}

LLVM IR (-O2):
define double @modjhlabs(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = fptosi double %3 to i32
%5 = sitofp i32 %4 to double
%6 = fneg double %5
%7 = tail call double @llvm.fmuladd.f64(double %6, double %1, double %0)
%8 = fcmp olt double %7, 0.000000e+00
%9 = select i1 %8, double %1, double -0.000000e+00
%10 = fadd double %7, %9
ret double %10
}
/* Variables and functions */
#define EACCES 129
#define ENOENT 128
int errno;
int exec_error(void) {
  int ret;
  switch (errno) {
  case ENOENT:
    ret = 127;
    break;
  case EACCES:
    ret = 126;
    break;
  default:
    ret = 1;
    break;
  }
  errno = 0;
  return ret;
}


x86 assembly (clang, -O0):
<exec_error>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
sub    $0x80,%eax
je     1133 <exec_error+0x33>
jmp    1120 <exec_error+0x20>
mov    -0x8(%rbp),%eax
sub    $0x81,%eax
je     113f <exec_error+0x3f>
jmp    114b <exec_error+0x4b>
movl   $0x7f,-0x4(%rbp)
jmp    1152 <exec_error+0x52>
movl   $0x7e,-0x4(%rbp)
jmp    1152 <exec_error+0x52>
movl   $0x1,-0x4(%rbp)
mov    0x2e87(%rip),%rax
movl   $0x0,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exec_error>:
mov    0x2ed9(%rip),%rcx
mov    (%rcx),%eax
cmp    $0x81,%eax
mov    $0x7e,%edx
mov    $0x1,%esi
cmove  %edx,%esi
cmp    $0x80,%eax
mov    $0x7f,%eax
cmovne %esi,%eax
movl   $0x0,(%rcx)
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @exec_error() {
%1 = alloca i32
%2 = load i32, i32* @errno
switch i32 %2, label %5 [
i32 128, label %3
i32 129, label %4
]
3: ; preds = %0
store i32 127, i32* %1
br label %6
4: ; preds = %0
store i32 126, i32* %1
br label %6
5: ; preds = %0
store i32 1, i32* %1
br label %6
6: ; preds = %5, %4, %3
store i32 0, i32* @errno
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @exec_error() {
%1 = load i32, i32* @errno
%2 = icmp eq i32 %1, 129
%3 = select i1 %2, i32 126, i32 1
%4 = icmp eq i32 %1, 128
%5 = select i1 %4, i32 127, i32 %3
store i32 0, i32* @errno
ret i32 %5
}
/* Variables and functions */
int fun(int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d", fun(5));
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
call   1030 <fun@plt>
mov    %eax,%esi
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <fun@plt>
lea    0xebe(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @fun(i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @getchar()
ret i32 0
}
int test_imm_75uint32_reg(unsigned int val) {
  return ((val) & (0x75 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_75uint32_reg(i32 %0) {
%2 = and i32 %0, 117
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
unsigned DJBHash(char *str) {
  unsigned hash = 5381;
  while (*str)
    hash += (hash << 5) + (*str++);
  return (hash & 0x7fffffff);
}


x86 assembly (clang, -O0):
<DJBHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1141 <DJBHash+0x41>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <DJBHash+0xf>
mov    -0xc(%rbp),%eax
and    $0x7fffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DJBHash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <DJBHash+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
movsbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <DJBHash+0x10>
and    $0x7fffffff,%eax
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @DJBHash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 5381, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %5 to i32
%10 = mul i32 %6, 33
%11 = add i32 %10, %9
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = and i32 %11, 2147483647
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 5381, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ closelog();
void close_syslog(void) { closelog(); }


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

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

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

LLVM IR (-O2):
define void @close_syslog() {
%1 = tail call i32 (...) @closelog()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0x9b() {
  Assert_real((isascii(155) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              780, ("isascii should be 0 for 0x9b"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0x9b\00"
define void @t_isascii_0x9b() {
%1 = tail call i64 @isascii(i32 155)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 780, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void __delay(unsigned long loops) {}


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

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

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

LLVM IR (-O2):
define void @__delay(i64 %0) {
ret void
}
int misc_read() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @misc_read() {
ret i32 0
}
/* Variables and functions */
int strcmp_incase(char *, char *);
int strcmp_reverse_incase(char *s1, char *s2) {
  return (-1) * strcmp_incase(s1, s2);
}


x86 assembly (clang, -O0):
<strcmp_reverse_incase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp_incase@plt>
imul   $0xffffffff,%eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp_reverse_incase>:
push   %rax
call   1030 <strcmp_incase@plt>
neg    %eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @strcmp_reverse_incase(i8* %0, i8* %1) {
%3 = tail call i32 @strcmp_incase(i8* %0, i8* %1)
%4 = sub nsw i32 0, %3
ret i32 %4
}
int replaced_byte(unsigned x, unsigned char b, int i) {
  int i_times_8 = i << 3;
  unsigned mask = 0xFF << i_times_8;
  return (x & ~mask) | (b << i_times_8);
}


x86 assembly (clang, -O0):
<replaced_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x3,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
mov    $0xff,%eax
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x14(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0x5(%rbp),%edx
mov    -0x10(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<replaced_byte>:
lea    0x0(,%rdx,8),%ecx
mov    $0xff,%eax
shl    %cl,%eax
not    %eax
and    %edi,%eax
shl    %cl,%esi
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @replaced_byte(i32 %0, i8 zeroext %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i8 %1, i8* %5
store i32 %2, i32* %6
%9 = load i32, i32* %6
%10 = shl i32 %9, 3
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = shl i32 255, %11
store i32 %12, i32* %8
%13 = load i32, i32* %4
%14 = load i32, i32* %8
%15 = xor i32 %14, -1
%16 = and i32 %13, %15
%17 = load i8, i8* %5
%18 = zext i8 %17 to i32
%19 = load i32, i32* %7
%20 = shl i32 %18, %19
%21 = or i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @replaced_byte(i32 %0, i8 zeroext %1, i32 %2) {
%4 = shl i32 %2, 3
%5 = shl i32 255, %4
%6 = xor i32 %5, -1
%7 = and i32 %6, %0
%8 = zext i8 %1 to i32
%9 = shl i32 %8, %4
%10 = or i32 %7, %9
ret i32 %10
}
/* Variables and functions */
int rand();
char get_rand_balloon() {
  int num;
  num = rand() % 5;
  if (!num)
    return '^';
  if (num == 1)
    return '+';
  if (num == 2)
    return '=';
  if (num == 3)
    return 'o';
  if (num == 4)
    return '-';
  return '=';
}


x86 assembly (clang, -O0):
<get_rand_balloon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    113d <get_rand_balloon+0x2d>
movb   $0x5e,-0x1(%rbp)
jmp    118d <get_rand_balloon+0x7d>
cmpl   $0x1,-0x8(%rbp)
jne    1150 <get_rand_balloon+0x40>
movb   $0x2b,-0x1(%rbp)
jmp    118d <get_rand_balloon+0x7d>
cmpl   $0x2,-0x8(%rbp)
jne    1163 <get_rand_balloon+0x53>
movb   $0x3d,-0x1(%rbp)
jmp    118d <get_rand_balloon+0x7d>
cmpl   $0x3,-0x8(%rbp)
jne    1176 <get_rand_balloon+0x66>
movb   $0x6f,-0x1(%rbp)
jmp    118d <get_rand_balloon+0x7d>
cmpl   $0x4,-0x8(%rbp)
jne    1189 <get_rand_balloon+0x79>
movb   $0x2d,-0x1(%rbp)
jmp    118d <get_rand_balloon+0x7d>
movb   $0x3d,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rand_balloon>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
lea    0x0(,%rax,8),%ecx
movabs $0x2d6f3d2b5e,%rdx
shr    %cl,%rdx
cmp    $0x5,%eax
mov    $0x3d,%eax
cmovb  %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @get_rand_balloon() {
%1 = alloca i8
%2 = alloca i32
%3 = call i32 (...) @rand()
%4 = srem i32 %3, 5
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %0
store i8 94, i8* %1
br label %25
8: ; preds = %0
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %12
11: ; preds = %8
store i8 43, i8* %1
br label %25
12: ; preds = %8
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 2
br i1 %14, label %15, label %16
15: ; preds = %12
store i8 61, i8* %1
br label %25
16: ; preds = %12
%17 = load i32, i32* %2
%18 = icmp eq i32 %17, 3
br i1 %18, label %19, label %20
19: ; preds = %16
store i8 111, i8* %1
br label %25
20: ; preds = %16
%21 = load i32, i32* %2
%22 = icmp eq i32 %21, 4
br i1 %22, label %23, label %24
23: ; preds = %20
store i8 45, i8* %1
br label %25
24: ; preds = %20
store i8 61, i8* %1
br label %25
25: ; preds = %24, %23, %19, %15, %11, %7
%26 = load i8, i8* %1
ret i8 %26
}

LLVM IR (-O2):
define signext i8 @get_rand_balloon() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 5
%3 = icmp ult i32 %2, 5
%4 = zext i32 %2 to i40
%5 = shl nuw nsw i40 %4, 3
%6 = lshr i40 195139808094, %5
%7 = trunc i40 %6 to i8
%8 = select i1 %3, i8 %7, i8 61
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ msg_cond_wait();
void thread_wait() { msg_cond_wait(); }


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

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

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

LLVM IR (-O2):
define void @thread_wait() {
%1 = tail call i32 (...) @msg_cond_wait()
ret void
}