xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printidstring(char *);
int main(void) {
  printidstring(("Hello World!\n"));
  printidstring(("0123456789abcdef"
                 "0123456789abcdef"
                 "0123456789abcdef"
                 "0123456789abcdef"
                 "0123456789abcdef"
                 "0123456789abcdef"
                 "0123456789abcdef"
                 "0123456789abcdef"
                 "0123456789abcdef"
                 "0123456789abcdef"
                 "0123456789abcdef"
                 "0123456789abcdef"
                 "\n"
                 "\n"
                 "0123456789abcdef"
                 "0123456789abcdef"
                 "0123456789abcdef"
                 "0123456789abcdef"
                 "\n"));
  printidstring(("Hello World!\n"));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printidstring@plt>
lea    0xee7(%rip),%rdi
call   1030 <printidstring@plt>
mov    %rbx,%rdi
call   1030 <printidstring@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
@.str.1 = [260 x i8] c"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\0A\0A0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printidstring(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printidstring(i8* getelementptr inbounds ([260 x i8], [260 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printidstring(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello World!\0A\00"
@.str.1 = [260 x i8] c"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\0A\0A0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\0A\00"
define i32 @main() {
%1 = tail call i32 @printidstring(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printidstring(i8* getelementptr inbounds ([260 x i8], [260 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printidstring(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int check_arg_count(int, int /*<<< orphan*/);
int /*<<< orphan*/ echo();
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_return(int /*<<< orphan*/);
void cmd_echo(int nargs, char **args) {
  if (check_arg_count(nargs, 0) == 1)
    return;
  report_count(1);
  report_return(echo());
}


x86 assembly (clang, -O0):
<cmd_echo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1050 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1167 <cmd_echo+0x27>
jmp    117f <cmd_echo+0x3f>
mov    $0x1,%edi
call   1060 <report_count@plt>
mov    $0x0,%al
call   1030 <echo@plt>
mov    %eax,%edi
call   1040 <report_return@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_echo>:
push   %rax
xor    %esi,%esi
call   1050 <check_arg_count@plt>
cmp    $0x1,%eax
jne    114f <cmd_echo+0xf>
pop    %rax
ret
mov    $0x1,%edi
call   1060 <report_count@plt>
xor    %eax,%eax
call   1030 <echo@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <report_return@plt>

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

LLVM IR (-O2):
define void @cmd_echo(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 (...) @echo()
%8 = tail call i32 @report_return(i32 %7)
br label %9
9: ; preds = %2, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x4f() {
  Assert_real((ispunct(79) == 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_ispunct.c",
              400, ("ispunct should be 0 for O"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x4f>:
push   %rax
mov    $0x4f,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x190,%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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for O\00"
define void @t_ispunct_0x4f() {
%1 = call i64 @ispunct(i32 79)
%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 400, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for O\00"
define void @t_ispunct_0x4f() {
%1 = tail call i64 @ispunct(i32 79)
%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 400, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
char *readplainlabel(int /*<<< orphan*/ *);
char *readquotedlabel(int /*<<< orphan*/ *);
int /*<<< orphan*/ skipspace(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
char *readlabel(FILE *fp) {
  char *answer;
  int ch;
  skipspace(fp);
  ch = fgetc(fp);
  ungetc(ch, fp);
  if (ch == '\'')
    answer = readquotedlabel(fp);
  else
    answer = readplainlabel(fp);
  return answer;
}


x86 assembly (clang, -O0):
<readlabel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <skipspace@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1050 <ungetc@plt>
cmpl   $0x27,-0x14(%rbp)
jne    1199 <readlabel+0x49>
mov    -0x8(%rbp),%rdi
call   1040 <readquotedlabel@plt>
mov    %rax,-0x10(%rbp)
jmp    11a6 <readlabel+0x56>
mov    -0x8(%rbp),%rdi
call   1070 <readplainlabel@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readlabel>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1060 <skipspace@plt>
mov    %rbx,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
call   1050 <ungetc@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
cmp    $0x27,%ebp
jne    1182 <readlabel+0x32>
pop    %rbx
pop    %rbp
jmp    1040 <readquotedlabel@plt>
pop    %rbx
pop    %rbp
jmp    1070 <readplainlabel@plt>

LLVM IR (-O0):
define i8* @readlabel(i32* %0) {
%2 = alloca i32*
%3 = alloca i8*
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @skipspace(i32* %5)
%7 = load i32*, i32** %2
%8 = call i32 @fgetc(i32* %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = load i32*, i32** %2
%11 = call i32 @ungetc(i32 %9, i32* %10)
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 39
br i1 %13, label %14, label %17
14: ; preds = %1
%15 = load i32*, i32** %2
%16 = call i8* @readquotedlabel(i32* %15)
store i8* %16, i8** %3
br label %20
17: ; preds = %1
%18 = load i32*, i32** %2
%19 = call i8* @readplainlabel(i32* %18)
store i8* %19, i8** %3
br label %20
20: ; preds = %17, %14
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
define i8* @readlabel(i32* %0) {
%2 = tail call i32 @skipspace(i32* %0)
%3 = tail call i32 @fgetc(i32* %0)
%4 = tail call i32 @ungetc(i32 %3, i32* %0)
%5 = icmp eq i32 %3, 39
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i8* @readquotedlabel(i32* %0)
br label %10
8: ; preds = %1
%9 = tail call i8* @readplainlabel(i32* %0)
br label %10
10: ; preds = %8, %6
%11 = phi i8* [ %7, %6 ], [ %9, %8 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ IniAdj_lc898122();
int /*<<< orphan*/ IniClk_lc898122();
int /*<<< orphan*/ IniCmd_lc898122();
int /*<<< orphan*/ IniDgy_lc898122();
int /*<<< orphan*/ IniFil_lc898122();
int /*<<< orphan*/ IniGyr_lc898122();
int /*<<< orphan*/ IniIop_lc898122();
int /*<<< orphan*/ IniMon_lc898122();
int /*<<< orphan*/ IniSrv_lc898122();
void IniSet_lc898122(void) {
  IniCmd_lc898122();
  IniClk_lc898122();
  IniIop_lc898122();
  IniDgy_lc898122();
  IniMon_lc898122();
  IniSrv_lc898122();
  IniGyr_lc898122();
  IniFil_lc898122();
  IniAdj_lc898122();
}


x86 assembly (clang, -O0):
<IniSet_lc898122>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <IniCmd_lc898122@plt>
mov    $0x0,%al
call   10a0 <IniClk_lc898122@plt>
mov    $0x0,%al
call   1060 <IniIop_lc898122@plt>
mov    $0x0,%al
call   1040 <IniDgy_lc898122@plt>
mov    $0x0,%al
call   1030 <IniMon_lc898122@plt>
mov    $0x0,%al
call   1070 <IniSrv_lc898122@plt>
mov    $0x0,%al
call   1050 <IniGyr_lc898122@plt>
mov    $0x0,%al
call   10b0 <IniFil_lc898122@plt>
mov    $0x0,%al
call   1090 <IniAdj_lc898122@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IniSet_lc898122>:
push   %rax
xor    %eax,%eax
call   1080 <IniCmd_lc898122@plt>
xor    %eax,%eax
call   10a0 <IniClk_lc898122@plt>
xor    %eax,%eax
call   1060 <IniIop_lc898122@plt>
xor    %eax,%eax
call   1040 <IniDgy_lc898122@plt>
xor    %eax,%eax
call   1030 <IniMon_lc898122@plt>
xor    %eax,%eax
call   1070 <IniSrv_lc898122@plt>
xor    %eax,%eax
call   1050 <IniGyr_lc898122@plt>
xor    %eax,%eax
call   10b0 <IniFil_lc898122@plt>
xor    %eax,%eax
pop    %rcx
jmp    1090 <IniAdj_lc898122@plt>

LLVM IR (-O0):
define void @IniSet_lc898122() {
%1 = call i32 (...) @IniCmd_lc898122()
%2 = call i32 (...) @IniClk_lc898122()
%3 = call i32 (...) @IniIop_lc898122()
%4 = call i32 (...) @IniDgy_lc898122()
%5 = call i32 (...) @IniMon_lc898122()
%6 = call i32 (...) @IniSrv_lc898122()
%7 = call i32 (...) @IniGyr_lc898122()
%8 = call i32 (...) @IniFil_lc898122()
%9 = call i32 (...) @IniAdj_lc898122()
ret void
}

LLVM IR (-O2):
define void @IniSet_lc898122() {
%1 = tail call i32 (...) @IniCmd_lc898122()
%2 = tail call i32 (...) @IniClk_lc898122()
%3 = tail call i32 (...) @IniIop_lc898122()
%4 = tail call i32 (...) @IniDgy_lc898122()
%5 = tail call i32 (...) @IniMon_lc898122()
%6 = tail call i32 (...) @IniSrv_lc898122()
%7 = tail call i32 (...) @IniGyr_lc898122()
%8 = tail call i32 (...) @IniFil_lc898122()
%9 = tail call i32 (...) @IniAdj_lc898122()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rename(char const *, char const *);
int slate_RenameFile(const char *pathExisting, const char *pathNew) {
  return !rename(pathExisting, pathNew);
}


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

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

LLVM IR (-O0):
define i32 @slate_RenameFile(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @rename(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @slate_RenameFile(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @rename(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int syscall(int, char const *);
int acct(const char *filename) { return syscall(51, filename); }


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

x86 assembly (clang, -O2):
<acct>:
mov    %rdi,%rsi
mov    $0x33,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @acct(i8* %0) {
%2 = tail call i32 @syscall(i32 51, i8* %0)
ret i32 %2
}
/* Variables and functions */
int GetAnswer();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char *argv[]) { printf("%d\n", GetAnswer()); }


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

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

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

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

/* Variables and functions */
scalar_t__ run_inst(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void emulate(uint8_t memory[0x10000], uint8_t registers[16]) {
  while (run_inst(memory, registers)) {
  }
}


x86 assembly (clang, -O0):
<emulate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <run_inst@plt>
cmp    $0x0,%rax
je     113c <emulate+0x2c>
jmp    1120 <emulate+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emulate>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <run_inst@plt>
test   %rax,%rax
jne    1120 <emulate+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @emulate(i32* %0, i32* %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i64 @run_inst(i32* %0, i32* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %3
6: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ left_trim_serial_number(char *, int);
int /*<<< orphan*/ right_trim_serial_number(char *, int);
void trim_serial_number(char *serial_number, int desired_digits,
                        bool trim_left) {
  if (trim_left)
    left_trim_serial_number(serial_number, desired_digits);
  else
    right_trim_serial_number(serial_number, desired_digits);
}


x86 assembly (clang, -O0):
<trim_serial_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     114d <trim_serial_number+0x2d>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <left_trim_serial_number@plt>
jmp    1159 <trim_serial_number+0x39>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <right_trim_serial_number@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim_serial_number>:
test   %edx,%edx
je     1129 <trim_serial_number+0x9>
jmp    1030 <left_trim_serial_number@plt>
jmp    1040 <right_trim_serial_number@plt>

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

LLVM IR (-O2):
define void @trim_serial_number(i8* %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @left_trim_serial_number(i8* %0, i32 %1)
br label %9
7: ; preds = %3
%8 = tail call i32 @right_trim_serial_number(i8* %0, i32 %1)
br label %9
9: ; preds = %7, %5
ret void
}
/* Type definitions */
struct rect {
  int dummy;
};

/* Variables and functions */
int cmp(struct rect *, struct rect *);
int compare(const void *rect1, const void *rect2) {
  return (cmp((struct rect *)rect1, (struct rect *)rect2));
}


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

x86 assembly (clang, -O2):
<compare>:
jmp    1030 <cmp@plt>

LLVM IR (-O0):
%struct.rect = type { i32 }
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to %struct.rect*
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to %struct.rect*
%9 = call i32 @cmp(%struct.rect* %6, %struct.rect* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.rect = type { i32 }
define i32 @compare(i8* %0, i8* %1) {
%3 = bitcast i8* %0 to %struct.rect*
%4 = bitcast i8* %1 to %struct.rect*
%5 = tail call i32 @cmp(%struct.rect* %3, %struct.rect* %4)
ret i32 %5
}
int fcntl(int fd, int cmd, ...) {
  puts("# ");
  puts(__FUNCTION__);
  puts("()\n");
  delay(100000000);
  (void)(fd);
  (void)(cmd);
  return -1;
}


x86 assembly (clang, -O0):
<fcntl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xecb(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x9(%rbp)
call   1030 <puts@plt>
mov    -0x9(%rbp),%al
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
mov    -0x9(%rbp),%al
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
mov    -0x9(%rbp),%al
mov    $0x5f5e100,%edi
call   1040 <delay@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcntl>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
mov    $0x5f5e100,%edi
xor    %eax,%eax
call   1040 <delay@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"# \00"
@__FUNCTION__.fcntl = [6 x i8] c"fcntl\00"
@.str.1 = [4 x i8] c"()\0A\00"
define i32 @fcntl(i32 %0, i32 %1, ...) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__FUNCTION__.fcntl, i64 0, i64 0))
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (i32, ...) bitcast (i32 (...)* @delay to i32 (i32, ...)*)(i32 100000000)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
ret i32 -1
}

LLVM IR (-O2):
@.str = [3 x i8] c"# \00"
@__FUNCTION__.fcntl = [6 x i8] c"fcntl\00"
@.str.1 = [4 x i8] c"()\0A\00"
define i32 @fcntl(i32 %0, i32 %1, ...) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__FUNCTION__.fcntl, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @delay to i32 (i32, ...)*)(i32 100000000)
ret i32 -1
}
/* Variables and functions */
unsigned int find_symbol(char *);
int /*<<< orphan*/ sprintf(char *, char *, int, int);
unsigned int get_bank_function(int sbank, int dbank) {
  char name[32];
  sprintf(name, "__bank_%d_%d", sbank, dbank);
  return find_symbol(name);
}


x86 assembly (clang, -O0):
<get_bank_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xec1(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x30(%rbp),%rdi
call   1030 <find_symbol@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bank_function>:
push   %rbx
sub    $0x20,%rsp
mov    %esi,%ecx
mov    %edi,%edx
lea    0xed0(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <find_symbol@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"__bank_%d_%d\00"
define i32 @get_bank_function(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [32 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%11 = call i32 @find_symbol(i8* %10)
ret i32 %11
}

LLVM IR (-O2):
@.str = [13 x i8] c"__bank_%d_%d\00"
define i32 @get_bank_function(i32 %0, i32 %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%6 = call i32 @find_symbol(i8* %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ test(int *);
int main() {
  int i = 1;
  test(&i);
  if (i)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <test@plt>
cmpl   $0x0,-0x8(%rbp)
je     1150 <main+0x30>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <test@plt>
cmpl   $0x0,0x4(%rsp)
jne    113e <main+0x1e>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%3 = call i32 @test(i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
ret i32 0
}
__attribute__((always_)) void native_irq_enable(void) {
  asm volatile("sti" : : : "memory");
}


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

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

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

LLVM IR (-O2):
define void @native_irq_enable() {
tail call void asm sideeffect "sti", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
int climate_celcius_to_fahrenheit(int celcius) {
  return (celcius * 29) / 16 + 32;
}


x86 assembly (clang, -O0):
<climate_celcius_to_fahrenheit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x1d,-0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
add    $0x20,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<climate_celcius_to_fahrenheit>:
lea    (%rdi,%rdi,8),%eax
lea    (%rax,%rax,2),%ecx
add    %edi,%ecx
lea    (%rdi,%rcx,1),%eax
add    $0xf,%eax
mov    %edi,%edx
add    %ecx,%edx
cmovns %edx,%eax
sar    $0x4,%eax
add    $0x20,%eax
ret

LLVM IR (-O0):
define i32 @climate_celcius_to_fahrenheit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 29
%5 = sdiv i32 %4, 16
%6 = add nsw i32 %5, 32
ret i32 %6
}

LLVM IR (-O2):
define i32 @climate_celcius_to_fahrenheit(i32 %0) {
%2 = mul nsw i32 %0, 29
%3 = sdiv i32 %2, 16
%4 = add nsw i32 %3, 32
ret i32 %4
}
/* Variables and functions */
int getBit(unsigned int *, int);
int /*<<< orphan*/ printf(char *, ...);
void printBitSequence(unsigned int *bitseq) {
  int i;
  for (i = 0; i < 32; i++) {
    int bit = getBit(bitseq, i);
    printf("%d", bit);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printBitSequence>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    116b <printBitSequence+0x4b>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <getBit@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <printBitSequence+0x13>
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printBitSequence>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xec2(%rip),%r14
xor    %ebp,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <getBit@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    $0x20,%ebp
jne    1140 <printBitSequence+0x10>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @printBitSequence(i32* %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 0, %1 ], [ %6, %2 ]
%4 = tail call i32 @getBit(i32* %0, i32 %3)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = add nuw nsw i32 %3, 1
%7 = icmp eq i32 %6, 32
br i1 %7, label %8, label %2
8: ; preds = %2
%9 = tail call i32 @putchar(i32 10)
ret void
}
void path_012_expected_5(int a, int b) {
  switch (a) {
  case 0:
    return;
  case 1:
    break;
  }
  if (b) {
  }
}


x86 assembly (clang, -O0):
<path_012_expected_5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     112e <path_012_expected_5+0x2e>
jmp    111d <path_012_expected_5+0x1d>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
je     1133 <path_012_expected_5+0x33>
jmp    1138 <path_012_expected_5+0x38>
jmp    1147 <path_012_expected_5+0x47>
jmp    1138 <path_012_expected_5+0x38>
cmpl   $0x0,-0x8(%rbp)
je     1147 <path_012_expected_5+0x47>
jmp    1147 <path_012_expected_5+0x47>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @path_012_expected_5(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
switch i32 %5, label %8 [
i32 0, label %6
i32 1, label %7
]
6: ; preds = %2
br label %12
7: ; preds = %2
br label %8
8: ; preds = %2, %7
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8
br label %12
12: ; preds = %6, %11, %8
ret void
}

LLVM IR (-O2):
define void @path_012_expected_5(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
int exists(const char *filename) {
  struct stat buf;
  return stat(filename, &buf) == 0;
}


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

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

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @exists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @exists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct mls_conf {
  int dummy;
};

/* Variables and functions */
char *mls_conf_get(struct mls_conf *, char *);
int /*<<< orphan*/ sprintf(char *, char *, unsigned char);
char *mls_type_data_get_str(struct mls_conf *storage, unsigned char epc) {
  char key[2 + 1];
  char *data;
  sprintf(key, "%02X", epc);
  data = mls_conf_get(storage, key);
  return data;
}


x86 assembly (clang, -O0):
<mls_type_data_get_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
lea    -0xc(%rbp),%rdi
lea    0xec3(%rip),%rsi
movzbl -0x9(%rbp),%edx
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <mls_conf_get@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mls_type_data_get_str>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%edx
mov    %rdi,%rbx
lea    0xed0(%rip),%rsi
lea    0x5(%rsp),%r14
mov    %r14,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <mls_conf_get@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.mls_conf = type { i32 }
@.str = [5 x i8] c"%02X\00"
define i8* @mls_type_data_get_str(%struct.mls_conf* %0, i8 zeroext %1) {
%3 = alloca %struct.mls_conf*
%4 = alloca i8
%5 = alloca [3 x i8]
%6 = alloca i8*
store %struct.mls_conf* %0, %struct.mls_conf** %3
store i8 %1, i8* %4
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%8 = load i8, i8* %4
%9 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %8)
%10 = load %struct.mls_conf*, %struct.mls_conf** %3
%11 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%12 = call i8* @mls_conf_get(%struct.mls_conf* %10, i8* %11)
store i8* %12, i8** %6
%13 = load i8*, i8** %6
ret i8* %13
}

LLVM IR (-O2):
%struct.mls_conf = type { i32 }
@.str = [5 x i8] c"%02X\00"
define i8* @mls_type_data_get_str(%struct.mls_conf* %0, i8 zeroext %1) {
%3 = alloca [3 x i8]
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %1)
%6 = call i8* @mls_conf_get(%struct.mls_conf* %0, i8* %4)
ret i8* %6
}
__attribute__((always_)) int __ffsll(long long value) {
  long long lsb_minus_one;
  if (value) {
    __asm__("bsfq %1, %0" : "=r"(lsb_minus_one) : "rm"(value));
    return (lsb_minus_one + 1);
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<__ffsll>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1134 <__ffsll+0x34>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
bsf    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %eax,-0x4(%rbp)
jmp    113b <__ffsll+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ffsll>:
test   %rdi,%rdi
je     1114 <__ffsll+0x14>
mov    %rdi,-0x8(%rsp)
bsf    -0x8(%rsp),%rax
add    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @__ffsll(i64 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i64, i64* %3
%9 = call i64 asm "bsfq $1, $0", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i64 %8)
store i64 %9, i64* %4
%10 = load i64, i64* %4
%11 = add nsw i64 %10, 1
%12 = trunc i64 %11 to i32
store i32 %12, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @__ffsll(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 asm "bsfq $1, $0", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i64 %0)
%5 = trunc i64 %4 to i32
%6 = add i32 %5, 1
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ ntoh64(int /*<<< orphan*/);
uint64_t bytes_to_h64(char *bytes) {
  uint64_t result = *(uint64_t *)bytes;
  return ntoh64(result);
}


x86 assembly (clang, -O0):
<bytes_to_h64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <ntoh64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytes_to_h64>:
mov    (%rdi),%edi
jmp    1030 <ntoh64@plt>

LLVM IR (-O0):
define i32 @bytes_to_h64(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @ntoh64(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @bytes_to_h64(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @ntoh64(i32 %3)
ret i32 %4
}
int arraySearch(int array[], int size, int needle) {
  int i;
  for (i = 0; i < size; i++) {
  }
}


x86 assembly (clang, -O0):
<arraySearch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1134 <arraySearch+0x34>
jmp    1126 <arraySearch+0x26>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <arraySearch+0x15>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @arraySearch(i32* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void I2SSampleStampEnable(uint32_t ui32Base) {
  ;
  (*((volatile unsigned long *)(0x40021000 + 0x00000034))) = 0x00000001;
}


x86 assembly (clang, -O0):
<I2SSampleStampEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x40021034,%eax
movq   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2SSampleStampEnable>:
movq   $0x1,0x40021034
ret

LLVM IR (-O0):
define void @I2SSampleStampEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
store volatile i64 1, i64* inttoptr (i64 1073877044 to i64*)
ret void
}

LLVM IR (-O2):
define void @I2SSampleStampEnable(i32 %0) {
store volatile i64 1, i64* inttoptr (i64 1073877044 to i64*)
ret void
}
/* Variables and functions */
scalar_t__ another_function();
int exported_function();
int test_cxxflags();
int main(void) {
  int result = 0;
  {
    int tmp = exported_function();
    tmp += another_function();
    if (tmp != 46)
      result = 1;
  }
  result = 1;
  result = 1;
  result = test_cxxflags();
  return result;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <exported_function@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <another_function@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
cmpl   $0x2e,-0xc(%rbp)
je     1175 <main+0x45>
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0x8(%rbp)
mov    $0x0,%al
call   1050 <test_cxxflags@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <exported_function@plt>
xor    %eax,%eax
call   1040 <another_function@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <test_cxxflags@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%4 = call i32 (...) @exported_function()
store i32 %4, i32* %3
%5 = call i64 (...) @another_function()
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = add nsw i64 %7, %5
%9 = trunc i64 %8 to i32
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = icmp ne i32 %10, 46
br i1 %11, label %12, label %13
12: ; preds = %0
store i32 1, i32* %2
br label %13
13: ; preds = %12, %0
store i32 1, i32* %2
store i32 1, i32* %2
%14 = call i32 (...) @test_cxxflags()
store i32 %14, i32* %2
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @exported_function()
%2 = tail call i64 (...) @another_function()
%3 = tail call i32 (...) @test_cxxflags()
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int foo();
int main(void) {
  if (foo() != 128)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
cmp    $0x80,%eax
je     1148 <main+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
cmp    $0x80,%eax
jne    1133 <main+0x13>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @foo()
%3 = icmp ne i32 %2, 128
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = icmp eq i32 %1, 128
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
char *strupr(a)
char *a;
{
  char *ret = a;
  while (*a != '\0') {
    if (islower((unsigned char)*a))
      *a = toupper((unsigned char)*a);
    ++a;
  }
  return ret;
}


x86 assembly (clang, -O0):
<strupr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     117e <strupr+0x5e>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <islower@plt>
cmp    $0x0,%eax
je     116d <strupr+0x4d>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1040 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1134 <strupr+0x14>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupr>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1165 <strupr+0x45>
lea    0x1(%r14),%rbx
jmp    114b <strupr+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1165 <strupr+0x45>
movzbl %al,%ebp
mov    %ebp,%edi
call   1030 <islower@plt>
test   %eax,%eax
je     1140 <strupr+0x20>
mov    %ebp,%edi
call   1040 <toupper@plt>
mov    %al,-0x1(%rbx)
jmp    1140 <strupr+0x20>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @strupr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %23, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %26
10: ; preds = %5
%11 = load i8*, i8** %2
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = call i32 @islower(i32 %13)
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %23
16: ; preds = %10
%17 = load i8*, i8** %2
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = call i32 @toupper(i32 %19)
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %2
store i8 %21, i8* %22
br label %23
23: ; preds = %16, %10
%24 = load i8*, i8** %2
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %2
br label %5
26: ; preds = %5
%27 = load i8*, i8** %3
ret i8* %27
}

LLVM IR (-O2):
define i8* @strupr(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %13
%5 = phi i8 [ %15, %13 ], [ %2, %1 ]
%6 = phi i8* [ %14, %13 ], [ %0, %1 ]
%7 = zext i8 %5 to i32
%8 = tail call i32 @islower(i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %4
%11 = tail call i32 @toupper(i32 %7)
%12 = trunc i32 %11 to i8
store i8 %12, i8* %6
br label %13
13: ; preds = %10, %4
%14 = getelementptr inbounds i8, i8* %6, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %13, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ kprintf(char *);
int sys_readlink(const char *pathname, char *buf, size_t bufsiz) {
  (void)pathname;
  (void)buf;
  (void)bufsiz;
  kprintf("unimplemented\n");
  return -1;
}


x86 assembly (clang, -O0):
<sys_readlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed5(%rip),%rdi
call   1030 <kprintf@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_readlink>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <kprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"unimplemented\0A\00"
define i32 @sys_readlink(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @kprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [15 x i8] c"unimplemented\0A\00"
define i32 @sys_readlink(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
%4 = tail call i32 @kprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int bell_percent;
};
typedef TYPE_1__ XKeyboardControl;

/* Variables and functions */
void set_XKeyboardControl_bell_percent(void *_p, int _v) {
  ((XKeyboardControl *)_p)->bell_percent = (int)_v;
}


x86 assembly (clang, -O0):
<set_XKeyboardControl_bell_percent>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XKeyboardControl_bell_percent>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XKeyboardControl_bell_percent(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XKeyboardControl_bell_percent(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ change_state(int /*<<< orphan*/, int, int /*<<< orphan*/);
int /*<<< orphan*/ force_exit();
void score_state_handle_input(int input) {
  if (input == ('q'))
    force_exit();
  if (input == ('\n'))
    change_state((0), (1), (0));
}


x86 assembly (clang, -O0):
<score_state_handle_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x71,-0x4(%rbp)
jne    113c <score_state_handle_input+0x1c>
mov    $0x0,%al
call   1040 <force_exit@plt>
cmpl   $0xa,-0x4(%rbp)
jne    1154 <score_state_handle_input+0x34>
xor    %edx,%edx
mov    $0x1,%esi
mov    %edx,%edi
call   1030 <change_state@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<score_state_handle_input>:
cmp    $0xa,%edi
je     1131 <score_state_handle_input+0x11>
cmp    $0x71,%edi
jne    113f <score_state_handle_input+0x1f>
xor    %eax,%eax
jmp    1040 <force_exit@plt>
xor    %edi,%edi
mov    $0x1,%esi
xor    %edx,%edx
jmp    1030 <change_state@plt>
ret

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

LLVM IR (-O2):
define void @score_state_handle_input(i32 %0) {
switch i32 %0, label %6 [
i32 113, label %2
i32 10, label %4
]
2: ; preds = %1
%3 = tail call i32 (...) @force_exit()
br label %6
4: ; preds = %1
%5 = tail call i32 @change_state(i32 0, i32 1, i32 0)
br label %6
6: ; preds = %2, %1, %4
ret void
}