xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void set_pmu_sleep_clk_high() {
  mbus_remote_register_write(0x6, 0x19,
                             ((1 << 13) | (1 << 9) | (1 << 5) | (1)));
  delay(100);
  mbus_remote_register_write(0x6, 0x19,
                             ((1 << 13) | (1 << 9) | (1 << 5) | (1)));
  delay(100);
  mbus_remote_register_write(0x6, 0x15,
                             ((0 << 19) | (0 << 18) | (0 << 17) | (3 << 14) |
                              (1 << 13) | (1 << 9) | (1 << 5) | (6)));
  delay(100 * 10);
}


x86 assembly (clang, -O0):
<set_pmu_sleep_clk_high>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
mov    $0x19,%esi
mov    $0x2221,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x19,%esi
mov    $0x2221,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x15,%esi
mov    $0xe226,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x3e8,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_pmu_sleep_clk_high>:
push   %rax
mov    $0x6,%edi
mov    $0x19,%esi
mov    $0x2221,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x19,%esi
mov    $0x2221,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x15,%esi
mov    $0xe226,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x3e8,%edi
pop    %rax
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @set_pmu_sleep_clk_high() {
%1 = call i32 @mbus_remote_register_write(i32 6, i32 25, i32 8737)
%2 = call i32 @delay(i32 100)
%3 = call i32 @mbus_remote_register_write(i32 6, i32 25, i32 8737)
%4 = call i32 @delay(i32 100)
%5 = call i32 @mbus_remote_register_write(i32 6, i32 21, i32 57894)
%6 = call i32 @delay(i32 1000)
ret void
}

LLVM IR (-O2):
define void @set_pmu_sleep_clk_high() {
%1 = tail call i32 @mbus_remote_register_write(i32 6, i32 25, i32 8737)
%2 = tail call i32 @delay(i32 100)
%3 = tail call i32 @mbus_remote_register_write(i32 6, i32 25, i32 8737)
%4 = tail call i32 @delay(i32 100)
%5 = tail call i32 @mbus_remote_register_write(i32 6, i32 21, i32 57894)
%6 = tail call i32 @delay(i32 1000)
ret void
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getc(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ stdin;
main() {
  double nc;
  for (nc = 0; getc(stdin) != EOF; ++nc)
    ;
  printf("%.0f\n", nc);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
call   1040 <getc@plt>
mov    0x2e94(%rip),%rcx
cmp    (%rcx),%rax
je     1171 <main+0x51>
jmp    115a <main+0x3a>
movsd  0xe9e(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1137 <main+0x17>
movsd  -0x10(%rbp),%xmm0
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2ebd(%rip),%r14
mov    (%r14),%edi
call   1040 <getc@plt>
mov    0x2ea6(%rip),%rbx
xorpd  %xmm0,%xmm0
cmp    (%rbx),%rax
je     116f <main+0x4f>
xorpd  %xmm0,%xmm0
nopw   0x0(%rax,%rax,1)
addsd  0xea8(%rip),%xmm0
movsd  %xmm0,(%rsp)
mov    (%r14),%edi
call   1040 <getc@plt>
movsd  (%rsp),%xmm0
cmp    (%rbx),%rax
jne    1150 <main+0x30>
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdin = global i32 0
@EOF = global i64 0
@.str = [6 x i8] c"%.0f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* @stdin
%5 = call i64 @getc(i32 %4)
%6 = load i64, i64* @EOF
%7 = icmp ne i64 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %3
br label %9
9: ; preds = %8
%10 = load double, double* %2
%11 = fadd double %10, 1.000000e+00
store double %11, double* %2
br label %3
12: ; preds = %3
%13 = load double, double* %2
%14 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %13)
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@stdin = global i32 0
@EOF = global i64 0
@.str = [6 x i8] c"%.0f\0A\00"
define i32 @main() {
%1 = load i32, i32* @stdin
%2 = tail call i64 @getc(i32 %1)
%3 = load i64, i64* @EOF
%4 = icmp eq i64 %2, %3
br i1 %4, label %12, label %5
5: ; preds = %0, %5
%6 = phi double [ %7, %5 ], [ 0.000000e+00, %0 ]
%7 = fadd double %6, 1.000000e+00
%8 = load i32, i32* @stdin
%9 = tail call i64 @getc(i32 %8)
%10 = load i64, i64* @EOF
%11 = icmp eq i64 %9, %10
br i1 %11, label %12, label %5
12: ; preds = %5, %0
%13 = phi double [ 0.000000e+00, %0 ], [ %7, %5 ]
%14 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %13)
ret i32 0
}
char *ft_strcpy(char *dst, const char *src) {
  int index;
  index = 0;
  while (src[index]) {
    dst[index] = src[index];
    index++;
  }
  dst[index] = src[index];
  return (dst);
}


x86 assembly (clang, -O0):
<ft_strcpy>:
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
cmpb   $0x0,(%rax,%rcx,1)
je     1149 <ft_strcpy+0x49>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <ft_strcpy+0x13>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1127 <ft_strcpy+0x27>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rax,%rdx,1)
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <ft_strcpy+0x10>
mov    %edx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret
xor    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @ft_strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = and i64 %9, 4294967295
br label %15
15: ; preds = %13, %2
%16 = phi i64 [ 0, %2 ], [ %14, %13 ]
%17 = getelementptr inbounds i8, i8* %0, i64 %16
store i8 0, i8* %17
ret i8* %0
}
/* Type definitions */
struct transition {
  int dummy;
};
struct extra_state {
  int dummy;
};

/* Variables and functions */
const struct transition *hook_ignore(const char *ifname,
                                     struct extra_state *state,
                                     const void *packet, size_t packet_size) {
  (void)ifname;
  (void)state;
  (void)packet;
  (void)packet_size;
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.transition = type { i32 }
%struct.extra_state = type { i32 }
define %struct.transition* @hook_ignore(i8* %0, %struct.extra_state* %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca %struct.extra_state*
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store %struct.extra_state* %1, %struct.extra_state** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load %struct.extra_state*, %struct.extra_state** %6
%11 = load i8*, i8** %7
%12 = load i64, i64* %8
ret %struct.transition* null
}

LLVM IR (-O2):
%struct.transition = type { i32 }
%struct.extra_state = type { i32 }
define noalias %struct.transition* @hook_ignore(i8* nocapture readnone %0, %struct.extra_state* nocapture readnone %1, i8* nocapture readnone %2, i64 %3) {
ret %struct.transition* null
}
int cal(int a, int b) {
  int sum = a + b;
  int sum1 = a * b;
  return (a + b + sum + sum1);
}


x86 assembly (clang, -O0):
<cal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cal>:
lea    (%rsi,%rdi,1),%eax
imul   %edi,%esi
lea    (%rsi,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @cal(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = mul nsw i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = add nsw i32 %13, %14
%16 = load i32, i32* %5
%17 = add nsw i32 %15, %16
%18 = load i32, i32* %6
%19 = add nsw i32 %17, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @cal(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = mul nsw i32 %1, %0
%5 = shl nsw i32 %3, 1
%6 = add nsw i32 %5, %4
ret i32 %6
}
/* Variables and functions */
scalar_t__ detectCapitalUse(char *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  if (detectCapitalUse("FFFFFFFFFFFFFFFFFFFFf")) {
    printf("yes");
  } else {
    printf("no");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <detectCapitalUse@plt>
cmp    $0x0,%rax
je     1156 <main+0x36>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
jmp    1162 <main+0x42>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [22 x i8] c"FFFFFFFFFFFFFFFFFFFFf\00"
@.str.1 = [4 x i8] c"yes\00"
@.str.2 = [3 x i8] c"no\00"
define i32 @main() {
%1 = tail call i64 @detectCapitalUse(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @printf(i8* dereferenceable(1) %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_relative_participation(char *);
int main(int argc, char *argv[]) {
  test_relative_participation(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)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <test_relative_participation@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <test_relative_participation@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @test_relative_participation(i8* %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @test_relative_participation(i8* %4)
ret i32 0
}
void RnAssemblyHLT() { asm volatile("hlt"); }


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

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

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

LLVM IR (-O2):
define void @RnAssemblyHLT() {
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
h2() {
  char *b;
  const void *p;
  p = b;
  b = p;
}


x86 assembly (clang, -O0):
<h2>:
push   %rbp
mov    %rsp,%rbp
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @h2() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ assert(_Bool);
void verify_assert(_Bool expression) { assert(expression); }


x86 assembly (clang, -O0):
<verify_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
and    $0x1,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_assert>:
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @verify_assert(i1 zeroext %0) {
%2 = alloca i8
%3 = zext i1 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = trunc i8 %4 to i1
%6 = call i32 @assert(i1 zeroext %5)
ret void
}

LLVM IR (-O2):
define void @verify_assert(i1 zeroext %0) {
%2 = tail call i32 @assert(i1 zeroext %0)
ret void
}
/* Variables and functions */
int LOG_NDELAY;
int LOG_PID;
int /*<<< orphan*/ LOG_USER;
int /*<<< orphan*/ openlog(int /*<<< orphan*/, int, int /*<<< orphan*/);
int /*<<< orphan*/ program_invocation_name();
__attribute__((constructor)) void init_logging() {
  openlog(program_invocation_name(), LOG_NDELAY | LOG_PID, LOG_USER);
}


x86 assembly (clang, -O0):
<init_logging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <program_invocation_name@plt>
mov    %eax,%edi
mov    0x2e94(%rip),%rax
mov    (%rax),%esi
mov    0x2e9b(%rip),%rax
or     (%rax),%esi
mov    0x2ea2(%rip),%rax
mov    (%rax),%edx
call   1040 <openlog@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_logging>:
push   %rax
xor    %eax,%eax
call   1030 <program_invocation_name@plt>
mov    0x2e99(%rip),%rcx
mov    0x2ea2(%rip),%rdx
mov    (%rdx),%esi
or     (%rcx),%esi
mov    0x2ea7(%rip),%rcx
mov    (%rcx),%edx
mov    %eax,%edi
pop    %rax
jmp    1040 <openlog@plt>

LLVM IR (-O0):
@LOG_NDELAY = global i32 0
@LOG_PID = global i32 0
@LOG_USER = global i32 0
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @init_logging, i8* null }]
define void @init_logging() {
%1 = call i32 (...) @program_invocation_name()
%2 = load i32, i32* @LOG_NDELAY
%3 = load i32, i32* @LOG_PID
%4 = or i32 %2, %3
%5 = load i32, i32* @LOG_USER
%6 = call i32 @openlog(i32 %1, i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@LOG_NDELAY = global i32 0
@LOG_PID = global i32 0
@LOG_USER = global i32 0
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @init_logging, i8* null }]
define void @init_logging() {
%1 = tail call i32 (...) @program_invocation_name()
%2 = load i32, i32* @LOG_NDELAY
%3 = load i32, i32* @LOG_PID
%4 = or i32 %3, %2
%5 = load i32, i32* @LOG_USER
%6 = tail call i32 @openlog(i32 %1, i32 %4, i32 %5)
ret void
}
/* Variables and functions */
float SquareRootFloat(float number) {
  long i;
  float x, y;
  const float f = 1.5F;
  x = number * 0.5F;
  y = number;
  i = *(long *)&y;
  i = 0x5f3759df - (i >> 1);
  y = *(float *)&i;
  y = y * (f - (x * y * y));
  y = y * (f - (x * y * y));
  return number * y;
}


x86 assembly (clang, -O0):
<SquareRootFloat>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xee6(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
sar    $0x1,%rcx
mov    $0x5f3759df,%eax
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
mulss  -0x18(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe7b(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
mulss  -0x18(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe41(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x18(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @SquareRootFloat(float %0) {
%2 = alloca float
%3 = alloca i64
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %2
store float 1.500000e+00, float* %6
%7 = load float, float* %2
%8 = fmul float %7, 5.000000e-01
store float %8, float* %4
%9 = load float, float* %2
store float %9, float* %5
%10 = bitcast float* %5 to i64*
%11 = load i64, i64* %10
store i64 %11, i64* %3
%12 = load i64, i64* %3
%13 = ashr i64 %12, 1
%14 = sub nsw i64 1597463007, %13
store i64 %14, i64* %3
%15 = bitcast i64* %3 to float*
%16 = load float, float* %15
store float %16, float* %5
%17 = load float, float* %5
%18 = load float, float* %4
%19 = load float, float* %5
%20 = fmul float %18, %19
%21 = load float, float* %5
%22 = fneg float %20
%23 = call float @llvm.fmuladd.f32(float %22, float %21, float 1.500000e+00)
%24 = fmul float %17, %23
store float %24, float* %5
%25 = load float, float* %5
%26 = load float, float* %4
%27 = load float, float* %5
%28 = fmul float %26, %27
%29 = load float, float* %5
%30 = fneg float %28
%31 = call float @llvm.fmuladd.f32(float %30, float %29, float 1.500000e+00)
%32 = fmul float %25, %31
store float %32, float* %5
%33 = load float, float* %2
%34 = load float, float* %5
%35 = fmul float %33, %34
ret float %35
}

LLVM IR (-O2):
define float @SquareRootFloat(float %0) {
ret float poison
}
/* Variables and functions */
scalar_t__ randomMT();
int randomitem(int nitems) {
  return (int)((double)(((unsigned long)randomMT()) / 4294967296.) * nitems) %
         nitems;
}


x86 assembly (clang, -O0):
<randomitem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
call   1030 <randomMT@plt>
movq   %rax,%xmm0
movaps 0xee2(%rip),%xmm1
punpckldq %xmm1,%xmm0
movapd 0xee6(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xeaf(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomitem>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <randomMT@plt>
movq   %rax,%xmm0
punpckldq 0xed9(%rip),%xmm0
subpd  0xee1(%rip),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm0,%xmm1
mulsd  0xedd(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @randomitem(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 (...) @randomMT()
%4 = uitofp i64 %3 to double
%5 = fdiv double %4, 0x41F0000000000000
%6 = load i32, i32* %2
%7 = sitofp i32 %6 to double
%8 = fmul double %5, %7
%9 = fptosi double %8 to i32
%10 = load i32, i32* %2
%11 = srem i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @randomitem(i32 %0) {
%2 = tail call i64 (...) @randomMT()
%3 = uitofp i64 %2 to double
%4 = fmul double %3, 0x3DF0000000000000
%5 = sitofp i32 %0 to double
%6 = fmul double %4, %5
%7 = fptosi double %6 to i32
%8 = srem i32 %7, %0
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;
typedef int /*<<< orphan*/ mpf_t;

/* Variables and functions */
int /*<<< orphan*/ *malloc(int);
int /*<<< orphan*/ mpf_init(int /*<<< orphan*/);
int /*<<< orphan*/ mpf_print(int /*<<< orphan*/ *, char);
int /*<<< orphan*/ mpz_init_set_ui(int /*<<< orphan*/, int);
int /*<<< orphan*/ piComputing(int /*<<< orphan*/, int /*<<< orphan*/ *);
int main() {
  mpf_t *pi = malloc(sizeof(mpf_t));
  mpf_init(*pi);
  mpz_t digits;
  mpz_init_set_ui(digits, 14);
  piComputing(digits, pi);
  mpf_print(pi, ',');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <mpf_init@plt>
mov    -0x14(%rbp),%edi
mov    $0xe,%esi
call   1070 <mpz_init_set_ui@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <piComputing@plt>
mov    -0x10(%rbp),%rdi
mov    $0x2c,%esi
call   1040 <mpf_print@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    (%rax),%edi
call   1030 <mpf_init@plt>
mov    $0xe,%esi
call   1070 <mpz_init_set_ui@plt>
mov    %rbx,%rsi
call   1050 <piComputing@plt>
mov    %rbx,%rdi
mov    $0x2c,%esi
call   1040 <mpf_print@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32* @malloc(i32 4)
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = call i32 @mpf_init(i32 %6)
%8 = load i32, i32* %3
%9 = call i32 @mpz_init_set_ui(i32 %8, i32 14)
%10 = load i32, i32* %3
%11 = load i32*, i32** %2
%12 = call i32 @piComputing(i32 %10, i32* %11)
%13 = load i32*, i32** %2
%14 = call i32 @mpf_print(i32* %13, i8 signext 44)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 4)
%2 = load i32, i32* %1
%3 = tail call i32 @mpf_init(i32 %2)
%4 = tail call i32 @mpz_init_set_ui(i32 undef, i32 14)
%5 = tail call i32 @piComputing(i32 undef, i32* %1)
%6 = tail call i32 @mpf_print(i32* %1, i8 signext 44)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void *connection_handler(void *sock) {
  int socket_desc = *(int *)sock;
  char *message;
  message = "FIN\n";
  write(socket_desc, message, strlen(message));
  free(sock);
  puts("[OKAY] Closing connection");
  return 0;
}


x86 assembly (clang, -O0):
<connection_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
lea    0xea4(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1050 <write@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
lea    0xe70(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<connection_handler>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%ebp
lea    0xeb0(%rip),%r14
mov    %r14,%rdi
call   1060 <strlen@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1050 <write@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xe92(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"FIN\0A\00"
@.str.1 = [26 x i8] c"[OKAY] Closing connection\00"
define i8* @connection_handler(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
store i32 %7, i32* %3
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %4
%8 = load i32, i32* %3
%9 = load i8*, i8** %4
%10 = load i8*, i8** %4
%11 = call i32 @strlen(i8* %10)
%12 = call i32 @write(i32 %8, i8* %9, i32 %11)
%13 = load i8*, i8** %2
%14 = call i32 @free(i8* %13)
%15 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@.str = [5 x i8] c"FIN\0A\00"
@.str.1 = [26 x i8] c"[OKAY] Closing connection\00"
define noalias i8* @connection_handler(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @write(i32 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @free(i8* %0)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret i8* null
}
long double test3l(long double x) { return __builtin_sinl(x); }


x86 assembly (clang, -O0):
<test3l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <sinl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3l>:
jmp    1030 <sinl@plt>

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

LLVM IR (-O2):
define x86_fp80 @test3l(x86_fp80 %0) {
%2 = tail call x86_fp80 @sinl(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ clear_ptab(void *);
void porttab_free_fn(void *setting) { clear_ptab(setting); }


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

x86 assembly (clang, -O2):
<porttab_free_fn>:
jmp    1030 <clear_ptab@plt>

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

LLVM IR (-O2):
define void @porttab_free_fn(i8* %0) {
%2 = tail call i32 @clear_ptab(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void wrong() { printf("in wrong\n"); }


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"in wrong\00"
define void @wrong() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Menus_CloseByName(char *);
void CG_HideRadioMenu(void) { Menus_CloseByName("ingame_radio"); }


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"ingame_radio\00"
define void @CG_HideRadioMenu() {
%1 = tail call i32 @Menus_CloseByName(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
int cycle_is_check_spr_exp(unsigned int flags) {
  return (flags & 0x10000000) ? 1 : 0;
}


x86 assembly (clang, -O0):
<cycle_is_check_spr_exp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x10000000,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cycle_is_check_spr_exp>:
mov    %edi,%eax
shr    $0x1c,%eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @cycle_is_check_spr_exp(i32 %0) {
%2 = lshr i32 %0, 28
%3 = and i32 %2, 1
ret i32 %3
}
/* Variables and functions */
unsigned short VDP_getWindowAddress();
unsigned short VDP_getWindowPlanAddress() { return VDP_getWindowAddress(); }


x86 assembly (clang, -O0):
<VDP_getWindowPlanAddress>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <VDP_getWindowAddress@plt>
movzwl %ax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @VDP_getWindowPlanAddress() {
%1 = call zeroext i16 (...) @VDP_getWindowAddress()
ret i16 %1
}

LLVM IR (-O2):
define zeroext i16 @VDP_getWindowPlanAddress() {
%1 = tail call zeroext i16 (...) @VDP_getWindowAddress()
ret i16 %1
}
/* Variables and functions */
int strcmp(char *, char *);
int compare(const void *p, const void *q) {
  char *a, *b;
  a = (char *)p;
  b = (char *)q;
  return strcmp(a, b);
}


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

x86 assembly (clang, -O2):
<compare>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int UIntCmp(const void *a, const void *b) {
  return ((unsigned)((uintptr_t)(a))) - ((unsigned)((uintptr_t)(b)));
}


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

x86 assembly (clang, -O2):
<UIntCmp>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @UIntCmp(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 = ptrtoint i8* %5 to i64
%7 = trunc i64 %6 to i32
%8 = load i8*, i8** %4
%9 = ptrtoint i8* %8 to i64
%10 = trunc i64 %9 to i32
%11 = sub i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @UIntCmp(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = ptrtoint i8* %1 to i64
%6 = trunc i64 %5 to i32
%7 = sub i32 %4, %6
ret i32 %7
}
void log_debug2(const char *msg __attribute__((unused)), ...) {}


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

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

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

LLVM IR (-O2):
define void @log_debug2(i8* nocapture %0, ...) {
ret void
}
int main(void) {
  int *vetor = aloca(vetor, 2);
  printf("END. NA MAIN: %d", vetor);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <aloca@plt>
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <aloca@plt>
movslq %eax,%rsi
lea    0xec9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"END. NA MAIN: %d\00"
define i32 @main() {
%1 = alloca i32*
%2 = load i32*, i32** %1
%3 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @aloca to i32 (i32*, i32, ...)*)(i32* %2, i32 2)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %1
%6 = load i32*, i32** %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"END. NA MAIN: %d\00"
define i32 @main() {
%1 = tail call i32 (i32*, i32, ...) bitcast (i32 (...)* @aloca to i32 (i32*, i32, ...)*)(i32* undef, i32 2)
%2 = sext i32 %1 to i64
%3 = inttoptr i64 %2 to i32*
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ inner_lib_func();
void outer_lib_func(void) { inner_lib_func(); }


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

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

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

LLVM IR (-O2):
define void @outer_lib_func() {
%1 = tail call i32 (...) @inner_lib_func()
ret void
}
int test_imm_40uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x40 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_40uint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0x40,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_40uint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 64
%7 = icmp ne i64 %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_40uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 274877906944
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ skill_readdb();
void skill_reload(void) { skill_readdb(); }


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

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

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

LLVM IR (-O2):
define void @skill_reload() {
%1 = tail call i32 (...) @skill_readdb()
ret void
}
/* Variables and functions */
int i2c_smbus_read_byte_data(int, int);
int bananapiI2CReadReg8(int fd, int reg) {
  return i2c_smbus_read_byte_data(fd, reg);
}


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

x86 assembly (clang, -O2):
<bananapiI2CReadReg8>:
jmp    1030 <i2c_smbus_read_byte_data@plt>

LLVM IR (-O0):
define i32 @bananapiI2CReadReg8(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @i2c_smbus_read_byte_data(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @bananapiI2CReadReg8(i32 %0, i32 %1) {
%3 = tail call i32 @i2c_smbus_read_byte_data(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void B10(void) { printf("Test2\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"Test2\00"
define void @B10() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
__attribute__((always_)) void arch_free_page(struct page *page, int order) {}


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

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

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

LLVM IR (-O2):
%struct.page = type opaque
define void @arch_free_page(%struct.page* nocapture %0, i32 %1) {
ret void
}
void caller_2_2_1_2_2_2_2() {}


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

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

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

LLVM IR (-O2):
define void @caller_2_2_1_2_2_2_2() {
ret void
}
void toggleBit(int num, int pos, int *new_number) {
  *new_number = num ^ (1 << pos);
}


x86 assembly (clang, -O0):
<toggleBit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    -0x14(%rbp),%ecx
xor    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<toggleBit>:
btc    %esi,%edi
mov    %edi,(%rdx)
ret

LLVM IR (-O0):
define void @toggleBit(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
%8 = load i32, i32* %5
%9 = shl i32 1, %8
%10 = xor i32 %7, %9
%11 = load i32*, i32** %6
store i32 %10, i32* %11
ret void
}

LLVM IR (-O2):
define void @toggleBit(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = shl nuw i32 1, %1
%5 = xor i32 %4, %0
store i32 %5, i32* %2
ret void
}
void init_idct(void) { ; }


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

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

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

LLVM IR (-O2):
define void @init_idct() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sse4_1_min(int, int);
int main() {
  printf("min = %d", sse4_1_min(10, 4));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
mov    $0x4,%esi
call   1040 <sse4_1_min@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"min = %d\00"
define i32 @main() {
%1 = tail call i32 @sse4_1_min(i32 10, i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ualarm(int, int);
void os_setupAlarmInterval(int start, int period) { ualarm(start, period); }


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

x86 assembly (clang, -O2):
<os_setupAlarmInterval>:
jmp    1030 <ualarm@plt>

LLVM IR (-O0):
define void @os_setupAlarmInterval(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @ualarm(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @os_setupAlarmInterval(i32 %0, i32 %1) {
%3 = tail call i32 @ualarm(i32 %0, i32 %1)
ret void
}
imm0imm1(r0, r1, x0, x1, p0, p1) unsigned char r0, r1;
unsigned char *p0, *p1;
{
  if (22 <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<imm0imm1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %edx,-0x8(%rbp)
mov    %ecx,-0xc(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @imm0imm1(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i8
%8 = alloca i8
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
%13 = trunc i32 %0 to i8
%14 = trunc i32 %1 to i8
store i8 %13, i8* %7
store i8 %14, i8* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i8* %4, i8** %11
store i8* %5, i8** %12
ret i32 1
}

LLVM IR (-O2):
define i32 @imm0imm1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4, i8* nocapture readnone %5) {
ret i32 1
}
int SEXT(int value, int topbit) {
  int shift = sizeof(int) * 8 - topbit;
  return (value << shift) >> shift;
}


x86 assembly (clang, -O0):
<SEXT>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x8(%rbp),%rcx
mov    $0x20,%eax
sub    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @SEXT(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* %4
%7 = sext i32 %6 to i64
%8 = sub i64 32, %7
%9 = trunc i64 %8 to i32
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %5
%12 = shl i32 %10, %11
%13 = load i32, i32* %5
%14 = ashr i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @SEXT(i32 %0, i32 %1) {
%3 = sub i32 32, %1
%4 = shl i32 %0, %3
%5 = ashr i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ LedsP__Leds__led0Off();
void TelosbSensorReadingC__Leds__led0Off(void) { LedsP__Leds__led0Off(); }


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

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

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

LLVM IR (-O2):
define void @TelosbSensorReadingC__Leds__led0Off() {
%1 = tail call i32 (...) @LedsP__Leds__led0Off()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ multiply_array_number(double *, double *, double, int, int);
void divide_array_number_inplace(double *out, double f, int ncol, int nlns) {
  multiply_array_number(out, out, f, ncol, nlns);
}


x86 assembly (clang, -O0):
<divide_array_number_inplace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movsd  -0x10(%rbp),%xmm0
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <multiply_array_number@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<divide_array_number_inplace>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
jmp    1030 <multiply_array_number@plt>

LLVM IR (-O0):
define void @divide_array_number_inplace(double* %0, double %1, i32 %2, i32 %3) {
%5 = alloca double*
%6 = alloca double
%7 = alloca i32
%8 = alloca i32
store double* %0, double** %5
store double %1, double* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load double*, double** %5
%10 = load double*, double** %5
%11 = load double, double* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @multiply_array_number(double* %9, double* %10, double %11, i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
define void @divide_array_number_inplace(double* %0, double %1, i32 %2, i32 %3) {
%5 = tail call i32 @multiply_array_number(double* %0, double* %0, double %1, i32 %2, i32 %3)
ret void
}