xunge/DecIR huggingface dataset:
int dev_hotplug(struct device *dev, const char *action) { return 0; }


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

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

LLVM IR (-O0):
%struct.device = type opaque
define i32 @dev_hotplug(%struct.device* %0, i8* %1) {
%3 = alloca %struct.device*
%4 = alloca i8*
store %struct.device* %0, %struct.device** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
%struct.device = type opaque
define i32 @dev_hotplug(%struct.device* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int getDist(int, int *, int);
int /*<<< orphan*/ printf(char *, int);
void main() {
  int T = 570;
  int a[] = {2013, 2, 13, 314, 271, 1414, 1732};
  int len = sizeof(a) / sizeof(a[0]);
  int res = getDist(T, a, len);
  printf("Dist is %d", res);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x23a,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec2(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x7,-0x24(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1040 <getDist@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xee1(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x23a,%edi
mov    $0x7,%edx
call   1040 <getDist@plt>
lea    0xec8(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [7 x i32] [i32 2013, i32 2, i32 13, i32 314, i32 271, i32 1414, i32 1732]
@.str = [11 x i8] c"Dist is %d\00"
define void @main() {
%1 = alloca i32
%2 = alloca [7 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 570, i32* %1
%5 = bitcast [7 x i32]* %2 to i8*
store i32 7, i32* %3
%6 = load i32, i32* %1
%7 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call i32 @getDist(i32 %6, i32* %7, i32 %8)
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %10)
ret void
}

LLVM IR (-O2):
@__const.main.a = [7 x i32] [i32 2013, i32 2, i32 13, i32 314, i32 271, i32 1414, i32 1732]
@.str = [11 x i8] c"Dist is %d\00"
define void @main() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @getDist(i32 570, i32* %3, i32 7)
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
float CubicEaseIn(float p) { return p * p * p; }


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

x86 assembly (clang, -O2):
<CubicEaseIn>:
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @CubicEaseIn(float %0) {
%2 = fmul float %0, %0
%3 = fmul float %2, %0
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello world.\n");
  printf("Programming in C is fun.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world.\0A\00"
@.str.1 = [26 x i8] c"Programming in C is fun.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello world.\00"
@str.2 = [25 x i8] c"Programming in C is fun.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(int);
int *uninit() { return (int *)malloc(sizeof(int)); }


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

x86 assembly (clang, -O2):
<uninit>:
mov    $0x4,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i32* @uninit() {
%1 = call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
define i32* @uninit() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ outop2str(char *);
void outpuls() { outop2str("PULS"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"PULS\00"
define void @outpuls() {
%1 = call i32 @outop2str(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"PULS\00"
define void @outpuls() {
%1 = tail call i32 @outop2str(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
long long STEST909(long v) { return v + 3; }


x86 assembly (clang, -O0):
<STEST909>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x3,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<STEST909>:
lea    0x3(%rdi),%rax
ret

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

LLVM IR (-O2):
define i64 @STEST909(i64 %0) {
%2 = add nsw i64 %0, 3
ret i64 %2
}
/* Variables and functions */
void abort();
scalar_t__ printf(char *);
int main() { 1 ? (void)printf("foo") : abort(); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00"
define i32 @main() {
%1 = call i64 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
define i32 @main() {
%1 = tail call i64 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
long double _U_Qfneg(long double a) {
  union {
    long double ld;
    int i[4];
  } u;
  u.ld = a;
  u.i[0] ^= 0x80000000;
  return u.ld;
}


x86 assembly (clang, -O0):
<_U_Qfneg>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpt  -0x20(%rbp)
mov    -0x1d(%rbp),%al
xor    $0x80,%al
mov    %al,-0x1d(%rbp)
fldt   -0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_U_Qfneg>:
mov    0x10(%rsp),%eax
mov    0x8(%rsp),%rcx
movabs $0xffffffff00000000,%rdx
ff ff ff
and    %rcx,%rdx
xor    $0x80000000,%ecx
or     %rcx,%rdx
mov    %ax,-0x10(%rsp)
mov    %rdx,-0x18(%rsp)
fldt   -0x18(%rsp)
ret

LLVM IR (-O0):
%union.anon = type { x86_fp80 }
define x86_fp80 @_U_Qfneg(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca %union.anon
store x86_fp80 %0, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
%5 = bitcast %union.anon* %3 to x86_fp80*
store x86_fp80 %4, x86_fp80* %5
%6 = bitcast %union.anon* %3 to [4 x i32]*
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 0
%8 = load i32, i32* %7
%9 = xor i32 %8, -2147483648
store i32 %9, i32* %7
%10 = bitcast %union.anon* %3 to x86_fp80*
%11 = load x86_fp80, x86_fp80* %10
ret x86_fp80 %11
}

LLVM IR (-O2):
define x86_fp80 @_U_Qfneg(x86_fp80 %0) {
%2 = bitcast x86_fp80 %0 to i80
%3 = trunc i80 %2 to i32
%4 = xor i32 %3, -2147483648
%5 = zext i32 %4 to i80
%6 = and i80 %2, -4294967296
%7 = or i80 %6, %5
%8 = bitcast i80 %7 to x86_fp80
ret x86_fp80 %8
}
/* Variables and functions */
int /*<<< orphan*/ printString(char *, int /*<<< orphan*/, int, int);
void printReg(char *s) { printString(s, 0, 155, 255); }


x86 assembly (clang, -O0):
<printReg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x9b,%edx
mov    $0xff,%ecx
call   1030 <printString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printReg>:
xor    %esi,%esi
mov    $0x9b,%edx
mov    $0xff,%ecx
jmp    1030 <printString@plt>

LLVM IR (-O0):
define void @printReg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printString(i8* %3, i32 0, i32 155, i32 255)
ret void
}

LLVM IR (-O2):
define void @printReg(i8* %0) {
%2 = tail call i32 @printString(i8* %0, i32 0, i32 155, i32 255)
ret void
}
void enqueue(int a[][10], int x, int val, int *head) {
  a[x][head[x]] = val;
  head[x] = head[x] + 1;
}


x86 assembly (clang, -O0):
<enqueue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
mov    -0x18(%rbp),%rcx
movslq -0xc(%rbp),%rsi
movslq (%rcx,%rsi,4),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<enqueue>:
movslq %esi,%rax
movslq (%rcx,%rax,4),%r8
lea    (%rax,%rax,4),%rsi
lea    (%rdi,%rsi,8),%rsi
mov    %edx,(%rsi,%r8,4)
addl   $0x1,(%rcx,%rax,4)
ret

LLVM IR (-O0):
define void @enqueue([10 x i32]* %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca [10 x i32]*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
store [10 x i32]* %0, [10 x i32]** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = load i32, i32* %7
%10 = load [10 x i32]*, [10 x i32]** %5
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %10, i64 %12
%14 = load i32*, i32** %8
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [10 x i32], [10 x i32]* %13, i64 0, i64 %19
store i32 %9, i32* %20
%21 = load i32*, i32** %8
%22 = load i32, i32* %6
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %21, i64 %23
%25 = load i32, i32* %24
%26 = add nsw i32 %25, 1
%27 = load i32*, i32** %8
%28 = load i32, i32* %6
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i32, i32* %27, i64 %29
store i32 %26, i32* %30
ret void
}

LLVM IR (-O2):
define void @enqueue([10 x i32]* nocapture writeonly %0, i32 %1, i32 %2, i32* nocapture %3) {
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i32, i32* %3, i64 %5
%7 = load i32, i32* %6
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %0, i64 %5, i64 %8
store i32 %2, i32* %9
%10 = load i32, i32* %6
%11 = add nsw i32 %10, 1
store i32 %11, i32* %6
ret void
}
/* Variables and functions */
int isonum_731(char *);
int isonum_733(char *p) { return (isonum_731((char *)p)); }


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

x86 assembly (clang, -O2):
<isonum_733>:
jmp    1030 <isonum_731@plt>

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

LLVM IR (-O2):
define i32 @isonum_733(i8* %0) {
%2 = tail call i32 @isonum_731(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef float float_t;

/* Variables and functions */
float __rsign(float a, float_t b) {
  float x;
  x = (a >= 0.0F ? a : -a);
  return (b >= 0.0F ? x : -x);
}


x86 assembly (clang, -O0):
<__rsign>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     112e <__rsign+0x2e>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1145 <__rsign+0x45>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     116f <__rsign+0x6f>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1186 <__rsign+0x86>
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__rsign>:
movaps 0xef9(%rip),%xmm2
movaps %xmm0,%xmm3
xorps  %xmm2,%xmm3
xorps  %xmm4,%xmm4
xorps  %xmm5,%xmm5
cmpless %xmm0,%xmm5
andps  %xmm5,%xmm0
andnps %xmm3,%xmm5
orps   %xmm5,%xmm0
xorps  %xmm0,%xmm2
cmpless %xmm1,%xmm4
andps  %xmm4,%xmm0
andnps %xmm2,%xmm4
orps   %xmm4,%xmm0
ret

LLVM IR (-O0):
define float @__rsign(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = fcmp oge float %6, 0.000000e+00
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %13
10: ; preds = %2
%11 = load float, float* %3
%12 = fneg float %11
br label %13
13: ; preds = %10, %8
%14 = phi float [ %9, %8 ], [ %12, %10 ]
store float %14, float* %5
%15 = load float, float* %4
%16 = fcmp oge float %15, 0.000000e+00
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load float, float* %5
br label %22
19: ; preds = %13
%20 = load float, float* %5
%21 = fneg float %20
br label %22
22: ; preds = %19, %17
%23 = phi float [ %18, %17 ], [ %21, %19 ]
ret float %23
}

LLVM IR (-O2):
define float @__rsign(float %0, float %1) {
%3 = fcmp oge float %0, 0.000000e+00
%4 = fneg float %0
%5 = select i1 %3, float %0, float %4
%6 = fcmp oge float %1, 0.000000e+00
%7 = fneg float %5
%8 = select i1 %6, float %5, float %7
ret float %8
}
/* Type definitions */
typedef int /*<<< orphan*/ opt;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, void *, int);
int set_reuseaddr(int fd) {
  int opt = 1;
  return setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (void *)&opt, sizeof(opt));
}


x86 assembly (clang, -O0):
<set_reuseaddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_reuseaddr>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define i32 @set_reuseaddr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @SOL_SOCKET
%6 = load i32, i32* @SO_REUSEADDR
%7 = bitcast i32* %3 to i8*
%8 = call i32 @setsockopt(i32 %4, i32 %5, i32 %6, i8* %7, i32 4)
ret i32 %8
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define i32 @set_reuseaddr(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_REUSEADDR
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i8* %3, i32 4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ printf(char *, char const *const, int);
void Q_onAssert(char const *const file, int line) {
  printf("Assertion failed in %s, line %d", file, line);
  _exit(-1);
}


x86 assembly (clang, -O0):
<Q_onAssert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<Q_onAssert>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xed3(%rip),%rdi
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Assertion failed in %s, line %d\00"
define void @Q_onAssert(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
%8 = call i32 @_exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [32 x i8] c"Assertion failed in %s, line %d\00"
define void @Q_onAssert(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%4 = tail call i32 @_exit(i32 -1)
unreachable
}
/* Type definitions */
struct stat {
  scalar_t__ st_mode;
};

/* Variables and functions */
int /*<<< orphan*/ mode_string(unsigned short, char *);
void filemodestring(struct stat *statp, char *str) {
  mode_string((unsigned short)statp->st_mode, str);
}


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

x86 assembly (clang, -O2):
<filemodestring>:
movzwl (%rdi),%edi
jmp    1030 <mode_string@plt>

LLVM IR (-O0):
%struct.stat = type { i64 }
define void @filemodestring(%struct.stat* %0, i8* %1) {
%3 = alloca %struct.stat*
%4 = alloca i8*
store %struct.stat* %0, %struct.stat** %3
store i8* %1, i8** %4
%5 = load %struct.stat*, %struct.stat** %3
%6 = getelementptr inbounds %struct.stat, %struct.stat* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i16
%9 = load i8*, i8** %4
%10 = call i32 @mode_string(i16 zeroext %8, i8* %9)
ret void
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define void @filemodestring(%struct.stat* nocapture %0, i8* %1) {
%3 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i16
%6 = tail call i32 @mode_string(i16 zeroext %5, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sla_prebn(double *, double *, double *);
void csla_prebn(double bep0, double bep1, double rmatp[3][3]) {
  sla_prebn(&bep0, &bep1, &(rmatp[0][0]));
}


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

x86 assembly (clang, -O2):
<csla_prebn>:
sub    $0x18,%rsp
mov    %rdi,%rdx
movsd  %xmm0,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <sla_prebn@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @csla_prebn(double %0, double %1, [3 x double]* %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca [3 x double]*
store double %0, double* %4
store double %1, double* %5
store [3 x double]* %2, [3 x double]** %6
%7 = load [3 x double]*, [3 x double]** %6
%8 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0
%9 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 0
%10 = call i32 @sla_prebn(double* %4, double* %5, double* %9)
ret void
}

LLVM IR (-O2):
define void @csla_prebn(double %0, double %1, [3 x double]* %2) {
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 0
%7 = call i32 @sla_prebn(double* %4, double* %5, double* %6)
ret void
}
int count_char(char const *str, char const *chars) {
  int temp = 0;
  int time = 0;
  for (temp = 0; str[temp] != '\0'; temp++) {
    if (str[temp] == *chars) {
      time++;
    }
  }
  return time;
}


x86 assembly (clang, -O0):
<count_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     116d <count_char+0x6d>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    115a <count_char+0x5a>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    115f <count_char+0x5f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1121 <count_char+0x21>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_char>:
mov    (%rdi),%dl
test   %dl,%dl
je     1126 <count_char+0x26>
mov    (%rsi),%cl
add    $0x1,%rdi
xor    %eax,%eax
xchg   %ax,%ax
xor    %esi,%esi
cmp    %cl,%dl
sete   %sil
add    %esi,%eax
movzbl (%rdi),%edx
add    $0x1,%rdi
test   %dl,%dl
jne    1110 <count_char+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @count_char(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %2
%6 = load i8, i8* %1
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %14, %7 ]
%9 = phi i8 [ %3, %5 ], [ %16, %7 ]
%10 = phi i32 [ 0, %5 ], [ %13, %7 ]
%11 = icmp eq i8 %9, %6
%12 = zext i1 %11 to i32
%13 = add nuw nsw i32 %10, %12
%14 = add nuw nsw i64 %8, 1
%15 = getelementptr inbounds i8, i8* %0, i64 %14
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %7
18: ; preds = %7, %2
%19 = phi i32 [ 0, %2 ], [ %13, %7 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ input_pad_window_init(int *, char ***, int /*<<< orphan*/);
int /*<<< orphan*/ input_pad_window_main(void *);
void *input_pad_window_new(int /*<<< orphan*/);
int /*<<< orphan*/ input_pad_window_show(void *);
int main(int argc, char *argv[]) {
  void *data;
  input_pad_window_init(&argc, &argv, 0);
  data = input_pad_window_new(0);
  input_pad_window_show(data);
  input_pad_window_main(data);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <input_pad_window_init@plt>
xor    %edi,%edi
call   1050 <input_pad_window_new@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <input_pad_window_show@plt>
mov    -0x18(%rbp),%rdi
call   1060 <input_pad_window_main@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0x4(%rsp)
mov    %rsi,0x8(%rsp)
lea    0x4(%rsp),%rdi
lea    0x8(%rsp),%rsi
xor    %edx,%edx
call   1030 <input_pad_window_init@plt>
xor    %edi,%edi
call   1050 <input_pad_window_new@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <input_pad_window_show@plt>
mov    %rbx,%rdi
call   1060 <input_pad_window_main@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @input_pad_window_init(i32* %4, i8*** %5, i32 0)
%8 = call i8* @input_pad_window_new(i32 0)
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = call i32 @input_pad_window_show(i8* %9)
%11 = load i8*, i8** %6
%12 = call i32 @input_pad_window_main(i8* %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @input_pad_window_init(i32* %3, i8*** %4, i32 0)
%6 = call i8* @input_pad_window_new(i32 0)
%7 = call i32 @input_pad_window_show(i8* %6)
%8 = call i32 @input_pad_window_main(i8* %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ first(int);
int /*<<< orphan*/ second(int);
int main(int argc, const char *argv[]) {
  if (argc == 1)
    first(argc);
  else
    second(argc);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    114d <main+0x2d>
mov    -0x8(%rbp),%edi
call   1040 <first@plt>
jmp    1155 <main+0x35>
mov    -0x8(%rbp),%edi
call   1030 <second@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jne    1132 <main+0x12>
mov    $0x1,%edi
call   1040 <first@plt>
jmp    1137 <main+0x17>
call   1030 <second@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @first(i32 1)
br label %8
6: ; preds = %2
%7 = tail call i32 @second(i32 %0)
br label %8
8: ; preds = %6, %4
ret i32 0
}
void heap_free(void *ptr) { __asm__("int $0x40" ::"a"(68), "b"(13), "c"(ptr)); }


x86 assembly (clang, -O0):
<heap_free>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x44,%eax
mov    $0xd,%ebx
int    $0x40
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<heap_free>:
push   %rbx
mov    %rdi,%rcx
mov    $0x44,%eax
mov    $0xd,%ebx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define void @heap_free(i8* %0) {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 68, i32 13, i8* %0)
ret void
}
int test_imm_CAuint16_mem(unsigned short *val) {
  return ((*val) & (0xCA << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_CAuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 202
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int f(int);
int /*<<< orphan*/ getid(int);
int /*<<< orphan*/ printid(int);
void main() {
  int n;
  int fakt;
  getid(n);
  fakt = f(n);
  printid(fakt);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%edi
call   1040 <getid@plt>
mov    -0x4(%rbp),%edi
call   1030 <f@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <printid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1040 <getid@plt>
call   1030 <f@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <printid@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %1
%4 = call i32 @getid(i32 %3)
%5 = load i32, i32* %1
%6 = call i32 @f(i32 %5)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @printid(i32 %7)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @getid(i32 undef)
%2 = tail call i32 @f(i32 undef)
%3 = tail call i32 @printid(i32 %2)
ret void
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void print_usage(int status, char *name) {
  printf("Usage: %s [-n num_lines] file\n", name);
  if (status == EXIT_FAILURE) {
    exit(EXIT_FAILURE);
  } else {
    exit(EXIT_SUCCESS);
  }
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    0x2e97(%rip),%rcx
cmp    (%rcx),%eax
jne    115f <print_usage+0x3f>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eaa(%rip),%rax
cmp    %ebx,(%rax)
jne    1141 <print_usage+0x21>
mov    %ebx,%edi
call   1040 <exit@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Usage: %s [-n num_lines] file\0A\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define void @print_usage(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* %3
%8 = load i32, i32* @EXIT_FAILURE
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
%14 = load i32, i32* @EXIT_SUCCESS
%15 = call i32 @exit(i32 %14)
unreachable
}

LLVM IR (-O2):
@.str = [31 x i8] c"Usage: %s [-n num_lines] file\0A\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define void @print_usage(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = load i32, i32* @EXIT_FAILURE
%5 = icmp eq i32 %4, %0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @exit(i32 %0)
unreachable
8: ; preds = %2
%9 = load i32, i32* @EXIT_SUCCESS
%10 = tail call i32 @exit(i32 %9)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage(void) {
  printf("ubx - Utility to control GPS on USRP Brimstone\n\n"
         "Options:\n"
         "        -d (serial device, e.g. /dev/ttyPS1\n"
         "        -a (antenna supply, either 'on' or 'off')\n"
         "        -p (pps output, either 'on' or 'off')\n"
         "        -t (time reference either 'utc', 'gps', 'local')\n"
         "        -h (print this help message)\n\n"
         "Example:\n"
         "$ ubx -d /dev/ttyPS1 -p on -a on -t utc\n");
}


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

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

LLVM IR (-O0):
@.str = [342 x i8] c"ubx - Utility to control GPS on USRP Brimstone\0A\0AOptions:\0A -d (serial device, e.g. /dev/ttyPS1\0A -a (antenna supply, either 'on' or 'off')\0A -p (pps output, either 'on' or 'off')\0A -t (time reference either 'utc', 'gps', 'local')\0A -h (print this help message)\0A\0AExample:\0A$ ubx -d /dev/ttyPS1 -p on -a on -t utc\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([342 x i8], [342 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [341 x i8] c"ubx - Utility to control GPS on USRP Brimstone\0A\0AOptions:\0A -d (serial device, e.g. /dev/ttyPS1\0A -a (antenna supply, either 'on' or 'off')\0A -p (pps output, either 'on' or 'off')\0A -t (time reference either 'utc', 'gps', 'local')\0A -h (print this help message)\0A\0AExample:\0A$ ubx -d /dev/ttyPS1 -p on -a on -t utc\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([341 x i8], [341 x i8]* @str, i64 0, i64 0))
ret void
}
unsigned ZSTD_versionNumber(void) { return (1 * 100 * 100 + 3 * 100 + 1); }


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

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

LLVM IR (-O0):
define i32 @ZSTD_versionNumber() {
ret i32 10301
}

LLVM IR (-O2):
define i32 @ZSTD_versionNumber() {
ret i32 10301
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_memblockq_get_nblocks() {
  printf("NOT IMPLEMENTED:"
         "pa_memblockq_get_nblocks"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [41 x i8] c"NOT IMPLEMENTED:pa_memblockq_get_nblocks\00"
define i32 @pa_memblockq_get_nblocks() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ SDL_Delay(int);
void Delay(int wolfticks) {
  if (wolfticks > 0)
    SDL_Delay(wolfticks * 100 / 7);
}


x86 assembly (clang, -O0):
<Delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1138 <Delay+0x28>
imul   $0x64,-0x4(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <SDL_Delay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Delay>:
test   %edi,%edi
jle    1136 <Delay+0x26>
imul   $0x64,%edi,%eax
movslq %eax,%rdi
imul   $0xffffffff92492493,%rdi,%rax
shr    $0x20,%rax
add    %eax,%edi
mov    %edi,%eax
shr    $0x1f,%eax
sar    $0x2,%edi
add    %eax,%edi
jmp    1030 <SDL_Delay@plt>
ret

LLVM IR (-O0):
define void @Delay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i32, i32* %2
%7 = mul nsw i32 %6, 100
%8 = sdiv i32 %7, 7
%9 = call i32 @SDL_Delay(i32 %8)
br label %10
10: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @Delay(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = mul nsw i32 %0, 100
%5 = sdiv i32 %4, 7
%6 = tail call i32 @SDL_Delay(i32 %5)
br label %7
7: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ niceprint(char *);
void rockfall(void) {
  niceprint(
      "As the adventurers make their way through a long, twisting cavern, a "
      "tremor sets off a rockfall. Each party member must attempt three "
      "DC 12 Dexterity saving throws, taking 3d6 bludgeoning damage on each "
      "failed save. Any incapacitated creature not moved out of the area is "
      "buried under rubble, taking an additional 1d6 bludgeoning damage at "
      "the end of each of its turns until the creature is dug out or dead. "
      "Decrease the drow pursuit level by 1.\n\n");
}


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

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

LLVM IR (-O0):
@.str = [448 x i8] c"As the adventurers make their way through a long, twisting cavern, a tremor sets off a rockfall. Each party member must attempt three DC 12 Dexterity saving throws, taking 3d6 bludgeoning damage on each failed save. Any incapacitated creature not moved out of the area is buried under rubble, taking an additional 1d6 bludgeoning damage at the end of each of its turns until the creature is dug out or dead. Decrease the drow pursuit level by 1.\0A\0A\00"
define void @rockfall() {
%1 = call i32 @niceprint(i8* getelementptr inbounds ([448 x i8], [448 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [448 x i8] c"As the adventurers make their way through a long, twisting cavern, a tremor sets off a rockfall. Each party member must attempt three DC 12 Dexterity saving throws, taking 3d6 bludgeoning damage on each failed save. Any incapacitated creature not moved out of the area is buried under rubble, taking an additional 1d6 bludgeoning damage at the end of each of its turns until the creature is dug out or dead. Decrease the drow pursuit level by 1.\0A\0A\00"
define void @rockfall() {
%1 = tail call i32 @niceprint(i8* getelementptr inbounds ([448 x i8], [448 x i8]* @.str, i64 0, i64 0))
ret void
}
void log_stdout_init(void) {}


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

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

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

LLVM IR (-O2):
define void @log_stdout_init() {
ret void
}
/* Type definitions */
struct devinfo_head {
  int dummy;
};
struct dev_head {
  int dummy;
};

/* Variables and functions */
int usb_scan_dir(struct dev_head *, struct devinfo_head const *, char *);
int devtag_usb_scan(struct dev_head *result, const struct devinfo_head *sel) {
  return usb_scan_dir(result, sel, "/sys/bus/usb/devices");
}


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

x86 assembly (clang, -O2):
<devtag_usb_scan>:
lea    0xee9(%rip),%rdx
jmp    1030 <usb_scan_dir@plt>

LLVM IR (-O0):
%struct.dev_head = type { i32 }
%struct.devinfo_head = type { i32 }
@.str = [21 x i8] c"/sys/bus/usb/devices\00"
define i32 @devtag_usb_scan(%struct.dev_head* %0, %struct.devinfo_head* %1) {
%3 = alloca %struct.dev_head*
%4 = alloca %struct.devinfo_head*
store %struct.dev_head* %0, %struct.dev_head** %3
store %struct.devinfo_head* %1, %struct.devinfo_head** %4
%5 = load %struct.dev_head*, %struct.dev_head** %3
%6 = load %struct.devinfo_head*, %struct.devinfo_head** %4
%7 = call i32 @usb_scan_dir(%struct.dev_head* %5, %struct.devinfo_head* %6, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
%struct.dev_head = type { i32 }
%struct.devinfo_head = type { i32 }
@.str = [21 x i8] c"/sys/bus/usb/devices\00"
define i32 @devtag_usb_scan(%struct.dev_head* %0, %struct.devinfo_head* %1) {
%3 = tail call i32 @usb_scan_dir(%struct.dev_head* %0, %struct.devinfo_head* %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
int isaFish(void) {
  int powl;
  float mem;
  float memory;
  int wctomb;
  return 3;
}


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

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

LLVM IR (-O0):
define i32 @isaFish() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca i32
ret i32 3
}

LLVM IR (-O2):
define i32 @isaFish() {
ret i32 3
}
void caller_2_2_1_1_1_1_2() {}


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

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

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

LLVM IR (-O2):
define void @caller_2_2_1_1_1_1_2() {
ret void
}
void compress() {}


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

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

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

LLVM IR (-O2):
define void @compress() {
ret void
}
/* Variables and functions */
double dot_product(double *, double *, size_t);
double norm(double *, size_t);
double cos_angle(double op1[], double op2[], size_t len) {
  return dot_product(op1, op2, len) / (norm(op1, len) * norm(op2, len));
}


x86 assembly (clang, -O0):
<cos_angle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%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
call   1040 <dot_product@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <norm@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <norm@plt>
movsd  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cos_angle>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <dot_product@plt>
movsd  %xmm0,0x8(%rsp)
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <norm@plt>
movsd  %xmm0,(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <norm@plt>
mulsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define double @cos_angle(double* %0, double* %1, i64 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i64
store double* %0, double** %4
store double* %1, double** %5
store i64 %2, i64* %6
%7 = load double*, double** %4
%8 = load double*, double** %5
%9 = load i64, i64* %6
%10 = call double @dot_product(double* %7, double* %8, i64 %9)
%11 = load double*, double** %4
%12 = load i64, i64* %6
%13 = call double @norm(double* %11, i64 %12)
%14 = load double*, double** %5
%15 = load i64, i64* %6
%16 = call double @norm(double* %14, i64 %15)
%17 = fmul double %13, %16
%18 = fdiv double %10, %17
ret double %18
}

LLVM IR (-O2):
define double @cos_angle(double* %0, double* %1, i64 %2) {
%4 = tail call double @dot_product(double* %0, double* %1, i64 %2)
%5 = tail call double @norm(double* %0, i64 %2)
%6 = tail call double @norm(double* %1, i64 %2)
%7 = fmul double %5, %6
%8 = fdiv double %4, %7
ret double %8
}
/* Variables and functions */
unsigned int xxh32_result(void *);
unsigned int XXH32_result(void *state) { return xxh32_result(state); }


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

x86 assembly (clang, -O2):
<XXH32_result>:
jmp    1030 <xxh32_result@plt>

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

LLVM IR (-O2):
define i32 @XXH32_result(i8* %0) {
%2 = tail call i32 @xxh32_result(i8* %0)
ret i32 %2
}
/* Variables and functions */
void *calloc(int, int);
void *HeapAllocate(int number, int size) { return calloc(number, size); }


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

x86 assembly (clang, -O2):
<HeapAllocate>:
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i8* @HeapAllocate(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 = call i8* @calloc(i32 %5, i32 %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @HeapAllocate(i32 %0, i32 %1) {
%3 = tail call i8* @calloc(i32 %0, i32 %1)
ret i8* %3
}
/* Type definitions */
struct ship {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Write(int, struct ship *, long, long, long,
                         int /*<<< orphan*/);
void send_crew(struct ship *ship, long a, long b, long c) {
  Write(4, ship, a, b, c, 0);
}


x86 assembly (clang, -O0):
<send_crew>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    $0x4,%edi
xor    %r9d,%r9d
call   1030 <Write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_crew>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x4,%edi
xor    %r9d,%r9d
jmp    1030 <Write@plt>

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

LLVM IR (-O2):
%struct.ship = type { i32 }
define void @send_crew(%struct.ship* %0, i64 %1, i64 %2, i64 %3) {
%5 = tail call i32 @Write(i32 4, %struct.ship* %0, i64 %1, i64 %2, i64 %3, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOENT;
int /*<<< orphan*/ perror(int /*<<< orphan*/);
int main() { perror(ENOENT); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <perror@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@ENOENT = global i32 0
define i32 @main() {
%1 = load i32, i32* @ENOENT
%2 = call i32 @perror(i32 %1)
ret i32 0
}

LLVM IR (-O2):
@ENOENT = global i32 0
define i32 @main() {
%1 = load i32, i32* @ENOENT
%2 = tail call i32 @perror(i32 %1)
ret i32 0
}