xunge/DecIR huggingface dataset:
/* Variables and functions */
int O_NONBLOCK;
int O_WRONLY;
int /*<<< orphan*/ free(char *);
int open(char *, int);
char *suinput_get_uinput_path();
int suinput_open(void) {
  int uinput_fd;
  char *uinput_path;
  if ((uinput_path = suinput_get_uinput_path()) == NULL) {
    return -1;
  }
  uinput_fd = open(uinput_path, O_WRONLY | O_NONBLOCK);
  free(uinput_path);
  return uinput_fd;
}


x86 assembly (clang, -O0):
<suinput_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <suinput_get_uinput_path@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1159 <suinput_open+0x29>
movl   $0xffffffff,-0x4(%rbp)
jmp    1186 <suinput_open+0x56>
mov    -0x10(%rbp),%rdi
mov    0x2e6c(%rip),%rax
mov    (%rax),%esi
mov    0x2e7b(%rip),%rax
or     (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<suinput_open>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <suinput_get_uinput_path@plt>
test   %rax,%rax
je     116a <suinput_open+0x3a>
mov    %rax,%rbx
mov    0x2e87(%rip),%rax
mov    0x2e98(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    %rbx,%rdi
call   1040 <open@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
jmp    116f <suinput_open+0x3f>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@O_WRONLY = global i32 0
@O_NONBLOCK = global i32 0
define i32 @suinput_open() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = call i8* (...) @suinput_get_uinput_path()
store i8* %4, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 -1, i32* %1
br label %16
7: ; preds = %0
%8 = load i8*, i8** %3
%9 = load i32, i32* @O_WRONLY
%10 = load i32, i32* @O_NONBLOCK
%11 = or i32 %9, %10
%12 = call i32 @open(i8* %8, i32 %11)
store i32 %12, i32* %2
%13 = load i8*, i8** %3
%14 = call i32 @free(i8* %13)
%15 = load i32, i32* %2
store i32 %15, i32* %1
br label %16
16: ; preds = %7, %6
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
@O_NONBLOCK = global i32 0
define i32 @suinput_open() {
%1 = tail call i8* (...) @suinput_get_uinput_path()
%2 = icmp eq i8* %1, null
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = load i32, i32* @O_WRONLY
%5 = load i32, i32* @O_NONBLOCK
%6 = or i32 %5, %4
%7 = tail call i32 @open(i8* %1, i32 %6)
%8 = tail call i32 @free(i8* %1)
br label %9
9: ; preds = %0, %3
%10 = phi i32 [ %7, %3 ], [ -1, %0 ]
ret i32 %10
}
int bitNor(int x, int y) { return 2; }


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

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

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

LLVM IR (-O2):
define i32 @bitNor(i32 %0, i32 %1) {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sig_quit(int signo) { printf("Caught SIGQUIT.\n"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Caught SIGQUIT.\0A\00"
define void @sig_quit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"Caught SIGQUIT.\00"
define void @sig_quit(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_96uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x96 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_96uint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 150
%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_96uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 150
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ prompt_loop();
int main(int argc, char *argv[]) {
  prompt_loop();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <prompt_loop@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <prompt_loop@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @prompt_loop()
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @prompt_loop()
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int bot(int grid[6][7], int move) {
  int i;
  scanf("%d", &i);
  return i;
}


x86 assembly (clang, -O0):
<bot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bot>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @bot([7 x i32]* nocapture readnone %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ commFreeAllFds();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
void handlerSigInt(int sig) {
  printf("recv SIGINT <%d>, you may press ctrl+C.\n", sig);
  commFreeAllFds();
  sleep(1);
  exit(1);
}


x86 assembly (clang, -O0):
<handlerSigInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <commFreeAllFds@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<handlerSigInt>:
push   %rax
mov    %edi,%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <commFreeAllFds@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"recv SIGINT <%d>, you may press ctrl+C.\0A\00"
define void @handlerSigInt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (...) @commFreeAllFds()
%6 = call i32 @sleep(i32 1)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [41 x i8] c"recv SIGINT <%d>, you may press ctrl+C.\0A\00"
define void @handlerSigInt(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 (...) @commFreeAllFds()
%4 = tail call i32 @sleep(i32 1)
%5 = tail call i32 @exit(i32 1)
unreachable
}
char *skip_nonquote(char *s) {
  while (*s && *s != '\'')
    s++;
  return s;
}


x86 assembly (clang, -O0):
<skip_nonquote>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     112d <skip_nonquote+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x27,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <skip_nonquote+0x3d>
jmp    114e <skip_nonquote+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip_nonquote+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_nonquote>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
test   %cl,%cl
je     1122 <skip_nonquote+0x22>
cmp    $0x27,%cl
je     1122 <skip_nonquote+0x22>
add    $0x1,%rax
jmp    1110 <skip_nonquote+0x10>
ret

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

LLVM IR (-O2):
define i8* @skip_nonquote(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 39, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2
ret i8* %3
}
void addReplyBulkCString(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               20, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<addReplyBulkCString>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x14,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<addReplyBulkCString>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x14,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.addReplyBulkCString = [20 x i8] c"addReplyBulkCString\00"
define void @addReplyBulkCString() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 20, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__func__.addReplyBulkCString, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.addReplyBulkCString = [20 x i8] c"addReplyBulkCString\00"
define void @addReplyBulkCString() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 20, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__func__.addReplyBulkCString, i64 0, i64 0))
ret void
}
int test_imm_90uint32_mem(unsigned int *val) {
  return ((*val) & (0x90 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_90uint32_mem>:
testb  $0x90,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_90uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 144
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void GPIOGatingRatioConfigure(unsigned int baseAdd, unsigned int configFlag) {
  (*((volatile unsigned int *)(baseAdd + (0x130)))) &= ~((0x00000006u));
  (*((volatile unsigned int *)(baseAdd + (0x130)))) |=
      (configFlag & (0x00000006u));
}


x86 assembly (clang, -O0):
<GPIOGatingRatioConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x130,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xfffffff9,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
and    $0x6,%edx
mov    -0x4(%rbp),%eax
add    $0x130,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOGatingRatioConfigure>:
add    $0x130,%edi
andl   $0xfffffff9,(%rdi)
and    $0x6,%esi
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @GPIOGatingRatioConfigure(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = add i32 %5, 304
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -7
store volatile i32 %10, i32* %8
%11 = load i32, i32* %4
%12 = and i32 %11, 6
%13 = load i32, i32* %3
%14 = add i32 %13, 304
%15 = zext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
%17 = load volatile i32, i32* %16
%18 = or i32 %17, %12
store volatile i32 %18, i32* %16
ret void
}

LLVM IR (-O2):
define void @GPIOGatingRatioConfigure(i32 %0, i32 %1) {
%3 = add i32 %0, 304
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -7
store volatile i32 %7, i32* %5
%8 = and i32 %1, 6
%9 = load volatile i32, i32* %5
%10 = or i32 %9, %8
store volatile i32 %10, i32* %5
ret void
}
/* Variables and functions */
int base64_decode_update(int /*<<< orphan*/ *, void *, int *, void const *,
                         int);
int base64_decode_block(void *dst, int *dstlen, const void *src, int srclen) {
  return (base64_decode_update(NULL, dst, dstlen, src, srclen));
}


x86 assembly (clang, -O0):
<base64_decode_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
call   1030 <base64_decode_update@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_decode_block>:
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <base64_decode_update@plt>

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

LLVM IR (-O2):
define i32 @base64_decode_block(i8* %0, i32* %1, i8* %2, i32 %3) {
%5 = tail call i32 @base64_decode_update(i32* null, i8* %0, i32* %1, i8* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void tml_Free(void *ptr) {
  if (ptr != NULL) {
    free(ptr);
  }
}


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

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

LLVM IR (-O0):
define void @tml_Free(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(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @tml_Free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
char *strchr(char const *, int);
const char *nexttoken(const char *q, int sep) {
  if (q)
    q = strchr(q, sep);
  if (q)
    q++;
  return q;
}


x86 assembly (clang, -O0):
<nexttoken>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113a <nexttoken+0x2a>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1151 <nexttoken+0x41>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nexttoken>:
test   %rdi,%rdi
je     1121 <nexttoken+0x11>
push   %rax
call   1030 <strchr@plt>
add    $0x8,%rsp
jmp    1123 <nexttoken+0x13>
xor    %eax,%eax
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rax,%rcx
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i8* @nexttoken(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i8* @strchr(i8* %0, i32 %1)
br label %6
6: ; preds = %4, %2
%7 = phi i8* [ %5, %4 ], [ null, %2 ]
%8 = icmp eq i8* %7, null
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = select i1 %8, i8* null, i8* %9
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: pidns list\n"
                  "       pidns add NAME cmd ...\n"
                  "       pidns exec NAME cmd ...\n"
                  "       pidns delete NAME\n"
                  "       pidns identify PID\n");
}


x86 assembly (clang, -O0):
<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):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [131 x i8] c"Usage: pidns list\0A pidns add NAME cmd ...\0A pidns exec NAME cmd ...\0A pidns delete NAME\0A pidns identify PID\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [131 x i8] c"Usage: pidns list\0A pidns add NAME cmd ...\0A pidns exec NAME cmd ...\0A pidns delete NAME\0A pidns identify PID\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0))
ret void
}
int baz() { return "bazzz"; }


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"bazzz\00"
define i32 @baz() {
ret i32 ptrtoint ([6 x i8]* @.str to i32)
}

LLVM IR (-O2):
@.str = [6 x i8] c"bazzz\00"
define i32 @baz() {
ret i32 ptrtoint ([6 x i8]* @.str to i32)
}
int xmlDeclaration_function(const char *_tag_, int _type_, const char *version,
                            const char *encoding) {
  return (0);
}


x86 assembly (clang, -O0):
<xmlDeclaration_function>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xmlDeclaration_function(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
ret i32 0
}

LLVM IR (-O2):
define i32 @xmlDeclaration_function(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
ret i32 0
}
unsigned char inb(unsigned short port) {
  unsigned char r;
  asm volatile("inb %1, %0" : "=a"(r) : "dN"(port));
  return r;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb $1, $0", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb $1, $0", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ UFILE;
typedef int /*<<< orphan*/ UChar;

/* Variables and functions */
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ u_fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *u_finit(int /*<<< orphan*/, int /*<<< orphan*/ *,
                            int /*<<< orphan*/ *);
int /*<<< orphan*/ u_fprintf(int /*<<< orphan*/ *, char *,
                             int /*<<< orphan*/ *);
void print_uchars(UChar *str) {
  UFILE *out = u_finit(stdout, NULL, NULL);
  u_fprintf(out, "uchars: %S\n", str);
  u_fclose(out);
}


x86 assembly (clang, -O0):
<print_uchars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1030 <u_finit@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe9c(%rip),%rsi
call   1040 <u_fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1050 <u_fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_uchars>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <u_finit@plt>
mov    %rax,%rbx
lea    0xead(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   1040 <u_fprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <u_fclose@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [12 x i8] c"uchars: %S\0A\00"
define void @print_uchars(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
%4 = load i32, i32* @stdout
%5 = call i32* @u_finit(i32 %4, i32* null, i32* null)
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32*, i32** %2
%8 = call i32 @u_fprintf(i32* %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %7)
%9 = load i32*, i32** %3
%10 = call i32 @u_fclose(i32* %9)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [12 x i8] c"uchars: %S\0A\00"
define void @print_uchars(i32* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32* @u_finit(i32 %2, i32* null, i32* null)
%4 = tail call i32 @u_fprintf(i32* %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %0)
%5 = tail call i32 @u_fclose(i32* %3)
ret void
}
unsigned int feld_rotl(const unsigned int value, int shift) {
  if ((shift &= sizeof(value) * 8 - 1) == 0)
    return value;
  return value << shift | value >> sizeof(value) * 8 - shift;
}


x86 assembly (clang, -O0):
<feld_rotl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
and    $0x1f,%rax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jne    1129 <feld_rotl+0x29>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1149 <feld_rotl+0x49>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    -0x8(%rbp),%edx
movslq -0xc(%rbp),%rsi
mov    $0x20,%ecx
sub    %rsi,%rcx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<feld_rotl>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%eax
ret

LLVM IR (-O0):
define i32 @feld_rotl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = and i64 %7, 31
%9 = trunc i64 %8 to i32
store i32 %9, i32* %5
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* %4
store i32 %12, i32* %3
br label %24
13: ; preds = %2
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = shl i32 %14, %15
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = sub i64 32, %19
%21 = trunc i64 %20 to i32
%22 = lshr i32 %17, %21
%23 = or i32 %16, %22
store i32 %23, i32* %3
br label %24
24: ; preds = %13, %11
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @feld_rotl(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t bitor8to32(uint8_t b0, uint8_t b1, uint8_t b2, uint8_t b3) {
  return (((uint32_t)b0) << 24) | (((uint32_t)b1) << 16) |
         (((uint32_t)b2) << 8) | (uint32_t)b3;
}


x86 assembly (clang, -O0):
<bitor8to32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x18,%eax
mov    -0x10(%rbp),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x18(%rbp),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x20(%rbp),%rcx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitor8to32>:
mov    %rcx,%rax
shl    $0x18,%edi
shl    $0x10,%esi
or     %edi,%esi
shl    $0x8,%edx
or     %edx,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @bitor8to32(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %5
%10 = trunc i64 %9 to i32
%11 = shl i32 %10, 24
%12 = load i64, i64* %6
%13 = trunc i64 %12 to i32
%14 = shl i32 %13, 16
%15 = or i32 %11, %14
%16 = load i64, i64* %7
%17 = trunc i64 %16 to i32
%18 = shl i32 %17, 8
%19 = or i32 %15, %18
%20 = load i64, i64* %8
%21 = trunc i64 %20 to i32
%22 = or i32 %19, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @bitor8to32(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = trunc i64 %0 to i32
%6 = shl i32 %5, 24
%7 = trunc i64 %1 to i32
%8 = shl i32 %7, 16
%9 = or i32 %8, %6
%10 = trunc i64 %2 to i32
%11 = shl i32 %10, 8
%12 = or i32 %9, %11
%13 = trunc i64 %3 to i32
%14 = or i32 %12, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
int /*<<< orphan*/ write(int, char *, int);
void *noisy(void *x) {
  char c = (uintptr_t)x;
  for (;;) {
    usleep(250 * 1000);
    write(2, &c, 1);
    if (c == 'C')
      *((unsigned *)0) = 42;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<noisy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %al,-0x9(%rbp)
mov    $0x3d090,%edi
call   1040 <usleep@plt>
mov    $0x2,%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
movsbl -0x9(%rbp),%eax
cmp    $0x43,%eax
jne    1165 <noisy+0x45>
xor    %eax,%eax
movl   $0x2a,(%rax)
jmp    1133 <noisy+0x13>

x86 assembly (clang, -O2):
<noisy>:
push   %rbx
sub    $0x10,%rsp
mov    %dil,0xf(%rsp)
lea    0xf(%rsp),%rbx
nop
mov    $0x3d090,%edi
call   1040 <usleep@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
jmp    1130 <noisy+0x10>

LLVM IR (-O0):
define i8* @noisy(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
%6 = trunc i64 %5 to i8
store i8 %6, i8* %3
br label %7
7: ; preds = %14, %1
%8 = call i32 @usleep(i32 250000)
%9 = call i32 @write(i32 2, i8* %3, i32 1)
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 67
br i1 %12, label %13, label %14
13: ; preds = %7
store i32 42, i32* null
br label %14
14: ; preds = %13, %7
br label %7
}

LLVM IR (-O2):
define noalias i8* @noisy(i8* %0) {
%2 = alloca i8
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i8
store i8 %4, i8* %2
%5 = icmp ne i8 %4, 67
br label %6
6: ; preds = %6, %1
%7 = tail call i32 @usleep(i32 250000)
%8 = call i32 @write(i32 2, i8* %2, i32 1)
tail call void @llvm.assume(i1 %5)
br label %6
}
/* Variables and functions */
int /*<<< orphan*/ displaystring(char *);
void menu_statustext(char *help_line) {
  if (help_line != NULL) {
    displaystring(help_line);
  } else {
    displaystring(" ");
  }
}


x86 assembly (clang, -O0):
<menu_statustext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1135 <menu_statustext+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <displaystring@plt>
jmp    1141 <menu_statustext+0x31>
lea    0xec4(%rip),%rdi
call   1030 <displaystring@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<menu_statustext>:
test   %rdi,%rdi
je     111a <menu_statustext+0xa>
jmp    1030 <displaystring@plt>
lea    0xedf(%rip),%rdi
jmp    1030 <displaystring@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @menu_statustext(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 @displaystring(i8* %6)
br label %10
8: ; preds = %1
%9 = call i32 @displaystring(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @menu_statustext(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @displaystring(i8* %0)
br label %7
5: ; preds = %1
%6 = tail call i32 @displaystring(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help(void) {
  printf("\nZone scanner testing tool.\n"
         "Usage: zscanner-tool [parameters] origin zonefile\n"
         "\n"
         "Parameters:\n"
         " -m [0,1,2]   Processing mode.\n"
         "     0        Empty output.\n"
         "     1        Debug output (DEFAULT).\n"
         "     2        Test output.\n"
         " -t           Launch unit tests.\n"
         " -h           Print this help.\n");
}


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

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

LLVM IR (-O0):
@.str = [280 x i8] c"\0AZone scanner testing tool.\0AUsage: zscanner-tool [parameters] origin zonefile\0A\0AParameters:\0A -m [0,1,2] Processing mode.\0A 0 Empty output.\0A 1 Debug output (DEFAULT).\0A 2 Test output.\0A -t Launch unit tests.\0A -h Print this help.\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([280 x i8], [280 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [279 x i8] c"\0AZone scanner testing tool.\0AUsage: zscanner-tool [parameters] origin zonefile\0A\0AParameters:\0A -m [0,1,2] Processing mode.\0A 0 Empty output.\0A 1 Debug output (DEFAULT).\0A 2 Test output.\0A -t Launch unit tests.\0A -h Print this help.\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([279 x i8], [279 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void sysfail(char const *msg) {
  perror(msg);
  exit(1);
}


x86 assembly (clang, -O0):
<sysfail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sysfail>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @sysfail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @sysfail(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
__attribute__((always_)) int
register_timer_hook(int (*hook)(struct pt_regs *)) {
  return -38;
}


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

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

LLVM IR (-O0):
%struct.pt_regs = type opaque
define i32 @register_timer_hook(i32 (%struct.pt_regs*)* %0) {
%2 = alloca i32 (%struct.pt_regs*)*
store i32 (%struct.pt_regs*)* %0, i32 (%struct.pt_regs*)** %2
ret i32 -38
}

LLVM IR (-O2):
%struct.pt_regs = type opaque
define i32 @register_timer_hook(i32 (%struct.pt_regs*)* nocapture readnone %0) {
ret i32 -38
}
/* Variables and functions */
scalar_t__ calloc(unsigned int, int);
int /*<<< orphan*/ nrerror(char *);
float *Vector(int nl, int nh) {
  float *v;
  v = (float *)calloc((unsigned)(nh - nl + 1), sizeof(float));
  if (!v)
    nrerror("allocation failure in Vector()");
  return v - nl;
}


x86 assembly (clang, -O0):
<Vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
sub    -0x4(%rbp),%edi
add    $0x1,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115c <Vector+0x3c>
lea    0xea9(%rip),%rdi
call   1030 <nrerror@plt>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Vector>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
sub    %edi,%esi
lea    0x1(%rsi),%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1148 <Vector+0x28>
lea    0xebd(%rip),%rdi
call   1030 <nrerror@plt>
movslq %ebp,%rax
shl    $0x2,%rax
sub    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"allocation failure in Vector()\00"
define float* @Vector(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca float*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = call i64 @calloc(i32 %9, i32 4)
%11 = inttoptr i64 %10 to float*
store float* %11, float** %5
%12 = load float*, float** %5
%13 = icmp ne float* %12, null
br i1 %13, label %16, label %14
14: ; preds = %2
%15 = call i32 @nrerror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %2
%17 = load float*, float** %5
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = sub i64 0, %19
%21 = getelementptr inbounds float, float* %17, i64 %20
ret float* %21
}

LLVM IR (-O2):
@.str = [31 x i8] c"allocation failure in Vector()\00"
define float* @Vector(i32 %0, i32 %1) {
%3 = sub i32 1, %0
%4 = add i32 %3, %1
%5 = tail call i64 @calloc(i32 %4, i32 4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @nrerror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
%10 = inttoptr i64 %5 to float*
%11 = sext i32 %0 to i64
%12 = sub nsw i64 0, %11
%13 = getelementptr inbounds float, float* %10, i64 %12
ret float* %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  printf("정수 입력 ");
  scanf("%d %d", &a, &b);
  printf("곱 = %d\n몫 = %d", a * b, a / b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
imul   -0xc(%rbp),%esi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,%edx
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%ecx
mov    (%rsp),%esi
mov    %ecx,%eax
cltd
idiv   %esi
imul   %ecx,%esi
lea    0xebc(%rip),%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"\EC\A0\95\EC\88\98 \EC\9E\85\EB\A0\A5 \00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [18 x i8] c"\EA\B3\B1 = %d\0A\EB\AA\AB = %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = mul nsw i32 %6, %7
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = sdiv i32 %9, %10
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %8, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"\EC\A0\95\EC\88\98 \EC\9E\85\EB\A0\A5 \00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [18 x i8] c"\EA\B3\B1 = %d\0A\EB\AA\AB = %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = mul nsw i32 %8, %7
%10 = sdiv i32 %7, %8
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %9, i32 %10)
ret i32 0
}
extern double mipsfltest2(int x1, double x2, double x3) {
  return (x1 + x2 + x3);
}


x86 assembly (clang, -O0):
<mipsfltest2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mipsfltest2>:
cvtsi2sd %edi,%xmm2
addsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @mipsfltest2(i32 %0, double %1, double %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca double
store i32 %0, i32* %4
store double %1, double* %5
store double %2, double* %6
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to double
%9 = load double, double* %5
%10 = fadd double %8, %9
%11 = load double, double* %6
%12 = fadd double %10, %11
ret double %12
}

LLVM IR (-O2):
define double @mipsfltest2(i32 %0, double %1, double %2) {
%4 = sitofp i32 %0 to double
%5 = fadd double %4, %1
%6 = fadd double %5, %2
ret double %6
}
/* Type definitions */
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Display;
typedef int /*<<< orphan*/ Atom;

/* Variables and functions */
int /*<<< orphan*/ False;
int /*<<< orphan*/ XInternAtom(int /*<<< orphan*/ *, char const *,
                               int /*<<< orphan*/);
int send_client_msg(int /*<<< orphan*/ *, int /*<<< orphan*/, char *, int,
                    int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
                    int /*<<< orphan*/);
int toggle_property(Display *disp, Window *win, const char *property) {
  Atom prop;
  prop = XInternAtom(disp, property, False);
  return send_client_msg(disp, *win, "_NET_WM_STATE", 2, prop, 0, 0, 0);
}


x86 assembly (clang, -O0):
<toggle_property>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    0x2ea5(%rip),%rax
mov    (%rax),%edx
call   1030 <XInternAtom@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x1c(%rbp),%r8d
lea    0xe9e(%rip),%rdx
mov    $0x2,%ecx
xor    %r9d,%r9d
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
call   1040 <send_client_msg@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toggle_property>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2eb7(%rip),%rax
mov    (%rax),%eax
mov    %rdx,%rsi
mov    %eax,%edx
call   1030 <XInternAtom@plt>
mov    (%r14),%esi
lea    0xeb9(%rip),%rdx
mov    %rbx,%rdi
mov    $0x2,%ecx
mov    %eax,%r8d
xor    %r9d,%r9d
push   $0x0
push   $0x0
call   1040 <send_client_msg@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@False = global i32 0
@.str = [14 x i8] c"_NET_WM_STATE\00"
define i32 @toggle_property(i32* %0, i32* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%8 = load i32*, i32** %4
%9 = load i8*, i8** %6
%10 = load i32, i32* @False
%11 = call i32 @XInternAtom(i32* %8, i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32*, i32** %4
%13 = load i32*, i32** %5
%14 = load i32, i32* %13
%15 = load i32, i32* %7
%16 = call i32 @send_client_msg(i32* %12, i32 %14, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 2, i32 %15, i32 0, i32 0, i32 0)
ret i32 %16
}

LLVM IR (-O2):
@False = global i32 0
@.str = [14 x i8] c"_NET_WM_STATE\00"
define i32 @toggle_property(i32* %0, i32* nocapture %1, i8* %2) {
%4 = load i32, i32* @False
%5 = tail call i32 @XInternAtom(i32* %0, i8* %2, i32 %4)
%6 = load i32, i32* %1
%7 = tail call i32 @send_client_msg(i32* %0, i32 %6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 2, i32 %5, i32 0, i32 0, i32 0)
ret i32 %7
}
void tegra_mipi_cal_destroy(struct tegra_dc *dc) {}


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

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

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

LLVM IR (-O2):
%struct.tegra_dc = type opaque
define void @tegra_mipi_cal_destroy(%struct.tegra_dc* nocapture %0) {
ret void
}
void g_date_subtract_years() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void print_depth_shift(FILE *fp, int depth) {
  int j;
  for (j = 0; j < depth; j++) {
    fprintf(fp, " ");
  }
}


x86 assembly (clang, -O0):
<print_depth_shift>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1150 <print_depth_shift+0x40>
mov    -0x8(%rbp),%rdi
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_depth_shift+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_depth_shift>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1132 <print_depth_shift+0x22>
mov    %esi,%ebx
mov    %rdi,%r14
nopl   (%rax)
mov    $0x20,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebx
jne    1120 <print_depth_shift+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @print_depth_shift(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @fputc(i32 32, i32* %0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}