xunge/DecIR huggingface dataset:
/* Type definitions */
struct queue {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ queue_free(struct queue *);
struct queue *queue_new();
int /*<<< orphan*/ queue_test_print(struct queue *);
int /*<<< orphan*/ queue_test_push(struct queue *);
int /*<<< orphan*/ queue_test_timeout_1(struct queue *);
void queue_test_1(void) {
  struct queue *q;
  q = queue_new();
  queue_test_push(q);
  queue_test_print(q);
  queue_test_timeout_1(q);
  queue_test_print(q);
  queue_free(q);
}


x86 assembly (clang, -O0):
<queue_test_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <queue_new@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <queue_test_push@plt>
mov    -0x8(%rbp),%rdi
call   1070 <queue_test_print@plt>
mov    -0x8(%rbp),%rdi
call   1040 <queue_test_timeout_1@plt>
mov    -0x8(%rbp),%rdi
call   1070 <queue_test_print@plt>
mov    -0x8(%rbp),%rdi
call   1060 <queue_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<queue_test_1>:
push   %rbx
xor    %eax,%eax
call   1050 <queue_new@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <queue_test_push@plt>
mov    %rbx,%rdi
call   1070 <queue_test_print@plt>
mov    %rbx,%rdi
call   1040 <queue_test_timeout_1@plt>
mov    %rbx,%rdi
call   1070 <queue_test_print@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1060 <queue_free@plt>

LLVM IR (-O0):
%struct.queue = type { i32 }
define void @queue_test_1() {
%1 = alloca %struct.queue*
%2 = call %struct.queue* (...) @queue_new()
store %struct.queue* %2, %struct.queue** %1
%3 = load %struct.queue*, %struct.queue** %1
%4 = call i32 @queue_test_push(%struct.queue* %3)
%5 = load %struct.queue*, %struct.queue** %1
%6 = call i32 @queue_test_print(%struct.queue* %5)
%7 = load %struct.queue*, %struct.queue** %1
%8 = call i32 @queue_test_timeout_1(%struct.queue* %7)
%9 = load %struct.queue*, %struct.queue** %1
%10 = call i32 @queue_test_print(%struct.queue* %9)
%11 = load %struct.queue*, %struct.queue** %1
%12 = call i32 @queue_free(%struct.queue* %11)
ret void
}

LLVM IR (-O2):
%struct.queue = type { i32 }
define void @queue_test_1() {
%1 = tail call %struct.queue* (...) @queue_new()
%2 = tail call i32 @queue_test_push(%struct.queue* %1)
%3 = tail call i32 @queue_test_print(%struct.queue* %1)
%4 = tail call i32 @queue_test_timeout_1(%struct.queue* %1)
%5 = tail call i32 @queue_test_print(%struct.queue* %1)
%6 = tail call i32 @queue_free(%struct.queue* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ERR_load_crypto_strings();
int /*<<< orphan*/ OpenSSL_add_all_algorithms();
int init_openssl() {
  ERR_load_crypto_strings();
  OpenSSL_add_all_algorithms();
  return 0;
}


x86 assembly (clang, -O0):
<init_openssl>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <ERR_load_crypto_strings@plt>
mov    $0x0,%al
call   1030 <OpenSSL_add_all_algorithms@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @init_openssl() {
%1 = call i32 (...) @ERR_load_crypto_strings()
%2 = call i32 (...) @OpenSSL_add_all_algorithms()
ret i32 0
}

LLVM IR (-O2):
define i32 @init_openssl() {
%1 = tail call i32 (...) @ERR_load_crypto_strings()
%2 = tail call i32 (...) @OpenSSL_add_all_algorithms()
ret i32 0
}
/* Type definitions */
struct activity {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ stub_print_net_sock_stats(struct activity *, int, int,
                                             unsigned long long,
                                             int /*<<< orphan*/);
void print_net_sock_stats(struct activity *a, int prev, int curr,
                          unsigned long long itv) {
  stub_print_net_sock_stats(a, prev, curr, itv, 0);
}


x86 assembly (clang, -O0):
<print_net_sock_stats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <stub_print_net_sock_stats@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_net_sock_stats>:
xor    %r8d,%r8d
jmp    1030 <stub_print_net_sock_stats@plt>

LLVM IR (-O0):
%struct.activity = type { i32 }
define void @print_net_sock_stats(%struct.activity* %0, i32 %1, i32 %2, i64 %3) {
%5 = alloca %struct.activity*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
store %struct.activity* %0, %struct.activity** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i64 %3, i64* %8
%9 = load %struct.activity*, %struct.activity** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i64, i64* %8
%13 = call i32 @stub_print_net_sock_stats(%struct.activity* %9, i32 %10, i32 %11, i64 %12, i32 0)
ret void
}

LLVM IR (-O2):
%struct.activity = type { i32 }
define void @print_net_sock_stats(%struct.activity* %0, i32 %1, i32 %2, i64 %3) {
%5 = tail call i32 @stub_print_net_sock_stats(%struct.activity* %0, i32 %1, i32 %2, i64 %3, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void CyPmDisablePicuInterrupts(void) {
  (void)memset((void *)(0x40004500u), 0,
               (0x00000008u + 0x00000008u + 0x00000008u + 0x00000008u +
                0x00000008u + 0x00000008u + 0x00000008u));
  (void)memset((void *)(0x40004560u), 0, (0x00000008u));
  (void)memset((void *)(0x40004578u), 0, (0x00000008u));
}


x86 assembly (clang, -O0):
<CyPmDisablePicuInterrupts>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40004500,%edi
xor    %esi,%esi
mov    $0x38,%edx
call   1030 <memset@plt>
mov    $0x40004560,%edi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
mov    $0x40004578,%edi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CyPmDisablePicuInterrupts>:
push   %rax
mov    $0x40004500,%edi
xor    %esi,%esi
mov    $0x38,%edx
call   1030 <memset@plt>
mov    $0x40004560,%edi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
mov    $0x40004578,%edi
xor    %esi,%esi
mov    $0x8,%edx
pop    %rax
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @CyPmDisablePicuInterrupts() {
%1 = call i32 @memset(i8* inttoptr (i64 1073759488 to i8*), i32 0, i32 56)
%2 = call i32 @memset(i8* inttoptr (i64 1073759584 to i8*), i32 0, i32 8)
%3 = call i32 @memset(i8* inttoptr (i64 1073759608 to i8*), i32 0, i32 8)
ret void
}

LLVM IR (-O2):
define void @CyPmDisablePicuInterrupts() {
%1 = tail call i32 @memset(i8* inttoptr (i64 1073759488 to i8*), i32 0, i32 56)
%2 = tail call i32 @memset(i8* inttoptr (i64 1073759584 to i8*), i32 0, i32 8)
%3 = tail call i32 @memset(i8* inttoptr (i64 1073759608 to i8*), i32 0, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char const *, char *, int *);
unsigned char stox(const char byte) {
  int c;
  sscanf(&byte, "%x", &c);
  return c;
}


x86 assembly (clang, -O0):
<stox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    -0x1(%rbp),%rdi
lea    0xed7(%rip),%rsi
lea    -0x8(%rbp),%rdx
call   1030 <sscanf@plt>
mov    -0x8(%rbp),%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stox>:
push   %rax
mov    %dil,0x3(%rsp)
lea    0xee3(%rip),%rsi
lea    0x3(%rsp),%rdi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
mov    0x4(%rsp),%al
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%x\00"
define zeroext i8 @stox(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = bitcast i32* %3 to i8*
%5 = call i32 @sscanf(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = trunc i32 %6 to i8
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int terra_add(int, int);
int main(void) {
  assert(terra_add(1, 2) == 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <terra_add@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <terra_add@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @terra_add(i32 1, i32 2)
%3 = icmp eq i32 %2, 3
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @terra_add(i32 1, i32 2)
%2 = icmp eq i32 %1, 3
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret i32 0
}
void USBHostSuspend(unsigned long ulBase) {
  ;
  (*((volatile unsigned char *)(ulBase + 0x00000001))) |= 0x00000002;
}


x86 assembly (clang, -O0):
<USBHostSuspend>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
movzbl %cl,%ecx
or     $0x2,%ecx
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostSuspend>:
orb    $0x2,0x1(%rdi)
ret

LLVM IR (-O0):
define void @USBHostSuspend(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 1
%5 = inttoptr i64 %4 to i8*
%6 = load volatile i8, i8* %5
%7 = zext i8 %6 to i32
%8 = or i32 %7, 2
%9 = trunc i32 %8 to i8
store volatile i8 %9, i8* %5
ret void
}

LLVM IR (-O2):
define void @USBHostSuspend(i64 %0) {
%2 = add i64 %0, 1
%3 = inttoptr i64 %2 to i8*
%4 = load volatile i8, i8* %3
%5 = or i8 %4, 2
store volatile i8 %5, i8* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DAA();
int /*<<< orphan*/ T_WAIT_UNTIL(int);
void op_0x27(void) {
  DAA();
  T_WAIT_UNTIL(4);
  return;
}


x86 assembly (clang, -O0):
<op_0x27>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <DAA@plt>
mov    $0x4,%edi
call   1040 <T_WAIT_UNTIL@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_0x27>:
push   %rax
xor    %eax,%eax
call   1030 <DAA@plt>
mov    $0x4,%edi
pop    %rax
jmp    1040 <T_WAIT_UNTIL@plt>

LLVM IR (-O0):
define void @op_0x27() {
%1 = call i32 (...) @DAA()
%2 = call i32 @T_WAIT_UNTIL(i32 4)
ret void
}

LLVM IR (-O2):
define void @op_0x27() {
%1 = tail call i32 (...) @DAA()
%2 = tail call i32 @T_WAIT_UNTIL(i32 4)
ret void
}
void ls_costN_nm6_decref(void) {}


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

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

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

LLVM IR (-O2):
define void @ls_costN_nm6_decref() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PoiLocationHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void PoiLocationLogging() { UAVObjLogging(PoiLocationHandle()); }


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

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

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

LLVM IR (-O2):
define void @PoiLocationLogging() {
%1 = tail call i32 (...) @PoiLocationHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
char *arm_memchr(const char *p, int ch, int count) {
  int i;
  for (i = 0; i < count; i++) {
    if ((*p) == ch) {
      return ((char *)p);
    }
    p++;
  }
  return ((char *)((void *)0));
}


x86 assembly (clang, -O0):
<arm_memchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1158 <arm_memchr+0x58>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    113e <arm_memchr+0x3e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1160 <arm_memchr+0x60>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <arm_memchr+0x15>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_memchr>:
test   %edx,%edx
jle    1120 <arm_memchr+0x20>
mov    %rdi,%rax
nopw   0x0(%rax,%rax,1)
movsbl (%rax),%ecx
cmp    %esi,%ecx
je     1122 <arm_memchr+0x22>
add    $0x1,%rax
add    $0xffffffff,%edx
jne    1110 <arm_memchr+0x10>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @arm_memchr(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 0, i32* %8
br label %9
9: ; preds = %24, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %7
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %27
13: ; preds = %9
%14 = load i8*, i8** %5
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = load i32, i32* %6
%18 = icmp eq i32 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %13
%20 = load i8*, i8** %5
store i8* %20, i8** %4
br label %28
21: ; preds = %13
%22 = load i8*, i8** %5
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %5
br label %24
24: ; preds = %21
%25 = load i32, i32* %8
%26 = add nsw i32 %25, 1
store i32 %26, i32* %8
br label %9
27: ; preds = %9
store i8* null, i8** %4
br label %28
28: ; preds = %27, %19
%29 = load i8*, i8** %4
ret i8* %29
}

LLVM IR (-O2):
define i8* @arm_memchr(i8* %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3, %11
%6 = phi i32 [ %13, %11 ], [ 0, %3 ]
%7 = phi i8* [ %12, %11 ], [ %0, %3 ]
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, %1
br i1 %10, label %15, label %11
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = add nuw nsw i32 %6, 1
%14 = icmp eq i32 %13, %2
br i1 %14, label %15, label %5
15: ; preds = %5, %11, %3
%16 = phi i8* [ null, %3 ], [ null, %11 ], [ %7, %5 ]
ret i8* %16
}
/* Type definitions */
struct StringTable {
  int dummy;
};

/* Variables and functions */
int delString(struct StringTable *, int /*<<< orphan*/);
int /*<<< orphan*/ makeStringFromInt(int);
int delInt(struct StringTable *st, int key) {
  return delString(st, makeStringFromInt(key));
}


x86 assembly (clang, -O0):
<delInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <makeStringFromInt@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <delString@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delInt>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <makeStringFromInt@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <delString@plt>

LLVM IR (-O0):
%struct.StringTable = type { i32 }
define i32 @delInt(%struct.StringTable* %0, i32 %1) {
%3 = alloca %struct.StringTable*
%4 = alloca i32
store %struct.StringTable* %0, %struct.StringTable** %3
store i32 %1, i32* %4
%5 = load %struct.StringTable*, %struct.StringTable** %3
%6 = load i32, i32* %4
%7 = call i32 @makeStringFromInt(i32 %6)
%8 = call i32 @delString(%struct.StringTable* %5, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.StringTable = type { i32 }
define i32 @delInt(%struct.StringTable* %0, i32 %1) {
%3 = tail call i32 @makeStringFromInt(i32 %1)
%4 = tail call i32 @delString(%struct.StringTable* %0, i32 %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ header;

/* Variables and functions */
int /*<<< orphan*/ kannotate_write(char *, int);
int /*<<< orphan*/ marshal_u16(char *, int /*<<< orphan*/);
int /*<<< orphan*/ marshal_u32(char *, int);
void gator_annotate_channel_end(int channel) {
  char header[8];
  header[0] = 0x1c;
  header[1] = 0x06;
  marshal_u32(header + 2, channel);
  marshal_u16(header + 6, 0);
  kannotate_write(header, sizeof(header));
}


x86 assembly (clang, -O0):
<gator_annotate_channel_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movb   $0x1c,-0xc(%rbp)
movb   $0x6,-0xb(%rbp)
lea    -0xc(%rbp),%rdi
add    $0x2,%rdi
mov    -0x4(%rbp),%esi
call   1030 <marshal_u32@plt>
lea    -0xc(%rbp),%rdi
add    $0x6,%rdi
xor    %esi,%esi
call   1050 <marshal_u16@plt>
lea    -0xc(%rbp),%rdi
mov    $0x8,%esi
call   1040 <kannotate_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gator_annotate_channel_end>:
push   %rax
mov    %edi,%esi
movw   $0x61c,(%rsp)
lea    0x2(%rsp),%rdi
call   1030 <marshal_u32@plt>
lea    0x6(%rsp),%rdi
xor    %esi,%esi
call   1050 <marshal_u16@plt>
mov    %rsp,%rdi
mov    $0x8,%esi
call   1040 <kannotate_write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @gator_annotate_channel_end(i32 %0) {
%2 = alloca i32
%3 = alloca [8 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
store i8 28, i8* %4
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 1
store i8 6, i8* %5
%6 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds i8, i8* %6, i64 2
%8 = load i32, i32* %2
%9 = call i32 @marshal_u32(i8* %7, i32 %8)
%10 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%11 = getelementptr inbounds i8, i8* %10, i64 6
%12 = call i32 @marshal_u16(i8* %11, i32 0)
%13 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%14 = call i32 @kannotate_write(i8* %13, i32 8)
ret void
}

LLVM IR (-O2):
define void @gator_annotate_channel_end(i32 %0) {
%2 = alloca [8 x i8]
%3 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
store i8 28, i8* %3
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 1
store i8 6, i8* %4
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 2
%6 = call i32 @marshal_u32(i8* %5, i32 %0)
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 6
%8 = call i32 @marshal_u16(i8* %7, i32 0)
%9 = call i32 @kannotate_write(i8* %3, i32 8)
ret void
}
const char *CFV2PrefixExtractorName(void *state) {
  return "TestCFV2PrefixExtractor";
}


x86 assembly (clang, -O0):
<CFV2PrefixExtractorName>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CFV2PrefixExtractorName>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [24 x i8] c"TestCFV2PrefixExtractor\00"
define i8* @CFV2PrefixExtractorName(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [24 x i8] c"TestCFV2PrefixExtractor\00"
define i8* @CFV2PrefixExtractorName(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
double cos(double);
double sin(double);
void trans_polar2rect(double *toTrans, double *result) {
  double a = toTrans[0];
  double b = toTrans[1];
  result[0] = a * cos(b);
  result[1] = a * sin(b);
}


x86 assembly (clang, -O0):
<trans_polar2rect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trans_polar2rect>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
movsd  (%rdi),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%rdi),%xmm0
movsd  %xmm0,0x8(%rsp)
call   1040 <cos@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,0x8(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @trans_polar2rect(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
%6 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%7 = load double*, double** %3
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
store double %9, double* %5
%10 = load double*, double** %3
%11 = getelementptr inbounds double, double* %10, i64 1
%12 = load double, double* %11
store double %12, double* %6
%13 = load double, double* %5
%14 = load double, double* %6
%15 = call double @cos(double %14)
%16 = fmul double %13, %15
%17 = load double*, double** %4
%18 = getelementptr inbounds double, double* %17, i64 0
store double %16, double* %18
%19 = load double, double* %5
%20 = load double, double* %6
%21 = call double @sin(double %20)
%22 = fmul double %19, %21
%23 = load double*, double** %4
%24 = getelementptr inbounds double, double* %23, i64 1
store double %22, double* %24
ret void
}

LLVM IR (-O2):
define void @trans_polar2rect(double* nocapture %0, double* nocapture writeonly %1) {
%3 = load double, double* %0
%4 = getelementptr inbounds double, double* %0, i64 1
%5 = load double, double* %4
%6 = tail call double @cos(double %5)
%7 = fmul double %3, %6
store double %7, double* %1
%8 = tail call double @sin(double %5)
%9 = fmul double %3, %8
%10 = getelementptr inbounds double, double* %1, i64 1
store double %9, double* %10
ret void
}
/* Type definitions */
struct gg_search_request {
  int dummy;
};

/* Variables and functions */
const struct gg_search_request *
gg_search_request_mode_0(char *nickname, char *first_name, char *last_name,
                         char *city, int gender, int min_birth, int max_birth,
                         int active, int start) {
  return NULL;
}


x86 assembly (clang, -O0):
<gg_search_request_mode_0>:
push   %rbp
mov    %rsp,%rbp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.gg_search_request = type { i32 }
define %struct.gg_search_request* @gg_search_request_mode_0(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8) {
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
store i8* %0, i8** %10
store i8* %1, i8** %11
store i8* %2, i8** %12
store i8* %3, i8** %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store i32 %7, i32* %17
store i32 %8, i32* %18
ret %struct.gg_search_request* null
}

LLVM IR (-O2):
%struct.gg_search_request = type { i32 }
define noalias %struct.gg_search_request* @gg_search_request_mode_0(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8) {
ret %struct.gg_search_request* null
}
/* Variables and functions */
char *replaceNWord(char const *, char const *, char const *, int);
char *replaceAll(const char *buffer, const char *old, const char *nw) {
  return replaceNWord(buffer, old, nw, -1);
}


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

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

LLVM IR (-O0):
define i8* @replaceAll(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* @replaceNWord(i8* %7, i8* %8, i8* %9, i32 -1)
ret i8* %10
}

LLVM IR (-O2):
define i8* @replaceAll(i8* %0, i8* %1, i8* %2) {
%4 = tail call i8* @replaceNWord(i8* %0, i8* %1, i8* %2, i32 -1)
ret i8* %4
}
void avutil_version() {}


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

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

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

LLVM IR (-O2):
define void @avutil_version() {
ret void
}
void I422ToUYVYRow_C() {}


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

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

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

LLVM IR (-O2):
define void @I422ToUYVYRow_C() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ disable_irq_nosync(unsigned int);
__attribute__((always_)) void disable_irq_nosync_lockdep(unsigned int irq) {
  disable_irq_nosync(irq);
}


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

x86 assembly (clang, -O2):
<disable_irq_nosync_lockdep>:
jmp    1030 <disable_irq_nosync@plt>

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

LLVM IR (-O2):
define void @disable_irq_nosync_lockdep(i32 %0) {
%2 = tail call i32 @disable_irq_nosync(i32 %0)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int getMem(char *p) {
  p = (char *)malloc(sizeof(char) * 100);
  if (p == NULL) {
    return -1;
  }
  strcpy(p, "abdakg");
  printf("p = %s\n", p);
  return 0;
}


x86 assembly (clang, -O0):
<getMem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x64,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1161 <getMem+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    1188 <getMem+0x58>
mov    -0x10(%rbp),%rdi
lea    0xe94(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rsi
lea    0xe8b(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMem>:
push   %rbx
mov    $0x64,%edi
call   1050 <malloc@plt>
test   %rax,%rax
je     1165 <getMem+0x35>
mov    %rax,%rbx
lea    0xeb6(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
lea    0xeae(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"abdakg\00"
@.str.1 = [8 x i8] c"p = %s\0A\00"
define i32 @getMem(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i64 @malloc(i32 100)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %14
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i32 @strcpy(i8* %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%12 = load i8*, i8** %3
%13 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %12)
store i32 0, i32* %2
br label %14
14: ; preds = %9, %8
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str = [7 x i8] c"abdakg\00"
@.str.1 = [8 x i8] c"p = %s\0A\00"
define i32 @getMem(i8* nocapture readnone %0) {
%2 = tail call i64 @malloc(i32 100)
%3 = inttoptr i64 %2 to i8*
%4 = icmp eq i64 %2, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %3)
br label %8
8: ; preds = %1, %5
%9 = phi i32 [ 0, %5 ], [ -1, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void cbw(void) {
  put8(0x66);
  put8(0x98);
}


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

x86 assembly (clang, -O2):
<cbw>:
push   %rax
mov    $0x66,%edi
call   1030 <put8@plt>
mov    $0x98,%edi
pop    %rax
jmp    1030 <put8@plt>

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

LLVM IR (-O2):
define void @cbw() {
%1 = tail call i32 @put8(i32 102)
%2 = tail call i32 @put8(i32 152)
ret void
}
void qshuffle() {}


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

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

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

LLVM IR (-O2):
define void @qshuffle() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/ *);
void usage(FILE *file) {
  const char *usage =
      "Saturated add of 16bpp images\n"
      "\n"
      "Usage:\n"
      "\n"
      "progname mmx|x86 times\n"
      "\n"
      "   Run procedure x86 or MMX optimized that perform saturated\n"
      "   addition as many times as user want. Useful for profiling.\n";
  fputs(usage, file);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0xba,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [187 x i8] c"Saturated add of 16bpp images\0A\0AUsage:\0A\0Aprogname mmx|x86 times\0A\0A Run procedure x86 or MMX optimized that perform saturated\0A addition as many times as user want. Useful for profiling.\0A\00"
define void @usage(i32* %0) {
%2 = alloca i32*
%3 = alloca i8*
store i32* %0, i32** %2
store i8* getelementptr inbounds ([187 x i8], [187 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %3
%5 = load i32*, i32** %2
%6 = call i32 @fputs(i8* %4, i32* %5)
ret void
}

LLVM IR (-O2):
@.str = [187 x i8] c"Saturated add of 16bpp images\0A\0AUsage:\0A\0Aprogname mmx|x86 times\0A\0A Run procedure x86 or MMX optimized that perform saturated\0A addition as many times as user want. Useful for profiling.\0A\00"
define void @usage(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([187 x i8], [187 x i8]* @.str, i64 0, i64 0), i64 186, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hook2(void) { printf("atexit hook 2\n"); }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
long matoi(char *);
long getval(FILE *f) {
  char fbuf[8];
  fgets(fbuf, 8, f);
  return matoi(fbuf);
}


x86 assembly (clang, -O0):
<getval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x8,%esi
call   1030 <fgets@plt>
lea    -0x10(%rbp),%rdi
call   1040 <matoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getval>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rdx
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <fgets@plt>
mov    %rbx,%rdi
call   1040 <matoi@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i64 @getval(i32* %0) {
%2 = alloca i32*
%3 = alloca [8 x i8]
store i32* %0, i32** %2
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%5 = load i32*, i32** %2
%6 = call i32 @fgets(i8* %4, i32 8, i32* %5)
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%8 = call i64 @matoi(i8* %7)
ret i64 %8
}

LLVM IR (-O2):
define i64 @getval(i32* nocapture %0) {
%2 = alloca [8 x i8]
%3 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%4 = call i32 @fgets(i8* %3, i32 8, i32* %0)
%5 = call i64 @matoi(i8* %3)
ret i64 %5
}
/* Variables and functions */
void *mycalloc(size_t nmemb, size_t size) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @mycalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @mycalloc(i64 %0, i64 %1) {
ret i8* null
}
int (*foo(void))[2] {
  static int foo_arr[2] = {1, 2};
  return &foo_arr;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f15(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    0x2f19(%rip),%rax
ret

LLVM IR (-O0):
@foo.foo_arr = internal global [2 x i32] [i32 1, i32 2]
define [2 x i32]* @foo() {
ret [2 x i32]* @foo.foo_arr
}

LLVM IR (-O2):
@foo.foo_arr = internal global [2 x i32] [i32 1, i32 2]
define [2 x i32]* @foo() {
ret [2 x i32]* @foo.foo_arr
}
/* Variables and functions */
char *malloc(int);
int sprintf(char *, char const *, float, float);
char *msg_app_flt_flt(const char *msg1, float n1, float n2) {
  char *p = malloc(200);
  int b = sprintf(p, msg1, n1, n2);
  return p;
}


x86 assembly (clang, -O0):
<msg_app_flt_flt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
mov    $0xc8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
call   1040 <sprintf@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_app_flt_flt>:
push   %r14
push   %rbx
push   %rax
movss  %xmm1,0x4(%rsp)
movss  %xmm0,(%rsp)
mov    %rdi,%r14
mov    $0xc8,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
movss  (%rsp),%xmm0
movss  0x4(%rsp),%xmm1
call   1040 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @msg_app_flt_flt(i8* %0, float %1, float %2) {
%4 = alloca i8*
%5 = alloca float
%6 = alloca float
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %4
store float %1, float* %5
store float %2, float* %6
%9 = call i8* @malloc(i32 200)
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = load i8*, i8** %4
%12 = load float, float* %5
%13 = load float, float* %6
%14 = call i32 @sprintf(i8* %10, i8* %11, float %12, float %13)
store i32 %14, i32* %8
%15 = load i8*, i8** %7
ret i8* %15
}

LLVM IR (-O2):
define noalias i8* @msg_app_flt_flt(i8* nocapture %0, float %1, float %2) {
%4 = tail call dereferenceable_or_null(200) i8* @malloc(i32 200)
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %4, i8* dereferenceable(1) %0, float %1, float %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void assert_port(int port) {
  if (port < 0 || port > 65535) {
    fprintf(stderr, "Invalid port: %d\n", port);
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<assert_port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1142 <assert_port+0x22>
cmpl   $0xffff,-0x4(%rbp)
jle    1168 <assert_port+0x48>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xeab(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_port>:
cmp    $0x10000,%edi
jae    1129 <assert_port+0x9>
ret
push   %rax
mov    %edi,%edx
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"Invalid port: %d\0A\00"
@EXIT_FAILURE = global i32 0
define void @assert_port(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 65535
br i1 %7, label %8, label %14
8: ; preds = %5, %1
%9 = load i32, i32* @stderr
%10 = load i32, i32* %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %5
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"Invalid port: %d\0A\00"
@EXIT_FAILURE = global i32 0
define void @assert_port(i32 %0) {
%2 = icmp ugt i32 %0, 65535
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret void
}
int next_sibling(int i) {
  if (i >= 2 && i < 4)
    return i + 2;
  if (i >= 6 && i < 18)
    return i + 4;
  if (i >= 22 && i < 1030)
    return i + 16;
  return -1;
}


x86 assembly (clang, -O0):
<next_sibling>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     1129 <next_sibling+0x29>
cmpl   $0x4,-0x8(%rbp)
jge    1129 <next_sibling+0x29>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <next_sibling+0x77>
cmpl   $0x6,-0x8(%rbp)
jl     114b <next_sibling+0x4b>
cmpl   $0x12,-0x8(%rbp)
jge    114b <next_sibling+0x4b>
mov    -0x8(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <next_sibling+0x77>
cmpl   $0x16,-0x8(%rbp)
jl     1170 <next_sibling+0x70>
cmpl   $0x406,-0x8(%rbp)
jge    1170 <next_sibling+0x70>
mov    -0x8(%rbp),%eax
add    $0x10,%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <next_sibling+0x77>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_sibling>:
mov    %edi,%eax
mov    %edi,%ecx
and    $0xfffffffe,%ecx
cmp    $0x2,%ecx
jne    1110 <next_sibling+0x10>
add    $0x2,%eax
ret
lea    -0x6(%rax),%ecx
cmp    $0xb,%ecx
ja     111c <next_sibling+0x1c>
add    $0x4,%eax
ret
lea    -0x16(%rax),%ecx
add    $0x10,%eax
cmp    $0x3f0,%ecx
mov    $0xffffffff,%ecx
cmovb  %eax,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @next_sibling(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 2
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 4
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 2
store i32 %11, i32* %2
br label %31
12: ; preds = %6, %1
%13 = load i32, i32* %3
%14 = icmp sge i32 %13, 6
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 18
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 4
store i32 %20, i32* %2
br label %31
21: ; preds = %15, %12
%22 = load i32, i32* %3
%23 = icmp sge i32 %22, 22
br i1 %23, label %24, label %30
24: ; preds = %21
%25 = load i32, i32* %3
%26 = icmp slt i32 %25, 1030
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 16
store i32 %29, i32* %2
br label %31
30: ; preds = %24, %21
store i32 -1, i32* %2
br label %31
31: ; preds = %30, %27, %18, %9
%32 = load i32, i32* %2
ret i32 %32
}

LLVM IR (-O2):
define i32 @next_sibling(i32 %0) {
%2 = and i32 %0, -2
%3 = icmp eq i32 %2, 2
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = add nuw nsw i32 %0, 2
br label %16
6: ; preds = %1
%7 = add i32 %0, -6
%8 = icmp ult i32 %7, 12
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = add nuw nsw i32 %0, 4
br label %16
11: ; preds = %6
%12 = add i32 %0, -22
%13 = icmp ult i32 %12, 1008
%14 = add nsw i32 %0, 16
%15 = select i1 %13, i32 %14, i32 -1
br label %16
16: ; preds = %11, %9, %4
%17 = phi i32 [ %5, %4 ], [ %10, %9 ], [ %15, %11 ]
ret i32 %17
}
int from_point_to_pixel(float f, int max) { return (int)(f * max); }


x86 assembly (clang, -O0):
<from_point_to_pixel>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<from_point_to_pixel>:
cvtsi2ss %edi,%xmm1
mulss  %xmm0,%xmm1
cvttss2si %xmm1,%eax
ret

LLVM IR (-O0):
define i32 @from_point_to_pixel(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%5 = load float, float* %3
%6 = load i32, i32* %4
%7 = sitofp i32 %6 to float
%8 = fmul float %5, %7
%9 = fptosi float %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @from_point_to_pixel(float %0, i32 %1) {
%3 = sitofp i32 %1 to float
%4 = fmul float %3, %0
%5 = fptosi float %4 to i32
ret i32 %5
}
/* Variables and functions */
int fun(double);
double computeArea(double interval, double x_coordinate_one,
                   double x_coordinate_two) {
  return interval * ((fun(x_coordinate_one) + fun(x_coordinate_two)) / 2);
}


x86 assembly (clang, -O0):
<computeArea>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <fun@plt>
mov    %eax,-0x1c(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <fun@plt>
movsd  -0x28(%rbp),%xmm0
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<computeArea>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm2,(%rsp)
movsd  %xmm0,0x8(%rsp)
movaps %xmm1,%xmm0
call   1030 <fun@plt>
mov    %eax,%ebx
movsd  (%rsp),%xmm0
call   1030 <fun@plt>
add    %ebx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
mulsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @computeArea(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = call i32 @fun(double %8)
%10 = load double, double* %6
%11 = call i32 @fun(double %10)
%12 = add nsw i32 %9, %11
%13 = sdiv i32 %12, 2
%14 = sitofp i32 %13 to double
%15 = fmul double %7, %14
ret double %15
}

LLVM IR (-O2):
define double @computeArea(double %0, double %1, double %2) {
%4 = tail call i32 @fun(double %1)
%5 = tail call i32 @fun(double %2)
%6 = add nsw i32 %5, %4
%7 = sdiv i32 %6, 2
%8 = sitofp i32 %7 to double
%9 = fmul double %8, %0
ret double %9
}
/* Variables and functions */
void *malloc(size_t);
void *pppoat_alloc(size_t size) { return malloc(size); }


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

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

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

LLVM IR (-O2):
define noalias i8* @pppoat_alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
float sqrt(float);
float trigono(float factor1, float factor2) {
  return factor1 + factor2 + sqrt(factor1 * factor1 + factor2 * factor2);
}


x86 assembly (clang, -O0):
<trigono>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trigono>:
movaps %xmm0,%xmm2
addss  %xmm1,%xmm2
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1131 <trigono+0x21>
sqrtss %xmm0,%xmm0
jmp    1147 <trigono+0x37>
push   %rax
movss  %xmm2,0x4(%rsp)
call   1030 <sqrt@plt>
movss  0x4(%rsp),%xmm2
add    $0x8,%rsp
addss  %xmm0,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @trigono(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* %4
%7 = fadd float %5, %6
%8 = load float, float* %3
%9 = load float, float* %3
%10 = load float, float* %4
%11 = load float, float* %4
%12 = fmul float %10, %11
%13 = call float @llvm.fmuladd.f32(float %8, float %9, float %12)
%14 = call float @sqrt(float %13)
%15 = fadd float %7, %14
ret float %15
}

LLVM IR (-O2):
define float @trigono(float %0, float %1) {
%3 = fadd float %0, %1
%4 = fmul float %1, %1
%5 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %4)
%6 = tail call float @sqrt(float %5)
%7 = fadd float %3, %6
ret float %7
}
/* Type definitions */
struct sockaddr_s {
  int dummy;
};
struct sockaddr_in {
  int /*<<< orphan*/ sin_port;
};

/* Variables and functions */
int ntohs(int /*<<< orphan*/);
int WINS_GetSocketPort(struct sockaddr_s *addr) {
  return ntohs(((struct sockaddr_in *)addr)->sin_port);
}


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

x86 assembly (clang, -O2):
<WINS_GetSocketPort>:
mov    (%rdi),%edi
jmp    1030 <ntohs@plt>

LLVM IR (-O0):
%struct.sockaddr_s = type { i32 }
%struct.sockaddr_in = type { i32 }
define i32 @WINS_GetSocketPort(%struct.sockaddr_s* %0) {
%2 = alloca %struct.sockaddr_s*
store %struct.sockaddr_s* %0, %struct.sockaddr_s** %2
%3 = load %struct.sockaddr_s*, %struct.sockaddr_s** %2
%4 = bitcast %struct.sockaddr_s* %3 to %struct.sockaddr_in*
%5 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = call i32 @ntohs(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.sockaddr_s = type { i32 }
define i32 @WINS_GetSocketPort(%struct.sockaddr_s* nocapture %0) {
%2 = getelementptr %struct.sockaddr_s, %struct.sockaddr_s* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @ntohs(i32 %3)
ret i32 %4
}