xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ anagram_r(char *, char **, int /*<<< orphan*/, int, int,
                             int *);
char **calloc(int, int);
int factorial(int);
int strlen(char *);
char **anagram(char *s) {
  int length = strlen(s);
  int size = factorial(length);
  char **retVal = calloc(size + 1, sizeof(char **));
  int count = 0;
  anagram_r(s, retVal, 0, size, length, &count);
  return retVal;
}


x86 assembly (clang, -O0):
<anagram>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <factorial@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
add    $0x1,%edi
mov    $0x8,%esi
call   1050 <calloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%r8d
xor    %edx,%edx
lea    -0x1c(%rbp),%r9
call   1060 <anagram_r@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<anagram>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %eax,%r15d
mov    %eax,%edi
call   1030 <factorial@plt>
mov    %eax,%ebx
lea    0x1(%rbx),%edi
mov    $0x8,%esi
call   1050 <calloc@plt>
mov    %rax,%rbp
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%r9
mov    %r14,%rdi
mov    %rax,%rsi
xor    %edx,%edx
mov    %ebx,%ecx
mov    %r15d,%r8d
call   1060 <anagram_r@plt>
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8** @anagram(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i8* %0, i8** %2
%7 = load i8*, i8** %2
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @factorial(i32 %9)
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
%13 = call i8** @calloc(i32 %12, i32 8)
store i8** %13, i8*** %5
store i32 0, i32* %6
%14 = load i8*, i8** %2
%15 = load i8**, i8*** %5
%16 = load i32, i32* %4
%17 = load i32, i32* %3
%18 = call i32 @anagram_r(i8* %14, i8** %15, i32 0, i32 %16, i32 %17, i32* %6)
%19 = load i8**, i8*** %5
ret i8** %19
}

LLVM IR (-O2):
define i8** @anagram(i8* %0) {
%2 = alloca i32
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @factorial(i32 %3)
%5 = add nsw i32 %4, 1
%6 = tail call i8** @calloc(i32 %5, i32 8)
%7 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%8 = call i32 @anagram_r(i8* %0, i8** %6, i32 0, i32 %4, i32 %3, i32* %2)
ret i8** %6
}
/* Variables and functions */
int /*<<< orphan*/ TCFLSH;
int ioctl(int, int /*<<< orphan*/, int *);
int tcflush(int fd, int queue_selector) {
  return (ioctl(fd, TCFLSH, &queue_selector));
}


x86 assembly (clang, -O0):
<tcflush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcflush>:
push   %rax
mov    %esi,0x4(%rsp)
mov    0x2ec4(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
pop    %rcx
ret

LLVM IR (-O0):
@TCFLSH = global i32 0
define i32 @tcflush(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* @TCFLSH
%7 = call i32 @ioctl(i32 %5, i32 %6, i32* %4)
ret i32 %7
}

LLVM IR (-O2):
@TCFLSH = global i32 0
define i32 @tcflush(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = load i32, i32* @TCFLSH
%5 = call i32 @ioctl(i32 %0, i32 %4, i32* %3)
ret i32 %5
}
unsigned int x86_readtscp(void) {
  unsigned int tscp;
  __asm__ __volatile__("rdtscp\n\t" : "=a"(tscp) :);
  return tscp;
}


x86 assembly (clang, -O0):
<x86_readtscp>:
push   %rbp
mov    %rsp,%rbp
rdtscp
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @x86_readtscp() {
%1 = alloca i32
%2 = call i32 asm sideeffect "rdtscp\0A\09", "={ax},~{dirflag},~{fpsr},~{flags}"()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @x86_readtscp() {
%1 = tail call i32 asm sideeffect "rdtscp\0A\09", "={ax},~{dirflag},~{fpsr},~{flags}"()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void __afl_manual_init(void) { printf("manual_init\n"); }


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"manual_init\00"
define void @__afl_manual_init() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void cooked_stdin(void) { system("/bin/stty cooked echo"); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"/bin/stty cooked echo\00"
define void @cooked_stdin() {
%1 = call i32 @system(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"/bin/stty cooked echo\00"
define void @cooked_stdin() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Print(char *);
int /*<<< orphan*/ nap(int);
void nogold(void) {
  Print("You don't have enough gold to pay for that!");
  nap(2200);
}


x86 assembly (clang, -O0):
<nogold>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <Print@plt>
mov    $0x898,%edi
call   1030 <nap@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nogold>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <Print@plt>
mov    $0x898,%edi
pop    %rax
jmp    1030 <nap@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"You don't have enough gold to pay for that!\00"
define void @nogold() {
%1 = call i32 @Print(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @nap(i32 2200)
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"You don't have enough gold to pay for that!\00"
define void @nogold() {
%1 = tail call i32 @Print(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @nap(i32 2200)
ret void
}
int main() {
  float x;
  float y;
  float z;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int recv_byte();
int /*<<< orphan*/ send_byte(int);
uint8_t debug_instr_2(uint8_t in0, uint8_t in1) {
  send_byte(0x56);
  send_byte(in0);
  send_byte(in1);
  return recv_byte();
}


x86 assembly (clang, -O0):
<debug_instr_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x56,%edi
call   1040 <send_byte@plt>
mov    -0x4(%rbp),%edi
call   1040 <send_byte@plt>
mov    -0x8(%rbp),%edi
call   1040 <send_byte@plt>
mov    $0x0,%al
call   1030 <recv_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_instr_2>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x56,%edi
call   1040 <send_byte@plt>
mov    %ebp,%edi
call   1040 <send_byte@plt>
mov    %ebx,%edi
call   1040 <send_byte@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <recv_byte@plt>

LLVM IR (-O0):
define i32 @debug_instr_2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @send_byte(i32 86)
%6 = load i32, i32* %3
%7 = call i32 @send_byte(i32 %6)
%8 = load i32, i32* %4
%9 = call i32 @send_byte(i32 %8)
%10 = call i32 (...) @recv_byte()
ret i32 %10
}

LLVM IR (-O2):
define i32 @debug_instr_2(i32 %0, i32 %1) {
%3 = tail call i32 @send_byte(i32 86)
%4 = tail call i32 @send_byte(i32 %0)
%5 = tail call i32 @send_byte(i32 %1)
%6 = tail call i32 (...) @recv_byte()
ret i32 %6
}
long kernel__Int__hash(long self) {
  long var;
  var = self;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


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

x86 assembly (clang, -O2):
<kernel__Int__hash>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @kernel__Int__hash(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
store i64 %4, i64* %3
br label %5
5: ; preds = %1
%6 = load i64, i64* %3
ret i64 %6
}

LLVM IR (-O2):
define i64 @kernel__Int__hash(i64 returned %0) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ AT_FDCWD;
int EXIT_FAILURE;
int EXIT_SUCCESS;
scalar_t__ fchmodat(int /*<<< orphan*/, char *, int, int /*<<< orphan*/);
int main(void) {
  if (0 > fchmodat(AT_FDCWD, "arnold.layne", 0000, 0))
    return EXIT_FAILURE;
  else
    return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <fchmodat@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jle    1157 <main+0x47>
mov    0x2e93(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <main+0x53>
mov    0x2e7a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <fchmodat@plt>
test   %rax,%rax
jns    1138 <main+0x28>
mov    0x2eaa(%rip),%rax
jmp    113f <main+0x2f>
mov    0x2e99(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@AT_FDCWD = global i32 0
@.str = [13 x i8] c"arnold.layne\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @AT_FDCWD
%3 = call i64 @fchmodat(i32 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
%4 = icmp sgt i64 0, %3
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = load i32, i32* @EXIT_FAILURE
store i32 %6, i32* %1
br label %9
7: ; preds = %0
%8 = load i32, i32* @EXIT_SUCCESS
store i32 %8, i32* %1
br label %9
9: ; preds = %7, %5
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@AT_FDCWD = global i32 0
@.str = [13 x i8] c"arnold.layne\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = load i32, i32* @AT_FDCWD
%2 = tail call i64 @fchmodat(i32 %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
%3 = icmp slt i64 %2, 0
%4 = load i32, i32* @EXIT_FAILURE
%5 = load i32, i32* @EXIT_SUCCESS
%6 = select i1 %3, i32 %4, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ teardown();
void judge_sys_return(int ret, const char *sys_func) {
  if (ret < 0) {
    perror(sys_func);
    teardown();
    exit(1);
  } else
    return;
}


x86 assembly (clang, -O0):
<judge_sys_return>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1163 <judge_sys_return+0x33>
mov    -0x10(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x0,%al
call   1050 <teardown@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<judge_sys_return>:
test   %edi,%edi
js     1135 <judge_sys_return+0x5>
ret
push   %rax
mov    %rsi,%rdi
call   1030 <perror@plt>
xor    %eax,%eax
call   1050 <teardown@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @judge_sys_return(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 = icmp slt i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @perror(i8* %8)
%10 = call i32 (...) @teardown()
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @judge_sys_return(i32 %0, i8* nocapture %1) {
%3 = icmp slt i32 %0, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = tail call i32 @perror(i8* %1)
%6 = tail call i32 (...) @teardown()
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OutputPower(unsigned char, char);
void SetPower(unsigned char Outputs, char Power) {
  OutputPower(Outputs, Power);
}


x86 assembly (clang, -O0):
<SetPower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
movzbl %al,%edi
movsbl -0x2(%rbp),%esi
call   1030 <OutputPower@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetPower>:
jmp    1030 <OutputPower@plt>

LLVM IR (-O0):
define void @SetPower(i8 zeroext %0, i8 signext %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 @OutputPower(i8 zeroext %5, i8 signext %6)
ret void
}

LLVM IR (-O2):
define void @SetPower(i8 zeroext %0, i8 signext %1) {
%3 = tail call i32 @OutputPower(i8 zeroext %0, i8 signext %1)
ret void
}
/* Variables and functions */
int libset_write_script(char *);
int /*<<< orphan*/ session_file_make_path(char *, char *);
int write_settings_file(char *fullname) {
  session_file_make_path(fullname, "settings.inp");
  return libset_write_script(fullname);
}


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

x86 assembly (clang, -O2):
<write_settings_file>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1040 <session_file_make_path@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <libset_write_script@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"settings.inp\00"
define i32 @write_settings_file(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @session_file_make_path(i8* %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 @libset_write_script(i8* %5)
ret i32 %6
}

LLVM IR (-O2):
@.str = [13 x i8] c"settings.inp\00"
define i32 @write_settings_file(i8* %0) {
%2 = tail call i32 @session_file_make_path(i8* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @libset_write_script(i8* %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ write_real(char *, double const, size_t);
void prior_print_delta(const void *data, char *buf, size_t n) {
  const double *x = data;
  write_real(buf, *x, n);
}


x86 assembly (clang, -O0):
<prior_print_delta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rsi
call   1030 <write_real@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prior_print_delta>:
movsd  (%rdi),%xmm0
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <write_real@plt>

LLVM IR (-O0):
define void @prior_print_delta(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca double*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
store double* %9, double** %7
%10 = load i8*, i8** %5
%11 = load double*, double** %7
%12 = load double, double* %11
%13 = load i64, i64* %6
%14 = call i32 @write_real(i8* %10, double %12, i64 %13)
ret void
}

LLVM IR (-O2):
define void @prior_print_delta(i8* nocapture %0, i8* %1, i64 %2) {
%4 = bitcast i8* %0 to double*
%5 = load double, double* %4
%6 = tail call i32 @write_real(i8* %1, double %5, i64 %2)
ret void
}
void __attribute__((preserve_most)) typedef_fun_foo(int x) {}


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

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

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

LLVM IR (-O2):
define preserve_mostcc void @typedef_fun_foo(i32 %0) {
ret void
}
/* Type definitions */
union bpf_attr {
  int /*<<< orphan*/ pathname;
};
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_OBJ_GET;
int /*<<< orphan*/ memset(union bpf_attr *, int /*<<< orphan*/, int);
int /*<<< orphan*/ ptr_to_u64(void *);
int sys_bpf(int /*<<< orphan*/, union bpf_attr *, int);
int bpf_obj_get(const char *pathname) {
  union bpf_attr attr;
  memset(&attr, 0, sizeof(attr));
  attr.pathname = ptr_to_u64((void *)pathname);
  return sys_bpf(BPF_OBJ_GET, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_obj_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1050 <memset@plt>
mov    -0x8(%rbp),%rdi
call   1040 <ptr_to_u64@plt>
mov    %eax,-0x10(%rbp)
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <sys_bpf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_obj_get>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1050 <memset@plt>
mov    %rbx,%rdi
call   1040 <ptr_to_u64@plt>
mov    %eax,(%rsp)
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <sys_bpf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%union.bpf_attr = type { i32 }
@BPF_OBJ_GET = global i32 0
define i32 @bpf_obj_get(i8* %0) {
%2 = alloca i8*
%3 = alloca %union.bpf_attr
store i8* %0, i8** %2
%4 = call i32 @memset(%union.bpf_attr* %3, i32 0, i32 4)
%5 = load i8*, i8** %2
%6 = call i32 @ptr_to_u64(i8* %5)
%7 = bitcast %union.bpf_attr* %3 to i32*
store i32 %6, i32* %7
%8 = load i32, i32* @BPF_OBJ_GET
%9 = call i32 @sys_bpf(i32 %8, %union.bpf_attr* %3, i32 4)
ret i32 %9
}

LLVM IR (-O2):
%union.bpf_attr = type { i32 }
@BPF_OBJ_GET = global i32 0
define i32 @bpf_obj_get(i8* %0) {
%2 = alloca %union.bpf_attr
%3 = bitcast %union.bpf_attr* %2 to i8*
%4 = call i32 @memset(%union.bpf_attr* %2, i32 0, i32 4)
%5 = call i32 @ptr_to_u64(i8* %0)
%6 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %2, i64 0, i32 0
store i32 %5, i32* %6
%7 = load i32, i32* @BPF_OBJ_GET
%8 = call i32 @sys_bpf(i32 %7, %union.bpf_attr* %2, i32 4)
ret i32 %8
}
/* Variables and functions */
int strlen(char *);
int cmpStrLen(const void *a, const void *b) {
  return (strlen((char *)a) - strlen((char *)b));
}


x86 assembly (clang, -O0):
<cmpStrLen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpStrLen>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <strlen@plt>
sub    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @cmpStrLen(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 = call i32 @strlen(i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = sub nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @cmpStrLen(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = sub nsw i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ germany();
int /*<<< orphan*/ printf(char *);
void italy() {
  printf("I am in  ITALY.\n");
  germany();
  printf("I am back in ITALY.\n");
}


x86 assembly (clang, -O0):
<italy>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <germany@plt>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<italy>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <germany@plt>
lea    0xed5(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"I am in ITALY.\0A\00"
@.str.1 = [21 x i8] c"I am back in ITALY.\0A\00"
define void @italy() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @germany()
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"I am in ITALY.\00"
@str.2 = [20 x i8] c"I am back in ITALY.\00"
define void @italy() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @germany()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
void quit() {
  fclose(stdin);
  fclose(stdout);
  fclose(stderr);
  exit(0);
}


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdin = global i32 0
@stdout = global i32 0
@stderr = global i32 0
define void @quit() {
%1 = load i32, i32* @stdin
%2 = call i32 @fclose(i32 %1)
%3 = load i32, i32* @stdout
%4 = call i32 @fclose(i32 %3)
%5 = load i32, i32* @stderr
%6 = call i32 @fclose(i32 %5)
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdin = global i32 0
@stdout = global i32 0
@stderr = global i32 0
define void @quit() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @fclose(i32 %1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fclose(i32 %3)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fclose(i32 %5)
%7 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i = 1;
  printf("%d", !i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

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

/* Variables and functions */
int jhash_1word(int /*<<< orphan*/, int);
int ppm_hash_pid(pid_t pid) {
  return jhash_1word(pid, (0x3af5f2ee)) & ((1 << (8)) - 1);
}


x86 assembly (clang, -O0):
<ppm_hash_pid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x3af5f2ee,%esi
call   1030 <jhash_1word@plt>
and    $0xff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ppm_hash_pid>:
push   %rax
mov    $0x3af5f2ee,%esi
call   1030 <jhash_1word@plt>
movzbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ppm_hash_pid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @jhash_1word(i32 %3, i32 989197038)
%5 = and i32 %4, 255
ret i32 %5
}

LLVM IR (-O2):
define i32 @ppm_hash_pid(i32 %0) {
%2 = tail call i32 @jhash_1word(i32 %0, i32 989197038)
%3 = and i32 %2, 255
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_sub_pi8(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 __attribute__((no, unused)) test(__m64 s1, __m64 s2) {
  return _mm_sub_pi8(s1, s2);
}


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

x86 assembly (clang, -O2):
<test>:
jmp    1030 <_mm_sub_pi8@plt>

LLVM IR (-O0):
define i32 @test(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @_mm_sub_pi8(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_sub_pi8(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ clamp(unsigned char, int /*<<< orphan*/, int);
unsigned char extract_grey(unsigned char *, int);
int /*<<< orphan*/ set_grey(unsigned char *, int, int /*<<< orphan*/);
void add_grey(unsigned char *grey, int i, int amount) {
  unsigned char val = extract_grey(grey, i);
  set_grey(grey, i, clamp(val + amount, 0, 255));
}


x86 assembly (clang, -O0):
<add_grey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <extract_grey@plt>
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
movzbl -0x11(%rbp),%eax
add    -0x10(%rbp),%eax
xor    %esi,%esi
mov    $0xff,%edx
movzbl %al,%edi
call   1030 <clamp@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    %eax,%edx
call   1040 <set_grey@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_grey>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%r14d
mov    %rdi,%rbp
call   1050 <extract_grey@plt>
add    %al,%bl
movzbl %bl,%edi
xor    %esi,%esi
mov    $0xff,%edx
call   1030 <clamp@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
mov    %eax,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <set_grey@plt>

LLVM IR (-O0):
define void @add_grey(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call zeroext i8 @extract_grey(i8* %8, i32 %9)
store i8 %10, i8* %7
%11 = load i8*, i8** %4
%12 = load i32, i32* %5
%13 = load i8, i8* %7
%14 = zext i8 %13 to i32
%15 = load i32, i32* %6
%16 = add nsw i32 %14, %15
%17 = trunc i32 %16 to i8
%18 = call i32 @clamp(i8 zeroext %17, i32 0, i32 255)
%19 = call i32 @set_grey(i8* %11, i32 %12, i32 %18)
ret void
}

LLVM IR (-O2):
define void @add_grey(i8* %0, i32 %1, i32 %2) {
%4 = tail call zeroext i8 @extract_grey(i8* %0, i32 %1)
%5 = trunc i32 %2 to i8
%6 = add i8 %4, %5
%7 = tail call i32 @clamp(i8 zeroext %6, i32 0, i32 255)
%8 = tail call i32 @set_grey(i8* %0, i32 %1, i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int test5(void) {
  int i, sum = 0;
  int *tab4;
  tab4 = malloc(20 * sizeof(int));
  for (i = 0; i < 21; i++) {
    sum += tab4[i];
  }
  free(tab4);
  return sum;
}


x86 assembly (clang, -O0):
<test5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
mov    $0x50,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x15,-0x4(%rbp)
jge    116d <test5+0x4d>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <test5+0x24>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test5>:
push   %rbx
mov    $0x50,%edi
call   1040 <malloc@plt>
movdqu 0x44(%rax),%xmm0
movdqu 0x4(%rax),%xmm1
movdqu 0x14(%rax),%xmm2
movdqu 0x24(%rax),%xmm3
paddd  %xmm0,%xmm3
movdqu 0x34(%rax),%xmm0
paddd  %xmm2,%xmm0
paddd  %xmm3,%xmm0
pshufd $0xee,%xmm0,%xmm2
paddd  %xmm0,%xmm2
pshufd $0x55,%xmm2,%xmm0
paddd  %xmm2,%xmm0
movd   %xmm0,%ecx
pshufd $0xee,%xmm1,%xmm0
paddd  %xmm1,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%ebx
add    %ecx,%ebx
add    (%rax),%ebx
mov    %rax,%rdi
call   1030 <free@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test5() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %2
%4 = call i32* @malloc(i32 80)
store i32* %4, i32** %3
store i32 0, i32* %1
br label %5
5: ; preds = %16, %0
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 21
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = load i32*, i32** %3
%10 = load i32, i32* %1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
%13 = load i32, i32* %12
%14 = load i32, i32* %2
%15 = add nsw i32 %14, %13
store i32 %15, i32* %2
br label %16
16: ; preds = %8
%17 = load i32, i32* %1
%18 = add nsw i32 %17, 1
store i32 %18, i32* %1
br label %5
19: ; preds = %5
%20 = load i32*, i32** %3
%21 = call i32 @free(i32* %20)
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @test5() {
%1 = tail call i32* @malloc(i32 80)
%2 = load i32, i32* %1
%3 = getelementptr inbounds i32, i32* %1, i64 1
%4 = bitcast i32* %3 to <4 x i32>*
%5 = load <4 x i32>, <4 x i32>* %4
%6 = getelementptr inbounds i32, i32* %1, i64 5
%7 = bitcast i32* %6 to <16 x i32>*
%8 = load <16 x i32>, <16 x i32>* %7
%9 = call i32 @llvm.vector.reduce.add.v16i32(<16 x i32> %8)
%10 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %5)
%11 = add nsw i32 %9, %10
%12 = add nsw i32 %11, %2
%13 = tail call i32 @free(i32* %1)
ret i32 %12
}
/* Variables and functions */
scalar_t__ strstr(char const *, char *);
int http_process_none(const char *hdr, void *arg) {
  int *where = (int *)arg;
  if (strstr(hdr, "none"))
    *where = 1;
  else
    *where = 0;
  return 1;
}


x86 assembly (clang, -O0):
<http_process_none>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xecd(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
je     1151 <http_process_none+0x41>
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
jmp    115b <http_process_none+0x4b>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<http_process_none>:
push   %rbx
mov    %rsi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strstr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"none\00"
define i32 @http_process_none(i8* %0, i8* nocapture writeonly %1) {
%3 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
%6 = bitcast i8* %1 to i32*
store i32 %5, i32* %6
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ VDP_fadeTo(unsigned short, unsigned short,
                              unsigned short const *, unsigned short,
                              unsigned char);
void VDP_fadePalTo(unsigned short numpal, const unsigned short *pal,
                   unsigned short numframe, unsigned char async) {
  VDP_fadeTo(numpal << 4, (numpal << 4) + 15, pal, numframe, async);
}


x86 assembly (clang, -O0):
<VDP_fadePalTo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %dx,%cx
mov    %di,%dx
mov    %dx,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %cx,-0x12(%rbp)
mov    %al,-0x13(%rbp)
movzwl -0x2(%rbp),%eax
shl    $0x4,%eax
mov    %ax,%si
movzwl -0x2(%rbp),%eax
shl    $0x4,%eax
add    $0xf,%eax
mov    %ax,%cx
mov    -0x10(%rbp),%rdx
mov    -0x12(%rbp),%ax
movzwl %si,%edi
movzwl %cx,%esi
movzwl %ax,%ecx
movzbl -0x13(%rbp),%r8d
call   1030 <VDP_fadeTo@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VDP_fadePalTo>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %rsi,%rdx
shl    $0x4,%edi
lea    0xf(%rdi),%eax
movzwl %di,%edi
movzwl %ax,%esi
jmp    1030 <VDP_fadeTo@plt>

LLVM IR (-O0):
define void @VDP_fadePalTo(i16 zeroext %0, i16* %1, i16 zeroext %2, i8 zeroext %3) {
%5 = alloca i16
%6 = alloca i16*
%7 = alloca i16
%8 = alloca i8
store i16 %0, i16* %5
store i16* %1, i16** %6
store i16 %2, i16* %7
store i8 %3, i8* %8
%9 = load i16, i16* %5
%10 = zext i16 %9 to i32
%11 = shl i32 %10, 4
%12 = trunc i32 %11 to i16
%13 = load i16, i16* %5
%14 = zext i16 %13 to i32
%15 = shl i32 %14, 4
%16 = add nsw i32 %15, 15
%17 = trunc i32 %16 to i16
%18 = load i16*, i16** %6
%19 = load i16, i16* %7
%20 = load i8, i8* %8
%21 = call i32 @VDP_fadeTo(i16 zeroext %12, i16 zeroext %17, i16* %18, i16 zeroext %19, i8 zeroext %20)
ret void
}

LLVM IR (-O2):
define void @VDP_fadePalTo(i16 zeroext %0, i16* %1, i16 zeroext %2, i8 zeroext %3) {
%5 = shl i16 %0, 4
%6 = or i16 %5, 15
%7 = tail call i32 @VDP_fadeTo(i16 zeroext %5, i16 zeroext %6, i16* %1, i16 zeroext %2, i8 zeroext %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ uex_iowrite8(int /*<<< orphan*/, void *);
void uex_iomemset(void *p, uint8_t v, uint32_t count) {
  uint32_t i = 0;
  while (i < count) {
    uex_iowrite8(v, p + i);
    i++;
  }
}


x86 assembly (clang, -O0):
<uex_iomemset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    115a <uex_iomemset+0x4a>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
add    -0x20(%rbp),%rsi
call   1030 <uex_iowrite8@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112b <uex_iomemset+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uex_iomemset>:
push   %rbp
push   %r14
push   %rbx
test   %rdx,%rdx
jle    1145 <uex_iomemset+0x35>
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14d,%edi
mov    %rbp,%rsi
call   1030 <uex_iowrite8@plt>
add    $0x1,%rbp
add    $0xffffffffffffffff,%rbx
jne    1130 <uex_iomemset+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @uex_iomemset(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
store i64 0, i64* %7
br label %8
8: ; preds = %12, %3
%9 = load i64, i64* %7
%10 = load i64, i64* %6
%11 = icmp slt i64 %9, %10
br i1 %11, label %12, label %20
12: ; preds = %8
%13 = load i32, i32* %5
%14 = load i8*, i8** %4
%15 = load i64, i64* %7
%16 = getelementptr i8, i8* %14, i64 %15
%17 = call i32 @uex_iowrite8(i32 %13, i8* %16)
%18 = load i64, i64* %7
%19 = add nsw i64 %18, 1
store i64 %19, i64* %7
br label %8
20: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @uex_iomemset(i8* %0, i32 %1, i64 %2) {
%4 = icmp sgt i64 %2, 0
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i64 [ %9, %5 ], [ 0, %3 ]
%7 = getelementptr i8, i8* %0, i64 %6
%8 = tail call i32 @uex_iowrite8(i32 %1, i8* %7)
%9 = add nuw nsw i64 %6, 1
%10 = icmp eq i64 %9, %2
br i1 %10, label %11, label %5
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ format_words();
int /*<<< orphan*/ squeeze_spaces();
int main(void) {
  squeeze_spaces();
  format_words();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <squeeze_spaces@plt>
mov    $0x0,%al
call   1030 <format_words@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <squeeze_spaces@plt>
xor    %eax,%eax
call   1030 <format_words@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @squeeze_spaces()
%2 = tail call i32 (...) @format_words()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sink(int /*<<< orphan*/, char);
__attribute__((noipa)) void fca3(char a[3]) {
  sink(0, a[0]);
  sink(0, a[1]);
  sink(0, a[2]);
  sink(0, a[3]);
}


x86 assembly (clang, -O0):
<fca3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xor    %edi,%edi
movsbl (%rax),%esi
call   1030 <sink@plt>
mov    -0x8(%rbp),%rax
xor    %edi,%edi
movsbl 0x1(%rax),%esi
call   1030 <sink@plt>
mov    -0x8(%rbp),%rax
xor    %edi,%edi
movsbl 0x2(%rax),%esi
call   1030 <sink@plt>
mov    -0x8(%rbp),%rax
xor    %edi,%edi
movsbl 0x3(%rax),%esi
call   1030 <sink@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fca3>:
push   %rbx
mov    %rdi,%rbx
movsbl (%rdi),%esi
xor    %edi,%edi
call   1030 <sink@plt>
movsbl 0x1(%rbx),%esi
xor    %edi,%edi
call   1030 <sink@plt>
movsbl 0x2(%rbx),%esi
xor    %edi,%edi
call   1030 <sink@plt>
movsbl 0x3(%rbx),%esi
xor    %edi,%edi
pop    %rbx
jmp    1030 <sink@plt>

LLVM IR (-O0):
define void @fca3(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = call i32 @sink(i32 0, i8 signext %5)
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = call i32 @sink(i32 0, i8 signext %9)
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 2
%13 = load i8, i8* %12
%14 = call i32 @sink(i32 0, i8 signext %13)
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 3
%17 = load i8, i8* %16
%18 = call i32 @sink(i32 0, i8 signext %17)
ret void
}

LLVM IR (-O2):
define void @fca3(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @sink(i32 0, i8 signext %2)
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = tail call i32 @sink(i32 0, i8 signext %5)
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = load i8, i8* %7
%9 = tail call i32 @sink(i32 0, i8 signext %8)
%10 = getelementptr inbounds i8, i8* %0, i64 3
%11 = load i8, i8* %10
%12 = tail call i32 @sink(i32 0, i8 signext %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int totient_sum(int);
void totient_sum_test(void) {
  assert(totient_sum(0) == 0);
  assert(totient_sum(1) == 1);
  assert(totient_sum(10) == 32);
  assert(totient_sum(100) == 3044);
}


x86 assembly (clang, -O0):
<totient_sum_test>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <totient_sum@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x1,%edi
call   1030 <totient_sum@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0xa,%edi
call   1030 <totient_sum@plt>
cmp    $0x20,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x64,%edi
call   1030 <totient_sum@plt>
cmp    $0xbe4,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<totient_sum_test>:
push   %rax
xor    %edi,%edi
call   1030 <totient_sum@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x1,%edi
call   1030 <totient_sum@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0xa,%edi
call   1030 <totient_sum@plt>
xor    %edi,%edi
cmp    $0x20,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x64,%edi
call   1030 <totient_sum@plt>
xor    %edi,%edi
cmp    $0xbe4,%eax
sete   %dil
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
define void @totient_sum_test() {
%1 = call i32 @totient_sum(i32 0)
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @assert(i32 %3)
%5 = call i32 @totient_sum(i32 1)
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call i32 @totient_sum(i32 10)
%10 = icmp eq i32 %9, 32
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = call i32 @totient_sum(i32 100)
%14 = icmp eq i32 %13, 3044
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
ret void
}

LLVM IR (-O2):
define void @totient_sum_test() {
%1 = tail call i32 @totient_sum(i32 0)
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @totient_sum(i32 1)
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @totient_sum(i32 10)
%10 = icmp eq i32 %9, 32
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i32 @totient_sum(i32 100)
%14 = icmp eq i32 %13, 3044
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: comm [-123i] file1 file2\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"usage: comm [-123i] file1 file2\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"usage: comm [-123i] file1 file2\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ do_cpuid(unsigned int *, unsigned int *, unsigned int *,
                            unsigned int *);
int crc32c_intel_works(void) {
  unsigned int eax, ebx, ecx, edx;
  eax = 1;
  do_cpuid(&eax, &ebx, &ecx, &edx);
  return (ecx & (1 << 20)) != 0;
}


x86 assembly (clang, -O0):
<crc32c_intel_works>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1030 <do_cpuid@plt>
mov    -0xc(%rbp),%eax
and    $0x100000,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc32c_intel_works>:
sub    $0x18,%rsp
movl   $0x1,0xc(%rsp)
lea    0xc(%rsp),%rdi
lea    0x14(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x10(%rsp),%rcx
call   1030 <do_cpuid@plt>
mov    0x8(%rsp),%eax
shr    $0x14,%eax
and    $0x1,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @crc32c_intel_works() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 1, i32* %1
%5 = call i32 @do_cpuid(i32* %1, i32* %2, i32* %3, i32* %4)
%6 = load i32, i32* %3
%7 = and i32 %6, 1048576
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @crc32c_intel_works() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
store i32 1, i32* %1
%9 = call i32 @do_cpuid(i32* %1, i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %3
%11 = lshr i32 %10, 20
%12 = and i32 %11, 1
ret i32 %12
}
int is_hex_letter(const int c) { return (c >= 'A' && c <= 'F'); }


x86 assembly (clang, -O0):
<is_hex_letter>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <is_hex_letter+0x20>
cmpl   $0x46,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_hex_letter>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x6,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @is_hex_letter(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 70
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @is_hex_letter(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 6
%4 = zext i1 %3 to i32
ret i32 %4
}
int RSD(int x) { return ((x & 2) ? (x | 1) : (x & (~1))); }


x86 assembly (clang, -O0):
<RSD>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1124 <RSD+0x24>
mov    -0x4(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <RSD+0x2d>
mov    -0x4(%rbp),%eax
and    $0xfffffffe,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RSD>:
mov    %edi,%eax
and    $0xfffffffe,%eax
shr    %edi
and    $0x1,%edi
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @RSD(i32 %0) {
%2 = and i32 %0, -2
%3 = lshr i32 %0, 1
%4 = and i32 %3, 1
%5 = or i32 %4, %2
ret i32 %5
}