xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *to_message(int num) {
  char static result[256];
  if (num < 10) {
    sprintf(result, "%d: blah blah", num);
  } else {
    strcpy(result, "Unknown");
  }
  return result;
}


x86 assembly (clang, -O0):
<to_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1150 <to_message+0x30>
mov    -0x4(%rbp),%edx
lea    0x2f01(%rip),%rdi
lea    0xeba(%rip),%rsi
call   1040 <sprintf@plt>
jmp    1163 <to_message+0x43>
lea    0x2ee9(%rip),%rdi
lea    0xeb0(%rip),%rsi
call   1030 <strcpy@plt>
lea    0x2ed6(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_message>:
push   %rax
cmp    $0x9,%edi
jg     113d <to_message+0x1d>
mov    %edi,%edx
lea    0x2f11(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1040 <sprintf@plt>
jmp    1150 <to_message+0x30>
lea    0x2efc(%rip),%rdi
lea    0xec3(%rip),%rsi
call   1030 <strcpy@plt>
lea    0x2ee9(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@to_message.result = internal global [256 x i8] zeroinitializer
@.str = [14 x i8] c"%d: blah blah\00"
@.str.1 = [8 x i8] c"Unknown\00"
define i8* @to_message(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 10
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @sprintf(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @to_message.result, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %10
8: ; preds = %1
%9 = call i32 @strcpy(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @to_message.result, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @to_message.result, i64 0, i64 0)
}

LLVM IR (-O2):
@to_message.result = internal global [256 x i8] zeroinitializer
@.str = [14 x i8] c"%d: blah blah\00"
@.str.1 = [8 x i8] c"Unknown\00"
define i8* @to_message(i32 %0) {
%2 = icmp slt i32 %0, 10
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([256 x i8], [256 x i8]* @to_message.result, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %7
5: ; preds = %1
%6 = tail call i32 @strcpy(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @to_message.result, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @to_message.result, i64 0, i64 0)
}
double identity(double d) { return d; }


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

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

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

LLVM IR (-O2):
define double @identity(double returned %0) {
ret double %0
}
/* Variables and functions */
int /*<<< orphan*/ chrono();
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
void basTimer() { pushNumber(chrono()); }


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

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

LLVM IR (-O0):
define void @basTimer() {
%1 = call i32 (...) @chrono()
%2 = call i32 @pushNumber(i32 %1)
ret void
}

LLVM IR (-O2):
define void @basTimer() {
%1 = tail call i32 (...) @chrono()
%2 = tail call i32 @pushNumber(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ b_print_string(char *);
int main(void) {
  b_print_string("Hello world, from C!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"Hello world, from C!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @b_print_string(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Hello world, from C!\0A\00"
define i32 @main() {
%1 = tail call i32 @b_print_string(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int foo(char *p) { return p[2]; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movsbl 0x2(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @foo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @foo(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ InitializePDPolicyVariables();
int /*<<< orphan*/ InitializePDProtocolVariables();
int /*<<< orphan*/ InitializeTypeC();
int /*<<< orphan*/ InitializeTypeCVariables();
void core_initialize(void) {
  InitializeTypeCVariables();
  InitializePDProtocolVariables();
  InitializePDPolicyVariables();
  InitializeTypeC();
}


x86 assembly (clang, -O0):
<core_initialize>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <InitializeTypeCVariables@plt>
mov    $0x0,%al
call   1030 <InitializePDProtocolVariables@plt>
mov    $0x0,%al
call   1040 <InitializePDPolicyVariables@plt>
mov    $0x0,%al
call   1050 <InitializeTypeC@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<core_initialize>:
push   %rax
xor    %eax,%eax
call   1060 <InitializeTypeCVariables@plt>
xor    %eax,%eax
call   1030 <InitializePDProtocolVariables@plt>
xor    %eax,%eax
call   1040 <InitializePDPolicyVariables@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <InitializeTypeC@plt>

LLVM IR (-O0):
define void @core_initialize() {
%1 = call i32 (...) @InitializeTypeCVariables()
%2 = call i32 (...) @InitializePDProtocolVariables()
%3 = call i32 (...) @InitializePDPolicyVariables()
%4 = call i32 (...) @InitializeTypeC()
ret void
}

LLVM IR (-O2):
define void @core_initialize() {
%1 = tail call i32 (...) @InitializeTypeCVariables()
%2 = tail call i32 (...) @InitializePDProtocolVariables()
%3 = tail call i32 (...) @InitializePDPolicyVariables()
%4 = tail call i32 (...) @InitializeTypeC()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int pop_count(int);
void characterize_mask(uint32_t mask, int *width, int *shift) {
  if (width)
    *width = pop_count(mask);
  if (shift)
    *shift = pop_count(((mask - 1) & ~mask)) & 31;
}


x86 assembly (clang, -O0):
<characterize_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113e <characterize_mask+0x2e>
mov    -0x4(%rbp),%edi
call   1030 <pop_count@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1167 <characterize_mask+0x57>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
and    %eax,%edi
call   1030 <pop_count@plt>
mov    %eax,%ecx
and    $0x1f,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<characterize_mask>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %edi,%ebx
test   %rsi,%rsi
je     112c <characterize_mask+0x1c>
mov    %rsi,%r15
mov    %ebx,%edi
call   1030 <pop_count@plt>
mov    %eax,(%r15)
test   %r14,%r14
je     1145 <characterize_mask+0x35>
lea    -0x1(%rbx),%eax
not    %ebx
and    %eax,%ebx
mov    %ebx,%edi
call   1030 <pop_count@plt>
and    $0x1f,%eax
mov    %eax,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @characterize_mask(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %5
%8 = icmp ne i32* %7, null
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i32, i32* %4
%11 = call i32 @pop_count(i32 %10)
%12 = load i32*, i32** %5
store i32 %11, i32* %12
br label %13
13: ; preds = %9, %3
%14 = load i32*, i32** %6
%15 = icmp ne i32* %14, null
br i1 %15, label %16, label %25
16: ; preds = %13
%17 = load i32, i32* %4
%18 = sub nsw i32 %17, 1
%19 = load i32, i32* %4
%20 = xor i32 %19, -1
%21 = and i32 %18, %20
%22 = call i32 @pop_count(i32 %21)
%23 = and i32 %22, 31
%24 = load i32*, i32** %6
store i32 %23, i32* %24
br label %25
25: ; preds = %16, %13
ret void
}

LLVM IR (-O2):
define void @characterize_mask(i32 %0, i32* writeonly %1, i32* writeonly %2) {
%4 = icmp eq i32* %1, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @pop_count(i32 %0)
store i32 %6, i32* %1
br label %7
7: ; preds = %5, %3
%8 = icmp eq i32* %2, null
br i1 %8, label %15, label %9
9: ; preds = %7
%10 = add nsw i32 %0, -1
%11 = xor i32 %0, -1
%12 = and i32 %10, %11
%13 = tail call i32 @pop_count(i32 %12)
%14 = and i32 %13, 31
store i32 %14, i32* %2
br label %15
15: ; preds = %9, %7
ret void
}
int test_imm_C9uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0xC9 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_C9uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 863288426496
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void cwde(void) { put8(0x98); }


x86 assembly (clang, -O0):
<cwde>:
push   %rbp
mov    %rsp,%rbp
mov    $0x98,%edi
call   1030 <put8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cwde>:
mov    $0x98,%edi
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @cwde() {
%1 = call i32 @put8(i32 152)
ret void
}

LLVM IR (-O2):
define void @cwde() {
%1 = tail call i32 @put8(i32 152)
ret void
}
void pc_serial_poll(void) {}


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

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

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

LLVM IR (-O2):
define void @pc_serial_poll() {
ret void
}
/* Variables and functions */
int M_PI;
float math_radians_to_degrees(const float radians) {
  return radians * (180 / M_PI);
}


x86 assembly (clang, -O0):
<math_radians_to_degrees>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mov    $0xb4,%eax
mov    0x2ece(%rip),%rcx
cltd
idivl  (%rcx)
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_radians_to_degrees>:
mov    0x2ee1(%rip),%rcx
mov    $0xb4,%eax
xor    %edx,%edx
idivl  (%rcx)
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
@M_PI = global i32 0
define float @math_radians_to_degrees(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load i32, i32* @M_PI
%5 = sdiv i32 180, %4
%6 = sitofp i32 %5 to float
%7 = fmul float %3, %6
ret float %7
}

LLVM IR (-O2):
@M_PI = global i32 0
define float @math_radians_to_degrees(float %0) {
%2 = load i32, i32* @M_PI
%3 = sdiv i32 180, %2
%4 = sitofp i32 %3 to float
%5 = fmul float %4, %0
ret float %5
}
/* Variables and functions */
int findString(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char *argv[]) {
  char a[] = "A brown fox jumps over the lazy dog.";
  char b[] = "lazy";
  printf("%d\n", findString(a, b, 0));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeaf(%rip),%rsi
mov    $0x25,%edx
call   1050 <memcpy@plt>
mov    0xec4(%rip),%eax
mov    %eax,-0x45(%rbp)
mov    0xebf(%rip),%al
mov    %al,-0x41(%rbp)
lea    -0x40(%rbp),%rdi
lea    -0x45(%rbp),%rsi
xor    %edx,%edx
call   1040 <findString@plt>
mov    %eax,%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movabs $0x2e676f6420797a,%rax
mov    %rax,0x2d(%rsp)
movb   $0x0,0xc(%rsp)
movl   $0x797a616c,0x8(%rsp)
79
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
xor    %edx,%edx
call   1040 <findString@plt>
lea    0xeba(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [37 x i8] c"A brown fox jumps over the lazy dog.\00"
@__const.main.b = [5 x i8] c"lazy\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [37 x i8]
%7 = alloca [5 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [37 x i8]* %6 to i8*
%9 = bitcast [5 x i8]* %7 to i8*
%10 = getelementptr inbounds [37 x i8], [37 x i8]* %6, i64 0, i64 0
%11 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%12 = call i32 @findString(i8* %10, i8* %11, i32 0)
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [37 x i8] c"A brown fox jumps over the lazy dog.\00"
@__const.main.b = [5 x i8] c"lazy\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [37 x i8]
%4 = alloca [5 x i8]
%5 = getelementptr inbounds [37 x i8], [37 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%7 = call i32 @findString(i8* %5, i8* %6, i32 0)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int *malloc(int);
int main() {
  int *ip = malloc(sizeof(int));
  *ip = 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1030 <malloc@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 4)
ret i32 0
}
void ARGBToABGR() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToABGR() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, double *);
double stringToDouble(char str[]) {
  double result;
  sscanf(str, "%lf", &result);
  return result;
}


x86 assembly (clang, -O0):
<stringToDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <sscanf@plt>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringToDouble>:
push   %rax
lea    0xee8(%rip),%rsi
mov    %rsp,%rdx
call   1030 <sscanf@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
define double @stringToDouble(i8* nocapture %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%5 = load double, double* %2
ret double %5
}
void ff_hevc_put_hevc_uni_epel_h32_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_h32_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void greeting() { printf("Hello from the C function 'greeting'\n"); }


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"Hello from the C function 'greeting'\0A\00"
define void @greeting() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [37 x i8] c"Hello from the C function 'greeting'\00"
define void @greeting() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_color_char_no_space(int, int /*<<< orphan*/);
void write_color_string(int c, const char *str) {
  while (*str)
    write_color_char_no_space(c, *str++);
}


x86 assembly (clang, -O0):
<write_color_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114b <write_color_string+0x3b>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%esi
call   1030 <write_color_char_no_space@plt>
jmp    111f <write_color_string+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_color_string>:
push   %rbp
push   %rbx
push   %rax
mov    (%rsi),%al
test   %al,%al
je     1145 <write_color_string+0x35>
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%esi
mov    %ebp,%edi
call   1030 <write_color_char_no_space@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <write_color_string+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @write_color_string(i32 %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %8, %5 ], [ %1, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %6 to i32
%10 = tail call i32 @write_color_char_no_space(i32 %0, i32 %9)
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
/* Variables and functions */
float __ocml_exp_f32(float);
float expf(float x) { return __ocml_exp_f32(x); }


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

x86 assembly (clang, -O2):
<expf>:
jmp    1030 <__ocml_exp_f32@plt>

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

LLVM IR (-O2):
define float @expf(float %0) {
%2 = tail call float @__ocml_exp_f32(float %0)
ret float %2
}
void *a_cas_p(volatile void *p, void *t, void *s) {
  if (*(long *)p == t)
    *(long *)p = s;
  return t;
}


x86 assembly (clang, -O0):
<a_cas_p>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
cmp    -0x10(%rbp),%rax
jne    112c <a_cas_p+0x2c>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_cas_p>:
mov    %rsi,%rax
cmp    %rsi,(%rdi)
je     1109 <a_cas_p+0x9>
ret
mov    %rdx,(%rdi)
ret

LLVM IR (-O0):
define i8* @a_cas_p(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 = bitcast i8* %7 to i64*
%9 = load i64, i64* %8
%10 = inttoptr i64 %9 to i8*
%11 = load i8*, i8** %5
%12 = icmp eq i8* %10, %11
br i1 %12, label %13, label %18
13: ; preds = %3
%14 = load i8*, i8** %6
%15 = ptrtoint i8* %14 to i64
%16 = load i8*, i8** %4
%17 = bitcast i8* %16 to i64*
store i64 %15, i64* %17
br label %18
18: ; preds = %13, %3
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define i8* @a_cas_p(i8* nocapture %0, i8* readnone returned %1, i8* %2) {
%4 = bitcast i8* %0 to i64*
%5 = load i64, i64* %4
%6 = inttoptr i64 %5 to i8*
%7 = icmp eq i8* %6, %1
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = ptrtoint i8* %2 to i64
store i64 %9, i64* %4
br label %10
10: ; preds = %8, %3
ret i8* %1
}
int main(void) {
  void getNumberAndBase(void), convertNumber(void),
      displayConvertedNumber(void);
  getNumberAndBase();
  convertNumber();
  displayConvertedNumber();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
tail call void @getNumberAndBase()
tail call void @convertNumber()
tail call void @displayConvertedNumber()
ret i32 0
}
int null_medium_changed(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @null_medium_changed() {
ret i32 0
}
/* Variables and functions */
int core5_swap(char *, int);
int U_EMRSAVEDC_swap(char *record, int torev) {
  return (core5_swap(record, torev));
}


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

x86 assembly (clang, -O2):
<U_EMRSAVEDC_swap>:
jmp    1030 <core5_swap@plt>

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

LLVM IR (-O2):
define i32 @U_EMRSAVEDC_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core5_swap(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_log_ratelimit() {
  printf("NOT IMPLEMENTED:"
         "pa_log_ratelimit"
         "\n");
}


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

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

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_log_ratelimit\00"
define i32 @pa_log_ratelimit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ glmPow3fs(float *, float *, float);
void glmPow3fs_(float x[3], float y) { glmPow3fs(x, x, y); }


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

x86 assembly (clang, -O2):
<glmPow3fs_>:
mov    %rdi,%rsi
jmp    1030 <glmPow3fs@plt>

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

LLVM IR (-O2):
define void @glmPow3fs_(float* %0, float %1) {
%3 = tail call i32 @glmPow3fs(float* %0, float* %0, float %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ serial_puts(char *);
void bogus(void) {
  serial_puts("Bogus exception, spinning ... \n");
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<bogus>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <serial_puts@plt>
jmp    1120 <bogus+0x10>

x86 assembly (clang, -O2):
<bogus>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <serial_puts@plt>
nopl   (%rax)
jmp    1120 <bogus+0x10>

LLVM IR (-O0):
@.str = [32 x i8] c"Bogus exception, spinning ... \0A\00"
define void @bogus() {
%1 = call i32 @serial_puts(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
br label %2
}

LLVM IR (-O2):
@.str = [32 x i8] c"Bogus exception, spinning ... \0A\00"
define void @bogus() {
%1 = tail call i32 @serial_puts(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _mktemp_usage(void) {
  fputs("Usage: "
        "mktemp"
        " [-d] [template]\n  -d	make a directory instead of a file\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_mktemp_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mktemp_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [71 x i8] c"Usage: mktemp [-d] [template]\0A -d\09make a directory instead of a file\0A\00"
@stderr = global i32 0
define i32 @_mktemp_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [71 x i8] c"Usage: mktemp [-d] [template]\0A -d\09make a directory instead of a file\0A\00"
@stderr = global i32 0
define i32 @_mktemp_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
p_hi() { printf("beet\n"); }


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

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

LLVM IR (-O2):
@str = [5 x i8] c"beet\00"
define i32 @p_hi() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xc7() {
  Assert_real((isbdigit(199) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              1000, ("isbdigit should be 0 for 0xc7"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0xc7>:
push   %rax
mov    $0xc7,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x3e8,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xc7\00"
define void @t_isbdigit_0xc7() {
%1 = call i64 @isbdigit(i32 199)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1000, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xc7\00"
define void @t_isbdigit_0xc7() {
%1 = tail call i64 @isbdigit(i32 199)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1000, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SendInterrupt(int, int, int, int);
void ScuSendExternalInterrupt14(void) {
  SendInterrupt(0x5E, 0x1, 0x8000, 0x40000000);
}


x86 assembly (clang, -O0):
<ScuSendExternalInterrupt14>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5e,%edi
mov    $0x1,%esi
mov    $0x8000,%edx
mov    $0x40000000,%ecx
call   1030 <SendInterrupt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ScuSendExternalInterrupt14>:
mov    $0x5e,%edi
mov    $0x1,%esi
mov    $0x8000,%edx
mov    $0x40000000,%ecx
jmp    1030 <SendInterrupt@plt>

LLVM IR (-O0):
define void @ScuSendExternalInterrupt14() {
%1 = call i32 @SendInterrupt(i32 94, i32 1, i32 32768, i32 1073741824)
ret void
}

LLVM IR (-O2):
define void @ScuSendExternalInterrupt14() {
%1 = tail call i32 @SendInterrupt(i32 94, i32 1, i32 32768, i32 1073741824)
ret void
}
int plus(int x) { return x * 2; }


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

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

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

LLVM IR (-O2):
define i32 @plus(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
long pt_time_sec() {
  struct timeval tv;
  gettimeofday(&tv, 0);
  return (long)tv.tv_sec;
}


x86 assembly (clang, -O0):
<pt_time_sec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pt_time_sec>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i64 }
define i64 @pt_time_sec() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i64, i64* %3
ret i64 %4
}

LLVM IR (-O2):
%struct.timeval = type { i64 }
define i64 @pt_time_sec() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i64, i64* %4
ret i64 %5
}
/* Variables and functions */
void *nullary_emit(void *, size_t, int);
void *bu_fill(void *dst, size_t n) {
  return nullary_emit(dst, n, ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3)));
}


x86 assembly (clang, -O0):
<bu_fill>:
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    $0xf,%edx
call   1030 <nullary_emit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bu_fill>:
mov    $0xf,%edx
jmp    1030 <nullary_emit@plt>

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

LLVM IR (-O2):
define i8* @bu_fill(i8* %0, i64 %1) {
%3 = tail call i8* @nullary_emit(i8* %0, i64 %1, i32 15)
ret i8* %3
}
void ptrace_sandbox_permit_setsockopt(struct pt_sandbox *p_sandbox) {
  (void)p_sandbox;
}


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

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

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

LLVM IR (-O2):
%struct.pt_sandbox = type opaque
define void @ptrace_sandbox_permit_setsockopt(%struct.pt_sandbox* nocapture %0) {
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memerrexit();
char *getpathbuffer(void) {
  char *buf;
  if (!(buf = malloc(1023 + 1)))
    memerrexit();
  return buf;
}


x86 assembly (clang, -O0):
<getpathbuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x400,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    1147 <getpathbuffer+0x27>
mov    $0x0,%al
call   1040 <memerrexit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpathbuffer>:
push   %rbx
mov    $0x400,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <getpathbuffer+0x1a>
xor    %eax,%eax
call   1040 <memerrexit@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @getpathbuffer() {
%1 = tail call dereferenceable_or_null(1024) i8* @malloc(i32 1024)
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @memerrexit()
br label %5
5: ; preds = %3, %0
ret i8* %1
}
void get_c_pointer_(char **mr_ptr, char **mr_ptr_val) {
  union ptr_or_val {
    char *val;
    char **ptr;
  };
  union ptr_or_val my_conversion;
  my_conversion.ptr = mr_ptr;
  *mr_ptr_val = my_conversion.val;
}


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

x86 assembly (clang, -O2):
<get_c_pointer_>:
mov    %rdi,(%rsi)
ret

LLVM IR (-O0):
%union.ptr_or_val = type { i8* }
define void @get_c_pointer_(i8** %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i8**
%5 = alloca %union.ptr_or_val
store i8** %0, i8*** %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %3
%7 = bitcast %union.ptr_or_val* %5 to i8***
store i8** %6, i8*** %7
%8 = bitcast %union.ptr_or_val* %5 to i8**
%9 = load i8*, i8** %8
%10 = load i8**, i8*** %4
store i8* %9, i8** %10
ret void
}

LLVM IR (-O2):
define void @get_c_pointer_(i8** %0, i8** nocapture writeonly %1) {
%3 = bitcast i8** %1 to i8***
store i8** %0, i8*** %3
ret void
}
char *strend(s)
register char *s;
{ return (*s ? (s + strlen(s) - 1) : s); }


x86 assembly (clang, -O0):
<strend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1154 <strend+0x44>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    115c <strend+0x4c>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strend>:
push   %rbx
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1128 <strend+0x18>
mov    %rbx,%rdi
call   1030 <strlen@plt>
add    %rax,%rbx
add    $0xffffffffffffffff,%rbx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @strend(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strlen(i8* %0)
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = getelementptr inbounds i8, i8* %6, i64 -1
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %7, %4 ], [ %0, %1 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv, char **envp) {
  printf("Hello World!");
  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    %rdx,-0x18(%rbp)
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World!\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct mainwindow {
  int dummy;
};

/* Variables and functions */
int mid_item(struct mainwindow *);
int handle_mid_item(struct mainwindow *mw) { return mid_item(mw); }


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

x86 assembly (clang, -O2):
<handle_mid_item>:
jmp    1030 <mid_item@plt>

LLVM IR (-O0):
%struct.mainwindow = type { i32 }
define i32 @handle_mid_item(%struct.mainwindow* %0) {
%2 = alloca %struct.mainwindow*
store %struct.mainwindow* %0, %struct.mainwindow** %2
%3 = load %struct.mainwindow*, %struct.mainwindow** %2
%4 = call i32 @mid_item(%struct.mainwindow* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.mainwindow = type { i32 }
define i32 @handle_mid_item(%struct.mainwindow* %0) {
%2 = tail call i32 @mid_item(%struct.mainwindow* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int plugin_open_rig(char *config) {
  printf("PrintFrequency plugin opened.\n");
  return 1;
}


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

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

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

LLVM IR (-O2):
@str = [30 x i8] c"PrintFrequency plugin opened.\00"
define i32 @plugin_open_rig(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret i32 1
}
float normal_fmaf(float b, float c, float d) { return (b * c) + d; }


x86 assembly (clang, -O0):
<normal_fmaf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
movss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<normal_fmaf>:
mulss  %xmm1,%xmm0
addss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @normal_fmaf(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @llvm.fmuladd.f32(float %7, float %8, float %9)
ret float %10
}

LLVM IR (-O2):
define float @normal_fmaf(float %0, float %1, float %2) {
%4 = tail call float @llvm.fmuladd.f32(float %0, float %1, float %2)
ret float %4
}
/* Variables and functions */
scalar_t__ gets(char *);
int /*<<< orphan*/ puts(char *);
main() {
  char *s;
  while (gets(s))
    puts(s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <gets@plt>
cmp    $0x0,%rax
je     1150 <main+0x30>
mov    -0x10(%rbp),%rdi
call   1030 <puts@plt>
jmp    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
call   1040 <gets@plt>
test   %rax,%rax
je     1141 <main+0x21>
call   1030 <puts@plt>
jmp    1130 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @gets(i8* undef)
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0, %3
%4 = tail call i32 @puts(i8* dereferenceable(1) undef)
%5 = tail call i64 @gets(i8* undef)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3, %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ recv_from_rsocket(int /*<<< orphan*/, void *,
                                     int /*<<< orphan*/, int /*<<< orphan*/,
                                     int /*<<< orphan*/);
void *socket_check_realloc(void *, int /*<<< orphan*/, char *);
void *recv_and_alloc(int64_t s, void *data, int64_t length) {
  data = socket_check_realloc(data, length, "receive buffer");
  recv_from_rsocket(s, data, length, 0, 0);
  return data;
}


x86 assembly (clang, -O0):
<recv_and_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    0xec0(%rip),%rdx
call   1030 <socket_check_realloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %r8d,%r8d
mov    %r8d,%ecx
call   1040 <recv_from_rsocket@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recv_and_alloc>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %edi,%r14d
lea    0xed0(%rip),%rdx
mov    %rsi,%rdi
mov    %ebx,%esi
call   1030 <socket_check_realloc@plt>
mov    %rax,%rbp
mov    %r14d,%edi
mov    %rax,%rsi
mov    %ebx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <recv_from_rsocket@plt>
mov    %rbp,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"receive buffer\00"
define i8* @recv_and_alloc(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = call i8* @socket_check_realloc(i8* %7, i32 %8, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i8* %9, i8** %5
%10 = load i32, i32* %4
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @recv_from_rsocket(i32 %10, i8* %11, i32 %12, i32 0, i32 0)
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [15 x i8] c"receive buffer\00"
define i8* @recv_and_alloc(i32 %0, i8* %1, i32 %2) {
%4 = tail call i8* @socket_check_realloc(i8* %1, i32 %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @recv_from_rsocket(i32 %0, i8* %4, i32 %2, i32 0, i32 0)
ret i8* %4
}