xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void sfree(void **addr) {
  void **__p = addr;
  if (*(__p) != NULL) {
    free(*(__p));
    *(__p) = NULL;
  }
}


x86 assembly (clang, -O0):
<sfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1149 <sfree+0x39>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sfree>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1128 <sfree+0x18>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @sfree(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @free(i8* %2)
store i8* null, i8** %0
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x46() {
  Assert_real((isgraph(70)),
              "/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_isgraph.c",
              355, ("isgraph should be 1 for F"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x46>:
push   %rbp
mov    %rsp,%rbp
mov    $0x46,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x163,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x46>:
push   %rax
mov    $0x46,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x163,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for F\00"
define void @t_isgraph_0x46() {
%1 = call i32 @isgraph(i32 70)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 355, i8* getelementptr inbounds ([26 x i8], [26 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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for F\00"
define void @t_isgraph_0x46() {
%1 = tail call i32 @isgraph(i32 70)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 355, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned char *cbor_write_type_size(unsigned char *, unsigned int, int,
                                    unsigned int);
unsigned char *cbor_write_tag(unsigned char *data, unsigned int size,
                              unsigned int tag) {
  return cbor_write_type_size(data, size, 6, tag);
}


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

x86 assembly (clang, -O2):
<cbor_write_tag>:
mov    %edx,%ecx
mov    $0x6,%edx
jmp    1030 <cbor_write_type_size@plt>

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

LLVM IR (-O2):
define i8* @cbor_write_tag(i8* %0, i32 %1, i32 %2) {
%4 = tail call i8* @cbor_write_type_size(i8* %0, i32 %1, i32 6, i32 %2)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ iconv_t;

/* Variables and functions */
size_t iconv(int /*<<< orphan*/, char **, size_t *, char **, size_t *);
size_t portable_iconv(void *cd, char **inbuf, size_t *inbytesleft,
                      char **outbuf, size_t *outbytesleft) {
  return iconv((iconv_t)cd, inbuf, inbytesleft, outbuf, outbytesleft);
}


x86 assembly (clang, -O0):
<portable_iconv>:
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),%rax
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <iconv@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<portable_iconv>:
jmp    1030 <iconv@plt>

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

LLVM IR (-O2):
define i64 @portable_iconv(i8* %0, i8** %1, i64* %2, i8** %3, i64* %4) {
%6 = ptrtoint i8* %0 to i64
%7 = trunc i64 %6 to i32
%8 = tail call i64 @iconv(i32 %7, i8** %1, i64* %2, i8** %3, i64* %4)
ret i64 %8
}
int soma(int x, int y) {
  int somatoria;
  somatoria = x + y;
  return somatoria;
}


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

x86 assembly (clang, -O2):
<soma>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @soma(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
void GLOB_FTL_Cache_Release(void) { return; }


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

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

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

LLVM IR (-O2):
define void @GLOB_FTL_Cache_Release() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CALC_appendString(char *);
void CALC_add7() { CALC_appendString("7"); }


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"7\00"
define void @CALC_add7() {
%1 = call i32 @CALC_appendString(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"7\00"
define void @CALC_add7() {
%1 = tail call i32 @CALC_appendString(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help_info(void) {
  printf("Usage: wdt_driver_test <timeout> <sleep> <test>\n");
  printf("    timeout: value in seconds to cause wdt timeout/reset\n");
  printf("    sleep: value in seconds to service the wdt\n");
  printf("    test: 0 - Service wdt with ioctl(), 1 - with write()\n");
}


x86 assembly (clang, -O0):
<help_info>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0a(%rip),%rdi
call   1030 <printf@plt>
lea    0xf38(%rip),%rdi
call   1030 <printf@plt>
lea    0xf5c(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help_info>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0c(%rip),%rdi
call   1030 <puts@plt>
lea    0xf39(%rip),%rdi
call   1030 <puts@plt>
lea    0xf5c(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"Usage: wdt_driver_test <timeout> <sleep> <test>\0A\00"
@.str.1 = [58 x i8] c" timeout: value in seconds to cause wdt timeout/reset\0A\00"
@.str.2 = [48 x i8] c" sleep: value in seconds to service the wdt\0A\00"
@.str.3 = [58 x i8] c" test: 0 - Service wdt with ioctl(), 1 - with write()\0A\00"
define void @help_info() {
%1 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [48 x i8] c"Usage: wdt_driver_test <timeout> <sleep> <test>\00"
@str.4 = [57 x i8] c" timeout: value in seconds to cause wdt timeout/reset\00"
@str.5 = [47 x i8] c" sleep: value in seconds to service the wdt\00"
@str.6 = [57 x i8] c" test: 0 - Service wdt with ioctl(), 1 - with write()\00"
define void @help_info() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ ttclose();
void panic(char *s) {
  ttclose();
  (void)fputs("panic: ", stderr);
  (void)fputs(s, stderr);
  (void)fputc('\n', stderr);
  exit(1);
}


x86 assembly (clang, -O0):
<panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <ttclose@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%esi
lea    0xe9d(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e6d(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e5f(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<panic>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1050 <ttclose@plt>
mov    0x2e8b(%rip),%rbx
mov    (%rbx),%esi
lea    0xea2(%rip),%rdi
call   1030 <fputs@plt>
mov    (%rbx),%esi
mov    %r14,%rdi
call   1030 <fputs@plt>
mov    (%rbx),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"panic: \00"
@stderr = global i32 0
define void @panic(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @ttclose()
%4 = load i32, i32* @stderr
%5 = call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i8*, i8** %2
%7 = load i32, i32* @stderr
%8 = call i32 @fputs(i8* %6, i32 %7)
%9 = load i32, i32* @stderr
%10 = call i32 @fputc(i8 signext 10, i32 %9)
%11 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"panic: \00"
@stderr = global i32 0
define void @panic(i8* %0) {
%2 = tail call i32 (...) @ttclose()
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fputs(i8* %0, i32 %5)
%7 = load i32, i32* @stderr
%8 = tail call i32 @fputc(i8 signext 10, i32 %7)
%9 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void welcome() {
  printf("Welcome to TNC!\n\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"Welcome to TNC!\0A\0A\00"
define void @welcome() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"Welcome to TNC!\0A\00"
define void @welcome() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void PageFree(void *_Block) { free(_Block); }


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

x86 assembly (clang, -O2):
<PageFree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @PageFree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void g_hook_alloc() {}


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

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

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

LLVM IR (-O2):
define void @g_hook_alloc() {
ret void
}
long long fi2(long long j, char *b, int i) { return j + b[i]; }


x86 assembly (clang, -O0):
<fi2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movsbq (%rcx,%rdx,1),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fi2>:
movslq %edx,%rax
movsbq (%rsi,%rax,1),%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @fi2(i64 %0, i8* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
store i64 %0, i64* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i64, i64* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i64
%14 = add nsw i64 %7, %13
ret i64 %14
}

LLVM IR (-O2):
define i64 @fi2(i64 %0, i8* nocapture %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i64
%8 = add nsw i64 %7, %0
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
extern size_t hexDecodeLength(size_t stringLen) {
  assert(0 == stringLen % 2);
  return stringLen / 2;
}


x86 assembly (clang, -O0):
<hexDecodeLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
and    $0x1,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexDecodeLength>:
push   %rbx
mov    %rdi,%rbx
not    %edi
and    $0x1,%edi
call   1030 <assert@plt>
shr    %rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @hexDecodeLength(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = urem i64 %3, 2
%5 = icmp eq i64 0, %4
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i64, i64* %2
%9 = udiv i64 %8, 2
ret i64 %9
}

LLVM IR (-O2):
define i64 @hexDecodeLength(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = and i32 %2, 1
%4 = xor i32 %3, 1
%5 = tail call i32 @assert(i32 %4)
%6 = lshr i64 %0, 1
ret i64 %6
}
void remove_light_sensor(struct ssp_data *data) { return; }


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

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

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

LLVM IR (-O2):
%struct.ssp_data = type opaque
define void @remove_light_sensor(%struct.ssp_data* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage(void) {
  fprintf(stderr, "Usage: petr_test <type> <gender> name\n"
                  "    type: first | middle | last\n"
                  "    gender: male | female\n");
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [97 x i8] c"Usage: petr_test <type> <gender> name\0A type: first | middle | last\0A gender: male | female\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [97 x i8] c"Usage: petr_test <type> <gender> name\0A type: first | middle | last\0A gender: male | female\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
print_data_send_error(int block_number) {
  printf("Unable to send data packet with block_number %d\n", block_number);
  exit(1);
}


x86 assembly (clang, -O0):
<print_data_send_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_data_send_error>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"Unable to send data packet with block_number %d\0A\00"
define i32 @print_data_send_error(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [49 x i8] c"Unable to send data packet with block_number %d\0A\00"
define i32 @print_data_send_error(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char *malloc(scalar_t__);
scalar_t__ strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, scalar_t__);
char *copy_string(char *s) {
  char *copy = malloc(strlen(s) + 1);
  strncpy(copy, s, strlen(s) + 1);
  return copy;
}


x86 assembly (clang, -O0):
<copy_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%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)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1030 <strncpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_string>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <strncpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @copy_string(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 = load i8*, i8** %2
%10 = load i8*, i8** %2
%11 = call i64 @strlen(i8* %10)
%12 = add nsw i64 %11, 1
%13 = call i32 @strncpy(i8* %8, i8* %9, i64 %12)
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @copy_string(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 = tail call i32 @strncpy(i8* %4, i8* %0, i64 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *);
int /*<<< orphan*/ output_byte(int);
void emit_popa() {
  assem_debug("popa\n");
  output_byte(0x61);
}


x86 assembly (clang, -O0):
<emit_popa>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0x61,%edi
call   1040 <output_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_popa>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0x61,%edi
pop    %rax
jmp    1040 <output_byte@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"popa\0A\00"
define void @emit_popa() {
%1 = call i32 @assem_debug(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @output_byte(i32 97)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"popa\0A\00"
define void @emit_popa() {
%1 = tail call i32 @assem_debug(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @output_byte(i32 97)
ret void
}
/* Variables and functions */
unsigned long long tailFact(int, int);
unsigned long long int fact(int n) {
  if (n < 0)
    return 0;
  else
    return tailFact(n, 1);
}


x86 assembly (clang, -O0):
<fact>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1132 <fact+0x22>
movq   $0x0,-0x8(%rbp)
jmp    1143 <fact+0x33>
mov    -0xc(%rbp),%edi
mov    $0x1,%esi
call   1030 <tailFact@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fact>:
test   %edi,%edi
js     111e <fact+0xe>
mov    $0x1,%esi
jmp    1030 <tailFact@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @fact(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i64 @tailFact(i32 %0, i32 1)
br label %5
5: ; preds = %1, %3
%6 = phi i64 [ %4, %3 ], [ 0, %1 ]
ret i64 %6
}
void ldb6_(void) {}


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

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

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

LLVM IR (-O2):
define void @ldb6_() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int num1, num2;
  int soma;
  num1 = 9;
  num2 = 10;
  soma = num1 + num2;
  printf("\nsoma = %d\n", soma);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"\0Asoma = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 9, i32* %2
store i32 10, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = add nsw i32 %5, %6
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"\0Asoma = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 19)
ret i32 0
}
int mightbestats(int state) {
  return (state == 0) || (state == 3) || (state == 8);
}


x86 assembly (clang, -O0):
<mightbestats>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112f <mightbestats+0x2f>
mov    $0x1,%al
cmpl   $0x3,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112f <mightbestats+0x2f>
cmpl   $0x8,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mightbestats>:
mov    $0x1,%eax
test   %edi,%edi
je     110e <mightbestats+0xe>
cmp    $0x3,%edi
jne    110f <mightbestats+0xf>
ret
xor    %eax,%eax
cmp    $0x8,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @mightbestats(i32 %0) {
switch i32 %0, label %2 [
i32 3, label %5
i32 0, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 8
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdout;
void *thread_func(void *name) {
  while (1) {
    fprintf(stdout, "This is a thread, my name is %s\n", (char *)name);
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<thread_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    112c <thread_func+0xc>

x86 assembly (clang, -O2):
<thread_func>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x2eb1(%rip),%r15
lea    0xeca(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    (%r15),%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1140 <thread_func+0x20>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [33 x i8] c"This is a thread, my name is %s\0A\00"
define i8* @thread_func(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = load i32, i32* @stdout
%5 = load i8*, i8** %2
%6 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 @sleep(i32 1)
br label %3
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [33 x i8] c"This is a thread, my name is %s\0A\00"
define noalias i8* @thread_func(i8* %0) {
br label %2
2: ; preds = %1, %2
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = tail call i32 @sleep(i32 1)
br label %2
}
int test_imm_F5int64_lowword_reg(long long val) {
  return ((val) & (0xF5 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F5int64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 245
%5 = icmp ne i64 %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_F5int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 245
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
scalar_t__ rand1();
int32_t randr(int32_t min, int32_t max) {
  return (int32_t)rand1() % (max - min + 1) + min;
}


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

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

LLVM IR (-O0):
define i32 @randr(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i64 (...) @rand1()
%6 = trunc i64 %5 to i32
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = add nsw i32 %9, 1
%11 = srem i32 %6, %10
%12 = load i32, i32* %3
%13 = add nsw i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @randr(i32 %0, i32 %1) {
%3 = tail call i64 (...) @rand1()
%4 = trunc i64 %3 to i32
%5 = sub i32 1, %0
%6 = add i32 %5, %1
%7 = srem i32 %4, %6
%8 = add nsw i32 %7, %0
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fill_with_chars(char, int);
int /*<<< orphan*/ printf(char *);
void printf_std_bar() {
  printf("\n ");
  fill_with_chars('=', 68);
}


x86 assembly (clang, -O0):
<printf_std_bar>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3d,%edi
mov    $0x44,%esi
call   1040 <fill_with_chars@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printf_std_bar>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3d,%edi
mov    $0x44,%esi
pop    %rax
jmp    1040 <fill_with_chars@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\0A \00"
define void @printf_std_bar() {
%1 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @fill_with_chars(i8 signext 61, i32 68)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\0A \00"
define void @printf_std_bar() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @fill_with_chars(i8 signext 61, i32 68)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_one_line_t32(int, int /*<<< orphan*/, int);
void print_8_2_t32(int k) {
  for (int loop = 0; loop < 2; ++loop) {
    print_one_line_t32(k, 0, 1);
  }
}


x86 assembly (clang, -O0):
<print_8_2_t32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1149 <print_8_2_t32+0x39>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <print_one_line_t32@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <print_8_2_t32+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_8_2_t32>:
push   %rbx
mov    %edi,%ebx
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <print_one_line_t32@plt>
mov    %ebx,%edi
xor    %esi,%esi
mov    $0x1,%edx
pop    %rbx
jmp    1030 <print_one_line_t32@plt>

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

LLVM IR (-O2):
define void @print_8_2_t32(i32 %0) {
%2 = tail call i32 @print_one_line_t32(i32 %0, i32 0, i32 1)
%3 = tail call i32 @print_one_line_t32(i32 %0, i32 0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
main() {
  char c = 5;
  c <<= 1;
  if (c != 10)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x5,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     1141 <main+0x31>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ err_log(int, int, char *, char *);
void main_ws_errhandler(int level, char *msg) {
  err_log(level, 0x00000002, "%s", msg);
}


x86 assembly (clang, -O0):
<main_ws_errhandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rcx
mov    $0x2,%esi
lea    0xece(%rip),%rdx
call   1030 <err_log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main_ws_errhandler>:
mov    %rsi,%rcx
lea    0xee6(%rip),%rdx
mov    $0x2,%esi
jmp    1030 <err_log@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @main_ws_errhandler(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 i8*, i8** %4
%7 = call i32 @err_log(i32 %5, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @main_ws_errhandler(i32 %0, i8* %1) {
%3 = tail call i32 @err_log(i32 %0, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int copy_dobldobl_target_solutions_to_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(255, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<copy_dobldobl_target_solutions_to_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xff,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_dobldobl_target_solutions_to_container>:
mov    $0xff,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @copy_dobldobl_target_solutions_to_container() {
%1 = tail call i32 @_ada_use_c2phc(i32 255, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Type definitions */
typedef int volatile uint8_t;

/* Variables and functions */
void flexram_wait(void) {
  while (!(*(volatile uint8_t *)0x40020001 & (uint8_t)0x01)) {
  }
}


x86 assembly (clang, -O0):
<flexram_wait>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <flexram_wait+0x9>
mov    $0x40020001,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1128 <flexram_wait+0x28>
jmp    112d <flexram_wait+0x2d>
jmp    1109 <flexram_wait+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flexram_wait>:
testl  $0x1,0x40020001
je     1100 <flexram_wait>
ret

LLVM IR (-O0):
define void @flexram_wait() {
br label %1
1: ; preds = %6, %0
%2 = load volatile i32, i32* inttoptr (i64 1073872897 to i32*)
%3 = and i32 %2, 1
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %7
6: ; preds = %1
br label %1
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @flexram_wait() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 1073872897 to i32*)
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
ret void
}
/* Variables and functions */
int omap_rev();
int is_omap2423(void) {
  return (((omap_rev() >> 16) & 0xffff) == (0x2423)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<is_omap2423>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <omap_rev@plt>
mov    %eax,%edx
sar    $0x10,%edx
and    $0xffff,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x2423,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_omap2423>:
push   %rax
xor    %eax,%eax
call   1030 <omap_rev@plt>
and    $0xffff0000,%eax
xor    %ecx,%ecx
cmp    $0x24230000,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_omap2423() {
%1 = call i32 (...) @omap_rev()
%2 = ashr i32 %1, 16
%3 = and i32 %2, 65535
%4 = icmp eq i32 %3, 9251
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_omap2423() {
%1 = tail call i32 (...) @omap_rev()
%2 = and i32 %1, -65536
%3 = icmp eq i32 %2, 606273536
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ getValue();
char *output_hash();
int /*<<< orphan*/ printf(char *, char *, int /*<<< orphan*/);
int main(void) {
  printf("%s%d\n", output_hash(), getValue());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <output_hash@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <getValue@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <output_hash@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <getValue@plt>
lea    0xeb7(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%s%d\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @output_hash()
%2 = tail call i32 (...) @getValue()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int EAST_CD_9(int in) {
  FILE *fin = fopen("func_header.h.ecov", "a");
  if (fin) {
    fprintf(fin, "CD9:%d\n", in);
  }
  fclose(fin);
  return in;
}


x86 assembly (clang, -O0):
<EAST_CD_9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1170 <EAST_CD_9+0x40>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeaa(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EAST_CD_9>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
lea    0xec4(%rip),%rdi
lea    0xed0(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1161 <EAST_CD_9+0x31>
lea    0xebe(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"func_header.h.ecov\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [8 x i8] c"CD9:%d\0A\00"
define i32 @EAST_CD_9(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = call i32* @fopen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32*, i32** %3
%9 = load i32, i32* %2
%10 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %7, %1
%12 = load i32*, i32** %3
%13 = call i32 @fclose(i32* %12)
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [19 x i8] c"func_header.h.ecov\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [8 x i8] c"CD9:%d\0A\00"
define i32 @EAST_CD_9(i32 returned %0) {
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fprintf(i32* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @fclose(i32* %2)
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void hang(void) {
  printf("\ns5pv%d:### ERROR ### Please RESET the board %d###\n", 210, 3);
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<hang>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0xd2,%esi
mov    $0x3,%edx
call   1030 <printf@plt>
jmp    112a <hang+0x1a>

x86 assembly (clang, -O2):
<hang>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xd2,%esi
mov    $0x3,%edx
call   1030 <printf@plt>
nopw   0x0(%rax,%rax,1)
jmp    1130 <hang+0x20>

LLVM IR (-O0):
@.str = [52 x i8] c"\0As5pv%d:### ERROR ### Please RESET the board %d###\0A\00"
define void @hang() {
%1 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 210, i32 3)
br label %2
2: ; preds = %2, %0
br label %2
}

LLVM IR (-O2):
@.str = [52 x i8] c"\0As5pv%d:### ERROR ### Please RESET the board %d###\0A\00"
define void @hang() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 210, i32 3)
br label %2
2: ; preds = %2, %0
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ __startrek_entry_pt_OSEK_Task_ts3();
void cil_keeperOSEK_Task_ts3(void) {
  {
    __startrek_entry_pt_OSEK_Task_ts3();
    return;
  }
}


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

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

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

LLVM IR (-O2):
define void @cil_keeperOSEK_Task_ts3() {
%1 = tail call i32 (...) @__startrek_entry_pt_OSEK_Task_ts3()
ret void
}
/* Type definitions */
struct ps_summary_event {
  int dummy;
};

/* Variables and functions */
int obus_event_is_empty(int /*<<< orphan*/);
int /*<<< orphan*/ ps_summary_const_obus_event(struct ps_summary_event const *);
int ps_summary_event_is_empty(const struct ps_summary_event *event) {
  return obus_event_is_empty(ps_summary_const_obus_event(event));
}


x86 assembly (clang, -O0):
<ps_summary_event_is_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ps_summary_const_obus_event@plt>
mov    %eax,%edi
call   1040 <obus_event_is_empty@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ps_summary_event_is_empty>:
push   %rax
call   1030 <ps_summary_const_obus_event@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <obus_event_is_empty@plt>

LLVM IR (-O0):
%struct.ps_summary_event = type { i32 }
define i32 @ps_summary_event_is_empty(%struct.ps_summary_event* %0) {
%2 = alloca %struct.ps_summary_event*
store %struct.ps_summary_event* %0, %struct.ps_summary_event** %2
%3 = load %struct.ps_summary_event*, %struct.ps_summary_event** %2
%4 = call i32 @ps_summary_const_obus_event(%struct.ps_summary_event* %3)
%5 = call i32 @obus_event_is_empty(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.ps_summary_event = type { i32 }
define i32 @ps_summary_event_is_empty(%struct.ps_summary_event* %0) {
%2 = tail call i32 @ps_summary_const_obus_event(%struct.ps_summary_event* %0)
%3 = tail call i32 @obus_event_is_empty(i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int _mm_movemask_ps(int /*<<< orphan*/);
int test_mm_movemask_ps(__m128 A) { return _mm_movemask_ps(A); }


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

x86 assembly (clang, -O2):
<test_mm_movemask_ps>:
jmp    1030 <_mm_movemask_ps@plt>

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

LLVM IR (-O2):
define i32 @test_mm_movemask_ps(i32 %0) {
%2 = tail call i32 @_mm_movemask_ps(i32 %0)
ret i32 %2
}
int szl_isspace(const char ch) {
  return ((ch == ' ') || (ch == '\t') || (ch == '\n') || (ch == '\r'));
}


x86 assembly (clang, -O0):
<szl_isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     114d <szl_isspace+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     114d <szl_isspace+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     114d <szl_isspace+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0xd,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<szl_isspace>:
cmp    $0x20,%dil
ja     1120 <szl_isspace+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100000600,%rdx
bt     %rcx,%rdx
jae    1120 <szl_isspace+0x20>
ret
xor    %eax,%eax
cmp    $0xd,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @szl_isspace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 10
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 13
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @szl_isspace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 10, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 13
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}