xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b, c;
  scanf("%d %d", &a, &b);
  char i;
  c = a + b;
  printf("%d", c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%esi
add    0x4(%rsp),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %6, %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
void *am(size_t);
void *a2(size_t n) { return am(n); }


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

x86 assembly (clang, -O2):
<a2>:
jmp    1030 <am@plt>

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

LLVM IR (-O2):
define i8* @a2(i64 %0) {
%2 = tail call i8* @am(i64 %0)
ret i8* %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ window;
};
typedef TYPE_1__ XButtonPressedEvent;

/* Variables and functions */
unsigned long get_XButtonPressedEvent_window(void *_p) {
  return (unsigned long)((XButtonPressedEvent *)_p)->window;
}


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

x86 assembly (clang, -O2):
<get_XButtonPressedEvent_window>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XButtonPressedEvent_window(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XButtonPressedEvent_window(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
void P(sid) int sid;
{ semcall(sid, -1); }


x86 assembly (clang, -O0):
<P>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xffffffff,%esi
mov    $0x0,%al
call   1030 <semcall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<P>:
mov    $0xffffffff,%esi
xor    %eax,%eax
jmp    1030 <semcall@plt>

LLVM IR (-O0):
define void @P(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, i32, ...) bitcast (i32 (...)* @semcall to i32 (i32, i32, ...)*)(i32 %3, i32 -1)
ret void
}

LLVM IR (-O2):
define void @P(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @semcall to i32 (i32, i32, ...)*)(i32 %0, i32 -1)
ret void
}
long cot(long z, const char usr_name[z]) {
  int i = 0;
  while (usr_name[i] != '\0') {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<cot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1136 <cot+0x36>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <cot+0x13>
movslq -0x14(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cot>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rsi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <cot+0x10>
mov    %eax,%eax
ret

LLVM IR (-O0):
define i64 @cot(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i32
store i64 %0, i64* %3
store i8* %1, i8** %4
%6 = load i64, i64* %3
store i32 0, i32* %5
br label %7
7: ; preds = %15, %2
%8 = load i8*, i8** %4
%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 %18
15: ; preds = %7
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %7
18: ; preds = %7
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
ret i64 %20
}

LLVM IR (-O2):
define i64 @cot(i64 %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %8, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = and i64 %4, 4294967295
ret i64 %10
}
float hp_to_w(float value) { return value * 745.69987158f; }


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

x86 assembly (clang, -O2):
<hp_to_w>:
mulss  0xef8(%rip),%xmm0
ret

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

LLVM IR (-O2):
define float @hp_to_w(float %0) {
%2 = fmul float %0, 0x40874D9960000000
ret float %2
}
void ff_hevc_put_hevc_bi_epel_hv12_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_hv12_8_sse4() {
ret void
}
int test_imm_AFuint32_mem(unsigned int *val) {
  return ((*val) & (0xAF << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_AFuint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 175
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void UYVYToYRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @UYVYToYRow_NEON() {
ret void
}
signed long long int
signedlonglongint_ignoring_unsignedlonglongint(signed long long int x,
                                               unsigned long long int y) {
  return x;
}


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

x86 assembly (clang, -O2):
<signedlonglongint_ignoring_unsignedlonglongint>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @signedlonglongint_ignoring_unsignedlonglongint(i64 returned %0, i64 %1) {
ret i64 %0
}
void QSswap(char *prvy, char *druhy) {
  if (prvy != druhy) {
    *prvy ^= *druhy;
    *druhy ^= *prvy;
    *prvy ^= *druhy;
  }
}


x86 assembly (clang, -O0):
<QSswap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1150 <QSswap+0x50>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %edx,%ecx
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %edx,%ecx
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<QSswap>:
cmp    %rsi,%rdi
je     1111 <QSswap+0x11>
mov    (%rdi),%al
xor    (%rsi),%al
mov    %al,(%rdi)
xor    (%rsi),%al
mov    %al,(%rsi)
xor    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @QSswap(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, %1
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = load i8, i8* %1
%6 = load i8, i8* %0
%7 = xor i8 %6, %5
store i8 %7, i8* %0
%8 = load i8, i8* %1
%9 = xor i8 %8, %7
store i8 %9, i8* %1
%10 = load i8, i8* %0
%11 = xor i8 %10, %9
store i8 %11, i8* %0
br label %12
12: ; preds = %4, %2
ret void
}
/* Type definitions */
struct timespec {
  long tv_sec;
  long tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void sleep_m(long nb_millisec) {
  struct timespec req;
  if (nb_millisec < 0)
    return;
  req.tv_sec = nb_millisec / 1000;
  req.tv_nsec = (long)(nb_millisec % 1000) * 1000000;
  nanosleep(&req, NULL);
  return;
}


x86 assembly (clang, -O0):
<sleep_m>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    112c <sleep_m+0x1c>
jmp    1164 <sleep_m+0x54>
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
imul   $0xf4240,%rdx,%rax
mov    %rax,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep_m>:
test   %rdi,%rdi
js     115c <sleep_m+0x4c>
sub    $0x18,%rsp
mov    %rdi,%rax
shr    $0x3,%rax
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
mul    %rcx
shr    $0x4,%rdx
mov    %rdx,0x8(%rsp)
imul   $0x3e8,%rdx,%rax
sub    %rax,%rdi
imul   $0xf4240,%rdi,%rax
mov    %rax,0x10(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define void @sleep_m(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.timespec
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %16
7: ; preds = %1
%8 = load i64, i64* %2
%9 = sdiv i64 %8, 1000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i64 %9, i64* %10
%11 = load i64, i64* %2
%12 = srem i64 %11, 1000
%13 = mul nsw i64 %12, 1000000
%14 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 %13, i64* %14
%15 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
br label %16
16: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define void @sleep_m(i64 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = icmp slt i64 %0, 0
br i1 %4, label %12, label %5
5: ; preds = %1
%6 = udiv i64 %0, 1000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i64 %6, i64* %7
%8 = urem i64 %0, 1000
%9 = mul nuw nsw i64 %8, 1000000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 %9, i64* %10
%11 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
br label %12
12: ; preds = %1, %5
ret void
}
int is_publisher(int pub) {
  int blueb = 933346;
  int alyson = 55583;
  int funimation = 4210;
  int pyramid = 1;
  if (pub == blueb)
    return 2;
  if (pub == alyson)
    return 3;
  if (pub == funimation)
    return 4;
  if (pub == pyramid)
    return 5;
  return 0;
}


x86 assembly (clang, -O0):
<is_publisher>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0xe3de2,-0xc(%rbp)
movl   $0xd91f,-0x10(%rbp)
movl   $0x1072,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    113b <is_publisher+0x3b>
movl   $0x2,-0x4(%rbp)
jmp    118a <is_publisher+0x8a>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1153 <is_publisher+0x53>
movl   $0x3,-0x4(%rbp)
jmp    118a <is_publisher+0x8a>
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    116b <is_publisher+0x6b>
movl   $0x4,-0x4(%rbp)
jmp    118a <is_publisher+0x8a>
mov    -0x8(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    1183 <is_publisher+0x83>
movl   $0x5,-0x4(%rbp)
jmp    118a <is_publisher+0x8a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_publisher>:
cmp    $0xd91e,%edi
jg     111b <is_publisher+0x1b>
cmp    $0x1,%edi
je     1134 <is_publisher+0x34>
cmp    $0x1072,%edi
jne    1131 <is_publisher+0x31>
mov    $0x4,%eax
ret
cmp    $0xe3de2,%edi
je     113a <is_publisher+0x3a>
cmp    $0xd91f,%edi
jne    1131 <is_publisher+0x31>
mov    $0x3,%eax
ret
xor    %eax,%eax
ret
mov    $0x5,%eax
ret
mov    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @is_publisher(i32 %0) {
switch i32 %0, label %5 [
i32 933346, label %6
i32 55583, label %2
i32 4210, label %3
i32 1, label %4
]
2: ; preds = %1
br label %6
3: ; preds = %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %5, %4, %3, %2
%7 = phi i32 [ 3, %2 ], [ 4, %3 ], [ 5, %4 ], [ 0, %5 ], [ 2, %1 ]
ret i32 %7
}
/* Type definitions */
typedef size_t uint32_t;

/* Variables and functions */
int base64toValue(char const, unsigned char *);
uint32_t base64CharacterCount(const char *EncodedString) {
  uint32_t length = 0;
  unsigned char junkChar;
  while (base64toValue(EncodedString[length], &junkChar) != -1) {
    length++;
  }
  return length;
}


x86 assembly (clang, -O0):
<base64CharacterCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
lea    -0x11(%rbp),%rsi
movsbl (%rax,%rcx,1),%edi
call   1030 <base64toValue@plt>
cmp    $0xffffffff,%eax
je     1153 <base64CharacterCount+0x43>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <base64CharacterCount+0x14>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64CharacterCount>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%r14
mov    $0xffffffffffffffff,%rbx
lea    0xf(%rsp),%r15
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%r14,%rbx,1),%edi
mov    %r15,%rsi
call   1030 <base64toValue@plt>
add    $0x1,%rbx
cmp    $0xffffffff,%eax
jne    1130 <base64CharacterCount+0x20>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @base64CharacterCount(i8* nocapture %0) {
%2 = alloca i8
br label %3
3: ; preds = %3, %1
%4 = phi i64 [ 0, %1 ], [ %9, %3 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = call i32 @base64toValue(i8 signext %6, i8* %2)
%8 = icmp eq i32 %7, -1
%9 = add i64 %4, 1
br i1 %8, label %10, label %3
10: ; preds = %3
ret i64 %4
}
/* Variables and functions */
unsigned short htons(unsigned short);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned short *, int);
unsigned short saveInt16ToBuffer(unsigned short value, unsigned char *buffer,
                                 unsigned short offset) {
  value = htons(value);
  memcpy(buffer + offset, &value, sizeof(unsigned short));
  return offset + sizeof(unsigned short);
}


x86 assembly (clang, -O0):
<saveInt16ToBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dx,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <htons@plt>
mov    %ax,-0x2(%rbp)
mov    -0x10(%rbp),%rdi
movzwl -0x12(%rbp),%eax
cltq
add    %rax,%rdi
lea    -0x2(%rbp),%rsi
mov    $0x2,%edx
call   1040 <memcpy@plt>
movzwl -0x12(%rbp),%eax
add    $0x2,%rax
movzwl %ax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saveInt16ToBuffer>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
call   1030 <htons@plt>
mov    %ax,0x6(%rsp)
mov    %ebx,%edi
add    %r14,%rdi
lea    0x6(%rsp),%rsi
mov    $0x2,%edx
call   1040 <memcpy@plt>
add    $0x2,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define zeroext i16 @saveInt16ToBuffer(i16 zeroext %0, i8* %1, i16 zeroext %2) {
%4 = alloca i16
%5 = alloca i8*
%6 = alloca i16
store i16 %0, i16* %4
store i8* %1, i8** %5
store i16 %2, i16* %6
%7 = load i16, i16* %4
%8 = call zeroext i16 @htons(i16 zeroext %7)
store i16 %8, i16* %4
%9 = load i8*, i8** %5
%10 = load i16, i16* %6
%11 = zext i16 %10 to i32
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %9, i64 %12
%14 = call i32 @memcpy(i8* %13, i16* %4, i32 2)
%15 = load i16, i16* %6
%16 = zext i16 %15 to i64
%17 = add i64 %16, 2
%18 = trunc i64 %17 to i16
ret i16 %18
}

LLVM IR (-O2):
define zeroext i16 @saveInt16ToBuffer(i16 zeroext %0, i8* %1, i16 zeroext %2) {
%4 = alloca i16
%5 = tail call zeroext i16 @htons(i16 zeroext %0)
store i16 %5, i16* %4
%6 = zext i16 %2 to i64
%7 = getelementptr inbounds i8, i8* %1, i64 %6
%8 = call i32 @memcpy(i8* %7, i16* %4, i32 2)
%9 = add i16 %2, 2
ret i16 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_SET(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ STDIN_FILENO;
int select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int stdin_non_empty() {
  fd_set fds;
  FD_SET(STDIN_FILENO, &fds);
  return select(1, &fds, NULL, NULL, NULL);
}


x86 assembly (clang, -O0):
<stdin_non_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    -0x4(%rbp),%rsi
call   1040 <FD_SET@plt>
mov    $0x1,%edi
lea    -0x4(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rdx
mov    %r8,%rcx
call   1030 <select@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdin_non_empty>:
push   %rbx
sub    $0x10,%rsp
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <FD_SET@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <select@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
define i32 @stdin_non_empty() {
%1 = alloca i32
%2 = load i32, i32* @STDIN_FILENO
%3 = call i32 @FD_SET(i32 %2, i32* %1)
%4 = call i32 @select(i32 1, i32* %1, i32* null, i32* null, i32* null)
ret i32 %4
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
define i32 @stdin_non_empty() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* @STDIN_FILENO
%4 = call i32 @FD_SET(i32 %3, i32* %1)
%5 = call i32 @select(i32 1, i32* %1, i32* null, i32* null, i32* null)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ UART2_send(char);
void EasyVR_Init(void) {
  UART2_send('l');
  UART2_send('E');
  UART2_send('o');
  UART2_send('D');
}


x86 assembly (clang, -O0):
<EasyVR_Init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6c,%edi
call   1030 <UART2_send@plt>
mov    $0x45,%edi
call   1030 <UART2_send@plt>
mov    $0x6f,%edi
call   1030 <UART2_send@plt>
mov    $0x44,%edi
call   1030 <UART2_send@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<EasyVR_Init>:
push   %rax
mov    $0x6c,%edi
call   1030 <UART2_send@plt>
mov    $0x45,%edi
call   1030 <UART2_send@plt>
mov    $0x6f,%edi
call   1030 <UART2_send@plt>
mov    $0x44,%edi
pop    %rax
jmp    1030 <UART2_send@plt>

LLVM IR (-O0):
define void @EasyVR_Init() {
%1 = call i32 @UART2_send(i8 signext 108)
%2 = call i32 @UART2_send(i8 signext 69)
%3 = call i32 @UART2_send(i8 signext 111)
%4 = call i32 @UART2_send(i8 signext 68)
ret void
}

LLVM IR (-O2):
define void @EasyVR_Init() {
%1 = tail call i32 @UART2_send(i8 signext 108)
%2 = tail call i32 @UART2_send(i8 signext 69)
%3 = tail call i32 @UART2_send(i8 signext 111)
%4 = tail call i32 @UART2_send(i8 signext 68)
ret void
}
/* Variables and functions */
int unsetenv(char *);
int CFR_deletevalue(char *token) {
  int rv;
  rv = unsetenv(token);
  return rv;
}


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

x86 assembly (clang, -O2):
<CFR_deletevalue>:
jmp    1030 <unsetenv@plt>

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

LLVM IR (-O2):
define i32 @CFR_deletevalue(i8* nocapture %0) {
%2 = tail call i32 @unsetenv(i8* %0)
ret i32 %2
}
int main() { return -2 < (unsigned long)-1; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
long unlikely(int);
long IS_ERR(const void *ptr) {
  return unlikely(((unsigned long)ptr) >= (unsigned long)-4095);
}


x86 assembly (clang, -O0):
<IS_ERR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    $0xfffffffffffff001,%rax
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <unlikely@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IS_ERR>:
xor    %eax,%eax
cmp    $0xfffffffffffff001,%rdi
setae  %al
mov    %eax,%edi
jmp    1030 <unlikely@plt>

LLVM IR (-O0):
define i64 @IS_ERR(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = icmp uge i64 %4, -4095
%6 = zext i1 %5 to i32
%7 = call i64 @unlikely(i32 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @IS_ERR(i8* readnone %0) {
%2 = icmp ugt i8* %0, inttoptr (i64 -4096 to i8*)
%3 = zext i1 %2 to i32
%4 = tail call i64 @unlikely(i32 %3)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ si475xAMRX_general_cfg();
int /*<<< orphan*/ si475xAMRX_hardware_cfg();
int /*<<< orphan*/ si475xAMRX_output_config();
int /*<<< orphan*/ si475xAMSWLWRX_regional_cfg();
void si475xAMSWLWRX_configure(void) {
  si475xAMRX_output_config();
  si475xAMRX_hardware_cfg();
  si475xAMRX_general_cfg();
  si475xAMSWLWRX_regional_cfg();
}


x86 assembly (clang, -O0):
<si475xAMSWLWRX_configure>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <si475xAMRX_output_config@plt>
mov    $0x0,%al
call   1040 <si475xAMRX_hardware_cfg@plt>
mov    $0x0,%al
call   1030 <si475xAMRX_general_cfg@plt>
mov    $0x0,%al
call   1050 <si475xAMSWLWRX_regional_cfg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<si475xAMSWLWRX_configure>:
push   %rax
xor    %eax,%eax
call   1060 <si475xAMRX_output_config@plt>
xor    %eax,%eax
call   1040 <si475xAMRX_hardware_cfg@plt>
xor    %eax,%eax
call   1030 <si475xAMRX_general_cfg@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <si475xAMSWLWRX_regional_cfg@plt>

LLVM IR (-O0):
define void @si475xAMSWLWRX_configure() {
%1 = call i32 (...) @si475xAMRX_output_config()
%2 = call i32 (...) @si475xAMRX_hardware_cfg()
%3 = call i32 (...) @si475xAMRX_general_cfg()
%4 = call i32 (...) @si475xAMSWLWRX_regional_cfg()
ret void
}

LLVM IR (-O2):
define void @si475xAMSWLWRX_configure() {
%1 = tail call i32 (...) @si475xAMRX_output_config()
%2 = tail call i32 (...) @si475xAMRX_hardware_cfg()
%3 = tail call i32 (...) @si475xAMRX_general_cfg()
%4 = tail call i32 (...) @si475xAMSWLWRX_regional_cfg()
ret void
}
float fsqr(float x) { return x * x; }


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

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

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

LLVM IR (-O2):
define float @fsqr(float %0) {
%2 = fmul float %0, %0
ret float %2
}
int audio_volume() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @audio_volume() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int baz(int /*<<< orphan*/);
int /*<<< orphan*/ foo();
int /*<<< orphan*/ test_skip_file_and_function();
int main() {
  int x;
  x = baz((bar(), foo()));
  test_skip_file_and_function();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <bar@plt>
mov    $0x0,%al
call   1050 <foo@plt>
mov    %eax,%edi
call   1030 <baz@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1060 <test_skip_file_and_function@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <bar@plt>
xor    %eax,%eax
call   1050 <foo@plt>
mov    %eax,%edi
call   1030 <baz@plt>
xor    %eax,%eax
call   1060 <test_skip_file_and_function@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @bar()
%4 = call i32 (...) @foo()
%5 = call i32 @baz(i32 %4)
store i32 %5, i32* %2
%6 = call i32 (...) @test_skip_file_and_function()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bar()
%2 = tail call i32 (...) @foo()
%3 = tail call i32 @baz(i32 %2)
%4 = tail call i32 (...) @test_skip_file_and_function()
ret i32 0
}
unsigned long hybla_fraction(unsigned long odds) {
  static const unsigned long fractions[] = {
      128, 139, 152, 165, 181, 197, 215, 234,
  };
  return (odds < (sizeof(fractions) / sizeof((fractions)[0]))) ? fractions[odds]
                                                               : 128;
}


x86 assembly (clang, -O0):
<hybla_fraction>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x8,-0x8(%rbp)
jae    112b <hybla_fraction+0x2b>
mov    -0x8(%rbp),%rcx
lea    0xee2(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x10(%rbp)
jmp    1139 <hybla_fraction+0x39>
mov    $0x80,%eax
mov    %rax,-0x10(%rbp)
jmp    1139 <hybla_fraction+0x39>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hybla_fraction>:
mov    $0x80,%eax
cmp    $0x7,%rdi
ja     1116 <hybla_fraction+0x16>
lea    0xeee(%rip),%rax
mov    (%rax,%rdi,8),%rax
ret

LLVM IR (-O0):
@hybla_fraction.fractions = internal constant [8 x i64] [i64 128, i64 139, i64 152, i64 165, i64 181, i64 197, i64 215, i64 234]
define i64 @hybla_fraction(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ult i64 %3, 8
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i64, i64* %2
%7 = getelementptr inbounds [8 x i64], [8 x i64]* @hybla_fraction.fractions, i64 0, i64 %6
%8 = load i64, i64* %7
br label %10
9: ; preds = %1
br label %10
10: ; preds = %9, %5
%11 = phi i64 [ %8, %5 ], [ 128, %9 ]
ret i64 %11
}

LLVM IR (-O2):
@hybla_fraction.fractions = internal unnamed_addr constant [8 x i64] [i64 128, i64 139, i64 152, i64 165, i64 181, i64 197, i64 215, i64 234]
define i64 @hybla_fraction(i64 %0) {
%2 = icmp ult i64 %0, 8
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = getelementptr inbounds [8 x i64], [8 x i64]* @hybla_fraction.fractions, i64 0, i64 %0
%5 = load i64, i64* %4
br label %6
6: ; preds = %1, %3
%7 = phi i64 [ %5, %3 ], [ 128, %1 ]
ret i64 %7
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int width;
};
typedef TYPE_1__ XCreateWindowEvent;

/* Variables and functions */
void set_XCreateWindowEvent_width(void *_p, int _v) {
  ((XCreateWindowEvent *)_p)->width = (int)_v;
}


x86 assembly (clang, -O0):
<set_XCreateWindowEvent_width>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XCreateWindowEvent_width(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 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XCreateWindowEvent_width(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
double pow(long double const, double);
void fktn_g(const long double *x, long double *y) {
  *y = 4.0 / (1.0 + pow(*x, 2.0));
}


x86 assembly (clang, -O0):
<fktn_g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
mov    %rsp,%rax
fstpt  (%rax)
movsd  0xecd(%rip),%xmm0
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xec5(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xec1(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
fldl   -0x18(%rbp)
mov    -0x10(%rbp),%rax
fstpt  (%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fktn_g>:
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%rbx
fldt   (%rdi)
fstpt  (%rsp)
movsd  0xedb(%rip),%xmm0
call   1030 <pow@plt>
addsd  0xed6(%rip),%xmm0
movsd  0xed6(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
fldl   0x18(%rsp)
fstpt  (%rbx)
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @fktn_g(x86_fp80* %0, x86_fp80* %1) {
%3 = alloca x86_fp80*
%4 = alloca x86_fp80*
store x86_fp80* %0, x86_fp80** %3
store x86_fp80* %1, x86_fp80** %4
%5 = load x86_fp80*, x86_fp80** %3
%6 = load x86_fp80, x86_fp80* %5
%7 = call double @pow(x86_fp80 %6, double 2.000000e+00)
%8 = fadd double 1.000000e+00, %7
%9 = fdiv double 4.000000e+00, %8
%10 = fpext double %9 to x86_fp80
%11 = load x86_fp80*, x86_fp80** %4
store x86_fp80 %10, x86_fp80* %11
ret void
}

LLVM IR (-O2):
define void @fktn_g(x86_fp80* nocapture %0, x86_fp80* nocapture writeonly %1) {
%3 = load x86_fp80, x86_fp80* %0
%4 = tail call double @pow(x86_fp80 %3, double 2.000000e+00)
%5 = fadd double %4, 1.000000e+00
%6 = fdiv double 4.000000e+00, %5
%7 = fpext double %6 to x86_fp80
store x86_fp80 %7, x86_fp80* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output(char *, int);
int /*<<< orphan*/ sscanf(char const *, char *, int *);
void printAcpiBatUsageInfo(const char *cmd) {
  int i;
  sscanf(cmd + 13, "%d", &i);
  output("Battery %d usage\t0\t2500\tmA\n", i);
}


x86 assembly (clang, -O0):
<printAcpiBatUsageInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0xd,%rdi
lea    0xec5(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <sscanf@plt>
mov    -0xc(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1030 <output@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printAcpiBatUsageInfo>:
push   %rax
add    $0xd,%rdi
lea    0xed4(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1040 <sscanf@plt>
mov    0x4(%rsp),%esi
lea    0xec2(%rip),%rdi
call   1030 <output@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [28 x i8] c"Battery %d usage\090\092500\09mA\0A\00"
define void @printAcpiBatUsageInfo(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 13
%6 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = call i32 @output(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [28 x i8] c"Battery %d usage\090\092500\09mA\0A\00"
define void @printAcpiBatUsageInfo(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = getelementptr inbounds i8, i8* %0, i64 13
%5 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = call i32 @output(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ gsitp(char *, int);
void g_pid_t() { gsitp("pid_t", sizeof(pid_t)); }


x86 assembly (clang, -O0):
<g_pid_t>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x4,%esi
call   1030 <gsitp@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_pid_t>:
lea    0xee9(%rip),%rdi
mov    $0x4,%esi
jmp    1030 <gsitp@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"pid_t\00"
define void @g_pid_t() {
%1 = tail call i32 @gsitp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 4)
ret void
}
/* Type definitions */
struct timeval {
  double tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double gettimeofday_sec() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec + tv.tv_usec * 1e-6;
}


x86 assembly (clang, -O0):
<gettimeofday_sec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xec9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettimeofday_sec>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdl 0x10(%rsp),%xmm0
mulsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, i32 }
define double @gettimeofday_sec() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to double
%8 = call double @llvm.fmuladd.f64(double %7, double 0x3EB0C6F7A0B5ED8D, double %4)
ret double %8
}

LLVM IR (-O2):
%struct.timeval = type { double, i32 }
define double @gettimeofday_sec() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = tail call double @llvm.fmuladd.f64(double %8, double 0x3EB0C6F7A0B5ED8D, double %5)
ret double %9
}
void SSL_CTX_load_verify_locations(void) {}


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

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

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

LLVM IR (-O2):
define void @SSL_CTX_load_verify_locations() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ parse_bsp(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  if (argc < 2) {
    printf("Usage: ./%s <filename>\n", argv[0]);
    return 1;
  }
  parse_bsp(argv[1]);
  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   $0x2,-0x8(%rbp)
jge    115f <main+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1173 <main+0x53>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <parse_bsp@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     113c <main+0x1c>
mov    (%rsi),%rsi
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret
mov    0x8(%rsi),%rdi
call   1030 <parse_bsp@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Usage: ./%s <filename>\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %11)
store i32 1, i32* %3
br label %18
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @parse_bsp(i8* %16)
store i32 0, i32* %3
br label %18
18: ; preds = %13, %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@.str = [24 x i8] c"Usage: ./%s <filename>\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %11
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @parse_bsp(i8* %9)
br label %11
11: ; preds = %7, %4
%12 = phi i32 [ 1, %4 ], [ 0, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ __mriPlatform_CommPrepareToWaitForGdbConnection();
int /*<<< orphan*/ __mriPlatform_CommWaitForReceiveDataToStop();
scalar_t__ didHostSendGdbAckChar();
int /*<<< orphan*/ waitForFirstCharFromHost();
void waitForGdbToConnect(void) {
  for (;;) {
    waitForFirstCharFromHost();
    if (didHostSendGdbAckChar())
      return;
    __mriPlatform_CommWaitForReceiveDataToStop();
    __mriPlatform_CommPrepareToWaitForGdbConnection();
  }
}


x86 assembly (clang, -O0):
<waitForGdbToConnect>:
push   %rbp
mov    %rsp,%rbp
jmp    1149 <waitForGdbToConnect+0x9>
mov    $0x0,%al
call   1040 <waitForFirstCharFromHost@plt>
mov    $0x0,%al
call   1050 <didHostSendGdbAckChar@plt>
cmp    $0x0,%rax
je     1163 <waitForGdbToConnect+0x23>
pop    %rbp
ret
mov    $0x0,%al
call   1060 <__mriPlatform_CommWaitForReceiveDataToStop@plt>
mov    $0x0,%al
call   1030 <__mriPlatform_CommPrepareToWaitForGdbConnection@plt>
jmp    1149 <waitForGdbToConnect+0x9>

x86 assembly (clang, -O2):
<waitForGdbToConnect>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <waitForFirstCharFromHost@plt>
xor    %eax,%eax
call   1050 <didHostSendGdbAckChar@plt>
test   %rax,%rax
jne    1173 <waitForGdbToConnect+0x33>
xor    %eax,%eax
call   1060 <__mriPlatform_CommWaitForReceiveDataToStop@plt>
xor    %eax,%eax
call   1030 <__mriPlatform_CommPrepareToWaitForGdbConnection@plt>
jmp    1150 <waitForGdbToConnect+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @waitForGdbToConnect() {
br label %1
1: ; preds = %6, %0
%2 = call i32 (...) @waitForFirstCharFromHost()
%3 = call i64 (...) @didHostSendGdbAckChar()
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
ret void
6: ; preds = %1
%7 = call i32 (...) @__mriPlatform_CommWaitForReceiveDataToStop()
%8 = call i32 (...) @__mriPlatform_CommPrepareToWaitForGdbConnection()
br label %1
}

LLVM IR (-O2):
define void @waitForGdbToConnect() {
%1 = tail call i32 (...) @waitForFirstCharFromHost()
%2 = tail call i64 (...) @didHostSendGdbAckChar()
%3 = icmp eq i64 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %5, %0
ret void
5: ; preds = %0, %5
%6 = tail call i32 (...) @__mriPlatform_CommWaitForReceiveDataToStop()
%7 = tail call i32 (...) @__mriPlatform_CommPrepareToWaitForGdbConnection()
%8 = tail call i32 (...) @waitForFirstCharFromHost()
%9 = tail call i64 (...) @didHostSendGdbAckChar()
%10 = icmp eq i64 %9, 0
br i1 %10, label %5, label %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void mm_block_free_ptr(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<mm_block_free_ptr>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @mm_block_free_ptr(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int get_max_possible_gap(int N, int K) { return N - K + 1; }


x86 assembly (clang, -O0):
<get_max_possible_gap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_max_possible_gap>:
sub    %esi,%edi
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @get_max_possible_gap(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 = sub nsw i32 %5, %6
%8 = add nsw i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_max_possible_gap(i32 %0, i32 %1) {
%3 = add i32 %0, 1
%4 = sub i32 %3, %1
ret i32 %4
}
/* Variables and functions */
bool una_bios_present(void) {
  unsigned int **bios_signature = (unsigned int **)0xFFFE;
  return (**bios_signature == 0xE5FD);
}


x86 assembly (clang, -O0):
<una_bios_present>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffe,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
cmpl   $0xe5fd,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<una_bios_present>:
mov    0xfffe,%rcx
xor    %eax,%eax
cmpl   $0xe5fd,(%rcx)
sete   %al
ret

LLVM IR (-O0):
define i32 @una_bios_present() {
%1 = alloca i32**
store i32** inttoptr (i64 65534 to i32**), i32*** %1
%2 = load i32**, i32*** %1
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 58877
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @una_bios_present() {
%1 = load i32*, i32** inttoptr (i64 65534 to i32**)
%2 = load i32, i32* %1
%3 = icmp eq i32 %2, 58877
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
void *memcpy(void *, void *, int);
void *libc_memcpy(void *dest, void *src, int n) { return memcpy(dest, src, n); }


x86 assembly (clang, -O0):
<libc_memcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libc_memcpy>:
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define i8* @libc_memcpy(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i8* @memcpy(i8* %7, i8* %8, i32 %9)
ret i8* %10
}

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