xunge/DecIR huggingface dataset:
void swap_int(int *pa, int *pb) {
  int tmp = *pa;
  *pa = *pb;
  *pb = tmp;
}


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

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

LLVM IR (-O0):
define void @swap_int(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap_int(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
void vsub(const float *src1, const float *src2, float *dst) {
  dst[(signed long int)0] = src1[(signed long int)0] - src2[(signed long int)0];
  dst[(signed long int)1] = src1[(signed long int)1] - src2[(signed long int)1];
  dst[(signed long int)2] = src1[(signed long int)2] - src2[(signed long int)2];
}


x86 assembly (clang, -O0):
<vsub>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsub>:
movss  (%rdi),%xmm0
subss  (%rsi),%xmm0
movss  %xmm0,(%rdx)
movss  0x4(%rdi),%xmm0
subss  0x4(%rsi),%xmm0
movss  %xmm0,0x4(%rdx)
movss  0x8(%rdi),%xmm0
subss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdx)
ret

LLVM IR (-O0):
define void @vsub(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 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %5
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fsub float %9, %12
%14 = load float*, float** %6
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = load float*, float** %4
%17 = getelementptr inbounds float, float* %16, i64 1
%18 = load float, float* %17
%19 = load float*, float** %5
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %20
%22 = fsub float %18, %21
%23 = load float*, float** %6
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
%25 = load float*, float** %4
%26 = getelementptr inbounds float, float* %25, i64 2
%27 = load float, float* %26
%28 = load float*, float** %5
%29 = getelementptr inbounds float, float* %28, i64 2
%30 = load float, float* %29
%31 = fsub float %27, %30
%32 = load float*, float** %6
%33 = getelementptr inbounds float, float* %32, i64 2
store float %31, float* %33
ret void
}

LLVM IR (-O2):
define void @vsub(float* nocapture %0, float* nocapture %1, float* nocapture writeonly %2) {
%4 = load float, float* %0
%5 = load float, float* %1
%6 = fsub float %4, %5
store float %6, float* %2
%7 = getelementptr inbounds float, float* %0, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %1, i64 1
%10 = load float, float* %9
%11 = fsub float %8, %10
%12 = getelementptr inbounds float, float* %2, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %0, i64 2
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %1, i64 2
%16 = load float, float* %15
%17 = fsub float %14, %16
%18 = getelementptr inbounds float, float* %2, i64 2
store float %17, float* %18
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ISSUING_DIST_POINT;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ ISSUING_DIST_POINT_it;
void ISSUING_DIST_POINT_free(ISSUING_DIST_POINT *a) {
  ASN1_item_free((ASN1_VALUE *)a, &ISSUING_DIST_POINT_it);
}


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

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

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

LLVM IR (-O2):
@ISSUING_DIST_POINT_it = global i32 0
define void @ISSUING_DIST_POINT_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @ISSUING_DIST_POINT_it)
ret void
}
/* Variables and functions */
int tou_errno(int);
int get_last_tou_socket_error(int s) { return tou_errno(s); }


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

x86 assembly (clang, -O2):
<get_last_tou_socket_error>:
jmp    1030 <tou_errno@plt>

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

LLVM IR (-O2):
define i32 @get_last_tou_socket_error(i32 %0) {
%2 = tail call i32 @tou_errno(i32 %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ Malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *CopyHeapString(char *String) {
  char *NewString;
  if (String == NULL) {
    return (NULL);
  } else {
    NewString = (char *)Malloc(strlen(String) + 1);
    strcpy(NewString, String);
    return (NewString);
  }
}


x86 assembly (clang, -O0):
<CopyHeapString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <CopyHeapString+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1182 <CopyHeapString+0x52>
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1030 <Malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CopyHeapString>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115a <CopyHeapString+0x2a>
mov    %rdi,%rbx
call   1050 <strlen@plt>
lea    0x1(%rax),%rdi
call   1030 <Malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <strcpy@plt>
jmp    115d <CopyHeapString+0x2d>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @CopyHeapString(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %2
br label %18
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @strlen(i8* %9)
%11 = add nsw i64 %10, 1
%12 = call i64 @Malloc(i64 %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %4
%14 = load i8*, i8** %4
%15 = load i8*, i8** %3
%16 = call i32 @strcpy(i8* %14, i8* %15)
%17 = load i8*, i8** %4
store i8* %17, i8** %2
br label %18
18: ; preds = %8, %7
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @CopyHeapString(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i64 @Malloc(i64 %5)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
br label %9
9: ; preds = %1, %3
%10 = phi i8* [ %7, %3 ], [ null, %1 ]
ret i8* %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
void fputnc(int c, size_t n, FILE *f) {
  while (n-- > 0) {
    fputc(c, f);
  }
}


x86 assembly (clang, -O0):
<fputnc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
jbe    114d <fputnc+0x3d>
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1030 <fputc@plt>
jmp    1123 <fputnc+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputnc>:
push   %rbp
push   %r14
push   %rbx
test   %rsi,%rsi
je     1140 <fputnc+0x30>
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
add    $0xffffffffffffffff,%rbx
jne    1130 <fputnc+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @fputnc(i32 %0, i64 %1, i32* nocapture %2) {
%4 = icmp eq i64 %1, 0
br i1 %4, label %10, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %7, %5 ], [ %1, %3 ]
%7 = add i64 %6, -1
%8 = tail call i32 @fputc(i32 %0, i32* %2)
%9 = icmp eq i64 %7, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void fakedef(void) {
  fputs("Unimplemented _Q* func called, exiting\n", stderr);
  exit(-1);
}


x86 assembly (clang, -O0):
<fakedef>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fakedef>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"Unimplemented _Q* func called, exiting\0A\00"
@stderr = global i32 0
define void @fakedef() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [40 x i8] c"Unimplemented _Q* func called, exiting\0A\00"
@stderr = global i32 0
define void @fakedef() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rol32(uint32_t x, int r) { return (x << (r & 31)) | (x >> (-r & 31)); }


x86 assembly (clang, -O0):
<rol32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
and    $0x1f,%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    $0x1f,%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rol32>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rol32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = and i32 %6, 31
%8 = shl i32 %5, %7
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sub nsw i32 0, %10
%12 = and i32 %11, 31
%13 = ashr i32 %9, %12
%14 = or i32 %8, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @rol32(i32 %0, i32 %1) {
%3 = and i32 %1, 31
%4 = shl i32 %0, %3
%5 = sub nsw i32 0, %1
%6 = and i32 %5, 31
%7 = ashr i32 %0, %6
%8 = or i32 %4, %7
ret i32 %8
}
/* Variables and functions */
scalar_t__ atan(double);
long double atanl(long double x) { return (long double)atan((double)x); }


x86 assembly (clang, -O0):
<atanl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <atan@plt>
mov    %rax,-0x18(%rbp)
fildll -0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atanl>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <atan@plt>
mov    %rax,0x10(%rsp)
fildll 0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @atanl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call i64 @atan(double %4)
%6 = sitofp i64 %5 to x86_fp80
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @atanl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call i64 @atan(double %2)
%4 = sitofp i64 %3 to x86_fp80
ret x86_fp80 %4
}
/* Variables and functions */
int /*<<< orphan*/ __emit_string_literal_range(char *, int, int, int);
void test_terminator_location(void) {
  __emit_string_literal_range("0123456789", 10, 10, 10);
}


x86 assembly (clang, -O0):
<test_terminator_location>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0xa,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <__emit_string_literal_range@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_terminator_location>:
lea    0xee9(%rip),%rdi
mov    $0xa,%esi
mov    $0xa,%edx
mov    $0xa,%ecx
jmp    1030 <__emit_string_literal_range@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"0123456789\00"
define void @test_terminator_location() {
%1 = call i32 @__emit_string_literal_range(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10, i32 10, i32 10)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"0123456789\00"
define void @test_terminator_location() {
%1 = tail call i32 @__emit_string_literal_range(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10, i32 10, i32 10)
ret void
}
/* Variables and functions */
scalar_t__ round(double);
long long llround(double x) { return (long long)round(x); }


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

x86 assembly (clang, -O2):
<llround>:
jmp    1030 <round@plt>

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

LLVM IR (-O2):
define i64 @llround(double %0) {
%2 = tail call i64 @round(double %0)
ret i64 %2
}
/* Variables and functions */
int UP3DCOMM_Open();
bool UP3D_Open() { return UP3DCOMM_Open(); }


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

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

LLVM IR (-O0):
define i32 @UP3D_Open() {
%1 = call i32 (...) @UP3DCOMM_Open()
ret i32 %1
}

LLVM IR (-O2):
define i32 @UP3D_Open() {
%1 = tail call i32 (...) @UP3DCOMM_Open()
ret i32 %1
}
BOOST_AUTO_TEST_CASE(arccsc) {
  TESTCASE1(arccsc, 1, 1.5707963267948966);
  TESTCASE1(arccsc, -1, -1.5707963267948966);
}


x86 assembly (clang, -O0):
<BOOST_AUTO_TEST_CASE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
movsd  0xedd(%rip),%xmm0
mov    $0x1,%al
call   1030 <TESTCASE1@plt>
mov    -0x8(%rbp),%edi
mov    $0xffffffff,%esi
movsd  0xebe(%rip),%xmm0
mov    $0x1,%al
call   1030 <TESTCASE1@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BOOST_AUTO_TEST_CASE>:
push   %rbx
mov    %edi,%ebx
movsd  0xee5(%rip),%xmm0
mov    $0x1,%esi
mov    $0x1,%al
call   1030 <TESTCASE1@plt>
movsd  0xed9(%rip),%xmm0
mov    %ebx,%edi
mov    $0xffffffff,%esi
mov    $0x1,%al
pop    %rbx
jmp    1030 <TESTCASE1@plt>

LLVM IR (-O0):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, i32, double, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, double, ...)*)(i32 %4, i32 1, double 0x3FF921FB54442D18)
%6 = load i32, i32* %3
%7 = call i32 (i32, i32, double, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, double, ...)*)(i32 %6, i32 -1, double 0xBFF921FB54442D18)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = tail call i32 (i32, i32, double, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, double, ...)*)(i32 %0, i32 1, double 0x3FF921FB54442D18)
%3 = tail call i32 (i32, i32, double, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, double, ...)*)(i32 %0, i32 -1, double 0xBFF921FB54442D18)
ret i32 undef
}
_Complex double pass_complex_double(_Complex double arg) { return arg; }


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

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

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

LLVM IR (-O2):
define { double, double } @pass_complex_double(double %0, double %1) {
%3 = insertvalue { double, double } poison, double %0, 0
%4 = insertvalue { double, double } %3, double %1, 1
ret { double, double } %4
}
/* Variables and functions */
int /*<<< orphan*/ writechar(char);
void writeln(void) {
  writechar('\r');
  writechar('\n');
}


x86 assembly (clang, -O0):
<writeln>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd,%edi
call   1030 <writechar@plt>
mov    $0xa,%edi
call   1030 <writechar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeln>:
push   %rax
mov    $0xd,%edi
call   1030 <writechar@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <writechar@plt>

LLVM IR (-O0):
define void @writeln() {
%1 = call i32 @writechar(i8 signext 13)
%2 = call i32 @writechar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @writeln() {
%1 = tail call i32 @writechar(i8 signext 13)
%2 = tail call i32 @writechar(i8 signext 10)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool rtp2435r_check_first(uint8_t *header) { return !!(header[2] & 0x1); }


x86 assembly (clang, -O0):
<rtp2435r_check_first>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtp2435r_check_first>:
mov    0x8(%rdi),%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @rtp2435r_check_first(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
%6 = and i32 %5, 1
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @rtp2435r_check_first(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = and i32 %3, 1
ret i32 %4
}
/* Type definitions */
struct timespec {
  int dummy;
};

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


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

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

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

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define void @timespec_now(%struct.timespec* %0) {
%2 = load i32, i32* @CLOCK_REALTIME
%3 = tail call i32 @clock_gettime(i32 %2, %struct.timespec* %0)
ret void
}
/* Variables and functions */
long double exp(long double);
long double tanhl(long double x) {
  long double x0 = exp(x);
  long double x1 = 1.0 / x0;
  return ((x0 + x1) / (x0 - x1));
}


x86 assembly (clang, -O0):
<tanhl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <exp@plt>
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
fld1
fdivp  %st,%st(1)
fstpt  -0x30(%rbp)
fldt   -0x20(%rbp)
fldt   -0x30(%rbp)
fld    %st(1)
fadd   %st(1),%st
fxch   %st(2)
fsubp  %st,%st(1)
fdivrp %st,%st(1)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tanhl>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpt  (%rsp)
call   1030 <exp@plt>
fld1
fdiv   %st(1),%st
fld    %st(1)
fadd   %st(1),%st
fxch   %st(2)
fsubp  %st,%st(1)
fdivrp %st,%st(1)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @tanhl(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%5 = load x86_fp80, x86_fp80* %2
%6 = call x86_fp80 @exp(x86_fp80 %5)
store x86_fp80 %6, x86_fp80* %3
%7 = load x86_fp80, x86_fp80* %3
%8 = fdiv x86_fp80 0xK3FFF8000000000000000, %7
store x86_fp80 %8, x86_fp80* %4
%9 = load x86_fp80, x86_fp80* %3
%10 = load x86_fp80, x86_fp80* %4
%11 = fadd x86_fp80 %9, %10
%12 = load x86_fp80, x86_fp80* %3
%13 = load x86_fp80, x86_fp80* %4
%14 = fsub x86_fp80 %12, %13
%15 = fdiv x86_fp80 %11, %14
ret x86_fp80 %15
}

LLVM IR (-O2):
define x86_fp80 @tanhl(x86_fp80 %0) {
%2 = tail call x86_fp80 @exp(x86_fp80 %0)
%3 = fdiv x86_fp80 0xK3FFF8000000000000000, %2
%4 = fadd x86_fp80 %2, %3
%5 = fsub x86_fp80 %2, %3
%6 = fdiv x86_fp80 %4, %5
ret x86_fp80 %6
}
/* Variables and functions */
unsigned long clk_get_pll_rate();
unsigned int reg_read_32(unsigned int volatile *);
unsigned long clk_get_ddr_rate(void) {
  unsigned long pll_rate, ddr_rate;
  unsigned int ctrl;
  pll_rate = clk_get_pll_rate();
  ctrl = reg_read_32((volatile unsigned int *)(0xbfe78034));
  ddr_rate = pll_rate / ((ctrl & (0x1f << 14)) >> 14);
  return ddr_rate;
}


x86 assembly (clang, -O0):
<clk_get_ddr_rate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1040 <clk_get_pll_rate@plt>
mov    %rax,-0x8(%rbp)
mov    $0xbfe78034,%edi
call   1030 <reg_read_32@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
and    $0x7c000,%ecx
shr    $0xe,%ecx
mov    %ecx,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clk_get_ddr_rate>:
push   %rbx
xor    %eax,%eax
call   1040 <clk_get_pll_rate@plt>
mov    %rax,%rbx
mov    $0xbfe78034,%edi
call   1030 <reg_read_32@plt>
mov    %eax,%ecx
shr    $0xe,%ecx
and    $0x1f,%ecx
mov    %rbx,%rax
shr    $0x20,%rax
je     1150 <clk_get_ddr_rate+0x30>
mov    %rbx,%rax
xor    %edx,%edx
div    %rcx
pop    %rbx
ret
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
pop    %rbx
ret

LLVM IR (-O0):
define i64 @clk_get_ddr_rate() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i32
%4 = call i64 (...) @clk_get_pll_rate()
store i64 %4, i64* %1
%5 = call i32 @reg_read_32(i32* inttoptr (i64 3219619892 to i32*))
store i32 %5, i32* %3
%6 = load i64, i64* %1
%7 = load i32, i32* %3
%8 = and i32 %7, 507904
%9 = lshr i32 %8, 14
%10 = zext i32 %9 to i64
%11 = udiv i64 %6, %10
store i64 %11, i64* %2
%12 = load i64, i64* %2
ret i64 %12
}

LLVM IR (-O2):
define i64 @clk_get_ddr_rate() {
%1 = tail call i64 (...) @clk_get_pll_rate()
%2 = tail call i32 @reg_read_32(i32* inttoptr (i64 3219619892 to i32*))
%3 = lshr i32 %2, 14
%4 = and i32 %3, 31
%5 = zext i32 %4 to i64
%6 = udiv i64 %1, %5
ret i64 %6
}
void putlong(unsigned char *p, int a) {
  p[0] = a;
  p[1] = a >> 8;
  p[2] = a >> 16;
  p[3] = a >> 24;
}


x86 assembly (clang, -O0):
<putlong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<putlong>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @putlong(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %1, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %1, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
unsigned long buf2long(unsigned char *buf) {
  return (unsigned long)(buf[3] << 24 | buf[2] << 16 | buf[1] << 8 | buf[0]);
}


x86 assembly (clang, -O0):
<buf2long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
or     %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf2long>:
movzbl 0x3(%rdi),%eax
shl    $0x18,%eax
movzbl 0x2(%rdi),%ecx
shl    $0x10,%rcx
cltq
or     %rcx,%rax
movzbl 0x1(%rdi),%ecx
shl    $0x8,%rcx
or     %rax,%rcx
movzbl (%rdi),%eax
or     %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @buf2long(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw i32 %4, 24
%6 = getelementptr inbounds i8, i8* %0, i64 2
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl nuw nsw i32 %8, 16
%10 = or i32 %9, %5
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl nuw nsw i32 %13, 8
%15 = or i32 %10, %14
%16 = load i8, i8* %0
%17 = zext i8 %16 to i32
%18 = or i32 %15, %17
%19 = sext i32 %18 to i64
ret i64 %19
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int fgetsize(FILE *fp) {
  long start, end;
  start = ftell(fp);
  fseek(fp, 0, SEEK_END);
  end = ftell(fp);
  rewind(fp);
  return (int)(end - start);
}


x86 assembly (clang, -O0):
<fgetsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ftell@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e94(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1040 <ftell@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0x18(%rbp),%rax
sub    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgetsize>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1040 <ftell@plt>
mov    %rax,%r14
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
mov    %r15,%rdi
xor    %esi,%esi
call   1050 <fseek@plt>
mov    %r15,%rdi
call   1040 <ftell@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1030 <rewind@plt>
sub    %r14d,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
define i32 @fgetsize(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
%4 = alloca i64
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i64 @ftell(i32* %5)
store i64 %6, i64* %3
%7 = load i32*, i32** %2
%8 = load i32, i32* @SEEK_END
%9 = call i32 @fseek(i32* %7, i32 0, i32 %8)
%10 = load i32*, i32** %2
%11 = call i64 @ftell(i32* %10)
store i64 %11, i64* %4
%12 = load i32*, i32** %2
%13 = call i32 @rewind(i32* %12)
%14 = load i64, i64* %4
%15 = load i64, i64* %3
%16 = sub nsw i64 %14, %15
%17 = trunc i64 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
@SEEK_END = global i32 0
define i32 @fgetsize(i32* nocapture %0) {
%2 = tail call i64 @ftell(i32* %0)
%3 = load i32, i32* @SEEK_END
%4 = tail call i32 @fseek(i32* %0, i32 0, i32 %3)
%5 = tail call i64 @ftell(i32* %0)
%6 = tail call i32 @rewind(i32* %0)
%7 = sub nsw i64 %5, %2
%8 = trunc i64 %7 to i32
ret i32 %8
}
void glGetInteger64i_v(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGetInteger64i_v() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void close(int handle) {
  printf("ftp::close() called!\n");
  printf("ftp::close: not yet implemented\n");
}


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

x86 assembly (clang, -O2):
<close>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef1(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"ftp::close() called!\0A\00"
@.str.1 = [33 x i8] c"ftp::close: not yet implemented\0A\00"
define void @close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"ftp::close() called!\00"
@str.2 = [32 x i8] c"ftp::close: not yet implemented\00"
define void @close(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void writelines(char *lineptr[], int nlines, int number) {
  int i;
  for (i = nlines - number; i < nlines; i++) {
    printf("%s\n", lineptr[i]);
  }
}


x86 assembly (clang, -O0):
<writelines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115d <writelines+0x4d>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <writelines+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writelines>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
jle    1145 <writelines+0x35>
mov    %rdi,%r15
movslq %esi,%r12
sub    %edx,%esi
movslq %esi,%rbx
lea    0xed2(%rip),%r14
xchg   %ax,%ax
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %r12,%rbx
jl     1130 <writelines+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @writelines(i8** %0, i32 %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8** %0, i8*** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = sub nsw i32 %8, %9
store i32 %10, i32* %7
br label %11
11: ; preds = %22, %3
%12 = load i32, i32* %7
%13 = load i32, i32* %5
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %25
15: ; preds = %11
%16 = load i8**, i8*** %4
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8*, i8** %16, i64 %18
%20 = load i8*, i8** %19
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %20)
br label %22
22: ; preds = %15
%23 = load i32, i32* %7
%24 = add nsw i32 %23, 1
store i32 %24, i32* %7
br label %11
25: ; preds = %11
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @writelines(i8** nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %16
5: ; preds = %3
%6 = sub i32 %1, %2
%7 = sext i32 %6 to i64
%8 = sext i32 %1 to i64
br label %9
9: ; preds = %5, %9
%10 = phi i64 [ %7, %5 ], [ %14, %9 ]
%11 = getelementptr inbounds i8*, i8** %0, i64 %10
%12 = load i8*, i8** %11
%13 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = add nsw i64 %10, 1
%15 = icmp slt i64 %14, %8
br i1 %15, label %9, label %16
16: ; preds = %9, %3
ret void
}
/* Variables and functions */
void token_decline(int *linenum) {
  if (linenum != NULL)
    (*linenum) = (*linenum) - 1;
}


x86 assembly (clang, -O0):
<token_decline>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1122 <token_decline+0x22>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<token_decline>:
test   %rdi,%rdi
je     1108 <token_decline+0x8>
addl   $0xffffffff,(%rdi)
ret

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

LLVM IR (-O2):
define void @token_decline(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i32, i32* %0
%5 = add nsw i32 %4, -1
store i32 %5, i32* %0
br label %6
6: ; preds = %3, %1
ret void
}
void X509_CRL_add_ext(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ _ses_str_cpy(int /*<<< orphan*/ *, int, char *,
                                unsigned int);
void ses_config_enclosure_descriptor_revision_level(uint8_t *data, char *s,
                                                    unsigned slen) {
  _ses_str_cpy(data + 36, 4, s, slen);
}


x86 assembly (clang, -O0):
<ses_config_enclosure_descriptor_revision_level>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x90,%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x4,%esi
call   1030 <_ses_str_cpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ses_config_enclosure_descriptor_revision_level>:
mov    %edx,%ecx
mov    %rsi,%rdx
add    $0x90,%rdi
mov    $0x4,%esi
jmp    1030 <_ses_str_cpy@plt>

LLVM IR (-O0):
define void @ses_config_enclosure_descriptor_revision_level(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 i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 36
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @_ses_str_cpy(i32* %8, i32 4, i8* %9, i32 %10)
ret void
}

LLVM IR (-O2):
define void @ses_config_enclosure_descriptor_revision_level(i32* %0, i8* %1, i32 %2) {
%4 = getelementptr inbounds i32, i32* %0, i64 36
%5 = tail call i32 @_ses_str_cpy(i32* %4, i32 4, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PrintHexdump(void *, int);
int /*<<< orphan*/ backtrace(void **, int);
void hexdump(void) {
  void *call_buffer[256];
  backtrace(call_buffer, 256);
  PrintHexdump(call_buffer[0], 255);
}


x86 assembly (clang, -O0):
<hexdump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x800,%rsp
lea    -0x800(%rbp),%rdi
mov    $0x100,%esi
call   1040 <backtrace@plt>
mov    -0x800(%rbp),%rdi
mov    $0xff,%esi
call   1030 <PrintHexdump@plt>
add    $0x800,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexdump>:
sub    $0x808,%rsp
mov    %rsp,%rdi
mov    $0x100,%esi
call   1040 <backtrace@plt>
mov    (%rsp),%rdi
mov    $0xff,%esi
call   1030 <PrintHexdump@plt>
add    $0x808,%rsp
ret

LLVM IR (-O0):
define void @hexdump() {
%1 = alloca [256 x i8*]
%2 = getelementptr inbounds [256 x i8*], [256 x i8*]* %1, i64 0, i64 0
%3 = call i32 @backtrace(i8** %2, i32 256)
%4 = getelementptr inbounds [256 x i8*], [256 x i8*]* %1, i64 0, i64 0
%5 = load i8*, i8** %4
%6 = call i32 @PrintHexdump(i8* %5, i32 255)
ret void
}

LLVM IR (-O2):
define void @hexdump() {
%1 = alloca [256 x i8*]
%2 = bitcast [256 x i8*]* %1 to i8*
%3 = getelementptr inbounds [256 x i8*], [256 x i8*]* %1, i64 0, i64 0
%4 = call i32 @backtrace(i8** %3, i32 256)
%5 = load i8*, i8** %3
%6 = call i32 @PrintHexdump(i8* %5, i32 255)
ret void
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void *tk_malloc(int sz) {
  void *ptr;
  ptr = malloc(sz);
  memset(ptr, 0, sz);
  return (ptr);
}


x86 assembly (clang, -O0):
<tk_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tk_malloc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @tk_malloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i32, i32* %2
%8 = call i32 @memset(i8* %6, i32 0, i32 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @tk_malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = tail call i32 @memset(i8* %2, i32 0, i32 %0)
ret i8* %2
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ test();
int main(int argc, char *argv[]) {
  test();
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test@plt>
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test()
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
int plus(int *a, int b) { return (*a += b); }


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

x86 assembly (clang, -O2):
<plus>:
mov    %esi,%eax
add    (%rdi),%eax
mov    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @plus(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = add nsw i32 %3, %1
store i32 %4, i32* %0
ret i32 %4
}
int search(int arr[], int n, int x) {
  int i;
  for (i = 0; i < n; i++)
    if (arr[i] == x)
      return i;
  return -1;
}


x86 assembly (clang, -O0):
<search>:
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    -0x14(%rbp),%eax
jge    1153 <search+0x53>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1140 <search+0x40>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <search+0x5a>
jmp    1145 <search+0x45>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <search+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<search>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111e <search+0x1e>
mov    %esi,%esi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edx,(%rdi,%rcx,4)
je     111f <search+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <search+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @search(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
double sqr(double x) { return (x * x); }


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

x86 assembly (clang, -O2):
<sqr>:
mulsd  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @sqr(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Variables and functions */
scalar_t__ xislower(int);
int xtoupper(int c) { return ((xislower(c)) ? (c & ~('a' - 'A')) : c); }


x86 assembly (clang, -O0):
<xtoupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <xislower@plt>
cmp    $0x0,%rax
je     113b <xtoupper+0x2b>
mov    -0x4(%rbp),%eax
and    $0xffffffdf,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <xtoupper+0x31>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xtoupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <xislower@plt>
mov    %ebx,%ecx
and    $0xffffffdf,%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @xtoupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @xislower(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = and i32 %7, -33
br label %11
9: ; preds = %1
%10 = load i32, i32* %2
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ %8, %6 ], [ %10, %9 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @xtoupper(i32 %0) {
%2 = tail call i64 @xislower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = and i32 %0, -33
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
void pm_loss_on_bus_added(struct bus_type *b) {}


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

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

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

LLVM IR (-O2):
%struct.bus_type = type opaque
define void @pm_loss_on_bus_added(%struct.bus_type* nocapture %0) {
ret void
}