xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0xd7() {
  Assert_real((isspace(215) == 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_isspace.c",
              1080, ("isspace should be 0 for 0xd7"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0xd7>:
push   %rax
mov    $0xd7,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x438,%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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xd7\00"
define void @t_isspace_0xd7() {
%1 = call i64 @isspace(i32 215)
%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 1080, 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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xd7\00"
define void @t_isspace_0xd7() {
%1 = tail call i64 @isspace(i32 215)
%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 1080, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int __builtin_spe_mfspefscr();
int /*<<< orphan*/ __builtin_spe_mtspefscr(int);
void __ev_set_spefscr_frmc(int rnd) {
  int i;
  i = __builtin_spe_mfspefscr();
  i &= ~0x00000003;
  i |= rnd;
  __builtin_spe_mtspefscr(i);
}


x86 assembly (clang, -O0):
<__ev_set_spefscr_frmc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__builtin_spe_mfspefscr@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xfffffffc,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <__builtin_spe_mtspefscr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ev_set_spefscr_frmc>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <__builtin_spe_mfspefscr@plt>
and    $0xfffffffc,%eax
or     %eax,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <__builtin_spe_mtspefscr@plt>

LLVM IR (-O0):
define void @__ev_set_spefscr_frmc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @__builtin_spe_mfspefscr()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = and i32 %5, -4
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = or i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = call i32 @__builtin_spe_mtspefscr(i32 %10)
ret void
}

LLVM IR (-O2):
define void @__ev_set_spefscr_frmc(i32 %0) {
%2 = tail call i32 (...) @__builtin_spe_mfspefscr()
%3 = and i32 %2, -4
%4 = or i32 %3, %0
%5 = tail call i32 @__builtin_spe_mtspefscr(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void hash_print_tab_(int cnt) {
  for (int n = 0; n < cnt; n++) {
    putchar('\t');
  }
}


x86 assembly (clang, -O0):
<hash_print_tab_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1146 <hash_print_tab_+0x36>
mov    $0x9,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <hash_print_tab_+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_print_tab_>:
push   %rbx
test   %edi,%edi
jle    112f <hash_print_tab_+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x9,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <hash_print_tab_+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @hash_print_tab_(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 @putchar(i8 signext 9)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %3, label %4
}
void early_init(unsigned int r0, unsigned int mach_type, unsigned int atags) {
  if (r0 != 0) {
  }
  if (mach_type == 0) {
  }
  if (atags == 0) {
  }
}


x86 assembly (clang, -O0):
<early_init>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     111c <early_init+0x1c>
jmp    111c <early_init+0x1c>
cmpl   $0x0,-0x8(%rbp)
jne    112b <early_init+0x2b>
jmp    112b <early_init+0x2b>
cmpl   $0x0,-0xc(%rbp)
jne    113a <early_init+0x3a>
jmp    113a <early_init+0x3a>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @early_init(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
scalar_t__ strcasecmp(char const *, char const *);
int acase_lt(const char *pat, const char *text) {
  return (strcasecmp(text, pat) < 0);
}


x86 assembly (clang, -O0):
<acase_lt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acase_lt>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <strcasecmp@plt>
shr    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @acase_lt(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strcasecmp(i8* %5, i8* %6)
%8 = icmp slt i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @acase_lt(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strcasecmp(i8* %1, i8* %0)
%4 = lshr i64 %3, 63
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void help(char *name) {
  printf("Usage: %s [opts]\n"
         "-h\thelp\n"
         "-l\tlisten\n"
         "-c\t<cert>\n"
         "-k\t<key>\n"
         "-d\t<hostname>\n"
         "-p\t<port>\n"
         "-C\tconnectbyname()\n",
         name);
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [98 x i8] c"Usage: %s [opts]\0A-h\09help\0A-l\09listen\0A-c\09<cert>\0A-k\09<key>\0A-d\09<hostname>\0A-p\09<port>\0A-C\09connectbyname()\0A\00"
define void @help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [98 x i8] c"Usage: %s [opts]\0A-h\09help\0A-l\09listen\0A-c\09<cert>\0A-k\09<key>\0A-d\09<hostname>\0A-p\09<port>\0A-C\09connectbyname()\0A\00"
define void @help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int in_range(int const, int /*<<< orphan*/, char);
bool is_digit(const int c) { return in_range(c, '0', '9'); }


x86 assembly (clang, -O0):
<is_digit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x30,%esi
mov    $0x39,%edx
call   1030 <in_range@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_digit>:
mov    $0x30,%esi
mov    $0x39,%edx
jmp    1030 <in_range@plt>

LLVM IR (-O0):
define i32 @is_digit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @in_range(i32 %3, i32 48, i8 signext 57)
ret i32 %4
}

LLVM IR (-O2):
define i32 @is_digit(i32 %0) {
%2 = tail call i32 @in_range(i32 %0, i32 48, i8 signext 57)
ret i32 %2
}
int func3(int a) { return a * 3; }


x86 assembly (clang, -O0):
<func3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x3,-0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func3>:
lea    (%rdi,%rdi,2),%eax
ret

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

LLVM IR (-O2):
define i32 @func3(i32 %0) {
%2 = mul nsw i32 %0, 3
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void hello(const char *name) { printf("Hello, %s!\n", name); }


x86 assembly (clang, -O0):
<hello>:
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):
<hello>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"Hello, %s!\0A\00"
define void @hello(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int f();
long func2() { return 4 * f(); }


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <f@plt>
shl    $0x2,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<func2>:
push   %rax
xor    %eax,%eax
call   1030 <f@plt>
shl    $0x2,%eax
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @func2() {
%1 = call i32 (...) @f()
%2 = mul nsw i32 4, %1
%3 = sext i32 %2 to i64
ret i64 %3
}

LLVM IR (-O2):
define i64 @func2() {
%1 = tail call i32 (...) @f()
%2 = shl nsw i32 %1, 2
%3 = sext i32 %2 to i64
ret i64 %3
}
int dial(int dir, int num) {
  if (dir == 0) {
    if (num == 9)
      return 0;
    else
      return num + 1;
  } else {
    if (num == 0)
      return 9;
    else
      return num - 1;
  }
}


x86 assembly (clang, -O0):
<dial>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1138 <dial+0x38>
cmpl   $0x9,-0xc(%rbp)
jne    112a <dial+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1157 <dial+0x57>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1157 <dial+0x57>
cmpl   $0x0,-0xc(%rbp)
jne    114e <dial+0x4e>
movl   $0x9,-0x4(%rbp)
jmp    1157 <dial+0x57>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dial>:
xor    %ecx,%ecx
xor    %eax,%eax
test   %edi,%edi
setne  %cl
sete   %al
lea    (%rax,%rax,8),%edx
neg    %edi
sbb    %eax,%eax
or     $0x1,%eax
lea    (%rcx,%rcx,8),%ecx
add    %esi,%eax
cmp    %esi,%edx
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @dial(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* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 9
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 0, i32* %3
br label %22
12: ; preds = %8
%13 = load i32, i32* %5
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %22
15: ; preds = %2
%16 = load i32, i32* %5
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 9, i32* %3
br label %22
19: ; preds = %15
%20 = load i32, i32* %5
%21 = sub nsw i32 %20, 1
store i32 %21, i32* %3
br label %22
22: ; preds = %19, %18, %12, %11
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @dial(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i32 9, i32 0
%5 = select i1 %3, i32 1, i32 -1
%6 = select i1 %3, i32 0, i32 9
%7 = icmp eq i32 %4, %1
%8 = add nsw i32 %5, %1
%9 = select i1 %7, i32 %6, i32 %8
ret i32 %9
}
char *Salloc(str)
char *str;
{
  char *strcpy();
  if (str == 0) {
    str = "";
  }
  return strcpy(Malloc((unsigned)strlen(str) + 1), str);
}


x86 assembly (clang, -O0):
<Salloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1152 <Salloc+0x22>
lea    0xeb2(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%edi
add    $0x1,%edi
mov    $0x0,%al
call   1030 <Malloc@plt>
movslq %eax,%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Salloc>:
push   %rbx
test   %rdi,%rdi
lea    0xec5(%rip),%rbx
cmovne %rdi,%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    0x1(%rax),%edi
xor    %eax,%eax
call   1030 <Malloc@plt>
movslq %eax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <strcpy@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @Salloc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %6
6: ; preds = %5, %1
%7 = load i8*, i8** %2
%8 = call i64 @strlen(i8* %7)
%9 = trunc i64 %8 to i32
%10 = add i32 %9, 1
%11 = call i32 (i32, ...) bitcast (i32 (...)* @Malloc to i32 (i32, ...)*)(i32 %10)
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i8*
%14 = load i8*, i8** %2
%15 = call i8* @strcpy(i8* %13, i8* %14)
ret i8* %15
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @Salloc(i8* %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0
%4 = tail call i64 @strlen(i8* dereferenceable(1) %3)
%5 = trunc i64 %4 to i32
%6 = add i32 %5, 1
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @Malloc to i32 (i32, ...)*)(i32 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = tail call i8* @strcpy(i8* dereferenceable(1) %9, i8* dereferenceable(1) %3)
ret i8* %9
}
/* Type definitions */
struct RNALalifold_args_info {
  int dummy;
};

/* Variables and functions */
int EXIT_SUCCESS;
int RNALalifold_cmdline_parser_required(struct RNALalifold_args_info *args_info,
                                        const char *prog_name) {
  (void)(args_info);
  (void)(prog_name);
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<RNALalifold_cmdline_parser_required>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.RNALalifold_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @RNALalifold_cmdline_parser_required(%struct.RNALalifold_args_info* %0, i8* %1) {
%3 = alloca %struct.RNALalifold_args_info*
%4 = alloca i8*
store %struct.RNALalifold_args_info* %0, %struct.RNALalifold_args_info** %3
store i8* %1, i8** %4
%5 = load %struct.RNALalifold_args_info*, %struct.RNALalifold_args_info** %3
%6 = load i8*, i8** %4
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
%struct.RNALalifold_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @RNALalifold_cmdline_parser_required(%struct.RNALalifold_args_info* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ mapif_parse_PartyLeave(int, int, int, int);
void inter_party_leave(int party_id, int account_id, int char_id) {
  mapif_parse_PartyLeave(-1, party_id, account_id, char_id);
  return;
}


x86 assembly (clang, -O0):
<inter_party_leave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%edi
call   1030 <mapif_parse_PartyLeave@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inter_party_leave>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    $0xffffffff,%edi
jmp    1030 <mapif_parse_PartyLeave@plt>

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

LLVM IR (-O2):
define void @inter_party_leave(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @mapif_parse_PartyLeave(i32 -1, i32 %0, i32 %1, i32 %2)
ret void
}
__typeof__(stpcpy(1, "")) test_stpcpy_136(void) { return stpcpy(1, ""); }


x86 assembly (clang, -O0):
<test_stpcpy_136>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rsi
mov    $0x1,%edi
call   1030 <stpcpy@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @test_stpcpy_136() {
%1 = call i8* @stpcpy(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
define i8* @test_stpcpy_136() {
store i8 0, i8* inttoptr (i64 1 to i8*)
ret i8* inttoptr (i64 1 to i8*)
}
main(int argc, char **argv) {
  int i;
  printf("argc = %d, argc = 0x%x, &argv = 0x%x, &i = 0x%x\n", argc, &argv,
         &argv, &i);
  if (argc > 0)
    main(argc - 1, argv);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec0(%rip),%rdi
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
mov    %rcx,%rdx
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x8(%rbp)
jle    116b <main+0x4b>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
call   1040 <main@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    %rsi,(%rsp)
lea    0xece(%rip),%rdi
mov    %rsp,%rcx
lea    0xc(%rsp),%r8
mov    %ebx,%esi
mov    %rcx,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
test   %ebx,%ebx
jle    1158 <main+0x38>
add    $0xffffffff,%ebx
mov    (%rsp),%rsi
mov    %ebx,%edi
call   1040 <main@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [49 x i8] c"argc = %d, argc = 0x%x, &argv = 0x%x, &i = 0x%x\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %7, i8*** %5, i8*** %5, i32* %6)
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* %4
%13 = sub nsw i32 %12, 1
%14 = load i8**, i8*** %5
%15 = call i32 @main(i32 %13, i8** %14)
br label %16
16: ; preds = %11, %2
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str = [49 x i8] c"argc = %d, argc = 0x%x, &argv = 0x%x, &i = 0x%x\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %1, i8*** %3
%5 = bitcast i32* %4 to i8*
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %0, i8*** %3, i8*** %3, i32* %4)
%7 = icmp sgt i32 %0, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = add nsw i32 %0, -1
%10 = load i8**, i8*** %3
%11 = call i32 @main(i32 %9, i8** %10)
br label %12
12: ; preds = %8, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printOverview();
int /*<<< orphan*/ printf(char *, int);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  int i;
  srand(time(NULL));
  i = rand();
  printOverview();
  printf("random num: %d\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    $0x0,%al
call   1070 <rand@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <printOverview@plt>
mov    -0x8(%rbp),%esi
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
xor    %eax,%eax
call   1070 <rand@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <printOverview@plt>
lea    0xe8a(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"random num: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
%5 = call i32 (...) @rand()
store i32 %5, i32* %2
%6 = call i32 (...) @printOverview()
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"random num: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @rand()
%4 = tail call i32 (...) @printOverview()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t read_defect_data_12_list_format(uint8_t *data) {
  return data[1] & 0x07;
}


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

x86 assembly (clang, -O2):
<read_defect_data_12_list_format>:
mov    0x4(%rdi),%eax
and    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @read_defect_data_12_list_format(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
%6 = and i32 %5, 7
ret i32 %6
}

LLVM IR (-O2):
define i32 @read_defect_data_12_list_format(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = and i32 %3, 7
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ TCSBRK;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int tcsendbreak(int fd, int duration) {
  if (duration <= 0)
    return ioctl(fd, TCSBRK, 0);
  __set_errno(EINVAL);
  return -1;
}


x86 assembly (clang, -O0):
<tcsendbreak>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     1153 <tcsendbreak+0x33>
mov    -0x8(%rbp),%edi
mov    0x2eae(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <ioctl@plt>
mov    %eax,-0x4(%rbp)
jmp    1168 <tcsendbreak+0x48>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcsendbreak>:
push   %rax
test   %esi,%esi
jle    113a <tcsendbreak+0x1a>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
pop    %rax
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
@TCSBRK = global i32 0
@EINVAL = global i32 0
define i32 @tcsendbreak(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 = icmp sle i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %4
%10 = load i32, i32* @TCSBRK
%11 = call i32 @ioctl(i32 %9, i32 %10, i32 0)
store i32 %11, i32* %3
br label %15
12: ; preds = %2
%13 = load i32, i32* @EINVAL
%14 = call i32 @__set_errno(i32 %13)
store i32 -1, i32* %3
br label %15
15: ; preds = %12, %8
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@TCSBRK = global i32 0
@EINVAL = global i32 0
define i32 @tcsendbreak(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i32, i32* @TCSBRK
%6 = tail call i32 @ioctl(i32 %0, i32 %5, i32 0)
br label %10
7: ; preds = %2
%8 = load i32, i32* @EINVAL
%9 = tail call i32 @__set_errno(i32 %8)
br label %10
10: ; preds = %7, %4
%11 = phi i32 [ %6, %4 ], [ -1, %7 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *aname) {
  fprintf(stderr, "usage: %s {--all | --t{0-4}}\n", aname);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"usage: %s {--all | --t{0-4}}\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"usage: %s {--all | --t{0-4}}\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
const char *_Locale_am_str(struct _Locale_time *ltime
                           __attribute__((__unused__))) {
  return "AM";
}


x86 assembly (clang, -O0):
<_Locale_am_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct._Locale_time = type opaque
@.str = [3 x i8] c"AM\00"
define i8* @_Locale_am_str(%struct._Locale_time* %0) {
%2 = alloca %struct._Locale_time*
store %struct._Locale_time* %0, %struct._Locale_time** %2
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct._Locale_time = type opaque
@.str = [3 x i8] c"AM\00"
define i8* @_Locale_am_str(%struct._Locale_time* nocapture readnone %0) {
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int do_send(int, char *);
int irc_time(int fd) { return do_send(fd, "TIME"); }


x86 assembly (clang, -O0):
<irc_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
call   1030 <do_send@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_time>:
lea    0xee9(%rip),%rsi
jmp    1030 <do_send@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"TIME\00"
define i32 @irc_time(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @do_send(i32 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [5 x i8] c"TIME\00"
define i32 @irc_time(i32 %0) {
%2 = tail call i32 @do_send(i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int func17();
int func18();
int func19() { return func17() + func18(); }


x86 assembly (clang, -O0):
<func19>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <func17@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <func18@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func19>:
push   %rbx
xor    %eax,%eax
call   1030 <func17@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <func18@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @func19() {
%1 = call i32 (...) @func17()
%2 = call i32 (...) @func18()
%3 = add nsw i32 %1, %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @func19() {
%1 = tail call i32 (...) @func17()
%2 = tail call i32 (...) @func18()
%3 = add nsw i32 %2, %1
ret i32 %3
}
int abs(int x) {
  if (x > 0) {
    return x;
  } else {
    return (0 - x);
  }
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    111c <abs+0x1c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <abs+0x24>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int timerE_get();
void udelay(unsigned long usec) {
  unsigned long base = timerE_get();
  while ((((timerE_get() << 8) - (base << 8)) >> 8) < usec)
    ;
}


x86 assembly (clang, -O0):
<udelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <timerE_get@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <timerE_get@plt>
shl    $0x8,%eax
cltq
mov    -0x10(%rbp),%rcx
shl    $0x8,%rcx
sub    %rcx,%rax
shr    $0x8,%rax
cmp    -0x8(%rbp),%rax
jae    1153 <udelay+0x43>
jmp    1129 <udelay+0x19>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<udelay>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <timerE_get@plt>
movslq %eax,%rbx
shl    $0x8,%rbx
neg    %rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <timerE_get@plt>
shl    $0x8,%eax
cltq
add    %rbx,%rax
shr    $0x8,%rax
cmp    %r14,%rax
jb     1130 <udelay+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @udelay(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = call i32 (...) @timerE_get()
%5 = sext i32 %4 to i64
store i64 %5, i64* %3
br label %6
6: ; preds = %16, %1
%7 = call i32 (...) @timerE_get()
%8 = shl i32 %7, 8
%9 = sext i32 %8 to i64
%10 = load i64, i64* %3
%11 = shl i64 %10, 8
%12 = sub i64 %9, %11
%13 = lshr i64 %12, 8
%14 = load i64, i64* %2
%15 = icmp ult i64 %13, %14
br i1 %15, label %16, label %17
16: ; preds = %6
br label %6
17: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @udelay(i64 %0) {
%2 = tail call i32 (...) @timerE_get()
%3 = sext i32 %2 to i64
%4 = mul nsw i64 %3, -256
br label %5
5: ; preds = %5, %1
%6 = tail call i32 (...) @timerE_get()
%7 = shl i32 %6, 8
%8 = sext i32 %7 to i64
%9 = add nsw i64 %4, %8
%10 = lshr exact i64 %9, 8
%11 = icmp ult i64 %10, %0
br i1 %11, label %5, label %12
12: ; preds = %5
ret void
}
void g_hash_table_foreach() {}


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

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

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

LLVM IR (-O2):
define void @g_hash_table_foreach() {
ret void
}
int dotelnet(argc, argv)
int argc;
char *argv[];
{
  struct telnet *tn;
  tn = dotelnet_subr(argc, argv, 0);
  if (tn)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<dotelnet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <dotelnet_subr@plt>
cltq
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114c <dotelnet+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1153 <dotelnet+0x43>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dotelnet>:
push   %rax
xor    %edx,%edx
xor    %eax,%eax
call   1030 <dotelnet_subr@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.telnet = type opaque
define i32 @dotelnet(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.telnet*
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 (i32, i8**, i32, ...) bitcast (i32 (...)* @dotelnet_subr to i32 (i32, i8**, i32, ...)*)(i32 %7, i8** %8, i32 0)
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to %struct.telnet*
store %struct.telnet* %11, %struct.telnet** %6
%12 = load %struct.telnet*, %struct.telnet** %6
%13 = icmp ne %struct.telnet* %12, null
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 0, i32* %3
br label %16
15: ; preds = %2
store i32 1, i32* %3
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @dotelnet(i32 %0, i8** %1) {
%3 = tail call i32 (i32, i8**, i32, ...) bitcast (i32 (...)* @dotelnet_subr to i32 (i32, i8**, i32, ...)*)(i32 %0, i8** %1, i32 0)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void SDCard_EnableRxInt(void) {}


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

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

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

LLVM IR (-O2):
define void @SDCard_EnableRxInt() {
ret void
}
foo(a, b, c, d, e, f, g, h, i) { return foo() + i; }


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

x86 assembly (clang, -O2):
<foo>:
jmp    1100 <foo>

LLVM IR (-O0):
define i32 @foo(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8) {
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
store i32 %0, i32* %10
store i32 %1, i32* %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store i32 %7, i32* %17
store i32 %8, i32* %18
%19 = call i32 (...) bitcast (i32 (i32, i32, i32, i32, i32, i32, i32, i32, i32)* @foo to i32 (...)*)()
%20 = load i32, i32* %18
%21 = add nsw i32 %19, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8) {
br label %10
10: ; preds = %10, %9
br label %10
}
/* Type definitions */
struct tempered_device_list {
  int dummy;
};

/* Variables and functions */
struct tempered_device_list *temper_type_enumerate(char **);
struct tempered_device_list *tempered_enumerate(char **error) {
  return temper_type_enumerate(error);
}


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

x86 assembly (clang, -O2):
<tempered_enumerate>:
jmp    1030 <temper_type_enumerate@plt>

LLVM IR (-O0):
%struct.tempered_device_list = type { i32 }
define %struct.tempered_device_list* @tempered_enumerate(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = call %struct.tempered_device_list* @temper_type_enumerate(i8** %3)
ret %struct.tempered_device_list* %4
}

LLVM IR (-O2):
%struct.tempered_device_list = type { i32 }
define %struct.tempered_device_list* @tempered_enumerate(i8** %0) {
%2 = tail call %struct.tempered_device_list* @temper_type_enumerate(i8** %0)
ret %struct.tempered_device_list* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long);
void print_array(unsigned long *a, int b) {
  int c;
  for (c = 0; c < b; c++)
    printf("%lu\n", a[c]);
}


x86 assembly (clang, -O0):
<print_array>:
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    1158 <print_array+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_array+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <print_array+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_array+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\0A\00"
define void @print_array(i64* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i64, i64* %0, i64 %7
%9 = load i64, i64* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
void bmi2_test() {
  unsigned i;
  unsigned long long a = 0xce7ace0ce7ace0;
  unsigned long long b = 0xface;
  unsigned __int128 res, res_ref;
  for (i = 0; i < 5; ++i) {
    a = a * (i + 1);
    b = b / (i + 1);
    res_ref = calc_mul_u64(a, b);
    res = (unsigned __int128)a * b;
    if (res != res_ref)
      abort();
  }
}


x86 assembly (clang, -O0):
<bmi2_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movabs $0xce7ace0ce7ace0,%rax
mov    %rax,-0x10(%rbp)
movq   $0xface,-0x18(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jae    11e7 <bmi2_test+0xc7>
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
xor    %edx,%edx
mov    %edx,-0x44(%rbp)
div    %rcx
mov    %rax,%rcx
mov    -0x44(%rbp),%eax
mov    %rcx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <calc_mul_u64@plt>
movslq %eax,%rcx
mov    %rcx,%rax
sar    $0x3f,%rax
mov    %rcx,-0x40(%rbp)
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mul    %rcx
mov    %rdx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
movaps -0x30(%rbp),%xmm0
movaps -0x40(%rbp),%xmm1
pcmpeqb %xmm1,%xmm0
pmovmskb %xmm0,%eax
sub    $0xffff,%eax
je     11d4 <bmi2_test+0xb4>
jmp    11cf <bmi2_test+0xaf>
call   1030 <abort@plt>
jmp    11d9 <bmi2_test+0xb9>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1145 <bmi2_test+0x25>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmi2_test>:
push   %rax
movabs $0xce7ace0ce7ace0,%rdi
mov    $0xface,%esi
xor    %eax,%eax
call   1040 <calc_mul_u64@plt>
call   1030 <abort@plt>

LLVM IR (-O0):
define void @bmi2_test() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i128
%5 = alloca i128
store i64 58118870600756448, i64* %2
store i64 64206, i64* %3
store i32 0, i32* %1
br label %6
6: ; preds = %34, %0
%7 = load i32, i32* %1
%8 = icmp ult i32 %7, 5
br i1 %8, label %9, label %37
9: ; preds = %6
%10 = load i64, i64* %2
%11 = load i32, i32* %1
%12 = add i32 %11, 1
%13 = zext i32 %12 to i64
%14 = mul i64 %10, %13
store i64 %14, i64* %2
%15 = load i64, i64* %3
%16 = load i32, i32* %1
%17 = add i32 %16, 1
%18 = zext i32 %17 to i64
%19 = udiv i64 %15, %18
store i64 %19, i64* %3
%20 = load i64, i64* %2
%21 = load i64, i64* %3
%22 = call i32 (i64, i64, ...) bitcast (i32 (...)* @calc_mul_u64 to i32 (i64, i64, ...)*)(i64 %20, i64 %21)
%23 = sext i32 %22 to i128
store i128 %23, i128* %5
%24 = load i64, i64* %2
%25 = zext i64 %24 to i128
%26 = load i64, i64* %3
%27 = zext i64 %26 to i128
%28 = mul i128 %25, %27
store i128 %28, i128* %4
%29 = load i128, i128* %4
%30 = load i128, i128* %5
%31 = icmp ne i128 %29, %30
br i1 %31, label %32, label %33
32: ; preds = %9
unreachable
33: ; preds = %9
br label %34
34: ; preds = %33
%35 = load i32, i32* %1
%36 = add i32 %35, 1
store i32 %36, i32* %1
br label %6
37: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @bmi2_test() {
%1 = tail call i32 (i64, i64, ...) bitcast (i32 (...)* @calc_mul_u64 to i32 (i64, i64, ...)*)(i64 58118870600756448, i64 64206)
tail call void @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ pop();
int /*<<< orphan*/ vid_writef(char *, int /*<<< orphan*/);
void logascii_handler(void) { vid_writef("%c", pop()); }


x86 assembly (clang, -O0):
<logascii_handler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <pop@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1040 <vid_writef@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<logascii_handler>:
push   %rax
xor    %eax,%eax
call   1030 <pop@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <vid_writef@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @logascii_handler() {
%1 = tail call i32 (...) @pop()
%2 = tail call i32 @vid_writef(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LED_BLINK_EN_RestoreConfig();
void LED_BLINK_EN_Wakeup(void) { LED_BLINK_EN_RestoreConfig(); }


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

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

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

LLVM IR (-O2):
define void @LED_BLINK_EN_Wakeup() {
%1 = tail call i32 (...) @LED_BLINK_EN_RestoreConfig()
ret void
}
/* Variables and functions */
char *malloc(size_t);
char *memcpy(char *, char const *, size_t);
char *mystrndup(const char *src, size_t len) {
  char *r = malloc(len + 1);
  r[len] = 0;
  return memcpy(r, src, len);
}


x86 assembly (clang, -O0):
<mystrndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrndup>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0x1(%rsi),%rdi
call   1040 <malloc@plt>
movb   $0x0,(%rax,%rbx,1)
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define i8* @mystrndup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = add i64 %6, 1
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i64, i64* %4
%11 = getelementptr inbounds i8, i8* %9, i64 %10
store i8 0, i8* %11
%12 = load i8*, i8** %5
%13 = load i8*, i8** %3
%14 = load i64, i64* %4
%15 = call i8* @memcpy(i8* %12, i8* %13, i64 %14)
ret i8* %15
}

LLVM IR (-O2):
define noalias i8* @mystrndup(i8* nocapture %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = getelementptr inbounds i8, i8* %4, i64 %1
store i8 0, i8* %5
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %4, i8* align 1 %0, i64 %1, i1 false)
ret i8* %4
}
int conditional(int x, int y, int z) {
  int notx = ((!x) << 31) >> 31;
  int ret = (~notx & y) | ((notx)&z);
  return ret;
}


x86 assembly (clang, -O0):
<conditional>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
shl    $0x1f,%eax
sar    $0x1f,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    $0xffffffff,%eax
and    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<conditional>:
mov    %esi,%eax
test   %edi,%edi
cmove  %edx,%eax
ret

LLVM IR (-O0):
define i32 @conditional(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
%13 = shl i32 %12, 31
%14 = ashr i32 %13, 31
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = xor i32 %15, -1
%17 = load i32, i32* %5
%18 = and i32 %16, %17
%19 = load i32, i32* %7
%20 = load i32, i32* %6
%21 = and i32 %19, %20
%22 = or i32 %18, %21
store i32 %22, i32* %8
%23 = load i32, i32* %8
ret i32 %23
}

LLVM IR (-O2):
define i32 @conditional(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i32 %2, i32 %1
ret i32 %5
}