xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
char *pgf_filename(char *fn, int size) {
  const char _pgf_ending[5] = {0x2e, 0x70, 0x67, 0x66, 0x00};
  char *newfile = (char *)malloc(size + 5);
  memcpy(newfile, fn, size);
  memcpy(&newfile[size], _pgf_ending, 5);
  return newfile;
}


x86 assembly (clang, -O0):
<pgf_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x11(%rbp)
mov    0xec6(%rip),%al
mov    %al,-0xd(%rbp)
mov    -0xc(%rbp),%edi
add    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rdi
movslq -0xc(%rbp),%rax
add    %rax,%rdi
lea    -0x11(%rbp),%rsi
mov    $0x5,%edx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pgf_filename>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %rdi,%r14
movb   $0x0,0xc(%rsp)
movl   $0x6667702e,0x8(%rsp)
66
lea    0x5(%rbx),%edi
call   1040 <malloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <memcpy@plt>
movslq %ebx,%rdi
add    %r15,%rdi
lea    0x8(%rsp),%rsi
mov    $0x5,%edx
call   1030 <memcpy@plt>
mov    %r15,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.pgf_filename._pgf_ending = [5 x i8] c".pgf\00"
define i8* @pgf_filename(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [5 x i8]
%6 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = bitcast [5 x i8]* %5 to i8*
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 5
%10 = call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %6
%12 = load i8*, i8** %6
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = call i32 @memcpy(i8* %12, i8* %13, i32 %14)
%16 = load i8*, i8** %6
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%21 = call i32 @memcpy(i8* %19, i8* %20, i32 5)
%22 = load i8*, i8** %6
ret i8* %22
}

LLVM IR (-O2):
@__const.pgf_filename._pgf_ending = [5 x i8] c".pgf\00"
define i8* @pgf_filename(i8* %0, i32 %1) {
%3 = alloca [5 x i8]
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%5 = add nsw i32 %1, 5
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @memcpy(i8* %7, i8* %0, i32 %1)
%9 = sext i32 %1 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = call i32 @memcpy(i8* %10, i8* %4, i32 5)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ DeinitFields();
void SwitchFrom_77230(void) { DeinitFields(); }


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

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

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

LLVM IR (-O2):
define void @SwitchFrom_77230() {
%1 = tail call i32 (...) @DeinitFields()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ OCSP_CERTSTATUS;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ OCSP_CERTSTATUS_it;
void OCSP_CERTSTATUS_free(OCSP_CERTSTATUS *a) {
  ASN1_item_free((ASN1_VALUE *)a, &OCSP_CERTSTATUS_it);
}


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

x86 assembly (clang, -O2):
<OCSP_CERTSTATUS_free>:
mov    0x2ec9(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

LLVM IR (-O0):
@OCSP_CERTSTATUS_it = global i32 0
define void @OCSP_CERTSTATUS_free(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @ASN1_item_free(i32* %3, i32* @OCSP_CERTSTATUS_it)
ret void
}

LLVM IR (-O2):
@OCSP_CERTSTATUS_it = global i32 0
define void @OCSP_CERTSTATUS_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @OCSP_CERTSTATUS_it)
ret void
}
int execute_getresgid32() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_getresgid32() {
ret i32 0
}
int numa_pfn_to_nid(unsigned long pfn) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @numa_pfn_to_nid(i64 %0) {
ret i32 0
}
float hosttonetf(float fval) {
  float result;
  char *ptr_val = (char *)&fval;
  char *ptr_res = (char *)&result;
  ptr_res[0] = ptr_val[3];
  ptr_res[1] = ptr_val[2];
  ptr_res[2] = ptr_val[1];
  ptr_res[3] = ptr_val[0];
  return result;
}


x86 assembly (clang, -O0):
<hosttonetf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<hosttonetf>:
movd   %xmm0,%eax
bswap  %eax
movd   %eax,%xmm0
ret

LLVM IR (-O0):
define float @hosttonetf(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca i8*
%5 = alloca i8*
store float %0, float* %2
%6 = bitcast float* %2 to i8*
store i8* %6, i8** %4
%7 = bitcast float* %3 to i8*
store i8* %7, i8** %5
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 3
%10 = load i8, i8* %9
%11 = load i8*, i8** %5
%12 = getelementptr inbounds i8, i8* %11, i64 0
store i8 %10, i8* %12
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8 %15, i8* %17
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = load i8, i8* %19
%21 = load i8*, i8** %5
%22 = getelementptr inbounds i8, i8* %21, i64 2
store i8 %20, i8* %22
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i64 0
%25 = load i8, i8* %24
%26 = load i8*, i8** %5
%27 = getelementptr inbounds i8, i8* %26, i64 3
store i8 %25, i8* %27
%28 = load float, float* %3
ret float %28
}

LLVM IR (-O2):
define float @hosttonetf(float %0) {
%2 = bitcast float %0 to i32
%3 = tail call i32 @llvm.bswap.i32(i32 %2)
%4 = bitcast i32 %3 to float
ret float %4
}
int test_imm_F6int64_midword_reg(long long val) {
  return ((val >> 16) & (0xF6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F6int64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0xf6,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F6int64_midword_reg>:
test   $0xf60000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F6int64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 246
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_F6int64_midword_reg(i64 %0) {
%2 = and i64 %0, 16121856
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
char *str_cat(char *d, char *s) {
  char *p = d;
  while (*d)
    d++;
  while (*d++ = *s++)
    continue;
  return p;
}


x86 assembly (clang, -O0):
<str_cat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <str_cat+0x32>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <str_cat+0x14>
jmp    1137 <str_cat+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1166 <str_cat+0x66>
jmp    1137 <str_cat+0x37>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_cat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <str_cat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <str_cat+0x20>
ret

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

LLVM IR (-O2):
define i8* @str_cat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) { printf("Hello world\n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%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 = [13 x i8] c"Hello world\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
char *basename(filename) const char *filename;
{
  char *p = strrchr(filename, '/');
  return p ? p + 1 : (char *)filename;
}


x86 assembly (clang, -O0):
<basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <basename+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <basename+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i32 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i32 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
void tst_fzsync_time(struct timespec *t) { clock_gettime(CLOCK_MONOTONIC, t); }


x86 assembly (clang, -O0):
<tst_fzsync_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst_fzsync_time>:
mov    %rdi,%rsi
mov    0x2ece(%rip),%rax
mov    (%rax),%edi
jmp    1030 <clock_gettime@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define void @tst_fzsync_time(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = load %struct.timespec*, %struct.timespec** %2
%5 = call i32 @clock_gettime(i32 %3, %struct.timespec* %4)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define void @tst_fzsync_time(%struct.timespec* %0) {
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = tail call i32 @clock_gettime(i32 %2, %struct.timespec* %0)
ret void
}
int f(int n) { return n >= 10; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
cmp    $0xa,%edi
setge  %al
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 10
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp sgt i32 %0, 9
%3 = zext i1 %2 to i32
ret i32 %3
}
double div_(double a, double b) { return b / a; }


x86 assembly (clang, -O0):
<div_>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<div_>:
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @div_(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = fdiv double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @div_(double %0, double %1) {
%3 = fdiv double %1, %0
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ AirspeedSettingsHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void AirspeedSettingsLogging() { UAVObjLogging(AirspeedSettingsHandle()); }


x86 assembly (clang, -O0):
<AirspeedSettingsLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <AirspeedSettingsHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<AirspeedSettingsLogging>:
push   %rax
xor    %eax,%eax
call   1040 <AirspeedSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @AirspeedSettingsLogging() {
%1 = call i32 (...) @AirspeedSettingsHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @AirspeedSettingsLogging() {
%1 = tail call i32 (...) @AirspeedSettingsHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bn_barrett_mod_test();
int /*<<< orphan*/ bn_div_mod_test();
int /*<<< orphan*/ bn_exp_test();
int /*<<< orphan*/ bn_mul_test();
void bignum_tests() {
  bn_mul_test();
  bn_div_mod_test();
  bn_barrett_mod_test();
  bn_exp_test();
}


x86 assembly (clang, -O0):
<bignum_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <bn_mul_test@plt>
mov    $0x0,%al
call   1050 <bn_div_mod_test@plt>
mov    $0x0,%al
call   1040 <bn_barrett_mod_test@plt>
mov    $0x0,%al
call   1060 <bn_exp_test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bignum_tests>:
push   %rax
xor    %eax,%eax
call   1030 <bn_mul_test@plt>
xor    %eax,%eax
call   1050 <bn_div_mod_test@plt>
xor    %eax,%eax
call   1040 <bn_barrett_mod_test@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <bn_exp_test@plt>

LLVM IR (-O0):
define void @bignum_tests() {
%1 = call i32 (...) @bn_mul_test()
%2 = call i32 (...) @bn_div_mod_test()
%3 = call i32 (...) @bn_barrett_mod_test()
%4 = call i32 (...) @bn_exp_test()
ret void
}

LLVM IR (-O2):
define void @bignum_tests() {
%1 = tail call i32 (...) @bn_mul_test()
%2 = tail call i32 (...) @bn_div_mod_test()
%3 = tail call i32 (...) @bn_barrett_mod_test()
%4 = tail call i32 (...) @bn_exp_test()
ret void
}
void appendfield(morewords) char *morewords;
{
  emit_string("+: ");
  emit_string(morewords);
}


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

x86 assembly (clang, -O2):
<appendfield>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <emit_string@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <emit_string@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"+: \00"
define void @appendfield(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @emit_string to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @emit_string to i32 (i8*, ...)*)(i8* %0)
ret void
}
void g_DUMMY_scrollbar_disconnect(int win_id) { win_id = win_id; }


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

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

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

LLVM IR (-O2):
define void @g_DUMMY_scrollbar_disconnect(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ busy();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int main(int argc, char *argv[]) {
  printf("Hello\n");
  busy();
  sleep(1);
  busy();
  sleep(1);
  printf("Bye\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <busy@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    $0x0,%al
call   1040 <busy@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <busy@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
call   1040 <busy@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
lea    0xea0(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"Hello\0A\00"
@.str.1 = [5 x i8] c"Bye\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @busy()
%8 = call i32 @sleep(i32 1)
%9 = call i32 (...) @busy()
%10 = call i32 @sleep(i32 1)
%11 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [6 x i8] c"Hello\00"
@str.2 = [4 x i8] c"Bye\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @busy()
%5 = tail call i32 @sleep(i32 1)
%6 = tail call i32 (...) @busy()
%7 = tail call i32 @sleep(i32 1)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
unsigned int call_kill(unsigned int id) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @call_kill(i32 %0) {
ret i32 0
}
void pnfs_destroy_all_layouts(struct nfs_client *clp) {}


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

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

LLVM IR (-O0):
%struct.nfs_client = type opaque
define void @pnfs_destroy_all_layouts(%struct.nfs_client* %0) {
%2 = alloca %struct.nfs_client*
store %struct.nfs_client* %0, %struct.nfs_client** %2
ret void
}

LLVM IR (-O2):
%struct.nfs_client = type opaque
define void @pnfs_destroy_all_layouts(%struct.nfs_client* nocapture %0) {
ret void
}
float stdlib_base_abs2f(const float x) { return x * x; }


x86 assembly (clang, -O0):
<stdlib_base_abs2f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_base_abs2f>:
mulss  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define float @stdlib_base_abs2f(float %0) {
%2 = fmul float %0, %0
ret float %2
}
/* Variables and functions */
int closef(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int);
scalar_t__ getpid();
int /*<<< orphan*/ stderr;
int close(int d) {
  fprintf(stderr, "[%d] closing %d\n", (int)getpid(), d);
  return closef(d);
}


x86 assembly (clang, -O0):
<close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getpid@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%edx
mov    -0x4(%rbp),%ecx
lea    0xea3(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1030 <closef@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ea4(%rip),%rax
mov    (%rax),%ebp
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xeb4(%rip),%rsi
mov    %ebp,%edi
mov    %eax,%edx
mov    %ebx,%ecx
call   1050 <fprintf@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <closef@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"[%d] closing %d\0A\00"
define i32 @close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i64 (...) @getpid()
%5 = trunc i64 %4 to i32
%6 = load i32, i32* %2
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @closef(i32 %8)
ret i32 %9
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"[%d] closing %d\0A\00"
define i32 @close(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i64 (...) @getpid()
%4 = trunc i64 %3 to i32
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %0)
%6 = tail call i32 @closef(i32 %0)
ret i32 %6
}
unsigned xrop3_101_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~T;
  stk2 = S | stk3;
  stk1 = D ^ stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_101_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_101_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
not    %ecx
mov    %eax,%edx
or     %ecx,%edx
xor    $0xff,%edx
xor    %eax,%edi
and    %ecx,%edx
not    %eax
and    %esi,%eax
or     %edi,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_101_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %6
%26 = load i32, i32* %10
%27 = or i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %5
%29 = load i32, i32* %9
%30 = xor i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = load i32, i32* %6
%33 = and i32 %31, %32
%34 = load i32, i32* %8
%35 = load i32, i32* %7
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = or i32 %33, %37
%39 = load i32, i32* %7
%40 = load i32, i32* %6
%41 = xor i32 %40, -1
%42 = and i32 %39, %41
%43 = load i32, i32* %5
%44 = and i32 %42, %43
%45 = or i32 %38, %44
ret i32 %45
}

LLVM IR (-O2):
define i32 @xrop3_101_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %6, -1
%8 = or i32 %4, %7
%9 = xor i32 %8, 255
%10 = xor i32 %4, %3
%11 = and i32 %9, %7
%12 = xor i32 %4, -1
%13 = and i32 %12, %5
%14 = or i32 %13, %10
%15 = or i32 %14, %11
ret i32 %15
}
int fun1056() { return 1056; }


x86 assembly (clang, -O0):
<fun1056>:
push   %rbp
mov    %rsp,%rbp
mov    $0x420,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fun1056() {
ret i32 1056
}

LLVM IR (-O2):
define i32 @fun1056() {
ret i32 1056
}
char getsign(int n) { return (n <= 0) ? 'N' : 'P'; }


x86 assembly (clang, -O0):
<getsign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x50,%eax
mov    $0x4e,%ecx
cmp    $0x0,%edx
cmovle %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsign>:
test   %edi,%edi
setg   %al
add    %al,%al
add    $0x4e,%al
ret

LLVM IR (-O0):
define signext i8 @getsign(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 78, i32 80
%7 = trunc i32 %6 to i8
ret i8 %7
}

LLVM IR (-O2):
define signext i8 @getsign(i32 %0) {
%2 = icmp slt i32 %0, 1
%3 = select i1 %2, i8 78, i8 80
ret i8 %3
}
/* Type definitions */
struct event {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int event_open_with_options(struct event *, int /*<<< orphan*/, int, int);
int event_open_with_pid(struct event *e, pid_t pid) {
  return event_open_with_options(e, pid, -1, -1);
}


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

x86 assembly (clang, -O2):
<event_open_with_pid>:
mov    $0xffffffff,%edx
mov    $0xffffffff,%ecx
jmp    1030 <event_open_with_options@plt>

LLVM IR (-O0):
%struct.event = type { i32 }
define i32 @event_open_with_pid(%struct.event* %0, i32 %1) {
%3 = alloca %struct.event*
%4 = alloca i32
store %struct.event* %0, %struct.event** %3
store i32 %1, i32* %4
%5 = load %struct.event*, %struct.event** %3
%6 = load i32, i32* %4
%7 = call i32 @event_open_with_options(%struct.event* %5, i32 %6, i32 -1, i32 -1)
ret i32 %7
}

LLVM IR (-O2):
%struct.event = type { i32 }
define i32 @event_open_with_pid(%struct.event* %0, i32 %1) {
%3 = tail call i32 @event_open_with_options(%struct.event* %0, i32 %1, i32 -1, i32 -1)
ret i32 %3
}
char *dec_to_bin(int number) {
  char *digits;
  int n_digits;
  int i;
  int copy;
  i = 0;
  copy = number;
  while (copy) {
    digits[i] = copy % 2;
    copy /= 2;
    i++;
  }
  return digits;
}


x86 assembly (clang, -O0):
<dec_to_bin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1150 <dec_to_bin+0x50>
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1114 <dec_to_bin+0x14>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @dec_to_bin(i32 %0) {
%2 = icmp eq i32 %0, 0
tail call void @llvm.assume(i1 %2)
ret i8* undef
}
OP(ed, e8) {}


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_mutex_unlock() {
  printf("NOT IMPLEMENTED:"
         "pa_mutex_unlock"
         "\n");
}


x86 assembly (clang, -O0):
<pa_mutex_unlock>:
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_mutex_unlock>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [32 x i8] c"NOT IMPLEMENTED:pa_mutex_unlock\00"
define i32 @pa_mutex_unlock() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int config_WITH_AZBOX(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @config_WITH_AZBOX() {
ret i32 0
}
void pit_null_timer(int new_out, int old_out) {}


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

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

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

LLVM IR (-O2):
define void @pit_null_timer(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ close(int /*<<< orphan*/);
int /*<<< orphan*/ execlp(char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ open(char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  assert(argc == 2);
  close(0);
  open(argv[1], O_RDONLY);
  execlp("sort", "sort", NULL);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %edi,%edi
call   1030 <close@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2e6b(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
lea    0xe75(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
mov    %rsi,%rdi
call   1060 <execlp@plt>
mov    0x2e3a(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
cmp    $0x2,%edi
sete   %al
mov    %eax,%edi
call   1040 <assert@plt>
xor    %edi,%edi
call   1030 <close@plt>
mov    0x8(%rbx),%rdi
mov    0x2e83(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
lea    0xe8d(%rip),%rdi
mov    %rdi,%rsi
xor    %edx,%edx
call   1060 <execlp@plt>
mov    0x2e54(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
@.str = [5 x i8] c"sort\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 2
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = call i32 @close(i32 0)
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = load i32, i32* @O_RDONLY
%15 = call i32 @open(i8* %13, i32 %14)
%16 = call i32 @execlp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* null)
%17 = load i32, i32* @EXIT_SUCCESS
ret i32 %17
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
@.str = [5 x i8] c"sort\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @close(i32 0)
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = load i32, i32* @O_RDONLY
%10 = tail call i32 @open(i8* %8, i32 %9)
%11 = tail call i32 @execlp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* null)
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void badusage(void) {
  fprintf(stderr,
          "Usage: fsaandnot [-ip d/s[dr]] [-op d/s] [-silent] [-v] [-l/-h]\n");
  fprintf(stderr, "       filename1 filename2 outfilename\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [65 x i8] c"Usage: fsaandnot [-ip d/s[dr]] [-op d/s] [-silent] [-v] [-l/-h]\0A\00"
@.str.1 = [40 x i8] c" filename1 filename2 outfilename\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [65 x i8] c"Usage: fsaandnot [-ip d/s[dr]] [-op d/s] [-silent] [-v] [-l/-h]\0A\00"
@.str.1 = [40 x i8] c" filename1 filename2 outfilename\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int isinf(double);
int __pruabi_isinf(double a) { return isinf(a); }


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

x86 assembly (clang, -O2):
<__pruabi_isinf>:
jmp    1030 <isinf@plt>

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

LLVM IR (-O2):
define i32 @__pruabi_isinf(double %0) {
%2 = tail call i32 @isinf(double %0)
ret i32 %2
}
/* Variables and functions */
char *concatenate(char *, char *, int, char const *, char const *,
                  char const *);
char *get_app_directory(const char *nm_root, const char *user,
                        const char *app_id) {
  return concatenate("%s/usercache/%s"
                     "/appcache/%s",
                     "app_dir_path", 3, nm_root, user, app_id);
}


x86 assembly (clang, -O0):
<get_app_directory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%r9
lea    0xec9(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x3,%edx
call   1030 <concatenate@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_app_directory>:
mov    %rdx,%r9
mov    %rsi,%r8
mov    %rdi,%rcx
lea    0xee0(%rip),%rdi
lea    0xef5(%rip),%rsi
mov    $0x3,%edx
jmp    1030 <concatenate@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"%s/usercache/%s/appcache/%s\00"
@.str.1 = [13 x i8] c"app_dir_path\00"
define i8* @get_app_directory(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i8* @concatenate(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 3, i8* %7, i8* %8, i8* %9)
ret i8* %10
}

LLVM IR (-O2):
@.str = [28 x i8] c"%s/usercache/%s/appcache/%s\00"
@.str.1 = [13 x i8] c"app_dir_path\00"
define i8* @get_app_directory(i8* %0, i8* %1, i8* %2) {
%4 = tail call i8* @concatenate(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 3, i8* %0, i8* %1, i8* %2)
ret i8* %4
}
unsigned short tf_bH(signed char x, unsigned short c) { return c / 3; }


x86 assembly (clang, -O0):
<tf_bH>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tf_bH>:
imul   $0xaaab,%esi,%eax
shr    $0x11,%eax
ret

LLVM IR (-O0):
define zeroext i16 @tf_bH(i8 signext %0, i16 zeroext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = zext i16 %5 to i32
%7 = sdiv i32 %6, 3
%8 = trunc i32 %7 to i16
ret i16 %8
}

LLVM IR (-O2):
define zeroext i16 @tf_bH(i8 signext %0, i16 zeroext %1) {
%3 = udiv i16 %1, 3
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ ili9340_draw_line_v(int, int, int, int);
void draw_vert_line(int x, int y, int h, int color_mode) {
  if (color_mode) {
    ili9340_draw_line_v(x, y, h, 0xF800);
  } else {
    ili9340_draw_line_v(x, y, h, 0x0000);
  }
}


x86 assembly (clang, -O0):
<draw_vert_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1146 <draw_vert_line+0x36>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0xf800,%ecx
call   1030 <ili9340_draw_line_v@plt>
jmp    1156 <draw_vert_line+0x46>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
xor    %ecx,%ecx
call   1030 <ili9340_draw_line_v@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_vert_line>:
test   %ecx,%ecx
mov    $0xf800,%eax
cmovne %eax,%ecx
jmp    1030 <ili9340_draw_line_v@plt>

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

LLVM IR (-O2):
define void @draw_vert_line(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %3, 0
%6 = select i1 %5, i32 0, i32 63488
%7 = tail call i32 @ili9340_draw_line_v(i32 %0, i32 %1, i32 %2, i32 %6)
ret void
}
int test_imm_B1int64_lowword_mem(long long *val) {
  return ((*val) & (0xB1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B1int64_lowword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
and    $0xb1,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B1int64_lowword_mem>:
testb  $0xb1,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_B1int64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 177
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_B1int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 177
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int hash(int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main(int argc, char **argv) {
  printf("Hash results are %x, %x, %x\n", hash(0xdeadbeef), hash(0x00000001),
         hash(0x00000130));
  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)
mov    $0xdeadbeef,%edi
call   1030 <hash@plt>
mov    %eax,-0x18(%rbp)
mov    $0x1,%edi
call   1030 <hash@plt>
mov    %eax,-0x14(%rbp)
mov    $0x130,%edi
call   1030 <hash@plt>
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    %eax,%ecx
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0xdeadbeef,%edi
call   1030 <hash@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1030 <hash@plt>
mov    %eax,%ebp
mov    $0x130,%edi
call   1030 <hash@plt>
lea    0xeb4(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%ecx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Hash results are %x, %x, %x\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @hash(i32 -559038737)
%7 = call i32 @hash(i32 1)
%8 = call i32 @hash(i32 304)
%9 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Hash results are %x, %x, %x\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @hash(i32 -559038737)
%4 = tail call i32 @hash(i32 1)
%5 = tail call i32 @hash(i32 304)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4, i32 %5)
ret i32 0
}