xunge/DecIR huggingface dataset:
void cmd_rating(void) {}


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

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

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

LLVM IR (-O2):
define void @cmd_rating() {
ret void
}
/* Variables and functions */
scalar_t__ acosl(long double);
int /*<<< orphan*/ link_failure_acosl();
void test_acosl(long double ld) {
  if (acosl(ld) != acosl(ld))
    link_failure_acosl();
}


x86 assembly (clang, -O0):
<test_acosl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <acosl@plt>
mov    %rax,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <acosl@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1163 <test_acosl+0x43>
mov    $0x0,%al
call   1030 <link_failure_acosl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_acosl>:
push   %rbx
sub    $0x20,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1040 <acosl@plt>
mov    %rax,%rbx
fldt   0x14(%rsp)
fstpt  (%rsp)
call   1040 <acosl@plt>
cmp    %rax,%rbx
jne    1151 <test_acosl+0x31>
add    $0x20,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1030 <link_failure_acosl@plt>

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

LLVM IR (-O2):
define void @test_acosl(x86_fp80 %0) {
%2 = tail call i64 @acosl(x86_fp80 %0)
%3 = tail call i64 @acosl(x86_fp80 %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_acosl()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SafeFree(char *);
void KeyDest(void *keyString) {
  if (keyString) {
    SafeFree((char *)keyString);
  }
}


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

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

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

LLVM IR (-O2):
define void @KeyDest(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @SafeFree(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Release\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"Release\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(int);
char *strcpy(char *, char const *);
int strlen(char const *);
char *strdup(const char *s) {
  int len = strlen(s);
  char *s2 = (char *)malloc((len + 1) * sizeof(char));
  return strcpy(s2, s);
}


x86 assembly (clang, -O0):
<strdup>:
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),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = mul i64 %9, 1
%11 = trunc i64 %10 to i32
%12 = call i64 @malloc(i32 %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %4
%14 = load i8*, i8** %4
%15 = load i8*, i8** %2
%16 = call i8* @strcpy(i8* %14, i8* %15)
ret i8* %16
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i8* @strcpy(i8* dereferenceable(1) %5, i8* dereferenceable(1) %0)
ret i8* %5
}
/* Variables and functions */
unsigned long update_crc(long, unsigned char *, int);
unsigned long crc16(unsigned char *buf, int len) {
  return update_crc(0L, buf, len);
}


x86 assembly (clang, -O0):
<crc16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
xor    %eax,%eax
mov    %eax,%edi
call   1030 <update_crc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc16>:
mov    %esi,%edx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <update_crc@plt>

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

LLVM IR (-O2):
define i64 @crc16(i8* %0, i32 %1) {
%3 = tail call i64 @update_crc(i64 0, i8* %0, i32 %1)
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
int SIGALRM;
int /*<<< orphan*/ echoRequestSend(int /*<<< orphan*/);
int /*<<< orphan*/ getpid();
void hdl_SIGALARM(int sig, siginfo_t *siginfo, void *context) {
  if (sig == SIGALRM)
    echoRequestSend(getpid());
}


x86 assembly (clang, -O0):
<hdl_SIGALARM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eab(%rip),%rcx
cmp    (%rcx),%eax
jne    1153 <hdl_SIGALARM+0x33>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
call   1040 <echoRequestSend@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hdl_SIGALARM>:
push   %rax
mov    0x2ec0(%rip),%rax
cmp    %edi,(%rax)
jne    113b <hdl_SIGALARM+0x1b>
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <echoRequestSend@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@SIGALRM = global i32 0
define void @hdl_SIGALARM(i32 %0, i32* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = load i32, i32* @SIGALRM
%5 = icmp eq i32 %4, %0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 (...) @getpid()
%8 = tail call i32 @echoRequestSend(i32 %7)
br label %9
9: ; preds = %6, %3
ret void
}
/* Type definitions */
struct sysinfo {
  int *loads;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
scalar_t__ sysinfo(struct sysinfo *);
int main() {
  struct sysinfo structSysinfo;
  if (sysinfo(&structSysinfo))
    return (1);
  printf("%lu\n", structSysinfo.loads[1] / 65536);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <sysinfo@plt>
cmp    $0x0,%rax
je     114e <main+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1172 <main+0x52>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    $0x10000,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
call   1040 <sysinfo@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1138 <main+0x18>
pop    %rcx
ret
mov    (%rsp),%rax
mov    0x4(%rax),%eax
lea    0xffff(%rax),%esi
test   %eax,%eax
cmovns %eax,%esi
sar    $0x10,%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sysinfo = type { i32* }
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.sysinfo
store i32 0, i32* %1
%3 = call i64 @sysinfo(%struct.sysinfo* %2)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 1, i32* %1
br label %13
6: ; preds = %0
%7 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %2, i32 0, i32 0
%8 = load i32*, i32** %7
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = sdiv i32 %10, 65536
%12 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %11)
store i32 0, i32* %1
br label %13
13: ; preds = %6, %5
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
%struct.sysinfo = type { i32* }
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = alloca %struct.sysinfo
%2 = bitcast %struct.sysinfo* %1 to i8*
%3 = call i64 @sysinfo(%struct.sysinfo* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %0
%6 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %1, i64 0, i32 0
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 65536
%11 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %0, %5
%13 = phi i32 [ 0, %5 ], [ 1, %0 ]
ret i32 %13
}
adr0adrx1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if ((*((unsigned short *)10000000)) <= (((unsigned short *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adr0adrx1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    $0x989680,%eax
movzwl (%rax),%eax
movslq -0x10(%rbp),%rdx
mov    $0xa98ac7,%ecx
movzwl (%rcx,%rdx,2),%ecx
cmp    %ecx,%eax
jg     1148 <adr0adrx1+0x48>
movl   $0x1,-0x4(%rbp)
jmp    114f <adr0adrx1+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0adrx1>:
movzwl 0x989680,%edx
movslq %ecx,%rcx
xor    %eax,%eax
cmp    0xa98ac7(%rcx,%rcx,1),%dx
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @adr0adrx1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture readnone %5) {
%7 = load i16, i16* inttoptr (i64 10000000 to i16*)
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds i16, i16* inttoptr (i64 11111111 to i16*), i64 %8
%10 = load i16, i16* %9
%11 = icmp ule i16 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ fatal(char *);
void *xcalloc(size_t nmemb, size_t size) {
  void *p;
  if ((p = calloc(nmemb, size)) == NULL)
    fatal("Can't allocate memory!");
  return p;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1157 <xcalloc+0x37>
lea    0xeae(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rbx
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xcalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Can't allocate memory!\00"
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @fatal(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
@.str = [23 x i8] c"Can't allocate memory!\00"
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @fatal(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
void av_blowfish_crypt() {}


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

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

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

LLVM IR (-O2):
define void @av_blowfish_crypt() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int somatorio(int);
int main() {
  printf("Somatorio: %d", somatorio(2));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"Somatorio: %d\00"
define i32 @main() {
%1 = tail call i32 @somatorio(i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __qsort(void *, size_t, int (*)(void const *, void const *),
                           int /*<<< orphan*/, size_t, void **);
int /*<<< orphan*/ free(void *);
void *malloc(size_t);
void qsort(void *base, size_t nmemb, size_t size,
           int (*compar)(const void *, const void *)) {
  void *tmp = malloc(size);
  __qsort(base, size, compar, 0, nmemb - 1, &tmp);
  free(tmp);
}


x86 assembly (clang, -O0):
<qsort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x10(%rbp),%r8
sub    $0x1,%r8
xor    %ecx,%ecx
lea    -0x28(%rbp),%r9
call   1040 <__qsort@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r12
mov    %rdx,%rdi
call   1050 <malloc@plt>
mov    %rax,(%rsp)
add    $0xffffffffffffffff,%rbx
mov    %rsp,%r9
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
xor    %ecx,%ecx
mov    %rbx,%r8
call   1040 <__qsort@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @qsort(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32 (i8*, i8*)*
%9 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32 (i8*, i8*)* %3, i32 (i8*, i8*)** %8
%10 = load i64, i64* %7
%11 = call i8* @malloc(i64 %10)
store i8* %11, i8** %9
%12 = load i8*, i8** %5
%13 = load i64, i64* %7
%14 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %8
%15 = load i64, i64* %6
%16 = sub i64 %15, 1
%17 = call i32 @__qsort(i8* %12, i64 %13, i32 (i8*, i8*)* %14, i32 0, i64 %16, i8** %9)
%18 = load i8*, i8** %9
%19 = call i32 @free(i8* %18)
ret void
}

LLVM IR (-O2):
define void @qsort(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3) {
%5 = alloca i8*
%6 = bitcast i8** %5 to i8*
%7 = tail call i8* @malloc(i64 %2)
store i8* %7, i8** %5
%8 = add i64 %1, -1
%9 = call i32 @__qsort(i8* %0, i64 %2, i32 (i8*, i8*)* %3, i32 0, i64 %8, i8** %5)
%10 = load i8*, i8** %5
%11 = call i32 @free(i8* %10)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ crc16(char const *, scalar_t__);
int do_xsum(const char *data, uint32_t len, uint32_t *xsum) {
  if (len == 0)
    return 0;
  *xsum = crc16(data, len);
  return 1;
}


x86 assembly (clang, -O0):
<do_xsum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    113b <do_xsum+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    1159 <do_xsum+0x49>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <crc16@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_xsum>:
test   %rsi,%rsi
je     1128 <do_xsum+0x18>
push   %rbx
mov    %rdx,%rbx
call   1030 <crc16@plt>
mov    %rax,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @do_xsum(i8* %0, i64 %1, i64* nocapture writeonly %2) {
%4 = icmp eq i64 %1, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i64 @crc16(i8* %0, i64 %1)
store i64 %6, i64* %2
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ 1, %5 ], [ 0, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ read(int, char *, int);
void rd_sleepy(void) {
  int fd;
  char buffer[32];
  fd = open("/dev/sleepy", O_RDONLY);
  if (fd < 0) {
    exit(-1);
  }
  read(fd, buffer, 10);
  close(fd);
}


x86 assembly (clang, -O0):
<rd_sleepy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
lea    0xea8(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1174 <rd_sleepy+0x34>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    -0x4(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    $0xa,%edx
call   1040 <read@plt>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rd_sleepy>:
push   %rbx
sub    $0x20,%rsp
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
lea    0xeab(%rip),%rdi
call   1050 <open@plt>
test   %eax,%eax
js     117b <rd_sleepy+0x3b>
mov    %eax,%ebx
mov    %rsp,%rsi
mov    %eax,%edi
mov    $0xa,%edx
call   1040 <read@plt>
mov    %ebx,%edi
add    $0x20,%rsp
pop    %rbx
jmp    1030 <close@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"/dev/sleepy\00"
@O_RDONLY = global i32 0
define void @rd_sleepy() {
%1 = alloca i32
%2 = alloca [32 x i8]
%3 = load i32, i32* @O_RDONLY
%4 = call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @exit(i32 -1)
unreachable
9: ; preds = %0
%10 = load i32, i32* %1
%11 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%12 = call i32 @read(i32 %10, i8* %11, i32 10)
%13 = load i32, i32* %1
%14 = call i32 @close(i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"/dev/sleepy\00"
@O_RDONLY = global i32 0
define void @rd_sleepy() {
%1 = alloca [32 x i8]
%2 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @O_RDONLY
%4 = tail call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %0
%9 = call i32 @read(i32 %4, i8* %2, i32 10)
%10 = tail call i32 @close(i32 %4)
ret void
}
void toggleRGB(char rgb) {
  unsigned int *data = ((unsigned int *)0x50023FFC);
  *data ^= 0x0E00 & (rgb << 9);
}


x86 assembly (clang, -O0):
<toggleRGB>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x50023ffc,%eax
mov    %rax,-0x10(%rbp)
movsbl -0x1(%rbp),%ecx
shl    $0x9,%ecx
and    $0xe00,%ecx
mov    -0x10(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<toggleRGB>:
and    $0x7,%edi
shl    $0x9,%edi
xor    %edi,0x50023ffc
ret

LLVM IR (-O0):
define void @toggleRGB(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32*
store i8 %0, i8* %2
store i32* inttoptr (i64 1342324732 to i32*), i32** %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = shl i32 %5, 9
%7 = and i32 3584, %6
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = xor i32 %9, %7
store i32 %10, i32* %8
ret void
}

LLVM IR (-O2):
define void @toggleRGB(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = shl nsw i32 %2, 9
%4 = and i32 %3, 3584
%5 = load i32, i32* inttoptr (i64 1342324732 to i32*)
%6 = xor i32 %5, %4
store i32 %6, i32* inttoptr (i64 1342324732 to i32*)
ret void
}
/* Variables and functions */
void *malloc(int);
void *index_alloc(int size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<index_alloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @index_alloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
unsigned int inl(unsigned short p) {
  unsigned int v;
  asm volatile("inl %1,%0" : "=a"(v) : "d"(p));
  return v;
}


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

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

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

LLVM IR (-O2):
define i32 @inl(i16 zeroext %0) {
%2 = tail call i32 asm sideeffect "inl $1,$0", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i32 %2
}
/* Type definitions */
struct mntent {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
struct mntent *getmntent_r(int /*<<< orphan*/ *, struct mntent *, char *, int);
scalar_t__ malloc(int);
struct mntent *getmntent(FILE *stream) {
  static struct mntent m;
  static char *getmntent_buffer;
  if (getmntent_buffer == NULL) {
    getmntent_buffer = (char *)malloc(4096);
  }
  return getmntent_r(stream, &m, getmntent_buffer, 4096);
}


x86 assembly (clang, -O0):
<getmntent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,0x2f0c(%rip)
jne    114b <getmntent+0x2b>
mov    $0x1000,%edi
call   1040 <malloc@plt>
mov    %rax,0x2ef5(%rip)
mov    -0x8(%rbp),%rdi
mov    0x2eea(%rip),%rdx
lea    0x2edb(%rip),%rsi
mov    $0x1000,%ecx
call   1030 <getmntent_r@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getmntent>:
push   %rbx
mov    %rdi,%rbx
mov    0x2f15(%rip),%rdx
test   %rdx,%rdx
jne    1144 <getmntent+0x24>
mov    $0x1000,%edi
call   1040 <malloc@plt>
mov    %rax,%rdx
mov    %rax,0x2efc(%rip)
lea    0x2eed(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1000,%ecx
pop    %rbx
jmp    1030 <getmntent_r@plt>

LLVM IR (-O0):
%struct.mntent = type { i32 }
@getmntent.m = internal global %struct.mntent zeroinitializer
@getmntent.getmntent_buffer = internal global i8* null
define %struct.mntent* @getmntent(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i8*, i8** @getmntent.getmntent_buffer
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = call i64 @malloc(i32 4096)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** @getmntent.getmntent_buffer
br label %8
8: ; preds = %5, %1
%9 = load i32*, i32** %2
%10 = load i8*, i8** @getmntent.getmntent_buffer
%11 = call %struct.mntent* @getmntent_r(i32* %9, %struct.mntent* @getmntent.m, i8* %10, i32 4096)
ret %struct.mntent* %11
}

LLVM IR (-O2):
%struct.mntent = type { i32 }
@getmntent.m = internal global %struct.mntent zeroinitializer
@getmntent.getmntent_buffer = internal unnamed_addr global i8* null
define %struct.mntent* @getmntent(i32* %0) {
%2 = load i8*, i8** @getmntent.getmntent_buffer
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i64 @malloc(i32 4096)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** @getmntent.getmntent_buffer
br label %7
7: ; preds = %4, %1
%8 = phi i8* [ %6, %4 ], [ %2, %1 ]
%9 = tail call %struct.mntent* @getmntent_r(i32* %0, %struct.mntent* @getmntent.m, i8* %8, i32 4096)
ret %struct.mntent* %9
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ vrc2_4_setParams9XX0(int /*<<< orphan*/, int);
void m23_setParams9XX0(uint16_t addr, uint8_t val) {
  if (val == 0xFF)
    val &= 1;
  vrc2_4_setParams9XX0(addr, val);
}


x86 assembly (clang, -O0):
<m23_setParams9XX0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jne    1134 <m23_setParams9XX0+0x24>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <vrc2_4_setParams9XX0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m23_setParams9XX0>:
cmp    $0xff,%esi
mov    $0x1,%eax
cmove  %eax,%esi
jmp    1030 <vrc2_4_setParams9XX0@plt>

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

LLVM IR (-O2):
define void @m23_setParams9XX0(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 255
%4 = select i1 %3, i32 1, i32 %1
%5 = tail call i32 @vrc2_4_setParams9XX0(i32 %0, i32 %4)
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int DE1_SOC_WM8731_log2(int);
uint16_t DE1_SOC_WM8731_shift_amount(uint16_t mask) {
  return DE1_SOC_WM8731_log2(mask & (~mask + 1));
}


x86 assembly (clang, -O0):
<DE1_SOC_WM8731_shift_amount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
add    $0x1,%eax
and    %eax,%edi
call   1030 <DE1_SOC_WM8731_log2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DE1_SOC_WM8731_shift_amount>:
mov    %edi,%eax
neg    %eax
and    %eax,%edi
jmp    1030 <DE1_SOC_WM8731_log2@plt>

LLVM IR (-O0):
define i32 @DE1_SOC_WM8731_shift_amount(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = xor i32 %4, -1
%6 = add nsw i32 %5, 1
%7 = and i32 %3, %6
%8 = call i32 @DE1_SOC_WM8731_log2(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @DE1_SOC_WM8731_shift_amount(i32 %0) {
%2 = sub i32 0, %0
%3 = and i32 %2, %0
%4 = tail call i32 @DE1_SOC_WM8731_log2(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ pcp_echo_off();
int /*<<< orphan*/ pcp_echo_on();
char *pcp_get_stdin();
int /*<<< orphan*/ printf(char *, ...);
char *pcp_get_passphrase(char *prompt) {
  printf("%s: ", prompt);
  pcp_echo_off();
  char *line = pcp_get_stdin();
  pcp_echo_on();
  printf("\n");
  return line;
}


x86 assembly (clang, -O0):
<pcp_get_passphrase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <pcp_echo_off@plt>
mov    $0x0,%al
call   1060 <pcp_get_stdin@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <pcp_echo_on@plt>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcp_get_passphrase>:
push   %rbx
mov    %rdi,%rsi
lea    0xea5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <pcp_echo_off@plt>
xor    %eax,%eax
call   1070 <pcp_get_stdin@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <pcp_echo_on@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%s: \00"
define i8* @pcp_get_passphrase(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (...) @pcp_echo_off()
%4 = tail call i8* (...) @pcp_get_stdin()
%5 = tail call i32 (...) @pcp_echo_on()
%6 = tail call i32 @putchar(i32 10)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void p(char *c, int l) {
  int i = 0;
  for (; i < l; i++)
    printf("'%c' ", c[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <p+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <p+0x16>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1158 <p+0x38>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <p+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"'%c' \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @p(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
%22 = 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 = [6 x i8] c"'%c' \00"
define void @p(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = tail call i32 @putchar(i32 10)
ret void
}
void scramble(void *bytes, int nbytes) {}


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

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

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

LLVM IR (-O2):
define void @scramble(i8* nocapture %0, i32 %1) {
ret void
}
void vgRotate(VGfloat) {}


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

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

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

LLVM IR (-O2):
define void @vgRotate(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(void) {
  fprintf(stderr, "this is spawn-test-helper from path-test-subdir\n");
  return 5;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x5,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x5,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [49 x i8] c"this is spawn-test-helper from path-test-subdir\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
ret i32 5
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [49 x i8] c"this is spawn-test-helper from path-test-subdir\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
ret i32 5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
void __put_unaligned_le16(uint16_t val, uint8_t *p) {
  *p++ = val;
  *p++ = val >> 8;
}


x86 assembly (clang, -O0):
<__put_unaligned_le16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x10(%rbp)
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x10(%rbp)
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__put_unaligned_le16>:
mov    %edi,(%rsi)
sar    $0x8,%edi
mov    %edi,0x4(%rsi)
ret

LLVM IR (-O0):
define void @__put_unaligned_le16(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 = getelementptr inbounds i32, i32* %6, i32 1
store i32* %7, i32** %4
store i32 %5, i32* %6
%8 = load i32, i32* %3
%9 = ashr i32 %8, 8
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i32 1
store i32* %11, i32** %4
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
define void @__put_unaligned_le16(i32 %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %0, i32* %1
%4 = ashr i32 %0, 8
store i32 %4, i32* %3
ret void
}
/* Variables and functions */
double cos(double);
double sin(double);
int solution(double t, double y[]) {
  y[0] = cos(t);
  y[1] = -sin(t);
  return 0;
}


x86 assembly (clang, -O0):
<solution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solution>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movsd  %xmm0,0x8(%rsp)
call   1040 <cos@plt>
movsd  %xmm0,(%rbx)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
xorps  0xeb7(%rip),%xmm0
movlps %xmm0,0x8(%rbx)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @solution(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
store double %0, double* %3
store double* %1, double** %4
%5 = load double, double* %3
%6 = call double @cos(double %5)
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 0
store double %6, double* %8
%9 = load double, double* %3
%10 = call double @sin(double %9)
%11 = fneg double %10
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 1
store double %11, double* %13
ret i32 0
}

LLVM IR (-O2):
define i32 @solution(double %0, double* nocapture writeonly %1) {
%3 = tail call double @cos(double %0)
store double %3, double* %1
%4 = tail call double @sin(double %0)
%5 = fneg double %4
%6 = getelementptr inbounds double, double* %1, i64 1
store double %5, double* %6
ret i32 0
}
/* Type definitions */
struct aaip_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ aaip_ring_adr(struct aaip_state *, size_t, int,
                                 unsigned char **, size_t *, size_t *,
                                 int /*<<< orphan*/);
int aaip_set_buffer_byte(struct aaip_state *aaip, size_t idx,
                         unsigned char data, int flag) {
  unsigned char *start_pt;
  size_t at_start_pt, at_recs;
  aaip_ring_adr(aaip, idx, 1, &start_pt, &at_start_pt, &at_recs, 0);
  *start_pt = data;
  return (1);
}


x86 assembly (clang, -O0):
<aaip_set_buffer_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
lea    -0x20(%rbp),%rcx
lea    -0x28(%rbp),%r8
lea    -0x30(%rbp),%r9
xor    %eax,%eax
movl   $0x0,(%rsp)
call   1030 <aaip_ring_adr@plt>
mov    -0x11(%rbp),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    $0x1,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aaip_set_buffer_byte>:
push   %rbx
sub    $0x20,%rsp
mov    %edx,%ebx
movl   $0x0,(%rsp)
lea    0x8(%rsp),%rcx
lea    0x18(%rsp),%r8
lea    0x10(%rsp),%r9
mov    $0x1,%edx
call   1030 <aaip_ring_adr@plt>
mov    0x8(%rsp),%rax
mov    %bl,(%rax)
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.aaip_state = type { i32 }
define i32 @aaip_set_buffer_byte(%struct.aaip_state* %0, i64 %1, i8 zeroext %2, i32 %3) {
%5 = alloca %struct.aaip_state*
%6 = alloca i64
%7 = alloca i8
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i64
store %struct.aaip_state* %0, %struct.aaip_state** %5
store i64 %1, i64* %6
store i8 %2, i8* %7
store i32 %3, i32* %8
%12 = load %struct.aaip_state*, %struct.aaip_state** %5
%13 = load i64, i64* %6
%14 = call i32 @aaip_ring_adr(%struct.aaip_state* %12, i64 %13, i32 1, i8** %9, i64* %10, i64* %11, i32 0)
%15 = load i8, i8* %7
%16 = load i8*, i8** %9
store i8 %15, i8* %16
ret i32 1
}

LLVM IR (-O2):
%struct.aaip_state = type { i32 }
define i32 @aaip_set_buffer_byte(%struct.aaip_state* %0, i64 %1, i8 zeroext %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = bitcast i8** %5 to i8*
%9 = bitcast i64* %6 to i8*
%10 = bitcast i64* %7 to i8*
%11 = call i32 @aaip_ring_adr(%struct.aaip_state* %0, i64 %1, i32 1, i8** %5, i64* %6, i64* %7, i32 0)
%12 = load i8*, i8** %5
store i8 %2, i8* %12
ret i32 1
}
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char *argv[]) {
  int a = 10;
  int b = 5;
  int c = add(a, b);
  printf("%d\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
movl   $0x5,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <add@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
mov    $0x5,%esi
call   1030 <add@plt>
lea    0xec9(%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 i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 10, i32* %6
store i32 5, i32* %7
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = call i32 @add(i32 %9, i32 %10)
store i32 %11, i32* %8
%12 = load i32, i32* %8
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
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 @add(i32 10, i32 5)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
int is_power_of_2(int n) { return (n & -n) == n; }


x86 assembly (clang, -O0):
<is_power_of_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x4(%rbp),%ecx
and    %ecx,%eax
cmp    -0x4(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_power_of_2>:
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_power_of_2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 0, %4
%6 = and i32 %3, %5
%7 = load i32, i32* %2
%8 = icmp eq i32 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @is_power_of_2(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct bufferevent {
  int dummy;
};

/* Variables and functions */
short BEV_EVENT_EOF;
short BEV_EVENT_ERROR;
int /*<<< orphan*/ bufferevent_free(struct bufferevent *);
void xkcp_mon_event_cb(struct bufferevent *bev, short what, void *ctx) {
  if (what & (BEV_EVENT_EOF | BEV_EVENT_ERROR)) {
    bufferevent_free(bev);
  }
}


x86 assembly (clang, -O0):
<xkcp_mon_event_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
movswl -0xa(%rbp),%eax
mov    0x2eae(%rip),%rcx
movswl (%rcx),%ecx
mov    0x2eb4(%rip),%rdx
movswl (%rdx),%edx
or     %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1155 <xkcp_mon_event_cb+0x45>
mov    -0x8(%rbp),%rdi
call   1030 <bufferevent_free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xkcp_mon_event_cb>:
mov    0x2ec9(%rip),%rax
mov    0x2ed2(%rip),%rcx
movzwl (%rcx),%ecx
or     (%rax),%cx
test   %si,%cx
je     112e <xkcp_mon_event_cb+0x1e>
jmp    1030 <bufferevent_free@plt>
ret

LLVM IR (-O0):
%struct.bufferevent = type { i32 }
@BEV_EVENT_EOF = global i16 0
@BEV_EVENT_ERROR = global i16 0
define void @xkcp_mon_event_cb(%struct.bufferevent* %0, i16 signext %1, i8* %2) {
%4 = alloca %struct.bufferevent*
%5 = alloca i16
%6 = alloca i8*
store %struct.bufferevent* %0, %struct.bufferevent** %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%7 = load i16, i16* %5
%8 = sext i16 %7 to i32
%9 = load i16, i16* @BEV_EVENT_EOF
%10 = sext i16 %9 to i32
%11 = load i16, i16* @BEV_EVENT_ERROR
%12 = sext i16 %11 to i32
%13 = or i32 %10, %12
%14 = and i32 %8, %13
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %3
%17 = load %struct.bufferevent*, %struct.bufferevent** %4
%18 = call i32 @bufferevent_free(%struct.bufferevent* %17)
br label %19
19: ; preds = %16, %3
ret void
}

LLVM IR (-O2):
%struct.bufferevent = type { i32 }
@BEV_EVENT_EOF = global i16 0
@BEV_EVENT_ERROR = global i16 0
define void @xkcp_mon_event_cb(%struct.bufferevent* %0, i16 signext %1, i8* nocapture readnone %2) {
%4 = load i16, i16* @BEV_EVENT_EOF
%5 = load i16, i16* @BEV_EVENT_ERROR
%6 = or i16 %5, %4
%7 = and i16 %6, %1
%8 = icmp eq i16 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = tail call i32 @bufferevent_free(%struct.bufferevent* %0)
br label %11
11: ; preds = %9, %3
ret void
}