xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void p_free(const char *fn, long line, void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<p_free>:
mov    %rdx,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @p_free(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = call i32 @free(i8* %7)
ret void
}

LLVM IR (-O2):
define void @p_free(i8* nocapture readnone %0, i64 %1, i8* nocapture %2) {
%4 = tail call i32 @free(i8* %2)
ret void
}
void asctoe64(s, y) char *s;
unsigned short *y;
{ asctoeg(s, y, 64); }


x86 assembly (clang, -O0):
<asctoe64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x40,%edx
mov    $0x0,%al
call   1030 <asctoeg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asctoe64>:
mov    $0x40,%edx
xor    %eax,%eax
jmp    1030 <asctoeg@plt>

LLVM IR (-O0):
define void @asctoe64(i8* %0, i16* %1) {
%3 = alloca i8*
%4 = alloca i16*
store i8* %0, i8** %3
store i16* %1, i16** %4
%5 = load i8*, i8** %3
%6 = load i16*, i16** %4
%7 = call i32 (i8*, i16*, i32, ...) bitcast (i32 (...)* @asctoeg to i32 (i8*, i16*, i32, ...)*)(i8* %5, i16* %6, i32 64)
ret void
}

LLVM IR (-O2):
define void @asctoe64(i8* %0, i16* %1) {
%3 = tail call i32 (i8*, i16*, i32, ...) bitcast (i32 (...)* @asctoeg to i32 (i8*, i16*, i32, ...)*)(i8* %0, i16* %1, i32 64)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vecNf_scalarMult_new(float *, float *, float const,
                                        int const);
void vecNf_scalarMult(float v[], const float scalar, const int n) {
  vecNf_scalarMult_new(v, v, scalar, n);
}


x86 assembly (clang, -O0):
<vecNf_scalarMult>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movss  -0xc(%rbp),%xmm0
mov    -0x10(%rbp),%edx
call   1030 <vecNf_scalarMult_new@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vecNf_scalarMult>:
mov    %esi,%edx
mov    %rdi,%rsi
jmp    1030 <vecNf_scalarMult_new@plt>

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

LLVM IR (-O2):
define void @vecNf_scalarMult(float* %0, float %1, i32 %2) {
%4 = tail call i32 @vecNf_scalarMult_new(float* %0, float* %0, float %1, i32 %2)
ret void
}
int ismatch(char a, char b) { return (a == b); }


x86 assembly (clang, -O0):
<ismatch>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ismatch>:
xor    %eax,%eax
cmp    %sil,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @ismatch(i8 signext %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 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ismatch(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
unsigned long rand();
unsigned long makeSeed() { return rand(); }


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

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

LLVM IR (-O0):
define i64 @makeSeed() {
%1 = call i64 (...) @rand()
ret i64 %1
}

LLVM IR (-O2):
define i64 @makeSeed() {
%1 = tail call i64 (...) @rand()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ Reserved169_DriverIRQHandler();
__attribute__((weak)) void Reserved169_IRQHandler(void) {
  Reserved169_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @Reserved169_IRQHandler() {
%1 = call i32 (...) @Reserved169_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @Reserved169_IRQHandler() {
%1 = tail call i32 (...) @Reserved169_DriverIRQHandler()
ret void
}
void ff_hevc_put_hevc_bi_w_epel_h4_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_epel_h4_12_sse4() {
ret void
}
void g_unichar_totitle() {}


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

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

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

LLVM IR (-O2):
define void @g_unichar_totitle() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
char *Rcmd(char *r) {
  printf("Rcmd executed\n");
  return NULL;
}


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Rcmd executed\00"
define noalias i8* @Rcmd(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void sint_put(signed int number, FILE *stream) {
  if (number > (signed int)9) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
    sint_put(number / (signed int)10, stream);
#pragma GCC diagnostic pop
  }
  fputc('0' + (char)(number % (signed int)10), stream);
}


x86 assembly (clang, -O0):
<sint_put>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x9,-0x4(%rbp)
jle    114f <sint_put+0x2f>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1030 <sint_put@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %dl,%al
movsbl %al,%eax
add    $0x30,%eax
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1040 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sint_put>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
cmp    $0xa,%edi
jl     1144 <sint_put+0x24>
mov    %ebp,%eax
mov    $0xcccccccd,%edi
imul   %rax,%rdi
shr    $0x23,%rdi
mov    %rbx,%rsi
call   1030 <sint_put@plt>
movslq %ebp,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebp
add    $0x30,%bpl
movsbl %bpl,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fputc@plt>

LLVM IR (-O0):
define void @sint_put(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 = icmp sgt i32 %5, 9
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* %3
%9 = sdiv i32 %8, 10
%10 = load i32*, i32** %4
br label %11
11: ; preds = %7, %2
%12 = load i32, i32* %3
%13 = srem i32 %12, 10
%14 = trunc i32 %13 to i8
%15 = sext i8 %14 to i32
%16 = add nsw i32 48, %15
%17 = trunc i32 %16 to i8
%18 = load i32*, i32** %4
%19 = call i32 @fputc(i8 signext %17, i32* %18)
ret void
}

LLVM IR (-O2):
define void @sint_put(i32 %0, i32* nocapture %1) {
%3 = icmp sgt i32 %0, 9
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = udiv i32 %0, 10
tail call void @sint_put(i32 %5, i32* %1)
br label %6
6: ; preds = %4, %2
%7 = srem i32 %0, 10
%8 = trunc i32 %7 to i8
%9 = add nsw i8 %8, 48
%10 = tail call i32 @fputc(i8 signext %9, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ConcatArgs(int);
int /*<<< orphan*/ G_LogPrintf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ trap_SendServerCommand(int, int /*<<< orphan*/);
int /*<<< orphan*/ va(char *, int /*<<< orphan*/);
void Svcmd_Chat_f(void) {
  trap_SendServerCommand(-1, va("chat \"%s\"", ConcatArgs(1)));
  G_LogPrintf("chat: %s\n", ConcatArgs(1));
}


x86 assembly (clang, -O0):
<Svcmd_Chat_f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <ConcatArgs@plt>
mov    %eax,%esi
lea    0xea9(%rip),%rdi
call   1050 <va@plt>
mov    %eax,%esi
mov    $0xffffffff,%edi
call   1030 <trap_SendServerCommand@plt>
mov    $0x1,%edi
call   1040 <ConcatArgs@plt>
mov    %eax,%esi
lea    0xe8f(%rip),%rdi
call   1060 <G_LogPrintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Svcmd_Chat_f>:
push   %rax
mov    $0x1,%edi
call   1040 <ConcatArgs@plt>
lea    0xeae(%rip),%rdi
mov    %eax,%esi
call   1050 <va@plt>
mov    $0xffffffff,%edi
mov    %eax,%esi
call   1030 <trap_SendServerCommand@plt>
mov    $0x1,%edi
call   1040 <ConcatArgs@plt>
lea    0xe94(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1060 <G_LogPrintf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"chat \22%s\22\00"
@.str.1 = [10 x i8] c"chat: %s\0A\00"
define void @Svcmd_Chat_f() {
%1 = call i32 @ConcatArgs(i32 1)
%2 = call i32 @va(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @trap_SendServerCommand(i32 -1, i32 %2)
%4 = call i32 @ConcatArgs(i32 1)
%5 = call i32 @G_LogPrintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"chat \22%s\22\00"
@.str.1 = [10 x i8] c"chat: %s\0A\00"
define void @Svcmd_Chat_f() {
%1 = tail call i32 @ConcatArgs(i32 1)
%2 = tail call i32 @va(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @trap_SendServerCommand(i32 -1, i32 %2)
%4 = tail call i32 @ConcatArgs(i32 1)
%5 = tail call i32 @G_LogPrintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_stream_get_underflow_index() {
  printf("NOT IMPLEMENTED:"
         "pa_stream_get_underflow_index"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [47 x i8] c"NOT IMPLEMENTED:pa_stream_get_underflow_index\0A\00"
define i32 @pa_stream_get_underflow_index() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [46 x i8] c"NOT IMPLEMENTED:pa_stream_get_underflow_index\00"
define i32 @pa_stream_get_underflow_index() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
bool is_alpha(char c) {
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_';
}


x86 assembly (clang, -O0):
<is_alpha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1129 <is_alpha+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    1155 <is_alpha+0x55>
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1148 <is_alpha+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    1155 <is_alpha+0x55>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_alpha>:
mov    %edi,%eax
and    $0xdf,%al
add    $0xbf,%al
cmp    $0x1a,%al
setb   %al
cmp    $0x5f,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_alpha(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %22, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 65
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 90
br i1 %17, label %22, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 95
br label %22
22: ; preds = %18, %14, %6
%23 = phi i1 [ true, %14 ], [ true, %6 ], [ %21, %18 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @is_alpha(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = icmp eq i8 %0, 95
%6 = or i1 %5, %4
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_size;
};
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
scalar_t__ stat(char const *, struct stat *);
off_t fsize(const char *filename) {
  struct stat st;
  if (stat(filename, &st) == 0)
    return st.st_size;
  perror("stat");
  exit(errno);
}


x86 assembly (clang, -O0):
<fsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jne    115c <fsize+0x2c>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret
lea    0xe9d(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<fsize>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %rax,%rax
jne    1143 <fsize+0x13>
mov    (%rsp),%eax
pop    %rcx
ret
lea    0xeb6(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [5 x i8] c"stat\00"
@errno = global i32 0
define i32 @fsize(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%9 = load i32, i32* %8
ret i32 %9
10: ; preds = %1
%11 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @errno
%13 = call i32 @exit(i32 %12)
unreachable
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [5 x i8] c"stat\00"
@errno = global i32 0
define i32 @fsize(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
ret i32 %8
9: ; preds = %1
%10 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @errno
%12 = call i32 @exit(i32 %11)
unreachable
}
/* Variables and functions */
scalar_t__ random();
double rand0max(double max) {
  double randnum;
  randnum = (double)random();
  randnum /= ((double)((unsigned long)0xffffffff) + 1) / max;
  return randnum;
}


x86 assembly (clang, -O0):
<rand0max>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xeca(%rip),%xmm1
divsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand0max>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <random@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  0xed3(%rip),%xmm1
divsd  (%rsp),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @rand0max(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = call i64 (...) @random()
%5 = sitofp i64 %4 to double
store double %5, double* %3
%6 = load double, double* %2
%7 = fdiv double 0x41F0000000000000, %6
%8 = load double, double* %3
%9 = fdiv double %8, %7
store double %9, double* %3
%10 = load double, double* %3
ret double %10
}

LLVM IR (-O2):
define double @rand0max(double %0) {
%2 = tail call i64 (...) @random()
%3 = sitofp i64 %2 to double
%4 = fdiv double 0x41F0000000000000, %0
%5 = fdiv double %3, %4
ret double %5
}
double UTD1(u)
unsigned u;
{
  double d;
  d = (int)u;
  return ((int)u < 0) ? d + 4294967296.0 : d;
}


x86 assembly (clang, -O0):
<UTD1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1132 <UTD1+0x32>
movsd  0xedd(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113c <UTD1+0x3c>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<UTD1>:
cvtsi2sd %edi,%xmm0
test   %edi,%edi
jns    1110 <UTD1+0x10>
addsd  0xef0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @UTD1(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
store double %5, double* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load double, double* %3
%10 = fadd double %9, 0x41F0000000000000
br label %13
11: ; preds = %1
%12 = load double, double* %3
br label %13
13: ; preds = %11, %8
%14 = phi double [ %10, %8 ], [ %12, %11 ]
ret double %14
}

LLVM IR (-O2):
define double @UTD1(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = icmp slt i32 %0, 0
%4 = fadd double %2, 0x41F0000000000000
%5 = select i1 %3, double %4, double %2
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int control_close(int fd) {
  close(fd);
  return (1);
}


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

x86 assembly (clang, -O2):
<control_close>:
push   %rax
call   1030 <close@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @control_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 1
}
void loop() {
  for (int i = 0; i < 10; i++)
    i + 2;
  return;
}


x86 assembly (clang, -O0):
<loop>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1123 <loop+0x23>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <loop+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @loop() {
ret void
}
/* Type definitions */
struct timespec {
  int tv_sec;
  long tv_nsec;
};

/* Variables and functions */
long delta_ns(struct timespec begin, struct timespec end) {
  return (end.tv_sec - begin.tv_sec) * 1000000000 + end.tv_nsec - begin.tv_nsec;
}


x86 assembly (clang, -O0):
<delta_ns>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
mov    %edx,-0x20(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x20(%rbp),%eax
sub    -0x10(%rbp),%eax
imul   $0x3b9aca00,%eax,%eax
cltq
add    -0x18(%rbp),%rax
sub    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<delta_ns>:
sub    %edi,%edx
imul   $0x3b9aca00,%edx,%eax
cltq
sub    %rsi,%rcx
add    %rcx,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define i64 @delta_ns(i32 %0, i64 %1, i32 %2, i64 %3) {
%5 = alloca %struct.timespec
%6 = alloca %struct.timespec
%7 = bitcast %struct.timespec* %5 to { i32, i64 }*
%8 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %7, i32 0, i32 0
store i32 %0, i32* %8
%9 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = bitcast %struct.timespec* %6 to { i32, i64 }*
%11 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %10, i32 0, i32 0
store i32 %2, i32* %11
%12 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %10, i32 0, i32 1
store i64 %3, i64* %12
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 0
%14 = load i32, i32* %13
%15 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 0
%16 = load i32, i32* %15
%17 = sub nsw i32 %14, %16
%18 = mul nsw i32 %17, 1000000000
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 1
%21 = load i64, i64* %20
%22 = add nsw i64 %19, %21
%23 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 1
%24 = load i64, i64* %23
%25 = sub nsw i64 %22, %24
ret i64 %25
}

LLVM IR (-O2):
define i64 @delta_ns(i32 %0, i64 %1, i32 %2, i64 %3) {
%5 = sub nsw i32 %2, %0
%6 = mul nsw i32 %5, 1000000000
%7 = sext i32 %6 to i64
%8 = sub i64 %3, %1
%9 = add i64 %8, %7
ret i64 %9
}
int HTTPWrapperSSLRecv(int s, char *buf, int len, int flags) { return -1; }


x86 assembly (clang, -O0):
<HTTPWrapperSSLRecv>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @HTTPWrapperSSLRecv(i32 %0, i8* nocapture readnone %1, i32 %2, i32 %3) {
ret i32 -1
}
int adds32(int x, int y) { return x + y; }


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

x86 assembly (clang, -O2):
<adds32>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @adds32(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @adds32(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
scalar_t__ isalpha(int);
int gchar(FILE *fp) {
  int c;
  while (isalpha(c = fgetc(fp)) == 0 && c != '-')
    ;
  return c;
}


x86 assembly (clang, -O0):
<gchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,%edi
mov    %edi,-0xc(%rbp)
call   1040 <isalpha@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0xd(%rbp)
jne    115b <gchar+0x3b>
cmpl   $0x2d,-0xc(%rbp)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    116b <gchar+0x4b>
jmp    1170 <gchar+0x50>
jmp    112c <gchar+0xc>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gchar>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1040 <isalpha@plt>
cmp    $0x2d,%ebp
je     114b <gchar+0x2b>
test   %rax,%rax
je     1130 <gchar+0x10>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @gchar(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
br label %4
4: ; preds = %14, %1
%5 = load i32*, i32** %2
%6 = call i32 @fgetc(i32* %5)
store i32 %6, i32* %3
%7 = call i64 @isalpha(i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = load i32, i32* %3
%11 = icmp ne i32 %10, 45
br label %12
12: ; preds = %9, %4
%13 = phi i1 [ false, %4 ], [ %11, %9 ]
br i1 %13, label %14, label %15
14: ; preds = %12
br label %4
15: ; preds = %12
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @gchar(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @fgetc(i32* %0)
%4 = tail call i64 @isalpha(i32 %3)
%5 = icmp eq i64 %4, 0
%6 = icmp ne i32 %3, 45
%7 = and i1 %6, %5
br i1 %7, label %2, label %8
8: ; preds = %2
ret i32 %3
}
__attribute__((__nothrow__)) strtoll(__const char *__restrict __nptr,
                                     char **__restrict __endptr, int __base) {}


x86 assembly (clang, -O0):
<strtoll>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @strtoll(i8* noalias nocapture readnone %0, i8** noalias nocapture readnone %1, i32 %2) {
ret i32 undef
}
double ls_costN_nm9_twice(double x) { return x + x; }


x86 assembly (clang, -O0):
<ls_costN_nm9_twice>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_costN_nm9_twice>:
addsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @ls_costN_nm9_twice(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fadd double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @ls_costN_nm9_twice(double %0) {
%2 = fadd double %0, %0
ret double %2
}
void idcZero(int assume) {
  if (assume)
    ;
}


x86 assembly (clang, -O0):
<idcZero>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1116 <idcZero+0x16>
jmp    1116 <idcZero+0x16>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @idcZero(i32 %0) {
ret void
}
void av_display_rotation_set() {}


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

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

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

LLVM IR (-O2):
define void @av_display_rotation_set() {
ret void
}
void foo065(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo065(i32 %0) {
ret void
}
/* Variables and functions */
int CRC_Check_16(unsigned char const *, unsigned long, unsigned short);
int DAB_DGDEC_IMPL_checkCrc(const unsigned char *buf, unsigned long len,
                            unsigned short crc_field) {
  return CRC_Check_16(buf, len, crc_field);
}


x86 assembly (clang, -O0):
<DAB_DGDEC_IMPL_checkCrc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movzwl -0x12(%rbp),%edx
call   1030 <CRC_Check_16@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DAB_DGDEC_IMPL_checkCrc>:
jmp    1030 <CRC_Check_16@plt>

LLVM IR (-O0):
define i32 @DAB_DGDEC_IMPL_checkCrc(i8* %0, i64 %1, i16 zeroext %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i16
store i8* %0, i8** %4
store i64 %1, i64* %5
store i16 %2, i16* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i16, i16* %6
%10 = call i32 @CRC_Check_16(i8* %7, i64 %8, i16 zeroext %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @DAB_DGDEC_IMPL_checkCrc(i8* %0, i64 %1, i16 zeroext %2) {
%4 = tail call i32 @CRC_Check_16(i8* %0, i64 %1, i16 zeroext %2)
ret i32 %4
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, int);
char *ds_strnzcpy(char *pDest, const char *pSource, int32_t iCount) {
  strncpy(pDest, pSource, iCount);
  pDest[iCount - 1] = 0;
  return (pDest);
}


x86 assembly (clang, -O0):
<ds_strnzcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ds_strnzcpy>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
call   1030 <strncpy@plt>
movslq %ebp,%rax
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @ds_strnzcpy(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @strncpy(i8* %7, i8* %8, i32 %9)
%11 = load i8*, i8** %4
%12 = load i32, i32* %6
%13 = sub nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %11, i64 %14
store i8 0, i8* %15
%16 = load i8*, i8** %4
ret i8* %16
}

LLVM IR (-O2):
define i8* @ds_strnzcpy(i8* returned %0, i8* %1, i32 %2) {
%4 = tail call i32 @strncpy(i8* %0, i8* %1, i32 %2)
%5 = add nsw i32 %2, -1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %7
ret i8* %0
}
/* Variables and functions */
scalar_t__ COND_LS();
int /*<<< orphan*/ EA_AY_AI_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_sls_8_ai(void) {
  m68ki_write_8(EA_AY_AI_8(), COND_LS() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_sls_8_ai>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <EA_AY_AI_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <COND_LS@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_sls_8_ai>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <EA_AY_AI_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <COND_LS@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_sls_8_ai() {
%1 = call i32 (...) @EA_AY_AI_8()
%2 = call i64 (...) @COND_LS()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_sls_8_ai() {
%1 = tail call i32 (...) @EA_AY_AI_8()
%2 = tail call i64 (...) @COND_LS()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SystemCall(int);
void RLUnCompVram(void *source, void *dest) { SystemCall(21); }


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

x86 assembly (clang, -O2):
<RLUnCompVram>:
mov    $0x15,%edi
jmp    1030 <SystemCall@plt>

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

LLVM IR (-O2):
define void @RLUnCompVram(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @SystemCall(i32 21)
ret void
}
int f(int a) {}


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

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

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
ret i32 undef
}
void *generate_raw(unsigned char *len_str, unsigned int *len_p) {
  unsigned char len = len_str[0] + 1;
  unsigned char *str = malloc(sizeof(unsigned char[len]));
  memcpy(str, len_str + 1, len);
  *len_p = len;
  return str;
}


x86 assembly (clang, -O0):
<generate_raw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
add    $0x1,%eax
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x1,%rsi
movzbl -0x11(%rbp),%eax
mov    %eax,%edx
call   1030 <memcpy@plt>
movzbl -0x11(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_raw>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%al
add    $0x1,%al
movzbl %al,%r15d
mov    %r15,%rdi
call   1040 <malloc@plt>
mov    %rax,%r12
add    $0x1,%rbx
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1030 <memcpy@plt>
mov    %r15d,(%r14)
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @generate_raw(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i8
%6 = alloca i8*
store i8* %0, i8** %3
store i32* %1, i32** %4
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = add nsw i32 %10, 1
%12 = trunc i32 %11 to i8
store i8 %12, i8* %5
%13 = load i8, i8* %5
%14 = zext i8 %13 to i64
%15 = call i8* @malloc(i64 %14)
store i8* %15, i8** %6
%16 = load i8*, i8** %6
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 1
%19 = load i8, i8* %5
%20 = zext i8 %19 to i64
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = load i32*, i32** %4
store i32 %22, i32* %23
%24 = load i8*, i8** %6
ret i8* %24
}

LLVM IR (-O2):
define noalias i8* @generate_raw(i8* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = add i8 %3, 1
%5 = zext i8 %4 to i64
%6 = tail call i8* @malloc(i64 %5)
%7 = getelementptr inbounds i8, i8* %0, i64 1
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %6, i8* align 1 %7, i64 %5, i1 false)
%8 = zext i8 %4 to i32
store i32 %8, i32* %1
ret i8* %6
}
void zhopa(void) {}


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

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

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

LLVM IR (-O2):
define void @zhopa() {
ret void
}
/* Variables and functions */
char checkDiagonalWin(char **);
char checkHorizontalWin(char **);
char checkVerticalWin(char **);
char checkWin(char board[5 + 1][5 + 1]) {
  char win;
  win = checkVerticalWin(board);
  if (win == 0) {
    win = checkHorizontalWin(board);
    if (win == 0) {
      win = checkDiagonalWin(board);
    }
  }
  return (win);
}


x86 assembly (clang, -O0):
<checkWin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <checkVerticalWin@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x0,%eax
jne    117f <checkWin+0x4f>
mov    -0x8(%rbp),%rdi
call   1050 <checkHorizontalWin@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x0,%eax
jne    117a <checkWin+0x4a>
mov    -0x8(%rbp),%rdi
call   1030 <checkDiagonalWin@plt>
mov    %al,-0x9(%rbp)
jmp    117f <checkWin+0x4f>
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkWin>:
push   %rbx
mov    %rdi,%rbx
call   1040 <checkVerticalWin@plt>
test   %al,%al
jne    1149 <checkWin+0x19>
mov    %rbx,%rdi
call   1050 <checkHorizontalWin@plt>
test   %al,%al
je     114b <checkWin+0x1b>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <checkDiagonalWin@plt>

LLVM IR (-O0):
define signext i8 @checkWin([6 x i8]* %0) {
%2 = alloca [6 x i8]*
%3 = alloca i8
store [6 x i8]* %0, [6 x i8]** %2
%4 = load [6 x i8]*, [6 x i8]** %2
%5 = bitcast [6 x i8]* %4 to i8**
%6 = call signext i8 @checkVerticalWin(i8** %5)
store i8 %6, i8* %3
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %22
10: ; preds = %1
%11 = load [6 x i8]*, [6 x i8]** %2
%12 = bitcast [6 x i8]* %11 to i8**
%13 = call signext i8 @checkHorizontalWin(i8** %12)
store i8 %13, i8* %3
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %10
%18 = load [6 x i8]*, [6 x i8]** %2
%19 = bitcast [6 x i8]* %18 to i8**
%20 = call signext i8 @checkDiagonalWin(i8** %19)
store i8 %20, i8* %3
br label %21
21: ; preds = %17, %10
br label %22
22: ; preds = %21, %1
%23 = load i8, i8* %3
ret i8 %23
}

LLVM IR (-O2):
define signext i8 @checkWin([6 x i8]* %0) {
%2 = bitcast [6 x i8]* %0 to i8**
%3 = tail call signext i8 @checkVerticalWin(i8** %2)
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = tail call signext i8 @checkHorizontalWin(i8** %2)
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call signext i8 @checkDiagonalWin(i8** %2)
br label %10
10: ; preds = %5, %8, %1
%11 = phi i8 [ %9, %8 ], [ %6, %5 ], [ %3, %1 ]
ret i8 %11
}
/* Variables and functions */
int fls(int);
int __fls(int mask) { return (fls(mask) - 1); }


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

x86 assembly (clang, -O2):
<__fls>:
push   %rax
call   1030 <fls@plt>
add    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @__fls(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @fls(i32 %3)
%5 = sub nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @__fls(i32 %0) {
%2 = tail call i32 @fls(i32 %0)
%3 = add nsw i32 %2, -1
ret i32 %3
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strnlen(char const *, size_t);
char *strndup(const char *str, size_t max) {
  size_t len = strnlen(str, max);
  char *res = malloc(len + 1);
  if (res) {
    memcpy(res, str, len);
    res[len] = '\0';
  }
  return res;
}


x86 assembly (clang, -O0):
<strndup>:
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 <strnlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     118a <strndup+0x5a>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strnlen@plt>
mov    %rax,%r15
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1164 <strndup+0x34>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strndup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i8*, i8** %3
%8 = load i64, i64* %4
%9 = call i64 @strnlen(i8* %7, i64 %8)
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = add i64 %10, 1
%12 = call i8* @malloc(i64 %11)
store i8* %12, i8** %6
%13 = load i8*, i8** %6
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %23
15: ; preds = %2
%16 = load i8*, i8** %6
%17 = load i8*, i8** %3
%18 = load i64, i64* %5
%19 = call i32 @memcpy(i8* %16, i8* %17, i64 %18)
%20 = load i8*, i8** %6
%21 = load i64, i64* %5
%22 = getelementptr inbounds i8, i8* %20, i64 %21
store i8 0, i8* %22
br label %23
23: ; preds = %15, %2
%24 = load i8*, i8** %6
ret i8* %24
}

LLVM IR (-O2):
define i8* @strndup(i8* %0, i64 %1) {
%3 = tail call i64 @strnlen(i8* %0, i64 %1)
%4 = add i64 %3, 1
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %3)
%9 = getelementptr inbounds i8, i8* %5, i64 %3
store i8 0, i8* %9
br label %10
10: ; preds = %7, %2
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int gethostname(char *, size_t);
int /*<<< orphan*/ reduceLen32(char *, int /*<<< orphan*/ *);
int sbpGethostname32(char *name, uint32_t *namelen) {
  size_t i, len = (size_t)(*namelen);
  int res = gethostname(name, len);
  reduceLen32(name, namelen);
  return res;
}


x86 assembly (clang, -O0):
<sbpGethostname32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <gethostname@plt>
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <reduceLen32@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbpGethostname32>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
movslq (%rsi),%rsi
call   1040 <gethostname@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <reduceLen32@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @sbpGethostname32(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
store i8* %0, i8** %3
store i32* %1, i32** %4
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = sext i32 %9 to i64
store i64 %10, i64* %6
%11 = load i8*, i8** %3
%12 = load i64, i64* %6
%13 = call i32 @gethostname(i8* %11, i64 %12)
store i32 %13, i32* %7
%14 = load i8*, i8** %3
%15 = load i32*, i32** %4
%16 = call i32 @reduceLen32(i8* %14, i32* %15)
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @sbpGethostname32(i8* %0, i32* %1) {
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = tail call i32 @gethostname(i8* %0, i64 %4)
%6 = tail call i32 @reduceLen32(i8* %0, i32* %1)
ret i32 %5
}
/* Variables and functions */
unsigned long __builtin_arm_rbit64(unsigned long);
unsigned long rbitl(unsigned long a) { return __builtin_arm_rbit64(a); }


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

x86 assembly (clang, -O2):
<rbitl>:
jmp    1030 <__builtin_arm_rbit64@plt>

LLVM IR (-O0):
define i64 @rbitl(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @__builtin_arm_rbit64(i64 %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @rbitl(i64 %0) {
%2 = tail call i64 @__builtin_arm_rbit64(i64 %0)
ret i64 %2
}
int pcifind(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @pcifind() {
ret i32 0
}

LLVM IR (-O2):
define i32 @pcifind() {
ret i32 0
}
void setThreadName(const char *name) {}


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

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

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

LLVM IR (-O2):
define void @setThreadName(i8* nocapture %0) {
ret void
}
/* Variables and functions */
char *STP_OUT_get_port_name(int);
int /*<<< orphan*/ printf(char *, ...);
void CLI_out_port_id(int port, unsigned char cr) {
  printf("%s", STP_OUT_get_port_name(port));
  if (cr) {
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<CLI_out_port_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <STP_OUT_get_port_name@plt>
mov    %rax,%rsi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpb   $0x0,-0x5(%rbp)
je     1162 <CLI_out_port_id+0x42>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CLI_out_port_id>:
push   %rbx
mov    %esi,%ebx
call   1050 <STP_OUT_get_port_name@plt>
lea    0xec1(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebx,%ebx
je     1158 <CLI_out_port_id+0x28>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @CLI_out_port_id(i32 %0, i8 zeroext %1) {
%3 = tail call i8* @STP_OUT_get_port_name(i32 %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = icmp eq i8 %1, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @putchar(i32 10)
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGSEGV;
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
void die() { kill(getpid(), SIGSEGV); }


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
call   1040 <kill@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<die>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    0x2eb9(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
pop    %rax
jmp    1040 <kill@plt>

LLVM IR (-O0):
@SIGSEGV = global i32 0
define void @die() {
%1 = call i32 (...) @getpid()
%2 = load i32, i32* @SIGSEGV
%3 = call i32 @kill(i32 %1, i32 %2)
ret void
}

LLVM IR (-O2):
@SIGSEGV = global i32 0
define void @die() {
%1 = tail call i32 (...) @getpid()
%2 = load i32, i32* @SIGSEGV
%3 = tail call i32 @kill(i32 %1, i32 %2)
ret void
}