xunge/DecIR huggingface dataset:
long GPIOGetIntNumber(unsigned long ulPort) {
  unsigned int ulInt;
  switch (ulPort) {
  case 0x40004000: {
    ulInt = 16;
    break;
  }
  case 0x40005000: {
    ulInt = 17;
    break;
  }
  case 0x40006000: {
    ulInt = 18;
    break;
  }
  case 0x40007000: {
    ulInt = 19;
    break;
  }
  default: {
    return (-1);
  }
  }
  return (ulInt);
}


x86 assembly (clang, -O0):
<GPIOGetIntNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
sub    $0x40004000,%rax
je     1160 <GPIOGetIntNumber+0x60>
jmp    1121 <GPIOGetIntNumber+0x21>
mov    -0x20(%rbp),%rax
sub    $0x40005000,%rax
je     116c <GPIOGetIntNumber+0x6c>
jmp    1136 <GPIOGetIntNumber+0x36>
mov    -0x20(%rbp),%rax
sub    $0x40006000,%rax
je     1178 <GPIOGetIntNumber+0x78>
jmp    114b <GPIOGetIntNumber+0x4b>
mov    -0x20(%rbp),%rax
sub    $0x40007000,%rax
je     1184 <GPIOGetIntNumber+0x84>
jmp    1190 <GPIOGetIntNumber+0x90>
movl   $0x10,-0x14(%rbp)
jmp    119d <GPIOGetIntNumber+0x9d>
movl   $0x11,-0x14(%rbp)
jmp    119d <GPIOGetIntNumber+0x9d>
movl   $0x12,-0x14(%rbp)
jmp    119d <GPIOGetIntNumber+0x9d>
movl   $0x13,-0x14(%rbp)
jmp    119d <GPIOGetIntNumber+0x9d>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    11a4 <GPIOGetIntNumber+0xa4>
mov    -0x14(%rbp),%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOGetIntNumber>:
add    $0xffffffffbfffc000,%rdi
rol    $0x34,%rdi
lea    0x10(%rdi),%rcx
cmp    $0x4,%rdi
mov    $0xffffffffffffffff,%rax
cmovb  %rcx,%rax
ret

LLVM IR (-O0):
define i64 @GPIOGetIntNumber(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
%5 = load i64, i64* %3
switch i64 %5, label %10 [
i64 1073758208, label %6
i64 1073762304, label %7
i64 1073766400, label %8
i64 1073770496, label %9
]
6: ; preds = %1
store i32 16, i32* %4
br label %11
7: ; preds = %1
store i32 17, i32* %4
br label %11
8: ; preds = %1
store i32 18, i32* %4
br label %11
9: ; preds = %1
store i32 19, i32* %4
br label %11
10: ; preds = %1
store i64 -1, i64* %2
br label %14
11: ; preds = %9, %8, %7, %6
%12 = load i32, i32* %4
%13 = zext i32 %12 to i64
store i64 %13, i64* %2
br label %14
14: ; preds = %11, %10
%15 = load i64, i64* %2
ret i64 %15
}

LLVM IR (-O2):
define i64 @GPIOGetIntNumber(i64 %0) {
%2 = add i64 %0, -1073758208
%3 = tail call i64 @llvm.fshl.i64(i64 %2, i64 %2, i64 52)
%4 = icmp ult i64 %3, 4
%5 = add i64 %3, 16
%6 = select i1 %4, i64 %5, i64 -1
ret i64 %6
}
/* Variables and functions */
scalar_t__ strtol(char *, int /*<<< orphan*/ *, int);
unsigned char get_number_from_hex_char(char high, char low) {
  char str[3];
  str[0] = high;
  str[1] = low;
  str[2] = '\0';
  return (unsigned char)strtol(str, NULL, 16);
}


x86 assembly (clang, -O0):
<get_number_from_hex_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x2(%rbp),%al
mov    %al,-0x4(%rbp)
movb   $0x0,-0x3(%rbp)
lea    -0x5(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1030 <strtol@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_number_from_hex_char>:
push   %rax
mov    %dil,0x5(%rsp)
mov    %sil,0x6(%rsp)
movb   $0x0,0x7(%rsp)
lea    0x5(%rsp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <strtol@plt>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @get_number_from_hex_char(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca [3 x i8]
store i8 %0, i8* %3
store i8 %1, i8* %4
%6 = load i8, i8* %3
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
store i8 %6, i8* %7
%8 = load i8, i8* %4
%9 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 1
store i8 %8, i8* %9
%10 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 2
store i8 0, i8* %10
%11 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%12 = call i64 @strtol(i8* %11, i32* null, i32 16)
%13 = trunc i64 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define zeroext i8 @get_number_from_hex_char(i8 signext %0, i8 signext %1) {
%3 = alloca [3 x i8]
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
store i8 %0, i8* %4
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 1
store i8 %1, i8* %5
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 2
store i8 0, i8* %6
%7 = call i64 @strtol(i8* nocapture %4, i32* null, i32 16)
%8 = trunc i64 %7 to i8
ret i8 %8
}
double pcmpt_deg(int d) {
  int deg;
  double minutes;
  deg = d / 100000;
  minutes = (((d / 100000.0) - deg) * 100) / 60.0;
  return (double)deg + minutes;
}


x86 assembly (clang, -O0):
<pcmpt_deg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x186a0,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeee(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xed1(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xebd(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcmpt_deg>:
movslq %edi,%rax
imul   $0x14f8b589,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2d,%rcx
add    %edx,%ecx
cvtsi2sd %eax,%xmm0
divsd  0xedd(%rip),%xmm0
cvtsi2sd %ecx,%xmm1
subsd  %xmm1,%xmm0
mulsd  0xed5(%rip),%xmm0
divsd  0xed5(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @pcmpt_deg(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 100000
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = sitofp i32 %7 to double
%9 = fdiv double %8, 1.000000e+05
%10 = load i32, i32* %3
%11 = sitofp i32 %10 to double
%12 = fsub double %9, %11
%13 = fmul double %12, 1.000000e+02
%14 = fdiv double %13, 6.000000e+01
store double %14, double* %4
%15 = load i32, i32* %3
%16 = sitofp i32 %15 to double
%17 = load double, double* %4
%18 = fadd double %16, %17
ret double %18
}

LLVM IR (-O2):
define double @pcmpt_deg(i32 %0) {
%2 = sdiv i32 %0, 100000
%3 = sitofp i32 %0 to double
%4 = fdiv double %3, 1.000000e+05
%5 = sitofp i32 %2 to double
%6 = fsub double %4, %5
%7 = fmul double %6, 1.000000e+02
%8 = fdiv double %7, 6.000000e+01
%9 = fadd double %8, %5
ret double %9
}
/* Variables and functions */
scalar_t__ alexa_malloc(int);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *alexa_strdup(const char *str) {
  int len = strlen(str);
  char *actual_str = (char *)alexa_malloc(len + 1);
  if (actual_str) {
    strcpy(actual_str, str);
  }
  return actual_str;
}


x86 assembly (clang, -O0):
<alexa_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1050 <alexa_malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     116f <alexa_strdup+0x3f>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alexa_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <alexa_malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1157 <alexa_strdup+0x27>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @alexa_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @alexa_malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %9
9: ; preds = %7, %1
ret i8* %5
}
/* Variables and functions */
int partition2(int *, int, int);
void quicksort_2(int *array, int low, int high) {
  int k = 0;
  if (low < high) {
    k = partition2(array, low, high);
    quicksort_2(array, low, k - 1);
    quicksort_2(array, k + 1, high);
  }
  return;
}


x86 assembly (clang, -O0):
<quicksort_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    117b <quicksort_2+0x5b>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition2@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quicksort_2@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quicksort_2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort_2>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quicksort_2+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition2@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quicksort_2@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quicksort_2+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @quicksort_2(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %3
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @partition2(i32* %12, i32 %13, i32 %14)
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = sub nsw i32 %18, 1
%20 = load i32*, i32** %4
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
%23 = load i32, i32* %6
br label %24
24: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @quicksort_2(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition2(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quicksort_2(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int randomGaussian(int, int);
int /*<<< orphan*/ sleep(int);
void goThink(int philoNum) {
  int thinkTime = randomGaussian(11, 7);
  if (thinkTime <= 0)
    thinkTime = 0;
  sleep(thinkTime);
  printf("Philosopher %d has thought for %d seconds\n", philoNum, thinkTime);
}


x86 assembly (clang, -O0):
<goThink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xb,%edi
mov    $0x7,%esi
call   1040 <randomGaussian@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     115e <goThink+0x2e>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <sleep@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<goThink>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xb,%edi
mov    $0x7,%esi
call   1040 <randomGaussian@plt>
xor    %ebp,%ebp
test   %eax,%eax
cmovns %eax,%ebp
mov    %ebp,%edi
call   1050 <sleep@plt>
lea    0xea7(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"Philosopher %d has thought for %d seconds\0A\00"
define void @goThink(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @randomGaussian(i32 11, i32 7)
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %3
br label %8
8: ; preds = %7, %1
%9 = load i32, i32* %3
%10 = call i32 @sleep(i32 %9)
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"Philosopher %d has thought for %d seconds\0A\00"
define void @goThink(i32 %0) {
%2 = tail call i32 @randomGaussian(i32 11, i32 7)
%3 = icmp sgt i32 %2, 0
%4 = select i1 %3, i32 %2, i32 0
%5 = tail call i32 @sleep(i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %4)
ret void
}
/* Type definitions */
typedef int mode_t;

/* Variables and functions */
int S_IXGRP;
int is_group_exec(mode_t mode) { return mode & S_IXGRP; }


x86 assembly (clang, -O0):
<is_group_exec>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ed7(%rip),%rcx
and    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_group_exec>:
mov    %edi,%eax
mov    0x2edf(%rip),%rcx
and    (%rcx),%eax
ret

LLVM IR (-O0):
@S_IXGRP = global i32 0
define i32 @is_group_exec(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @S_IXGRP
%5 = and i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
@S_IXGRP = global i32 0
define i32 @is_group_exec(i32 %0) {
%2 = load i32, i32* @S_IXGRP
%3 = and i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ recursive_a(int);
void recursive_b(int i) {
  printf("%d\n", i);
  if (i > 0) {
    recursive_a(--i);
  }
}


x86 assembly (clang, -O0):
<recursive_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x4(%rbp)
jle    1152 <recursive_b+0x32>
mov    -0x4(%rbp),%edi
add    $0xffffffff,%edi
mov    %edi,-0x4(%rbp)
call   1040 <recursive_a@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recursive_b>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
test   %ebx,%ebx
jle    1140 <recursive_b+0x20>
add    $0xffffffff,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1040 <recursive_a@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @recursive_b(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = add nsw i32 %0, -1
%6 = tail call i32 @recursive_a(i32 %5)
br label %7
7: ; preds = %4, %1
ret void
}
/* Type definitions */
struct passwd {
  int dummy;
};

/* Variables and functions */
struct passwd *getpwuid(unsigned uid) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.passwd = type { i32 }
define %struct.passwd* @getpwuid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret %struct.passwd* null
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
define noalias %struct.passwd* @getpwuid(i32 %0) {
ret %struct.passwd* null
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
void _mm_storeu_epi16(void *, int /*<<< orphan*/);
void test_mm_storeu_epi16(void *__p, __m128i __a) {
  return _mm_storeu_epi16(__p, __a);
}


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

x86 assembly (clang, -O2):
<test_mm_storeu_epi16>:
jmp    1030 <_mm_storeu_epi16@plt>

LLVM IR (-O0):
define void @test_mm_storeu_epi16(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
ret void
}

LLVM IR (-O2):
define void @test_mm_storeu_epi16(i8* %0, i32 %1) {
tail call void @_mm_storeu_epi16(i8* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t splitmix64_next(uint64_t *state) {
  uint64_t z = (*state += 0x9e3779b97f4a7c15);
  z = (z ^ (z >> 30)) * 0xbf58476d1ce4e5b9;
  z = (z ^ (z >> 27)) * 0x94d049bb133111eb;
  return z ^ (z >> 31);
}


x86 assembly (clang, -O0):
<splitmix64_next>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
movslq (%rcx),%rax
movabs $0x9e3779b97f4a7c15,%rdx
79 37 9e
add    %rdx,%rax
mov    %eax,(%rcx)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    $0x1e,%ecx
xor    %ecx,%eax
cltq
movabs $0xbf58476d1ce4e5b9,%rcx
47 58 bf
imul   %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    $0x1b,%ecx
xor    %ecx,%eax
cltq
movabs $0x94d049bb133111eb,%rcx
49 d0 94
imul   %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    $0x1f,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<splitmix64_next>:
mov    $0x7f4a7c15,%eax
add    (%rdi),%eax
mov    %eax,(%rdi)
mov    %eax,%ecx
sar    $0x1e,%ecx
xor    %eax,%ecx
imul   $0x1ce4e5b9,%ecx,%eax
mov    %eax,%ecx
sar    $0x1b,%ecx
xor    %eax,%ecx
imul   $0x133111eb,%ecx,%ecx
mov    %ecx,%eax
sar    $0x1f,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @splitmix64_next(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = add i64 %6, -7046029254386353131
%8 = trunc i64 %7 to i32
store i32 %8, i32* %4
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i32, i32* %3
%11 = ashr i32 %10, 30
%12 = xor i32 %9, %11
%13 = sext i32 %12 to i64
%14 = mul i64 %13, -4658895280553007687
%15 = trunc i64 %14 to i32
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = load i32, i32* %3
%18 = ashr i32 %17, 27
%19 = xor i32 %16, %18
%20 = sext i32 %19 to i64
%21 = mul i64 %20, -7723592293110705685
%22 = trunc i64 %21 to i32
store i32 %22, i32* %3
%23 = load i32, i32* %3
%24 = load i32, i32* %3
%25 = ashr i32 %24, 31
%26 = xor i32 %23, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @splitmix64_next(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add i32 %2, 2135587861
store i32 %3, i32* %0
%4 = ashr i32 %3, 30
%5 = xor i32 %4, %3
%6 = mul i32 %5, 484763065
%7 = ashr i32 %6, 27
%8 = xor i32 %7, %6
%9 = mul i32 %8, 321982955
%10 = ashr i32 %9, 31
%11 = xor i32 %10, %9
ret i32 %11
}
int bitxor_funktion(int var1, int var2) {
  int erg;
  erg = var1 ^ var2;
  return (var1 ^ var2);
}


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

x86 assembly (clang, -O2):
<bitxor_funktion>:
mov    %edi,%eax
xor    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @bitxor_funktion(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ test(char *);
int main() {
  char msg[] = "CC";
  test(msg);
  test("CC");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xe(%rsp)
movw   $0x4343,0xc(%rsp)
lea    0xed8(%rip),%rbx
lea    0xc(%rsp),%rdi
call   1030 <test@plt>
mov    %rbx,%rdi
call   1030 <test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.msg = [3 x i8] c"CC\00"
@.str = [3 x i8] c"CC\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i8]
store i32 0, i32* %1
%3 = bitcast [3 x i8]* %2 to i8*
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%5 = call i32 @test(i8* %4)
%6 = call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"CC\00"
define i32 @main() {
%1 = alloca [3 x i8]
%2 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%3 = call i32 @test(i8* %2)
%4 = call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int lib_e(int);
int lib_d(int i) { return lib_e(i + 1) - 1; }


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

x86 assembly (clang, -O2):
<lib_d>:
push   %rax
add    $0x1,%edi
call   1030 <lib_e@plt>
add    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @lib_d(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = call i32 @lib_e(i32 %4)
%6 = sub nsw i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @lib_d(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @lib_e(i32 %2)
%4 = add nsw i32 %3, -1
ret i32 %4
}
/* Variables and functions */
scalar_t__ MEM_32bits();
int /*<<< orphan*/ MEM_readLE32(void const *);
int /*<<< orphan*/ MEM_readLE64(void const *);
__attribute__((unused)) size_t MEM_readLEST(const void *memPtr) {
  if (MEM_32bits())
    return (size_t)MEM_readLE32(memPtr);
  else
    return (size_t)MEM_readLE64(memPtr);
}


x86 assembly (clang, -O0):
<MEM_readLEST>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <MEM_32bits@plt>
cmp    $0x0,%rax
je     1161 <MEM_readLEST+0x31>
mov    -0x10(%rbp),%rdi
call   1050 <MEM_readLE32@plt>
cltq
mov    %rax,-0x8(%rbp)
jmp    1170 <MEM_readLEST+0x40>
mov    -0x10(%rbp),%rdi
call   1040 <MEM_readLE64@plt>
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MEM_readLEST>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <MEM_32bits@plt>
mov    %rbx,%rdi
test   %rax,%rax
je     114a <MEM_readLEST+0x1a>
call   1050 <MEM_readLE32@plt>
jmp    114f <MEM_readLEST+0x1f>
call   1040 <MEM_readLE64@plt>
cltq
pop    %rbx
ret

LLVM IR (-O0):
define i64 @MEM_readLEST(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i64 (...) @MEM_32bits()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = call i32 @MEM_readLE32(i8* %7)
%9 = sext i32 %8 to i64
store i64 %9, i64* %2
br label %14
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = call i32 @MEM_readLE64(i8* %11)
%13 = sext i32 %12 to i64
store i64 %13, i64* %2
br label %14
14: ; preds = %10, %6
%15 = load i64, i64* %2
ret i64 %15
}

LLVM IR (-O2):
define i64 @MEM_readLEST(i8* %0) {
%2 = tail call i64 (...) @MEM_32bits()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @MEM_readLE32(i8* %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @MEM_readLE64(i8* %0)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ]
%10 = sext i32 %9 to i64
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void rws_socket_handle_sigpipe(int signal_number) {
  printf("\nlibrws handle sigpipe %i", signal_number);
  (void)signal_number;
  return;
}


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

x86 assembly (clang, -O2):
<rws_socket_handle_sigpipe>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"\0Alibrws handle sigpipe %i\00"
define void @rws_socket_handle_sigpipe(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"\0Alibrws handle sigpipe %i\00"
define void @rws_socket_handle_sigpipe(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
long zig_addw_long(long lhs, long rhs, long min, long max) {
  return (long)(((unsigned long)lhs) + ((unsigned long)rhs));
}


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

x86 assembly (clang, -O2):
<zig_addw_long>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @zig_addw_long(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = add i64 %9, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @zig_addw_long(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = add i64 %1, %0
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void pr(int **data, void *cl) { printf("%d ", (int)*data); }


x86 assembly (clang, -O0):
<pr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %eax,%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pr>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @pr(i32** nocapture %0, i8* nocapture readnone %1) {
%3 = load i32*, i32** %0
%4 = ptrtoint i32* %3 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
void FreeCharArray(char **a, int size) {
  int i;
  for (i = 0; i < size; i++) {
    free(a[i]);
  }
  free(a);
}


x86 assembly (clang, -O0):
<FreeCharArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <FreeCharArray+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <FreeCharArray+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FreeCharArray>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <FreeCharArray+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <FreeCharArray+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @FreeCharArray(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = bitcast i8** %0 to i8*
tail call void @free(i8* %13)
ret void
}
/* Variables and functions */
int slk_attroff(unsigned int);
int wrap_slk_attroff(unsigned int attrs) { return slk_attroff(attrs); }


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

x86 assembly (clang, -O2):
<wrap_slk_attroff>:
jmp    1030 <slk_attroff@plt>

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

LLVM IR (-O2):
define i32 @wrap_slk_attroff(i32 %0) {
%2 = tail call i32 @slk_attroff(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ wtime_(double *);
double elapsed_time(void) {
  double t;
  wtime_(&t);
  return (t);
}


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

x86 assembly (clang, -O2):
<elapsed_time>:
push   %rax
mov    %rsp,%rdi
call   1030 <wtime_@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @elapsed_time() {
%1 = alloca double
%2 = call i32 @wtime_(double* %1)
%3 = load double, double* %1
ret double %3
}

LLVM IR (-O2):
define double @elapsed_time() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @wtime_(double* %1)
%4 = load double, double* %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int /*<<< orphan*/, int);
int /*<<< orphan*/ east_span(unsigned long);
void east_span_test(void **state) {
  assert_int_equal(east_span(1ul),
                   0x00000000000000FFul & ~0x0101010101010101ul);
}


x86 assembly (clang, -O0):
<east_span_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1040 <east_span@plt>
mov    %eax,%edi
mov    $0xfe,%esi
call   1030 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<east_span_test>:
push   %rax
mov    $0x1,%edi
call   1040 <east_span@plt>
mov    %eax,%edi
mov    $0xfe,%esi
pop    %rax
jmp    1030 <assert_int_equal@plt>

LLVM IR (-O0):
define void @east_span_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @east_span(i64 1)
%4 = call i32 @assert_int_equal(i32 %3, i32 254)
ret void
}

LLVM IR (-O2):
define void @east_span_test(i8** nocapture readnone %0) {
%2 = tail call i32 @east_span(i64 1)
%3 = tail call i32 @assert_int_equal(i32 %2, i32 254)
ret void
}
/* Type definitions */
struct image_object {
  int dummy;
};

/* Variables and functions */
int _singularity_image_expand(struct image_object *, unsigned int);
int singularity_image_expand(struct image_object *image, unsigned int size) {
  return (_singularity_image_expand(image, size));
}


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

x86 assembly (clang, -O2):
<singularity_image_expand>:
jmp    1030 <_singularity_image_expand@plt>

LLVM IR (-O0):
%struct.image_object = type { i32 }
define i32 @singularity_image_expand(%struct.image_object* %0, i32 %1) {
%3 = alloca %struct.image_object*
%4 = alloca i32
store %struct.image_object* %0, %struct.image_object** %3
store i32 %1, i32* %4
%5 = load %struct.image_object*, %struct.image_object** %3
%6 = load i32, i32* %4
%7 = call i32 @_singularity_image_expand(%struct.image_object* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.image_object = type { i32 }
define i32 @singularity_image_expand(%struct.image_object* %0, i32 %1) {
%3 = tail call i32 @_singularity_image_expand(%struct.image_object* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int uart_write(char *, int);
int uart_write_err(char *, int);
int _write(int file, char *p, int len) {
  switch (file) {
  case 1:
    return uart_write(p, len);
  case 2:
    return uart_write_err(p, len);
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x1,%eax
je     1157 <_write+0x37>
jmp    1146 <_write+0x26>
mov    -0x18(%rbp),%eax
sub    $0x2,%eax
je     116b <_write+0x4b>
jmp    117f <_write+0x5f>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <uart_write@plt>
mov    %eax,-0x4(%rbp)
jmp    1186 <_write+0x66>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <uart_write_err@plt>
mov    %eax,-0x4(%rbp)
jmp    1186 <_write+0x66>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write>:
cmp    $0x2,%edi
je     1134 <_write+0x14>
cmp    $0x1,%edi
jne    113e <_write+0x1e>
mov    %rsi,%rdi
mov    %edx,%esi
jmp    1040 <uart_write@plt>
mov    %rsi,%rdi
mov    %edx,%esi
jmp    1030 <uart_write_err@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @_write(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
switch i32 %8, label %17 [
i32 1, label %9
i32 2, label %13
]
9: ; preds = %3
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = call i32 @uart_write(i8* %10, i32 %11)
store i32 %12, i32* %4
br label %18
13: ; preds = %3
%14 = load i8*, i8** %6
%15 = load i32, i32* %7
%16 = call i32 @uart_write_err(i8* %14, i32 %15)
store i32 %16, i32* %4
br label %18
17: ; preds = %3
store i32 -1, i32* %4
br label %18
18: ; preds = %17, %13, %9
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
define i32 @_write(i32 %0, i8* %1, i32 %2) {
switch i32 %0, label %8 [
i32 1, label %4
i32 2, label %6
]
4: ; preds = %3
%5 = tail call i32 @uart_write(i8* %1, i32 %2)
br label %8
6: ; preds = %3
%7 = tail call i32 @uart_write_err(i8* %1, i32 %2)
br label %8
8: ; preds = %3, %6, %4
%9 = phi i32 [ %7, %6 ], [ %5, %4 ], [ -1, %3 ]
ret i32 %9
}
/* Variables and functions */
scalar_t__ palin(int);
int /*<<< orphan*/ printf(char *);
void main() {
  if (palin(123454321))
    printf("Its palindrome");
  else
    printf("Its not palindrome");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x75bc371,%edi
call   1040 <palin@plt>
cmp    $0x0,%rax
je     1149 <main+0x29>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
jmp    1155 <main+0x35>
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x75bc371,%edi
call   1040 <palin@plt>
test   %rax,%rax
lea    0xeda(%rip),%rax
lea    0xec4(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Its palindrome\00"
@.str.1 = [19 x i8] c"Its not palindrome\00"
define void @main() {
%1 = call i64 @palin(i32 123454321)
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Its palindrome\00"
@.str.1 = [19 x i8] c"Its not palindrome\00"
define void @main() {
%1 = tail call i64 @palin(i32 123454321)
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
%4 = tail call i32 @printf(i8* dereferenceable(1) %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, void *, int);
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
uint16_t get16(void *data) {
  union {
    char bytes[2];
    uint16_t all;
  } x;
  memcpy(x.bytes, data, 2);
  return (ntohs(x.all));
}


x86 assembly (clang, -O0):
<get16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x2,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%edi
call   1040 <ntohs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get16>:
push   %rax
mov    %rdi,%rsi
mov    %rsp,%rdi
mov    $0x2,%edx
call   1030 <memcpy@plt>
mov    (%rsp),%edi
call   1040 <ntohs@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
%union.anon = type { i32 }
define i32 @get16(i8* %0) {
%2 = alloca %union.anon
%3 = bitcast %union.anon* %2 to i8*
%4 = call i32 @memcpy(i8* %3, i8* %0, i32 2)
%5 = getelementptr inbounds %union.anon, %union.anon* %2, i64 0, i32 0
%6 = load i32, i32* %5
%7 = call i32 @ntohs(i32 %6)
ret i32 %7
}
void gtk_label_set_use_markup() {}


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

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

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

LLVM IR (-O2):
define void @gtk_label_set_use_markup() {
ret void
}
void array_3(void) {
  int *primes[] = {2, 3, 5, 7, 9, 11, 13};
  showarray_3(primes, 6);
}


x86 assembly (clang, -O0):
<array_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x38,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rdi
mov    $0x6,%esi
mov    $0x0,%al
call   1030 <showarray_3@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_3>:
sub    $0x38,%rsp
mov    0xf15(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1030 <showarray_3@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.array_3.primes = [7 x i32*] [i32* inttoptr (i64 2 to i32*), i32* inttoptr (i64 3 to i32*), i32* inttoptr (i64 5 to i32*), i32* inttoptr (i64 7 to i32*), i32* inttoptr (i64 9 to i32*), i32* inttoptr (i64 11 to i32*), i32* inttoptr (i64 13 to i32*)]
define void @array_3() {
%1 = alloca [7 x i32*]
%2 = bitcast [7 x i32*]* %1 to i8*
%3 = getelementptr inbounds [7 x i32*], [7 x i32*]* %1, i64 0, i64 0
%4 = call i32 (i32**, i32, ...) bitcast (i32 (...)* @showarray_3 to i32 (i32**, i32, ...)*)(i32** %3, i32 6)
ret void
}

LLVM IR (-O2):
@__const.array_3.primes = [7 x i32*] [i32* inttoptr (i64 2 to i32*), i32* inttoptr (i64 3 to i32*), i32* inttoptr (i64 5 to i32*), i32* inttoptr (i64 7 to i32*), i32* inttoptr (i64 9 to i32*), i32* inttoptr (i64 11 to i32*), i32* inttoptr (i64 13 to i32*)]
define void @array_3() {
%1 = alloca [7 x i32*]
%2 = bitcast [7 x i32*]* %1 to i8*
%3 = getelementptr inbounds [7 x i32*], [7 x i32*]* %1, i64 0, i64 0
%4 = call i32 (i32**, i32, ...) bitcast (i32 (...)* @showarray_3 to i32 (i32**, i32, ...)*)(i32** %3, i32 6)
ret void
}
/* Variables and functions */
double sqrt(double);
double Dist(double x, double y, double xx, double yy) {
  return sqrt((x - xx) * (x - xx) + (y - yy) * (y - yy));
}


x86 assembly (clang, -O0):
<Dist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
subsd  -0x18(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm3
subsd  -0x20(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Dist>:
subsd  %xmm2,%xmm0
subsd  %xmm3,%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1133 <Dist+0x23>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @Dist(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %7
%11 = fsub double %9, %10
%12 = load double, double* %5
%13 = load double, double* %7
%14 = fsub double %12, %13
%15 = load double, double* %6
%16 = load double, double* %8
%17 = fsub double %15, %16
%18 = load double, double* %6
%19 = load double, double* %8
%20 = fsub double %18, %19
%21 = fmul double %17, %20
%22 = call double @llvm.fmuladd.f64(double %11, double %14, double %21)
%23 = call double @sqrt(double %22)
ret double %23
}

LLVM IR (-O2):
define double @Dist(double %0, double %1, double %2, double %3) {
%5 = fsub double %0, %2
%6 = fsub double %1, %3
%7 = fmul double %6, %6
%8 = tail call double @llvm.fmuladd.f64(double %5, double %5, double %7)
%9 = tail call double @sqrt(double %8)
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void print_banner(char *prog) {
  printf("%s- Secure RSA based chat (c) by %s\n", prog,
         "Victor Dorneanu & Simon Gene");
}


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

x86 assembly (clang, -O2):
<print_banner>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
lea    0xf04(%rip),%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"%s- Secure RSA based chat (c) by %s\0A\00"
@.str.1 = [29 x i8] c"Victor Dorneanu & Simon Gene\00"
define void @print_banner(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %3, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"%s- Secure RSA based chat (c) by %s\0A\00"
@.str.1 = [29 x i8] c"Victor Dorneanu & Simon Gene\00"
define void @print_banner(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int lower(int c) { return (c >= 'A' && c <= 'Z') ? c - 'A' + 'a' : c; }


x86 assembly (clang, -O0):
<lower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     112c <lower+0x2c>
cmpl   $0x5a,-0x4(%rbp)
jg     112c <lower+0x2c>
mov    -0x4(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <lower+0x32>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @lower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 65
%11 = add nsw i32 %10, 97
br label %14
12: ; preds = %5, %1
%13 = load i32, i32* %2
br label %14
14: ; preds = %12, %8
%15 = phi i32 [ %11, %8 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @lower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
double Gam(int n) {
  if (n <= 1) {
    return 1;
  } else {
    return (double)(n - 1) * Gam(n - 1);
  }
}


x86 assembly (clang, -O0):
<Gam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jg     1137 <Gam+0x27>
movsd  0xed3(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1162 <Gam+0x52>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <Gam@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Gam>:
push   %rax
cmp    $0x1,%edi
jg     1120 <Gam+0x10>
movsd  0xee2(%rip),%xmm0
pop    %rax
ret
add    $0xffffffff,%edi
cvtsi2sd %edi,%xmm0
movsd  %xmm0,(%rsp)
call   1030 <Gam@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @Gam(i32 %0) {
%2 = alloca double
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store double 1.000000e+00, double* %2
br label %15
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 1
%10 = sitofp i32 %9 to double
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 1
%13 = call double @Gam(i32 %12)
%14 = fmul double %10, %13
store double %14, double* %2
br label %15
15: ; preds = %7, %6
%16 = load double, double* %2
ret double %16
}

LLVM IR (-O2):
define double @Gam(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi double [ %9, %5 ], [ 1.000000e+00, %1 ]
ret double %4
5: ; preds = %1
%6 = add nsw i32 %0, -1
%7 = sitofp i32 %6 to double
%8 = tail call double @Gam(i32 %6)
%9 = fmul double %8, %7
br label %3
}