xunge/DecIR huggingface dataset:
P(a) char a;
{
  a;
  while (a > "  B   ")
    ;
}


x86 assembly (clang, -O0):
<P>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbq -0x5(%rbp),%rax
lea    0xeea(%rip),%rcx
cmp    %rcx,%rax
jbe    1124 <P+0x24>
jmp    110a <P+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<P>:
movsbq %dil,%rax
lea    0xef5(%rip),%rcx
cmp    %rcx,%rax
jbe    1112 <P+0x12>
jmp    1110 <P+0x10>
ret

LLVM IR (-O0):
@.str = [7 x i8] c" B \00"
define i32 @P(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = load i8, i8* %3
br label %6
6: ; preds = %11, %1
%7 = load i8, i8* %3
%8 = sext i8 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = icmp ugt i8* %9, getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
br i1 %10, label %11, label %12
11: ; preds = %6
br label %6
12: ; preds = %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [7 x i8] c" B \00"
define i32 @P(i32 %0) {
%2 = zext i32 %0 to i64
%3 = shl i64 %2, 56
%4 = ashr exact i64 %3, 56
%5 = inttoptr i64 %4 to i8*
%6 = icmp ugt i8* %5, getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
br i1 %6, label %7, label %8
7: ; preds = %1, %7
br label %7
8: ; preds = %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ enable_JTAG();
int /*<<< orphan*/ enable_SoftTube();
void copro_80186_init_hardware() {
  enable_JTAG();
  enable_SoftTube();
}


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

x86 assembly (clang, -O2):
<copro_80186_init_hardware>:
push   %rax
xor    %eax,%eax
call   1040 <enable_JTAG@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <enable_SoftTube@plt>

LLVM IR (-O0):
define void @copro_80186_init_hardware() {
%1 = call i32 (...) @enable_JTAG()
%2 = call i32 (...) @enable_SoftTube()
ret void
}

LLVM IR (-O2):
define void @copro_80186_init_hardware() {
%1 = tail call i32 (...) @enable_JTAG()
%2 = tail call i32 (...) @enable_SoftTube()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
void *MAP_FAILED;
void *mmap(void *, size_t, int, int, int, int /*<<< orphan*/);
void *mmap_or_null(void *addr, size_t length, int prot, int flags, int fd,
                   off_t offset) {
  void *ptr;
  if ((ptr = mmap(addr, length, prot, flags, fd, offset)) == MAP_FAILED)
    return (NULL);
  return (ptr);
}


x86 assembly (clang, -O0):
<mmap_or_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0x24(%rbp),%r8d
mov    -0x28(%rbp),%r9d
call   1030 <mmap@plt>
mov    %rax,-0x30(%rbp)
mov    0x2e8c(%rip),%rcx
cmp    (%rcx),%rax
jne    116a <mmap_or_null+0x5a>
movq   $0x0,-0x8(%rbp)
jmp    1172 <mmap_or_null+0x62>
mov    -0x30(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmap_or_null>:
push   %rax
call   1030 <mmap@plt>
mov    0x2ec3(%rip),%rcx
xor    %edx,%edx
cmp    (%rcx),%rax
cmove  %rdx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@MAP_FAILED = global i8* null
define i8* @mmap_or_null(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i8*
store i8* %0, i8** %8
store i64 %1, i64* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
%15 = load i8*, i8** %8
%16 = load i64, i64* %9
%17 = load i32, i32* %10
%18 = load i32, i32* %11
%19 = load i32, i32* %12
%20 = load i32, i32* %13
%21 = call i8* @mmap(i8* %15, i64 %16, i32 %17, i32 %18, i32 %19, i32 %20)
store i8* %21, i8** %14
%22 = load i8*, i8** @MAP_FAILED
%23 = icmp eq i8* %21, %22
br i1 %23, label %24, label %25
24: ; preds = %6
store i8* null, i8** %7
br label %27
25: ; preds = %6
%26 = load i8*, i8** %14
store i8* %26, i8** %7
br label %27
27: ; preds = %25, %24
%28 = load i8*, i8** %7
ret i8* %28
}

LLVM IR (-O2):
@MAP_FAILED = global i8* null
define i8* @mmap_or_null(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i8* @mmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5)
%8 = load i8*, i8** @MAP_FAILED
%9 = icmp eq i8* %7, %8
%10 = select i1 %9, i8* null, i8* %7
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_iochannel_free() {
  printf("NOT IMPLEMENTED:"
         "pa_iochannel_free"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"NOT IMPLEMENTED:pa_iochannel_free\0A\00"
define i32 @pa_iochannel_free() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [34 x i8] c"NOT IMPLEMENTED:pa_iochannel_free\00"
define i32 @pa_iochannel_free() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
void m_free(void *ptr) { printf("MEM: free (%p)\n", ptr); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"MEM: free (%p)\0A\00"
define void @m_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"MEM: free (%p)\0A\00"
define void @m_free(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void XMLDB_Generate_Begin_List_Item(FILE *dest_doc) {
  fprintf(dest_doc, "%s", "<listitem><para>");
}


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [17 x i8] c"<listitem><para>\00"
define void @XMLDB_Generate_Begin_List_Item(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [17 x i8] c"<listitem><para>\00"
define void @XMLDB_Generate_Begin_List_Item(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i64 16, i64 1, i32* %0)
ret void
}
void hclib_setState(int wid, int state) {}


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

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

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

LLVM IR (-O2):
define void @hclib_setState(i32 %0, i32 %1) {
ret void
}
int text_render_text(const char *text, int x, int y) { return 0; }


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

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

LLVM IR (-O0):
define i32 @text_render_text(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
ret i32 0
}

LLVM IR (-O2):
define i32 @text_render_text(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
void rop3_136_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = *D & S;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_136_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_136_1_1>:
or     %edx,%esi
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_136_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = and i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %7
%15 = load i8, i8* %7
%16 = zext i8 %15 to i32
%17 = load i8, i8* %5
%18 = zext i8 %17 to i32
%19 = xor i32 %18, -1
%20 = and i32 %16, %19
%21 = load i8, i8* %6
%22 = zext i8 %21 to i32
%23 = xor i32 %22, -1
%24 = and i32 %20, %23
%25 = load i8*, i8** %4
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = and i32 %27, %29
%31 = or i32 %24, %30
%32 = load i8*, i8** %4
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = load i8, i8* %6
%36 = zext i8 %35 to i32
%37 = and i32 %34, %36
%38 = or i32 %31, %37
%39 = trunc i32 %38 to i8
%40 = load i8*, i8** %4
store i8 %39, i8* %40
ret void
}

LLVM IR (-O2):
define void @rop3_136_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = and i8 %4, %5
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
void errorChrStr(void) {
  error("Invalid or unsupported character constant or string literal\n");
}


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

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

LLVM IR (-O0):
@.str = [61 x i8] c"Invalid or unsupported character constant or string literal\0A\00"
define void @errorChrStr() {
%1 = call i32 @error(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [61 x i8] c"Invalid or unsupported character constant or string literal\0A\00"
define void @errorChrStr() {
%1 = tail call i32 @error(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ A_STANDOUT;
int /*<<< orphan*/ attroff(int /*<<< orphan*/);
int /*<<< orphan*/ attron(int /*<<< orphan*/);
int /*<<< orphan*/ mvaddstr(int, int, char const *);
int strlen(char const *);
void msg_center(int nrow, int ncol, const char *str) {
  attron(A_STANDOUT);
  mvaddstr(nrow / 2, (ncol - strlen(str)) / 2, str);
  attroff(A_STANDOUT);
}


x86 assembly (clang, -O0):
<msg_center>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1050 <attron@plt>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%edi
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
call   1060 <mvaddstr@plt>
mov    0x2e3f(%rip),%rax
mov    (%rax),%edi
call   1030 <attroff@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_center>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %edi,%r15d
mov    0x2e89(%rip),%r12
mov    (%r12),%edi
call   1050 <attron@plt>
mov    %r15d,%ebx
shr    $0x1f,%ebx
add    %r15d,%ebx
sar    %ebx
mov    %r14,%rdi
call   1040 <strlen@plt>
sub    %eax,%ebp
mov    %ebp,%esi
shr    $0x1f,%esi
add    %ebp,%esi
sar    %esi
mov    %ebx,%edi
mov    %r14,%rdx
call   1060 <mvaddstr@plt>
mov    (%r12),%edi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <attroff@plt>

LLVM IR (-O0):
@A_STANDOUT = global i32 0
define void @msg_center(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* @A_STANDOUT
%8 = call i32 @attron(i32 %7)
%9 = load i32, i32* %4
%10 = sdiv i32 %9, 2
%11 = load i32, i32* %5
%12 = load i8*, i8** %6
%13 = call i32 @strlen(i8* %12)
%14 = sub nsw i32 %11, %13
%15 = sdiv i32 %14, 2
%16 = load i8*, i8** %6
%17 = call i32 @mvaddstr(i32 %10, i32 %15, i8* %16)
%18 = load i32, i32* @A_STANDOUT
%19 = call i32 @attroff(i32 %18)
ret void
}

LLVM IR (-O2):
@A_STANDOUT = global i32 0
define void @msg_center(i32 %0, i32 %1, i8* %2) {
%4 = load i32, i32* @A_STANDOUT
%5 = tail call i32 @attron(i32 %4)
%6 = sdiv i32 %0, 2
%7 = tail call i32 @strlen(i8* %2)
%8 = sub nsw i32 %1, %7
%9 = sdiv i32 %8, 2
%10 = tail call i32 @mvaddstr(i32 %6, i32 %9, i8* %2)
%11 = load i32, i32* @A_STANDOUT
%12 = tail call i32 @attroff(i32 %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb_local(unsigned short, unsigned char);
void x_outb(unsigned short port, unsigned char val) { outb_local(port, val); }


x86 assembly (clang, -O0):
<x_outb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x2(%rbp),%ax
movzwl %ax,%edi
movzbl -0x3(%rbp),%esi
call   1030 <outb_local@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_outb>:
jmp    1030 <outb_local@plt>

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

LLVM IR (-O2):
define void @x_outb(i16 zeroext %0, i8 zeroext %1) {
%3 = tail call i32 @outb_local(i16 zeroext %0, i8 zeroext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ kill_hostapd();
void sig_exit(int sig_num) {
  kill_hostapd();
  _exit(0);
}


x86 assembly (clang, -O0):
<sig_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <kill_hostapd@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<sig_exit>:
push   %rax
xor    %eax,%eax
call   1040 <kill_hostapd@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @sig_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @kill_hostapd()
%4 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @sig_exit(i32 %0) {
%2 = tail call i32 (...) @kill_hostapd()
%3 = tail call i32 @_exit(i32 0)
unreachable
}
/* Type definitions */
struct Pl_utl_sema {
  int dummy;
};
struct Pl_utl_bsema {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pl_utl_sema_i_post(struct Pl_utl_sema *);
void pl_utl_bsema_i_post(struct Pl_utl_bsema *_bsema_p) {
  pl_utl_sema_i_post((struct Pl_utl_sema *)_bsema_p);
}


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

x86 assembly (clang, -O2):
<pl_utl_bsema_i_post>:
jmp    1030 <pl_utl_sema_i_post@plt>

LLVM IR (-O0):
%struct.Pl_utl_bsema = type { i32 }
%struct.Pl_utl_sema = type { i32 }
define void @pl_utl_bsema_i_post(%struct.Pl_utl_bsema* %0) {
%2 = alloca %struct.Pl_utl_bsema*
store %struct.Pl_utl_bsema* %0, %struct.Pl_utl_bsema** %2
%3 = load %struct.Pl_utl_bsema*, %struct.Pl_utl_bsema** %2
%4 = bitcast %struct.Pl_utl_bsema* %3 to %struct.Pl_utl_sema*
%5 = call i32 @pl_utl_sema_i_post(%struct.Pl_utl_sema* %4)
ret void
}

LLVM IR (-O2):
%struct.Pl_utl_bsema = type { i32 }
%struct.Pl_utl_sema = type { i32 }
define void @pl_utl_bsema_i_post(%struct.Pl_utl_bsema* %0) {
%2 = bitcast %struct.Pl_utl_bsema* %0 to %struct.Pl_utl_sema*
%3 = tail call i32 @pl_utl_sema_i_post(%struct.Pl_utl_sema* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void Socket_Close(int sock_fd) { close(sock_fd); }


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

x86 assembly (clang, -O2):
<Socket_Close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @Socket_Close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
void xpreset() {}


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

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

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

LLVM IR (-O2):
define void @xpreset() {
ret void
}
void AS1_OnFreeTxBuf(void) {}


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

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

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

LLVM IR (-O2):
define void @AS1_OnFreeTxBuf() {
ret void
}
/* Variables and functions */
float sinhf(float);
float intr_wrap_068(float p1) { return sinhf(p1); }


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

x86 assembly (clang, -O2):
<intr_wrap_068>:
jmp    1030 <sinhf@plt>

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

LLVM IR (-O2):
define float @intr_wrap_068(float %0) {
%2 = tail call float @sinhf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ kernel_exec_irq(void *, int);
int /*<<< orphan*/ printf(char *);
void disable_smep_smap() {
  printf("[.] disabling SMEP & SMAP\n");
  kernel_exec_irq((void *)0xffffffff81064550ul, 0x406e0ul);
  printf("[.] SMEP & SMAP should be off now\n");
}


x86 assembly (clang, -O0):
<disable_smep_smap>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff81064550,%rdi
mov    $0x406e0,%esi
call   1040 <kernel_exec_irq@plt>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<disable_smep_smap>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff81064550,%rdi
mov    $0x406e0,%esi
call   1040 <kernel_exec_irq@plt>
lea    0xed5(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"[.] disabling SMEP & SMAP\0A\00"
@.str.1 = [35 x i8] c"[.] SMEP & SMAP should be off now\0A\00"
define void @disable_smep_smap() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @kernel_exec_irq(i8* inttoptr (i64 -2130295472 to i8*), i32 263904)
%3 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [26 x i8] c"[.] disabling SMEP & SMAP\00"
@str.2 = [34 x i8] c"[.] SMEP & SMAP should be off now\00"
define void @disable_smep_smap() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @kernel_exec_irq(i8* inttoptr (i64 -2130295472 to i8*), i32 263904)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World! (A simple C program.)\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"Hello World! (A simple C program.)\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [35 x i8] c"Hello World! (A simple C program.)\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int sched_yield(void) {
  long __res;
  __asm__ volatile("int $0x80" : "=a"(__res) : "0"(158));
  do {
    return (int)(__res);
  } while (0);
}


x86 assembly (clang, -O0):
<sched_yield>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9e,%eax
int    $0x80
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sched_yield>:
mov    $0x9e,%eax
int    $0x80
ret

LLVM IR (-O0):
define i32 @sched_yield() {
%1 = alloca i64
%2 = call i64 asm sideeffect "int $$0x80", "={ax},0,~{dirflag},~{fpsr},~{flags}"(i64 158)
store i64 %2, i64* %1
br label %3
3: ; preds = %0
%4 = load i64, i64* %1
%5 = trunc i64 %4 to i32
br label %6
6: ; preds = %3
ret i32 %5
}

LLVM IR (-O2):
define i32 @sched_yield() {
%1 = tail call i64 asm sideeffect "int $$0x80", "={ax},0,~{dirflag},~{fpsr},~{flags}"(i64 158)
%2 = trunc i64 %1 to i32
ret i32 %2
}
void test_after_each_dummy_2TDU1qc96gy8Vgfp(void) { return; }


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

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

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

LLVM IR (-O2):
define void @test_after_each_dummy_2TDU1qc96gy8Vgfp() {
ret void
}
double approx_sun_transit_time(double alpha_zero, double longitude, double nu) {
  return (alpha_zero - longitude - nu) / 360.0;
}


x86 assembly (clang, -O0):
<approx_sun_transit_time>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<approx_sun_transit_time>:
subsd  %xmm1,%xmm0
subsd  %xmm2,%xmm0
divsd  0xef0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @approx_sun_transit_time(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fsub double %7, %8
%10 = load double, double* %6
%11 = fsub double %9, %10
%12 = fdiv double %11, 3.600000e+02
ret double %12
}

LLVM IR (-O2):
define double @approx_sun_transit_time(double %0, double %1, double %2) {
%4 = fsub double %0, %1
%5 = fsub double %4, %2
%6 = fdiv double %5, 3.600000e+02
ret double %6
}
int col(int x) { return x & 7; }


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

x86 assembly (clang, -O2):
<col>:
mov    %edi,%eax
and    $0x7,%eax
ret

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

LLVM IR (-O2):
define i32 @col(i32 %0) {
%2 = and i32 %0, 7
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ ch341_init();
int /*<<< orphan*/ check_signature();
int /*<<< orphan*/ chip_prog_enable();
int /*<<< orphan*/ toggle_reset(int);
void ch_init(void) {
  ch341_init();
  toggle_reset(1);
  chip_prog_enable();
  check_signature();
}


x86 assembly (clang, -O0):
<ch_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <ch341_init@plt>
mov    $0x1,%edi
call   1030 <toggle_reset@plt>
mov    $0x0,%al
call   1050 <chip_prog_enable@plt>
mov    $0x0,%al
call   1040 <check_signature@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ch_init>:
push   %rax
xor    %eax,%eax
call   1060 <ch341_init@plt>
mov    $0x1,%edi
call   1030 <toggle_reset@plt>
xor    %eax,%eax
call   1050 <chip_prog_enable@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <check_signature@plt>

LLVM IR (-O0):
define void @ch_init() {
%1 = call i32 (...) @ch341_init()
%2 = call i32 @toggle_reset(i32 1)
%3 = call i32 (...) @chip_prog_enable()
%4 = call i32 (...) @check_signature()
ret void
}

LLVM IR (-O2):
define void @ch_init() {
%1 = tail call i32 (...) @ch341_init()
%2 = tail call i32 @toggle_reset(i32 1)
%3 = tail call i32 (...) @chip_prog_enable()
%4 = tail call i32 (...) @check_signature()
ret void
}
/* Variables and functions */
#define TPACKET_V1 129
#define TPACKET_V2 128
int /*<<< orphan*/ __v1_rx_user_ready(void *);
int /*<<< orphan*/ __v2_rx_user_ready(void *);
void __v1_v2_rx_user_ready(void *base, int version) {
  switch (version) {
  case TPACKET_V1:
    __v1_rx_user_ready(base);
    break;
  case TPACKET_V2:
    __v2_rx_user_ready(base);
    break;
  }
}


x86 assembly (clang, -O0):
<__v1_v2_rx_user_ready>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x80,%eax
je     1166 <__v1_v2_rx_user_ready+0x46>
jmp    1145 <__v1_v2_rx_user_ready+0x25>
mov    -0x10(%rbp),%eax
sub    $0x81,%eax
jne    116f <__v1_v2_rx_user_ready+0x4f>
jmp    1158 <__v1_v2_rx_user_ready+0x38>
mov    -0x8(%rbp),%rdi
call   1040 <__v1_rx_user_ready@plt>
jmp    116f <__v1_v2_rx_user_ready+0x4f>
mov    -0x8(%rbp),%rdi
call   1030 <__v2_rx_user_ready@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__v1_v2_rx_user_ready>:
cmp    $0x80,%esi
je     1135 <__v1_v2_rx_user_ready+0x15>
cmp    $0x81,%esi
jne    113a <__v1_v2_rx_user_ready+0x1a>
jmp    1040 <__v1_rx_user_ready@plt>
jmp    1030 <__v2_rx_user_ready@plt>
ret

LLVM IR (-O0):
define void @__v1_v2_rx_user_ready(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
switch i32 %5, label %12 [
i32 129, label %6
i32 128, label %9
]
6: ; preds = %2
%7 = load i8*, i8** %3
%8 = call i32 @__v1_rx_user_ready(i8* %7)
br label %12
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = call i32 @__v2_rx_user_ready(i8* %10)
br label %12
12: ; preds = %2, %9, %6
ret void
}

LLVM IR (-O2):
define void @__v1_v2_rx_user_ready(i8* %0, i32 %1) {
switch i32 %1, label %7 [
i32 129, label %3
i32 128, label %5
]
3: ; preds = %2
%4 = tail call i32 @__v1_rx_user_ready(i8* %0)
br label %7
5: ; preds = %2
%6 = tail call i32 @__v2_rx_user_ready(i8* %0)
br label %7
7: ; preds = %2, %5, %3
ret void
}
int main() {
  int xx;
  int yy = 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void digraph() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ findUnique2(int *, int);
int main() {
  int n;
  int a[] = {1, 3, 5, 6, 3, 2, 1, 2};
  n = sizeof(a) / sizeof(int);
  findUnique2(a, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed1(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x8,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <findUnique2@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <findUnique2@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [8 x i32] [i32 1, i32 3, i32 5, i32 6, i32 3, i32 2, i32 1, i32 2]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [8 x i32]
store i32 0, i32* %1
%4 = bitcast [8 x i32]* %3 to i8*
store i32 8, i32* %2
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 @findUnique2(i32* %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [8 x i32] [i32 1, i32 3, i32 5, i32 6, i32 3, i32 2, i32 1, i32 2]
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @findUnique2(i32* %3, i32 8)
ret i32 0
}
/* Variables and functions */
double erf(double);
int /*<<< orphan*/ printf(char *, double);
double sqrt(double);
int main() {
  printf("the integral of normal(0,1) distribution "
         "between -1.96 and 1.96 is: %g\n",
         erf(1.96 * sqrt(1.0 / 2.0)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec1(%rip),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xea9(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1050 <erf@plt>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
call   1040 <erf@plt>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [72 x i8] c"the integral of normal(0,1) distribution between -1.96 and 1.96 is: %g\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @sqrt(double 5.000000e-01)
%3 = fmul double 1.960000e+00, %2
%4 = call double @erf(double %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [72 x i8] c"the integral of normal(0,1) distribution between -1.96 and 1.96 is: %g\0A\00"
define i32 @main() {
%1 = tail call double @erf(double 0x3FF62CC4313F3FB9)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), double %1)
ret i32 0
}
/* Variables and functions */
bool simple_compare(const void *l, const void *r) { return (l == r); }


x86 assembly (clang, -O0):
<simple_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_compare>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @simple_compare(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 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @simple_compare(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free_const(void const *);
void xfree(const void *p) {
  if (p)
    free_const(p);
}


x86 assembly (clang, -O0):
<xfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <xfree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free_const@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfree>:
test   %rdi,%rdi
je     111a <xfree+0xa>
jmp    1030 <free_const@plt>
ret

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

LLVM IR (-O2):
define void @xfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free_const(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
long long different_ways(int, long long *);
int /*<<< orphan*/ printf(char *, long long);
int main(void) {
  long long ans;
  long long coins[] = {1, 2, 5, 10, 20, 50, 100, 200, 0};
  ans = different_ways(200, coins);
  printf("diffrerent_ways: %lld\n", ans);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x48,%edx
call   1040 <memcpy@plt>
lea    -0x60(%rbp),%rsi
mov    $0xc8,%edi
call   1050 <different_ways@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
mov    0xf15(%rip),%rax
mov    %rax,0x40(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xea5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0xc8,%edi
call   1040 <different_ways@plt>
lea    0xed5(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.coins = [9 x i64] [i64 1, i64 2, i64 5, i64 10, i64 20, i64 50, i64 100, i64 200, i64 0]
@.str = [23 x i8] c"diffrerent_ways: %lld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca [9 x i64]
store i32 0, i32* %1
%4 = bitcast [9 x i64]* %3 to i8*
%5 = getelementptr inbounds [9 x i64], [9 x i64]* %3, i64 0, i64 0
%6 = call i64 @different_ways(i32 200, i64* %5)
store i64 %6, i64* %2
%7 = load i64, i64* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i64 %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.coins = [9 x i64] [i64 1, i64 2, i64 5, i64 10, i64 20, i64 50, i64 100, i64 200, i64 0]
@.str = [23 x i8] c"diffrerent_ways: %lld\0A\00"
define i32 @main() {
%1 = alloca [9 x i64]
%2 = bitcast [9 x i64]* %1 to i8*
%3 = getelementptr inbounds [9 x i64], [9 x i64]* %1, i64 0, i64 0
%4 = call i64 @different_ways(i32 200, i64* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i64 %4)
ret i32 0
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRB9_get(void) { return U_WMRCORENONE_get("U_WMRB9"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRB9\00"
define i32 @U_WMRB9_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRB9\00"
define i32 @U_WMRB9_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int ftruncate(int, int /*<<< orphan*/);
int safe_ftruncate(int fd, off_t length) {
  int r;
  for (;;) {
    r = ftruncate(fd, length);
    if (!r || errno != EINTR)
      break;
  }
  return r;
}


x86 assembly (clang, -O0):
<safe_ftruncate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <ftruncate@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1150 <safe_ftruncate+0x40>
mov    0x2ea3(%rip),%rax
mov    (%rax),%rax
mov    0x2e91(%rip),%rcx
cmp    (%rcx),%rax
je     1155 <safe_ftruncate+0x45>
jmp    115a <safe_ftruncate+0x4a>
jmp    111e <safe_ftruncate+0xe>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_ftruncate>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    0x2ebe(%rip),%r14
mov    0x2eaf(%rip),%r15
nopl   0x0(%rax)
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <ftruncate@plt>
test   %eax,%eax
je     1145 <safe_ftruncate+0x35>
mov    (%r14),%rcx
cmp    (%r15),%rcx
je     1130 <safe_ftruncate+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i32 @safe_ftruncate(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @ftruncate(i32 %7, i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %6
%13 = load i64, i64* @errno
%14 = load i64, i64* @EINTR
%15 = icmp ne i64 %13, %14
br i1 %15, label %16, label %17
16: ; preds = %12, %6
br label %18
17: ; preds = %12
br label %6
18: ; preds = %16
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @safe_ftruncate(i32 %0, i32 %1) {
br label %3
3: ; preds = %6, %2
%4 = tail call i32 @ftruncate(i32 %0, i32 %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = load i64, i64* @errno
%8 = load i64, i64* @EINTR
%9 = icmp eq i64 %7, %8
br i1 %9, label %3, label %10
10: ; preds = %3, %6
ret i32 %4
}
int __low_level_init(void) { return 1; }


x86 assembly (clang, -O0):
<__low_level_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__low_level_init() {
ret i32 1
}

LLVM IR (-O2):
define i32 @__low_level_init() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void and_reg64_reg64(unsigned int reg1, unsigned int reg2) {
  put8(0x48);
  put8(0x21);
  put8(0xC0 | (reg2 << 3) | reg1);
}


x86 assembly (clang, -O0):
<and_reg64_reg64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x48,%edi
call   1030 <put8@plt>
mov    $0x21,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%edi
shl    $0x3,%edi
or     $0xc0,%edi
or     -0x4(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<and_reg64_reg64>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x48,%edi
call   1030 <put8@plt>
mov    $0x21,%edi
call   1030 <put8@plt>
shl    $0x3,%ebx
or     %ebp,%ebx
or     $0xc0,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @and_reg64_reg64(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @put8(i32 72)
%6 = call i32 @put8(i32 33)
%7 = load i32, i32* %4
%8 = shl i32 %7, 3
%9 = or i32 192, %8
%10 = load i32, i32* %3
%11 = or i32 %9, %10
%12 = call i32 @put8(i32 %11)
ret void
}

LLVM IR (-O2):
define void @and_reg64_reg64(i32 %0, i32 %1) {
%3 = tail call i32 @put8(i32 72)
%4 = tail call i32 @put8(i32 33)
%5 = shl i32 %1, 3
%6 = or i32 %5, %0
%7 = or i32 %6, 192
%8 = tail call i32 @put8(i32 %7)
ret void
}
void rwx(unsigned short bits, char *chars) {
  chars[0] = ((bits & 00400) ? 'r' : '-');
  chars[1] = ((bits & 00200) ? 'w' : '-');
  chars[2] = ((bits & 00100) ? 'x' : '-');
}


x86 assembly (clang, -O0):
<rwx>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x100,%edx
mov    $0x2d,%eax
mov    $0x72,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movzwl -0x2(%rbp),%edx
and    $0x80,%edx
mov    $0x2d,%eax
mov    $0x77,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
movzwl -0x2(%rbp),%edx
and    $0x40,%edx
mov    $0x2d,%eax
mov    $0x78,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rwx>:
test   $0x100,%edi
mov    $0x2d,%eax
mov    $0x72,%ecx
cmove  %eax,%ecx
mov    %cl,(%rsi)
test   $0x80,%dil
mov    $0x77,%ecx
cmove  %eax,%ecx
mov    %cl,0x1(%rsi)
test   $0x40,%dil
mov    $0x78,%ecx
cmove  %eax,%ecx
mov    %cl,0x2(%rsi)
ret

LLVM IR (-O0):
define void @rwx(i16 zeroext %0, i8* %1) {
%3 = alloca i16
%4 = alloca i8*
store i16 %0, i16* %3
store i8* %1, i8** %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = and i32 %6, 256
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 114, i32 45
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 0
store i8 %11, i8* %13
%14 = load i16, i16* %3
%15 = zext i16 %14 to i32
%16 = and i32 %15, 128
%17 = icmp ne i32 %16, 0
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 119, i32 45
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i64 1
store i8 %20, i8* %22
%23 = load i16, i16* %3
%24 = zext i16 %23 to i32
%25 = and i32 %24, 64
%26 = icmp ne i32 %25, 0
%27 = zext i1 %26 to i64
%28 = select i1 %26, i32 120, i32 45
%29 = trunc i32 %28 to i8
%30 = load i8*, i8** %4
%31 = getelementptr inbounds i8, i8* %30, i64 2
store i8 %29, i8* %31
ret void
}

LLVM IR (-O2):
define void @rwx(i16 zeroext %0, i8* nocapture writeonly %1) {
%3 = zext i16 %0 to i32
%4 = and i32 %3, 256
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i8 45, i8 114
store i8 %6, i8* %1
%7 = and i32 %3, 128
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i8 45, i8 119
%10 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %9, i8* %10
%11 = and i32 %3, 64
%12 = icmp eq i32 %11, 0
%13 = select i1 %12, i8 45, i8 120
%14 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %13, i8* %14
ret void
}
/* Variables and functions */
bool nrf52_errata_103(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_103() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xb3() {
  Assert_real((islower(179) == 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_islower.c",
              900, ("islower should be 0 for 0xb3"));
}


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

x86 assembly (clang, -O2):
<t_islower_0xb3>:
push   %rax
mov    $0xb3,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x384,%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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xb3\00"
define void @t_islower_0xb3() {
%1 = call i64 @islower(i32 179)
%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 900, 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xb3\00"
define void @t_islower_0xb3() {
%1 = tail call i64 @islower(i32 179)
%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 900, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int help() {
  printf("USAGE: toon [options] <file> [more options and/or files]\n");
  printf("OPTIONS:\n");
  printf("        -o [string] : output filename (NOTE: affects only the next "
         "input file)\n");
  printf("        -t [float]  : thickness (default = 1)\n");
  return 1;
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf13(%rip),%rdi
call   1030 <printf@plt>
lea    0xf11(%rip),%rdi
call   1030 <printf@plt>
lea    0xf55(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [58 x i8] c"USAGE: toon [options] <file> [more options and/or files]\0A\00"
@.str.1 = [10 x i8] c"OPTIONS:\0A\00"
@.str.2 = [80 x i8] c" -o [string] : output filename (NOTE: affects only the next input file)\0A\00"
@.str.3 = [47 x i8] c" -t [float] : thickness (default = 1)\0A\00"
define i32 @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [57 x i8] c"USAGE: toon [options] <file> [more options and/or files]\00"
@str.4 = [9 x i8] c"OPTIONS:\00"
@str.5 = [79 x i8] c" -o [string] : output filename (NOTE: affects only the next input file)\00"
@str.6 = [46 x i8] c" -t [float] : thickness (default = 1)\00"
define i32 @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.6, i64 0, i64 0))
ret i32 1
}