xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ rankOf(int);
int square(int /*<<< orphan*/, int);
int castleRookTo(int king, int rook) {
  return square(rankOf(king), (rook > king) ? 5 : 3);
}


x86 assembly (clang, -O0):
<castleRookTo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <rankOf@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%edx
mov    $0x3,%esi
mov    $0x5,%eax
cmp    %edx,%ecx
cmovg  %eax,%esi
call   1040 <square@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<castleRookTo>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <rankOf@plt>
xor    %ecx,%ecx
cmp    %ebp,%ebx
setg   %cl
lea    (%rcx,%rcx,1),%esi
add    $0x3,%esi
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <square@plt>

LLVM IR (-O0):
define i32 @castleRookTo(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 = call i32 @rankOf(i32 %5)
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = icmp sgt i32 %7, %8
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 5, i32 3
%12 = call i32 @square(i32 %6, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @castleRookTo(i32 %0, i32 %1) {
%3 = tail call i32 @rankOf(i32 %0)
%4 = icmp sgt i32 %1, %0
%5 = select i1 %4, i32 5, i32 3
%6 = tail call i32 @square(i32 %3, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int proov(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i;
  scanf("%d", &i);
  printf("%d\n", proov(i));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1030 <proov@plt>
mov    %eax,%esi
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @proov(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
int(_rl_to_upper)(c) int c;
{
  return ((((unsigned char)(c) == (c)) && (1 && islower(c)))
              ? toupper((unsigned char)c)
              : (c));
}


x86 assembly (clang, -O0):
<_rl_to_upper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movzbl %al,%eax
cmp    -0x4(%rbp),%eax
jne    115e <_rl_to_upper+0x3e>
mov    -0x4(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%eax
je     115e <_rl_to_upper+0x3e>
mov    -0x4(%rbp),%eax
movzbl %al,%edi
call   1040 <toupper@plt>
mov    %eax,-0x8(%rbp)
jmp    1164 <_rl_to_upper+0x44>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_rl_to_upper>:
push   %rbx
mov    %edi,%ebx
cmp    $0xff,%edi
ja     113f <_rl_to_upper+0x1f>
mov    %ebx,%edi
call   1030 <islower@plt>
test   %eax,%eax
je     113f <_rl_to_upper+0x1f>
movzbl %bl,%edi
pop    %rbx
jmp    1040 <toupper@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @_rl_to_upper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = zext i8 %4 to i32
%6 = load i32, i32* %2
%7 = icmp eq i32 %5, %6
br i1 %7, label %8, label %17
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i32 @islower(i32 %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = load i32, i32* %2
%14 = trunc i32 %13 to i8
%15 = zext i8 %14 to i32
%16 = call i32 @toupper(i32 %15)
br label %19
17: ; preds = %8, %1
%18 = load i32, i32* %2
br label %19
19: ; preds = %17, %12
%20 = phi i32 [ %16, %12 ], [ %18, %17 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @_rl_to_upper(i32 %0) {
%2 = and i32 %0, 255
%3 = icmp ult i32 %0, 256
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i32 @islower(i32 %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @toupper(i32 %2)
br label %9
9: ; preds = %1, %4, %7
%10 = phi i32 [ %8, %7 ], [ %0, %4 ], [ %0, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void my_strfree(char *str) { free(str); }


x86 assembly (clang, -O0):
<my_strfree>:
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):
<my_strfree>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @my_strfree(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 @my_strfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void swap(int *a, int *b) {
  int *tmp;
  *tmp = *a;
  *a = *b;
  *b = *tmp;
}


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

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

LLVM IR (-O2):
int test_imm_9Duint8_mem(unsigned char *val) {
  return ((*val) & (0x9D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_9Duint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 157
%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_9Duint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -99
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void RTC_Alarm_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @RTC_Alarm_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @RTC_Alarm_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
float CDec(int *target, float multi, int index) {
  if (index == 1) {
    return *target * multi;
  } else {
    return (*target * multi) + CDec(++target, multi / 2, --index);
  }
}


x86 assembly (clang, -O0):
<CDec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    %esi,-0x18(%rbp)
cmpl   $0x1,-0x18(%rbp)
jne    1145 <CDec+0x35>
mov    -0x10(%rbp),%rax
cvtsi2ssl (%rax),%xmm0
mulss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11a1 <CDec+0x91>
mov    -0x10(%rbp),%rax
cvtsi2ssl (%rax),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x4,%rdi
mov    %rdi,-0x10(%rbp)
movss  -0x14(%rbp),%xmm0
movss  0xe8b(%rip),%xmm1
divss  %xmm1,%xmm0
mov    -0x18(%rbp),%esi
add    $0xffffffff,%esi
mov    %esi,-0x18(%rbp)
call   1030 <CDec@plt>
movss  -0x20(%rbp),%xmm2
movaps %xmm0,%xmm1
movss  -0x1c(%rbp),%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CDec>:
push   %rax
movaps %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsi2ssl (%rdi),%xmm0
cmp    $0x1,%esi
jne    1126 <CDec+0x16>
mulss  %xmm1,%xmm0
pop    %rax
ret
add    $0x4,%rdi
movss  %xmm0,0x4(%rsp)
movss  0xec8(%rip),%xmm0
mulss  %xmm1,%xmm0
add    $0xffffffff,%esi
movss  %xmm1,(%rsp)
call   1030 <CDec@plt>
movss  0x4(%rsp),%xmm1
mulss  (%rsp),%xmm1
addss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @CDec(i32* %0, float %1, i32 %2) {
%4 = alloca float
%5 = alloca i32*
%6 = alloca float
%7 = alloca i32
store i32* %0, i32** %5
store float %1, float* %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %16
10: ; preds = %3
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = sitofp i32 %12 to float
%14 = load float, float* %6
%15 = fmul float %13, %14
store float %15, float* %4
br label %29
16: ; preds = %3
%17 = load i32*, i32** %5
%18 = load i32, i32* %17
%19 = sitofp i32 %18 to float
%20 = load float, float* %6
%21 = load i32*, i32** %5
%22 = getelementptr inbounds i32, i32* %21, i32 1
store i32* %22, i32** %5
%23 = load float, float* %6
%24 = fdiv float %23, 2.000000e+00
%25 = load i32, i32* %7
%26 = add nsw i32 %25, -1
store i32 %26, i32* %7
%27 = call float @CDec(i32* %22, float %24, i32 %26)
%28 = call float @llvm.fmuladd.f32(float %19, float %20, float %27)
store float %28, float* %4
br label %29
29: ; preds = %16, %10
%30 = load float, float* %4
ret float %30
}

LLVM IR (-O2):
define float @CDec(i32* nocapture %0, float %1, i32 %2) {
%4 = icmp eq i32 %2, 1
%5 = load i32, i32* %0
%6 = sitofp i32 %5 to float
br i1 %4, label %7, label %11
7: ; preds = %3
%8 = fmul float %6, %1
br label %9
9: ; preds = %7, %11
%10 = phi float [ %16, %11 ], [ %8, %7 ]
ret float %10
11: ; preds = %3
%12 = getelementptr inbounds i32, i32* %0, i64 1
%13 = fmul float %1, 5.000000e-01
%14 = add nsw i32 %2, -1
%15 = tail call float @CDec(i32* %12, float %13, i32 %14)
%16 = tail call float @llvm.fmuladd.f32(float %6, float %1, float %15)
br label %9
}
/* Type definitions */
struct net_device {
  int dummy;
};

/* Variables and functions */
scalar_t__ netif_queue_stopped(struct net_device *);
int /*<<< orphan*/ netif_stop_queue(struct net_device *);
void acx_stop_queue(struct net_device *ndev, const char *msg) {
  if (netif_queue_stopped(ndev))
    return;
  netif_stop_queue(ndev);
  if (msg)
    ;
}


x86 assembly (clang, -O0):
<acx_stop_queue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <netif_queue_stopped@plt>
cmp    $0x0,%rax
je     1148 <acx_stop_queue+0x28>
jmp    1161 <acx_stop_queue+0x41>
mov    -0x8(%rbp),%rdi
call   1030 <netif_stop_queue@plt>
cmpq   $0x0,-0x10(%rbp)
je     1161 <acx_stop_queue+0x41>
jmp    1161 <acx_stop_queue+0x41>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acx_stop_queue>:
push   %rbx
mov    %rdi,%rbx
call   1040 <netif_queue_stopped@plt>
test   %rax,%rax
je     1130 <acx_stop_queue+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <netif_stop_queue@plt>

LLVM IR (-O0):
%struct.net_device = type { i32 }
define void @acx_stop_queue(%struct.net_device* %0, i8* %1) {
%3 = alloca %struct.net_device*
%4 = alloca i8*
store %struct.net_device* %0, %struct.net_device** %3
store i8* %1, i8** %4
%5 = load %struct.net_device*, %struct.net_device** %3
%6 = call i64 @netif_queue_stopped(%struct.net_device* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
br label %15
9: ; preds = %2
%10 = load %struct.net_device*, %struct.net_device** %3
%11 = call i32 @netif_stop_queue(%struct.net_device* %10)
%12 = load i8*, i8** %4
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %15
14: ; preds = %9
br label %15
15: ; preds = %8, %14, %9
ret void
}

LLVM IR (-O2):
%struct.net_device = type { i32 }
define void @acx_stop_queue(%struct.net_device* %0, i8* nocapture readnone %1) {
%3 = tail call i64 @netif_queue_stopped(%struct.net_device* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @netif_stop_queue(%struct.net_device* %0)
br label %7
7: ; preds = %5, %2
ret void
}
int main(void) {
  struct {
    int x;
  } a;
  struct {
    int x;
  } b;
  int *p = &a.x;
  int *q = &b.x;
  if (&p < &q) {
    return 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x18(%rbp),%rax
lea    -0x20(%rbp),%rcx
cmp    %rcx,%rax
jae    1133 <main+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.anon = type { i32 }
%struct.anon.0 = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.anon
%3 = alloca %struct.anon.0
%4 = alloca i32*
%5 = alloca i32*
store i32 0, i32* %1
%6 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 0
store i32* %6, i32** %4
%7 = getelementptr inbounds %struct.anon.0, %struct.anon.0* %3, i32 0, i32 0
store i32* %7, i32** %5
%8 = icmp ult i32** %4, %5
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 0, i32* %1
br label %10
10: ; preds = %9, %0
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int foo();
int main(void) {
  int res = foo();
  if (res != 1225)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x4c9,-0x8(%rbp)
je     114d <main+0x2d>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
cmp    $0x4c9,%eax
jne    1133 <main+0x13>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @foo()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 1225
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = icmp eq i32 %1, 1225
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
int main(void) {
  printf("max int: %d %x\n", (int)((unsigned)~0 >> 1),
         (int)((unsigned)~0 >> 1));
  int min_int = ((unsigned)~0 >> 1) - 1;
  printf("min int: %d %x, %d %x\n", min_int, min_int, (0 - min_int),
         (unsigned)(0 - min_int));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x7fffffff,%edx
mov    %edx,%esi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x7ffffffe,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
xor    %ecx,%ecx
sub    -0x4(%rbp),%ecx
xor    %r8d,%r8d
sub    -0x4(%rbp),%r8d
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x7fffffff,%esi
mov    $0x7fffffff,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
mov    $0x7ffffffe,%esi
mov    $0x7ffffffe,%edx
mov    $0x80000002,%ecx
mov    $0x80000002,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"max int: %d %x\0A\00"
@.str.1 = [23 x i8] c"min int: %d %x, %d %x\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 2147483647, i32 2147483647)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 2147483646, i32 2147483646, i32 -2147483646, i32 -2147483646)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void __attribute__((__no__))
foo_cleanup(char *param __attribute__((__unused__))) {
  exit(42);
}


x86 assembly (clang, -O0):
<foo_cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2a,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<foo_cleanup>:
push   %rax
mov    $0x2a,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @foo_cleanup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @exit(i32 42)
unreachable
}

LLVM IR (-O2):
define void @foo_cleanup(i8* nocapture readnone %0) {
%2 = tail call i32 @exit(i32 42)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ colorationCaractere(char const, unsigned int const);
int /*<<< orphan*/ printf(char *, ...);
void afficherElementLegendeAide(const char caractere,
                                const unsigned int couleurCaractere,
                                const char *message) {
  printf("\t");
  colorationCaractere(caractere, couleurCaractere);
  printf(" : %s\n", message);
}


x86 assembly (clang, -O0):
<afficherElementLegendeAide>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%esi
movsbl %al,%edi
call   1040 <colorationCaractere@plt>
mov    -0x10(%rbp),%rsi
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<afficherElementLegendeAide>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0x9,%edi
call   1030 <putchar@plt>
mov    %ebx,%edi
mov    %ebp,%esi
call   1050 <colorationCaractere@plt>
lea    0xeab(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\09\00"
@.str.1 = [7 x i8] c" : %s\0A\00"
define void @afficherElementLegendeAide(i8 signext %0, i32 %1, i8* %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i8*
store i8 %0, i8* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = load i8, i8* %4
%9 = load i32, i32* %5
%10 = call i32 @colorationCaractere(i8 signext %8, i32 %9)
%11 = load i8*, i8** %6
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %11)
ret void
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c" : %s\0A\00"
define void @afficherElementLegendeAide(i8 signext %0, i32 %1, i8* %2) {
%4 = tail call i32 @putchar(i32 9)
%5 = tail call i32 @colorationCaractere(i8 signext %0, i32 %1)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void usage() { puts("libncbi -q|--query QUERY [-f|--file FILE]"); }


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

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

LLVM IR (-O0):
@.str = [42 x i8] c"libncbi -q|--query QUERY [-f|--file FILE]\00"
define void @usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"libncbi -q|--query QUERY [-f|--file FILE]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned int vsubss2(int /*<<< orphan*/, unsigned int);
unsigned int vnegss2(unsigned int a) { return vsubss2(0, a); }


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

x86 assembly (clang, -O2):
<vnegss2>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <vsubss2@plt>

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

LLVM IR (-O2):
define i32 @vnegss2(i32 %0) {
%2 = tail call i32 @vsubss2(i32 0, i32 %0)
ret i32 %2
}
void g_build_path() {}


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

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

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

LLVM IR (-O2):
define void @g_build_path() {
ret void
}
/* Type definitions */
typedef int off_t;

/* Variables and functions */
int /*<<< orphan*/ EBADF;
int /*<<< orphan*/ ESPIPE;
int /*<<< orphan*/ errno;
off_t __attribute__((weak)) _lseek(int fd, off_t offset, int whence) {
  switch (fd) {
  case 0:
  case 1:
  case 2:
    errno = ESPIPE;
    break;
  default:
    errno = EBADF;
  }
  return -1;
}


x86 assembly (clang, -O0):
<_lseek>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x2,%eax
ja     1135 <_lseek+0x35>
jmp    111e <_lseek+0x1e>
mov    0x2ec3(%rip),%rax
mov    (%rax),%ecx
mov    0x2eaa(%rip),%rax
mov    %ecx,(%rax)
jmp    1147 <_lseek+0x47>
mov    0x2e94(%rip),%rax
mov    (%rax),%ecx
mov    0x2e93(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_lseek>:
cmp    $0x3,%edi
jae    110e <_lseek+0xe>
mov    0x2edc(%rip),%rax
jmp    1115 <_lseek+0x15>
mov    0x2ebb(%rip),%rax
mov    (%rax),%eax
mov    0x2eba(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ESPIPE = global i32 0
@errno = global i32 0
@EBADF = global i32 0
define weak i32 @_lseek(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
switch i32 %7, label %10 [
i32 0, label %8
i32 1, label %8
i32 2, label %8
]
8: ; preds = %3, %3, %3
%9 = load i32, i32* @ESPIPE
store i32 %9, i32* @errno
br label %12
10: ; preds = %3
%11 = load i32, i32* @EBADF
store i32 %11, i32* @errno
br label %12
12: ; preds = %10, %8
ret i32 -1
}

LLVM IR (-O2):
@ESPIPE = global i32 0
@errno = global i32 0
@EBADF = global i32 0
define weak i32 @_lseek(i32 %0, i32 %1, i32 %2) {
%4 = icmp ult i32 %0, 3
%5 = load i32, i32* @ESPIPE
%6 = load i32, i32* @EBADF
%7 = select i1 %4, i32 %5, i32 %6
store i32 %7, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ _PROCEDURE_LINKAGE_TABLE_();
void strlen() {
  _PROCEDURE_LINKAGE_TABLE_();
  return;
}


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

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

LLVM IR (-O0):
define void @strlen() {
%1 = call i32 (...) @_PROCEDURE_LINKAGE_TABLE_()
ret void
}

LLVM IR (-O2):
define void @strlen() {
%1 = tail call i32 (...) @_PROCEDURE_LINKAGE_TABLE_()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ syscall(int, char *, int /*<<< orphan*/, int);
void ireads(char *str, int maxlen) { syscall(0x4973, str, 0, maxlen); }


x86 assembly (clang, -O0):
<ireads>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%ecx
mov    $0x4973,%edi
xor    %edx,%edx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ireads>:
mov    %esi,%ecx
mov    %rdi,%rsi
mov    $0x4973,%edi
xor    %edx,%edx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define void @ireads(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 @syscall(i32 18803, i8* %5, i32 0, i32 %6)
ret void
}

LLVM IR (-O2):
define void @ireads(i8* %0, i32 %1) {
%3 = tail call i32 @syscall(i32 18803, i8* %0, i32 0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ fbi_swap_uint64_t(int /*<<< orphan*/);
uint64_t fbi_test_swap_uint64_t(uint64_t u64) { return fbi_swap_uint64_t(u64); }


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

x86 assembly (clang, -O2):
<fbi_test_swap_uint64_t>:
jmp    1030 <fbi_swap_uint64_t@plt>

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

LLVM IR (-O2):
define i32 @fbi_test_swap_uint64_t(i32 %0) {
%2 = tail call i32 @fbi_swap_uint64_t(i32 %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ phys_to_virt(int);
int /*<<< orphan*/ printk(char *);
void restore_NMI_vector(unsigned short *high, unsigned short *low) {
  printk("Restoring NMI vector\n");
  *((volatile unsigned short *)phys_to_virt((0xa))) = *high;
  *((volatile unsigned short *)phys_to_virt((0x8))) = *low;
}


x86 assembly (clang, -O0):
<restore_NMI_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <printk@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x14(%rbp)
mov    $0xa,%edi
call   1040 <phys_to_virt@plt>
mov    -0x14(%rbp),%cx
mov    %cx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x12(%rbp)
mov    $0x8,%edi
call   1040 <phys_to_virt@plt>
mov    -0x12(%rbp),%cx
mov    %cx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<restore_NMI_vector>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
call   1030 <printk@plt>
movzwl (%rbx),%ebx
mov    $0xa,%edi
call   1040 <phys_to_virt@plt>
mov    %bx,(%rax)
movzwl (%r14),%ebx
mov    $0x8,%edi
call   1040 <phys_to_virt@plt>
mov    %bx,(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Restoring NMI vector\0A\00"
define void @restore_NMI_vector(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
store i16* %0, i16** %3
store i16* %1, i16** %4
%5 = call i32 @printk(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%6 = load i16*, i16** %3
%7 = load i16, i16* %6
%8 = call i64 @phys_to_virt(i32 10)
%9 = inttoptr i64 %8 to i16*
store volatile i16 %7, i16* %9
%10 = load i16*, i16** %4
%11 = load i16, i16* %10
%12 = call i64 @phys_to_virt(i32 8)
%13 = inttoptr i64 %12 to i16*
store volatile i16 %11, i16* %13
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Restoring NMI vector\0A\00"
define void @restore_NMI_vector(i16* nocapture %0, i16* nocapture %1) {
%3 = tail call i32 @printk(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = load i16, i16* %0
%5 = tail call i64 @phys_to_virt(i32 10)
%6 = inttoptr i64 %5 to i16*
store volatile i16 %4, i16* %6
%7 = load i16, i16* %1
%8 = tail call i64 @phys_to_virt(i32 8)
%9 = inttoptr i64 %8 to i16*
store volatile i16 %7, i16* %9
ret void
}
/* Type definitions */
typedef int u_int;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int read_u16l(int /*<<< orphan*/ *);
int read_s16l(FILE *fp) {
  u_int t = read_u16l(fp);
  if (t >= 0x8000)
    t |= ~0xffff;
  return (int)t;
}


x86 assembly (clang, -O0):
<read_s16l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <read_u16l@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x8000,-0xc(%rbp)
jl     1140 <read_s16l+0x30>
mov    -0xc(%rbp),%eax
or     $0xffff0000,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_s16l>:
push   %rax
call   1030 <read_u16l@plt>
mov    %eax,%ecx
or     $0xffff0000,%ecx
cmp    $0x8000,%eax
cmovge %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @read_s16l(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @read_u16l(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sge i32 %6, 32768
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* %3
%10 = or i32 %9, -65536
store i32 %10, i32* %3
br label %11
11: ; preds = %8, %1
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @read_s16l(i32* %0) {
%2 = tail call i32 @read_u16l(i32* %0)
%3 = icmp sgt i32 %2, 32767
%4 = or i32 %2, -65536
%5 = select i1 %3, i32 %4, i32 %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *strsignal(int sig) {
  static char errbuf[16];
  sprintf(errbuf, "signal %d", sig);
  return errbuf;
}


x86 assembly (clang, -O0):
<strsignal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0x2f1b(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2f08(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strsignal>:
push   %rbx
mov    %edi,%edx
lea    0x2f26(%rip),%rbx
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@strsignal.errbuf = internal global [16 x i8] zeroinitializer
@.str = [10 x i8] c"signal %d\00"
define i8* @strsignal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @strsignal.errbuf, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @strsignal.errbuf, i64 0, i64 0)
}

LLVM IR (-O2):
@strsignal.errbuf = internal global [16 x i8] zeroinitializer
@.str = [10 x i8] c"signal %d\00"
define i8* @strsignal(i32 %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @strsignal.errbuf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @strsignal.errbuf, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *);
char *get_post_login_sed_executable(char *destination_application) {
  static char sed_executable[512];
  sprintf(sed_executable, "sed \"s/post_login?.*\\\"/post_login?%s\\\"/\"",
          destination_application);
  return sed_executable;
}


x86 assembly (clang, -O0):
<get_post_login_sed_executable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0x2f19(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2f06(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_post_login_sed_executable>:
push   %rbx
mov    %rdi,%rdx
lea    0x2f25(%rip),%rbx
lea    0xede(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@get_post_login_sed_executable.sed_executable = internal global [512 x i8] zeroinitializer
@.str = [41 x i8] c"sed \22s/post_login?.*\\\22/post_login?%s\\\22/\22\00"
define i8* @get_post_login_sed_executable(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([512 x i8], [512 x i8]* @get_post_login_sed_executable.sed_executable, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8* getelementptr inbounds ([512 x i8], [512 x i8]* @get_post_login_sed_executable.sed_executable, i64 0, i64 0)
}

LLVM IR (-O2):
@get_post_login_sed_executable.sed_executable = internal global [512 x i8] zeroinitializer
@.str = [41 x i8] c"sed \22s/post_login?.*\\\22/post_login?%s\\\22/\22\00"
define i8* @get_post_login_sed_executable(i8* %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([512 x i8], [512 x i8]* @get_post_login_sed_executable.sed_executable, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* getelementptr inbounds ([512 x i8], [512 x i8]* @get_post_login_sed_executable.sed_executable, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ I_Error(char *, char *);
int R_CheckTextureNumForName(char *);
int R_TextureNumForName(char *name) {
  int i;
  i = R_CheckTextureNumForName(name);
  if (i == -1)
    I_Error("R_TextureNumForName: %s not found", name);
  return i;
}


x86 assembly (clang, -O0):
<R_TextureNumForName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <R_CheckTextureNumForName@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1152 <R_TextureNumForName+0x32>
mov    -0x8(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1040 <I_Error@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<R_TextureNumForName>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <R_CheckTextureNumForName@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
jne    1141 <R_TextureNumForName+0x21>
lea    0xec7(%rip),%rdi
mov    %rbx,%rsi
call   1040 <I_Error@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [34 x i8] c"R_TextureNumForName: %s not found\00"
define i32 @R_TextureNumForName(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @R_CheckTextureNumForName(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @I_Error(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %1
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@.str = [34 x i8] c"R_TextureNumForName: %s not found\00"
define i32 @R_TextureNumForName(i8* %0) {
%2 = tail call i32 @R_CheckTextureNumForName(i8* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @I_Error(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %4, %1
ret i32 %2
}
/* Variables and functions */
double rnd_32int();
double rnd_r2(void) { return rnd_32int() * (1.0 / 4294967296.0); }


x86 assembly (clang, -O0):
<rnd_r2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rnd_32int@plt>
movsd  0xedd(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd_r2>:
push   %rax
xor    %eax,%eax
call   1030 <rnd_32int@plt>
mulsd  0xee0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @rnd_r2() {
%1 = call double (...) @rnd_32int()
%2 = fmul double %1, 0x3DF0000000000000
ret double %2
}

LLVM IR (-O2):
define double @rnd_r2() {
%1 = tail call double (...) @rnd_32int()
%2 = fmul double %1, 0x3DF0000000000000
ret double %2
}
char *wstrdup(const char *str) {
  assert(str != ((void *)0));
  return strcpy(wmalloc(strlen(str) + 1), str);
}


x86 assembly (clang, -O0):
<wstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1050 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    $0x0,%al
call   1060 <wmalloc@plt>
movslq %eax,%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wstrdup>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
xor    %eax,%eax
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
xor    %eax,%eax
call   1060 <wmalloc@plt>
movslq %eax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @wstrdup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %5)
%7 = load i8*, i8** %2
%8 = call i64 @strlen(i8* %7)
%9 = add i64 %8, 1
%10 = call i32 (i64, ...) bitcast (i32 (...)* @wmalloc to i32 (i64, ...)*)(i64 %9)
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i8*
%13 = load i8*, i8** %2
%14 = call i8* @strcpy(i8* %12, i8* %13)
ret i8* %14
}

LLVM IR (-O2):
define i8* @wstrdup(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %3)
%5 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%6 = add i64 %5, 1
%7 = tail call i32 (i64, ...) bitcast (i32 (...)* @wmalloc to i32 (i64, ...)*)(i64 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = tail call i8* @strcpy(i8* dereferenceable(1) %9, i8* dereferenceable(1) %0)
ret i8* %9
}
/* Type definitions */
struct rpmsg_endpoint_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ RPMSG_CREATE_EPT_IOCTL;
int ioctl(int, int /*<<< orphan*/, struct rpmsg_endpoint_info *);
int /*<<< orphan*/ perror(char *);
int rpmsg_create_ept(int rpfd, struct rpmsg_endpoint_info *eptinfo) {
  int ret;
  ret = ioctl(rpfd, RPMSG_CREATE_EPT_IOCTL, eptinfo);
  if (ret)
    perror("Failed to create endpoint.\n");
  return ret;
}


x86 assembly (clang, -O0):
<rpmsg_create_ept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     115d <rpmsg_create_ept+0x3d>
lea    0xea8(%rip),%rdi
call   1040 <perror@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpmsg_create_ept>:
push   %rbx
mov    %rsi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    113c <rpmsg_create_ept+0x1c>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
jmp    1138 <rpmsg_create_ept+0x18>

LLVM IR (-O0):
%struct.rpmsg_endpoint_info = type { i32 }
@RPMSG_CREATE_EPT_IOCTL = global i32 0
@.str = [28 x i8] c"Failed to create endpoint.\0A\00"
define i32 @rpmsg_create_ept(i32 %0, %struct.rpmsg_endpoint_info* %1) {
%3 = alloca i32
%4 = alloca %struct.rpmsg_endpoint_info*
%5 = alloca i32
store i32 %0, i32* %3
store %struct.rpmsg_endpoint_info* %1, %struct.rpmsg_endpoint_info** %4
%6 = load i32, i32* %3
%7 = load i32, i32* @RPMSG_CREATE_EPT_IOCTL
%8 = load %struct.rpmsg_endpoint_info*, %struct.rpmsg_endpoint_info** %4
%9 = call i32 @ioctl(i32 %6, i32 %7, %struct.rpmsg_endpoint_info* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %2
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
%struct.rpmsg_endpoint_info = type { i32 }
@RPMSG_CREATE_EPT_IOCTL = global i32 0
@.str = [28 x i8] c"Failed to create endpoint.\0A\00"
define i32 @rpmsg_create_ept(i32 %0, %struct.rpmsg_endpoint_info* %1) {
%3 = load i32, i32* @RPMSG_CREATE_EPT_IOCTL
%4 = tail call i32 @ioctl(i32 %0, i32 %3, %struct.rpmsg_endpoint_info* %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Hello World"); }


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 = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mwte_fft_bit_reversal_sort_test(int);
int main(void) {
  mwte_fft_bit_reversal_sort_test(32);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @mwte_fft_bit_reversal_sort_test(i32 32)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
scalar_t__ test_expr_in_if();
scalar_t__ test_struct_in_arrayref();
int main(void) {
  if (test_struct_in_arrayref())
    return 1;
  if (test_expr_in_if())
    return 2;
  printf("PASS\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <test_struct_in_arrayref@plt>
cmp    $0x0,%rax
je     115c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    118c <main+0x5c>
mov    $0x0,%al
call   1030 <test_expr_in_if@plt>
cmp    $0x0,%rax
je     1179 <main+0x49>
movl   $0x2,-0x4(%rbp)
jmp    118c <main+0x5c>
lea    0xe80(%rip),%rdi
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_struct_in_arrayref@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1147 <main+0x17>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <test_expr_in_if@plt>
mov    %rax,%rcx
mov    $0x2,%eax
test   %rcx,%rcx
jne    1145 <main+0x15>
lea    0xe9e(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"PASS\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @test_struct_in_arrayref()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %11
5: ; preds = %0
%6 = call i64 (...) @test_expr_in_if()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 2, i32* %1
br label %11
9: ; preds = %5
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %11
11: ; preds = %9, %8, %4
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@str = [5 x i8] c"PASS\00"
define i32 @main() {
%1 = tail call i64 (...) @test_struct_in_arrayref()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = tail call i64 (...) @test_expr_in_if()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %3, %0, %6
%9 = phi i32 [ 0, %6 ], [ 1, %0 ], [ 2, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *me) {
  fprintf(stderr,
          "\n"
          "Usage: %s [-p physaddrbase [-d device]] <mem>[B|K|M|G] [loops]\n",
          me);
  exit(0x01);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [65 x i8] c"\0AUsage: %s [-p physaddrbase [-d device]] <mem>[B|K|M|G] [loops]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [65 x i8] c"\0AUsage: %s [-p physaddrbase [-d device]] <mem>[B|K|M|G] [loops]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int c;
  while ((c = getchar()) != EOF) {
    printf("Character = [%c]\n", c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     115c <main+0x3c>
mov    -0x8(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%r14
cmp    (%r14),%eax
je     1156 <main+0x36>
lea    0xec2(%rip),%rbx
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
@.str = [18 x i8] c"Character = [%c]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %3
10: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [18 x i8] c"Character = [%c]\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %7, %4 ], [ %1, %0 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 (...) @getchar()
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
ret i32 0
}