xunge/DecIR huggingface dataset:
/* Type definitions */
struct wl_seat {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
void *wl_proxy_get_user_data(struct wl_proxy *);
void *wl_seat_get_user_data(struct wl_seat *wl_seat) {
  return wl_proxy_get_user_data((struct wl_proxy *)wl_seat);
}


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

x86 assembly (clang, -O2):
<wl_seat_get_user_data>:
jmp    1030 <wl_proxy_get_user_data@plt>

LLVM IR (-O0):
%struct.wl_seat = type { i32 }
%struct.wl_proxy = type { i32 }
define i8* @wl_seat_get_user_data(%struct.wl_seat* %0) {
%2 = alloca %struct.wl_seat*
store %struct.wl_seat* %0, %struct.wl_seat** %2
%3 = load %struct.wl_seat*, %struct.wl_seat** %2
%4 = bitcast %struct.wl_seat* %3 to %struct.wl_proxy*
%5 = call i8* @wl_proxy_get_user_data(%struct.wl_proxy* %4)
ret i8* %5
}

LLVM IR (-O2):
%struct.wl_seat = type { i32 }
%struct.wl_proxy = type { i32 }
define i8* @wl_seat_get_user_data(%struct.wl_seat* %0) {
%2 = bitcast %struct.wl_seat* %0 to %struct.wl_proxy*
%3 = tail call i8* @wl_proxy_get_user_data(%struct.wl_proxy* %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ UARTprintf(char *);
void NmiSR(void) {
  while (1) {
    UARTprintf("NmiSR\r\n");
  }
}


x86 assembly (clang, -O0):
<NmiSR>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <NmiSR+0x9>
lea    0xee0(%rip),%rdi
call   1030 <UARTprintf@plt>
jmp    1119 <NmiSR+0x9>

x86 assembly (clang, -O2):
<NmiSR>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <UARTprintf@plt>
jmp    1120 <NmiSR+0x10>

LLVM IR (-O0):
@.str = [8 x i8] c"NmiSR\0D\0A\00"
define void @NmiSR() {
br label %1
1: ; preds = %0, %1
%2 = call i32 @UARTprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"NmiSR\0D\0A\00"
define void @NmiSR() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @UARTprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %1
}
/* Variables and functions */
scalar_t__ str_value();
int is_end() {
  if (str_value() == 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <str_value@plt>
cmp    $0x0,%rax
jne    1135 <is_end+0x25>
movl   $0x1,-0x4(%rbp)
jmp    113c <is_end+0x2c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_end>:
push   %rax
xor    %eax,%eax
call   1030 <str_value@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_end() {
%1 = alloca i32
%2 = call i64 (...) @str_value()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %6
5: ; preds = %0
store i32 0, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_end() {
%1 = tail call i64 (...) @str_value()
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ b(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[], char *envp[]) {
  printf("a(%d)\n", argc);
  b(argc + argc + argc);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
lea    (%rbx,%rbx,2),%edi
call   1030 <b@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"a(%d)\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = mul nsw i32 %0, 3
%6 = tail call i32 @b(i32 %5)
ret i32 0
}
int test_imm_79uint8_reg(unsigned char val) {
  return ((val) & (0x79 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_79uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x79,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_79uint8_reg>:
test   $0x79,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_79uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 121
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int doSomething(int (*f)(int, int), int a, int b) { return (f(a, b)); }


x86 assembly (clang, -O0):
<doSomething>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doSomething>:
mov    %rdi,%rax
mov    %esi,%edi
mov    %edx,%esi
jmp    *%rax

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

LLVM IR (-O2):
define i32 @doSomething(i32 (i32, i32)* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 %0(i32 %1, i32 %2)
ret i32 %4
}
int dot(int *input1, int *input2) {
  return ((input1[0] * input2[0]) + (input1[1] * input2[1]) +
          (input1[2] * input2[2]));
}


x86 assembly (clang, -O0):
<dot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
imul   (%rcx),%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
mov    -0x10(%rbp),%rdx
imul   0x4(%rdx),%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
mov    -0x10(%rbp),%rdx
imul   0x8(%rdx),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dot>:
mov    (%rsi),%eax
imul   (%rdi),%eax
mov    0x4(%rsi),%ecx
imul   0x4(%rdi),%ecx
add    %eax,%ecx
mov    0x8(%rsi),%eax
imul   0x8(%rdi),%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @dot(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 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = mul nsw i32 %7, %10
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32, i32* %13
%15 = load i32*, i32** %4
%16 = getelementptr inbounds i32, i32* %15, i64 1
%17 = load i32, i32* %16
%18 = mul nsw i32 %14, %17
%19 = add nsw i32 %11, %18
%20 = load i32*, i32** %3
%21 = getelementptr inbounds i32, i32* %20, i64 2
%22 = load i32, i32* %21
%23 = load i32*, i32** %4
%24 = getelementptr inbounds i32, i32* %23, i64 2
%25 = load i32, i32* %24
%26 = mul nsw i32 %22, %25
%27 = add nsw i32 %19, %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @dot(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %3
%6 = getelementptr inbounds i32, i32* %0, i64 1
%7 = load i32, i32* %6
%8 = getelementptr inbounds i32, i32* %1, i64 1
%9 = load i32, i32* %8
%10 = mul nsw i32 %9, %7
%11 = add nsw i32 %10, %5
%12 = getelementptr inbounds i32, i32* %0, i64 2
%13 = load i32, i32* %12
%14 = getelementptr inbounds i32, i32* %1, i64 2
%15 = load i32, i32* %14
%16 = mul nsw i32 %15, %13
%17 = add nsw i32 %11, %16
ret i32 %17
}
double gas_dens(double molmass, double pressure, double temperature) {
  double r = 8.3144598;
  double gd = ((molmass * pressure) / (r * temperature));
  return gd;
}


x86 assembly (clang, -O0):
<gas_dens>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xee5(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<gas_dens>:
mulsd  %xmm1,%xmm0
mulsd  0xef4(%rip),%xmm2
divsd  %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define double @gas_dens(double %0, double %1, double %2) {
%4 = fmul double %0, %1
%5 = fmul double %2, 0x4020A100DFF9D03B
%6 = fdiv double %4, %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float, float, ...);
int main(void) {
  int i = 40;
  float x = 839.21f;
  printf("|%d|%5d|%-5d|%5.3d|\n", i, i, i, i);
  printf("|%10.3f|%10.3e|%-10g|\n", x, x, x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x28,-0x8(%rbp)
movss  0xed2(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
cvtsi2ssl -0x8(%rbp),%xmm2
mov    -0x8(%rbp),%esi
lea    0xeb8(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
lea    0xeb0(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movss  0xee0(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
mov    $0x28,%esi
mov    $0x3,%al
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
movss  0xec3(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
mov    $0x3,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"|%d|%5d|%-5d|%5.3d|\0A\00"
@.str.1 = [23 x i8] c"|%10.3f|%10.3e|%-10g|\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
store i32 40, i32* %2
store float 0x408A39AE20000000, float* %3
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to float
%6 = load i32, i32* %2
%7 = sitofp i32 %6 to float
%8 = load i32, i32* %2
%9 = sitofp i32 %8 to float
%10 = load i32, i32* %2
%11 = call i32 (i8*, float, float, float, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), float %5, float %7, float %9, i32 %10)
%12 = load float, float* %3
%13 = load float, float* %3
%14 = load float, float* %3
%15 = call i32 (i8*, float, float, float, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), float %12, float %13, float %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"|%d|%5d|%-5d|%5.3d|\0A\00"
@.str.1 = [23 x i8] c"|%10.3f|%10.3e|%-10g|\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, float, float, float, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), float 4.000000e+01, float 4.000000e+01, float 4.000000e+01, i32 40)
%2 = tail call i32 (i8*, float, float, float, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), float 0x408A39AE20000000, float 0x408A39AE20000000, float 0x408A39AE20000000)
ret i32 0
}
int test_imm_C5uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xC5 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_C5uint64_lowword_reg>:
test   $0xc5,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C5uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 197
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void bar() {
  printf("====================================================================="
         "===========\n");
}


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

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

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

LLVM IR (-O2):
@str = [81 x i8] c"================================================================================\00"
define void @bar() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *strchr(char *, char);
int get64Pos(char c) {
  char dict[] =
      "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  char *posp = strchr(dict, c);
  return (posp) ? (posp - dict) : 0;
}


x86 assembly (clang, -O0):
<get64Pos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x41,%edx
call   1040 <memcpy@plt>
lea    -0x50(%rbp),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
je     1173 <get64Pos+0x53>
mov    -0x58(%rbp),%rax
lea    -0x50(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x60(%rbp)
jmp    117e <get64Pos+0x5e>
xor    %eax,%eax
mov    %rax,-0x60(%rbp)
jmp    117e <get64Pos+0x5e>
mov    -0x60(%rbp),%rax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get64Pos>:
push   %rbx
sub    $0x50,%rsp
mov    %edi,%esi
movaps 0xf12(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xef6(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeda(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebe(%rip),%xmm0
movaps %xmm0,(%rsp)
movb   $0x0,0x40(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strchr@plt>
mov    %eax,%edx
sub    %ebx,%edx
xor    %ecx,%ecx
test   %rax,%rax
cmovne %edx,%ecx
mov    %ecx,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.get64Pos.dict = [65 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\00"
define i32 @get64Pos(i8 signext %0) {
%2 = alloca i8
%3 = alloca [65 x i8]
%4 = alloca i8*
store i8 %0, i8* %2
%5 = bitcast [65 x i8]* %3 to i8*
%6 = getelementptr inbounds [65 x i8], [65 x i8]* %3, i64 0, i64 0
%7 = load i8, i8* %2
%8 = call i8* @strchr(i8* %6, i8 signext %7)
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %17
11: ; preds = %1
%12 = load i8*, i8** %4
%13 = getelementptr inbounds [65 x i8], [65 x i8]* %3, i64 0, i64 0
%14 = ptrtoint i8* %12 to i64
%15 = ptrtoint i8* %13 to i64
%16 = sub i64 %14, %15
br label %18
17: ; preds = %1
br label %18
18: ; preds = %17, %11
%19 = phi i64 [ %16, %11 ], [ 0, %17 ]
%20 = trunc i64 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
@__const.get64Pos.dict = [65 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\00"
define i32 @get64Pos(i8 signext %0) {
%2 = alloca [65 x i8]
%3 = getelementptr inbounds [65 x i8], [65 x i8]* %2, i64 0, i64 0
%4 = call i8* @strchr(i8* %3, i8 signext %0)
%5 = icmp eq i8* %4, null
%6 = ptrtoint i8* %4 to i64
%7 = ptrtoint [65 x i8]* %2 to i64
%8 = sub i64 %6, %7
%9 = trunc i64 %8 to i32
%10 = select i1 %5, i32 0, i32 %9
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __builtin_ctz(unsigned int);
uint32_t chpl_bitops_ctz_32(unsigned int x) { return x ? __builtin_ctz(x) : 0; }


x86 assembly (clang, -O0):
<chpl_bitops_ctz_32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     111f <chpl_bitops_ctz_32+0x1f>
mov    -0x4(%rbp),%eax
bsf    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <chpl_bitops_ctz_32+0x29>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <chpl_bitops_ctz_32+0x29>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chpl_bitops_ctz_32>:
bsf    %edi,%eax
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @chpl_bitops_ctz_32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @llvm.cttz.i32(i32 %6, i1 true)
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi i32 [ %7, %5 ], [ 0, %8 ]
ret i32 %10
}

LLVM IR (-O2):
define i32 @chpl_bitops_ctz_32(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = tail call i32 @llvm.cttz.i32(i32 %0, i1 true)
%4 = select i1 %2, i32 0, i32 %3
ret i32 %4
}
void hwInitCriticalPeripherals(void) {}


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

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

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

LLVM IR (-O2):
define void @hwInitCriticalPeripherals() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Get_Time_From_tm(char *, struct tm *);
struct tm *localtime(int /*<<< orphan*/ *);
void Get_Time_From_time_t(char *curr_time, time_t *rawtime) {
  struct tm *timeinfo;
  timeinfo = localtime(rawtime);
  Get_Time_From_tm(curr_time, timeinfo);
}


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

x86 assembly (clang, -O2):
<Get_Time_From_time_t>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <localtime@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1040 <Get_Time_From_tm@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define void @Get_Time_From_time_t(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca %struct.tm*
store i8* %0, i8** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = call %struct.tm* @localtime(i32* %6)
store %struct.tm* %7, %struct.tm** %5
%8 = load i8*, i8** %3
%9 = load %struct.tm*, %struct.tm** %5
%10 = call i32 @Get_Time_From_tm(i8* %8, %struct.tm* %9)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define void @Get_Time_From_time_t(i8* %0, i32* %1) {
%3 = tail call %struct.tm* @localtime(i32* %1)
%4 = tail call i32 @Get_Time_From_tm(i8* %0, %struct.tm* %3)
ret void
}
void TCC_DeinitalizeVIQE() {}


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

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

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

LLVM IR (-O2):
define void @TCC_DeinitalizeVIQE() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_goldfish_tty();
void module_init() { init_goldfish_tty(); }


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

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

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

LLVM IR (-O2):
define void @module_init() {
%1 = tail call i32 (...) @init_goldfish_tty()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_ruby_comment_entities();
int /*<<< orphan*/ test_ruby_comments();
void all_ruby_tests() {
  test_ruby_comments();
  test_ruby_comment_entities();
}


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

x86 assembly (clang, -O2):
<all_ruby_tests>:
push   %rax
xor    %eax,%eax
call   1030 <test_ruby_comments@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <test_ruby_comment_entities@plt>

LLVM IR (-O0):
define void @all_ruby_tests() {
%1 = call i32 (...) @test_ruby_comments()
%2 = call i32 (...) @test_ruby_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_ruby_tests() {
%1 = tail call i32 (...) @test_ruby_comments()
%2 = tail call i32 (...) @test_ruby_comment_entities()
ret void
}
/* Variables and functions */
int __gthread_active_p(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__gthread_active_p() {
ret i32 0
}
void X509_CRL_get_ext_count(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_CRL_get_ext_count() {
ret void
}
/* Variables and functions */
int tcflush(int /*<<< orphan*/, int /*<<< orphan*/);
int main(void) { return tcflush(0, 0); }


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

x86 assembly (clang, -O2):
<main>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <tcflush@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @tcflush(i32 0, i32 0)
ret i32 %1
}
int test_imm_22int8_mem(signed char *val) {
  return ((*val) & (-0x22 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_22int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -34
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ getline(char **, size_t *, int /*<<< orphan*/ *);
ssize_t agetline(char **p, size_t *size, FILE *fp) {
  return getline(p, size, fp);
}


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

x86 assembly (clang, -O2):
<agetline>:
jmp    1030 <getline@plt>

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

LLVM IR (-O2):
define i32 @agetline(i8** %0, i64* %1, i32* %2) {
%4 = tail call i32 @getline(i8** %0, i64* %1, i32* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: testcall [-?] [-v] [-i] [-s SILENCE_THRESHOLD] [-u "
                  "USERNAME -p PASSWORD -h HOST]\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [89 x i8] c"Usage: testcall [-?] [-v] [-i] [-s SILENCE_THRESHOLD] [-u USERNAME -p PASSWORD -h HOST]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [89 x i8] c"Usage: testcall [-?] [-v] [-i] [-s SILENCE_THRESHOLD] [-u USERNAME -p PASSWORD -h HOST]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
char *strchr(const char *s, int c) {
  while (*s != (char)c) {
    if (!*s)
      return ((void *)0);
    s++;
  }
  return (char *)s;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x14(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
je     114b <strchr+0x4b>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    113a <strchr+0x3a>
movq   $0x0,-0x8(%rbp)
jmp    1153 <strchr+0x53>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <strchr+0xb>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
movsbl %sil,%ecx
movsbl (%rdi),%edx
cmp    %edx,%ecx
je     1120 <strchr+0x20>
xchg   %ax,%ax
test   %dl,%dl
je     1121 <strchr+0x21>
movsbl 0x1(%rax),%edx
add    $0x1,%rax
cmp    %edx,%ecx
jne    1110 <strchr+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @strchr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
br label %6
6: ; preds = %19, %2
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = load i32, i32* %5
%11 = trunc i32 %10 to i8
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %9, %12
br i1 %13, label %14, label %22
14: ; preds = %6
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = icmp ne i8 %16, 0
br i1 %17, label %19, label %18
18: ; preds = %14
store i8* null, i8** %3
br label %24
19: ; preds = %14
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %4
br label %6
22: ; preds = %6
%23 = load i8*, i8** %4
store i8* %23, i8** %3
br label %24
24: ; preds = %22, %18
%25 = load i8*, i8** %3
ret i8* %25
}

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
%5 = load i8, i8* %0
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %4, %6
br i1 %7, label %17, label %8
8: ; preds = %2, %12
%9 = phi i8 [ %14, %12 ], [ %5, %2 ]
%10 = phi i8* [ %13, %12 ], [ %0, %2 ]
%11 = icmp eq i8 %9, 0
br i1 %11, label %17, label %12
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %4, %15
br i1 %16, label %17, label %8
17: ; preds = %8, %12, %2
%18 = phi i8* [ %0, %2 ], [ %13, %12 ], [ null, %8 ]
ret i8* %18
}
int mystrlen(char *s) {
  int i = 0;
  while (s[i]) {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<mystrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     112f <mystrlen+0x2f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <mystrlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <mystrlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @mystrlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
double Timer();
double Runtime(void) { return Timer(); }


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

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

LLVM IR (-O0):
define double @Runtime() {
%1 = call double (...) @Timer()
ret double %1
}

LLVM IR (-O2):
define double @Runtime() {
%1 = tail call double (...) @Timer()
ret double %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("concrete contains gravel and cement.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"concrete contains gravel and cement.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [37 x i8] c"concrete contains gravel and cement.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ closelog();
void joe_closelog(void) {
  closelog();
  return;
}


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

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

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

LLVM IR (-O2):
define void @joe_closelog() {
%1 = tail call i32 (...) @closelog()
ret void
}
AR0AX1(r0, r1, x0, x1, p0, p1) char r0, r1;
char *p0, *p1;
{ (p0[10000000]) = (((char *)11111111)[x1]); }


x86 assembly (clang, -O0):
<AR0AX1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movslq -0x10(%rbp),%rcx
mov    $0xa98ac7,%eax
mov    (%rax,%rcx,1),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x989680(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AR0AX1>:
movslq %ecx,%rax
mov    0xa98ac7(%rax),%al
mov    %al,0x989680(%r8)
ret

LLVM IR (-O0):
define i32 @AR0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = trunc i32 %0 to i8
%15 = trunc i32 %1 to i8
store i8 %14, i8* %8
store i8 %15, i8* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%16 = load i32, i32* %11
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* inttoptr (i64 11111111 to i8*), i64 %17
%19 = load i8, i8* %18
%20 = load i8*, i8** %12
%21 = getelementptr inbounds i8, i8* %20, i64 10000000
store i8 %19, i8* %21
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @AR0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture writeonly %4, i8* nocapture readnone %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i8, i8* inttoptr (i64 11111111 to i8*), i64 %7
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %4, i64 10000000
store i8 %9, i8* %10
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int fread(void *, int, int, int /*<<< orphan*/ *);
scalar_t__ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int s_read(void *user, int offset, void *buf, int size) {
  FILE *f = user;
  if (fseek(f, offset, SEEK_SET) != 0)
    return 0;
  return fread(buf, 1, size, f);
}


x86 assembly (clang, -O0):
<s_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    0x2e94(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
cmp    $0x0,%rax
je     1169 <s_read+0x49>
movl   $0x0,-0x4(%rbp)
jmp    1181 <s_read+0x61>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%edx
mov    -0x30(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_read>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %rdx,%rbp
mov    %rdi,%rbx
mov    0x2eac(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
test   %rax,%rax
je     1147 <s_read+0x27>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %rbp,%rdi
mov    $0x1,%esi
mov    %r14d,%edx
mov    %rbx,%rcx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fread@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @s_read(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
%11 = load i8*, i8** %6
%12 = bitcast i8* %11 to i32*
store i32* %12, i32** %10
%13 = load i32*, i32** %10
%14 = load i32, i32* %7
%15 = load i32, i32* @SEEK_SET
%16 = call i64 @fseek(i32* %13, i32 %14, i32 %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %4
store i32 0, i32* %5
br label %24
19: ; preds = %4
%20 = load i8*, i8** %8
%21 = load i32, i32* %9
%22 = load i32*, i32** %10
%23 = call i32 @fread(i8* %20, i32 1, i32 %21, i32* %22)
store i32 %23, i32* %5
br label %24
24: ; preds = %19, %18
%25 = load i32, i32* %5
ret i32 %25
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @s_read(i8* nocapture %0, i32 %1, i8* nocapture %2, i32 %3) {
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* @SEEK_SET
%7 = tail call i64 @fseek(i32* %5, i32 %1, i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 @fread(i8* %2, i32 1, i32 %3, i32* %5)
br label %11
11: ; preds = %4, %9
%12 = phi i32 [ %10, %9 ], [ 0, %4 ]
ret i32 %12
}
const volatile unsigned char *
find_data_start(const volatile unsigned char *r1ptr) {
  ++r1ptr;
  while (*r1ptr != 0xfe)
    ++r1ptr;
  return r1ptr + 1;
}


x86 assembly (clang, -O0):
<find_data_start>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
movzbl %al,%eax
cmp    $0xfe,%eax
je     1139 <find_data_start+0x39>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <find_data_start+0x14>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_data_start>:
mov    %rdi,%rax
add    $0x1,%rax
nopw   0x0(%rax,%rax,1)
movzbl (%rax),%ecx
add    $0x1,%rax
cmp    $0xfe,%cl
jne    1110 <find_data_start+0x10>
ret

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

LLVM IR (-O2):
define i8* @find_data_start(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load volatile i8, i8* %4
%6 = icmp eq i8 %5, -2
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %3, i64 2
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ F_SETFL;
int /*<<< orphan*/ O_NONBLOCK;
int /*<<< orphan*/ fcntl(int, int /*<<< orphan*/, int /*<<< orphan*/);
void make_nonblocking(int fd) { fcntl(fd, F_SETFL, O_NONBLOCK); }


x86 assembly (clang, -O0):
<make_nonblocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
mov    0x2eba(%rip),%rax
mov    (%rax),%edx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_nonblocking>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    0x2ec8(%rip),%rax
mov    (%rax),%edx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @make_nonblocking(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_SETFL
%5 = load i32, i32* @O_NONBLOCK
%6 = call i32 @fcntl(i32 %3, i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @make_nonblocking(i32 %0) {
%2 = load i32, i32* @F_SETFL
%3 = load i32, i32* @O_NONBLOCK
%4 = tail call i32 @fcntl(i32 %0, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ computeUniformColorLUTD();
int /*<<< orphan*/ computeUniformColorLUTI();
int /*<<< orphan*/ computeUniformColorLUTP();
int /*<<< orphan*/ computeUniformColorLUTT();
void computeUniformColorLUT() {
  computeUniformColorLUTI();
  computeUniformColorLUTD();
  computeUniformColorLUTT();
  computeUniformColorLUTP();
}


x86 assembly (clang, -O0):
<computeUniformColorLUT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <computeUniformColorLUTI@plt>
mov    $0x0,%al
call   1060 <computeUniformColorLUTD@plt>
mov    $0x0,%al
call   1040 <computeUniformColorLUTT@plt>
mov    $0x0,%al
call   1050 <computeUniformColorLUTP@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<computeUniformColorLUT>:
push   %rax
xor    %eax,%eax
call   1030 <computeUniformColorLUTI@plt>
xor    %eax,%eax
call   1060 <computeUniformColorLUTD@plt>
xor    %eax,%eax
call   1040 <computeUniformColorLUTT@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <computeUniformColorLUTP@plt>

LLVM IR (-O0):
define void @computeUniformColorLUT() {
%1 = call i32 (...) @computeUniformColorLUTI()
%2 = call i32 (...) @computeUniformColorLUTD()
%3 = call i32 (...) @computeUniformColorLUTT()
%4 = call i32 (...) @computeUniformColorLUTP()
ret void
}

LLVM IR (-O2):
define void @computeUniformColorLUT() {
%1 = tail call i32 (...) @computeUniformColorLUTI()
%2 = tail call i32 (...) @computeUniformColorLUTD()
%3 = tail call i32 (...) @computeUniformColorLUTT()
%4 = tail call i32 (...) @computeUniformColorLUTP()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gpio_output(char const *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void gpio_export(int gpioNr) {
  const char *filename = "/sys/class/gpio/export";
  char buf[(128)];
  sprintf(buf, "%d", gpioNr);
  gpio_output(filename, buf);
}


x86 assembly (clang, -O0):
<gpio_export>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
lea    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xecd(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1030 <gpio_output@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_export>:
push   %rbx
sub    $0x80,%rsp
mov    %edi,%edx
lea    0xee6(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
lea    0xebd(%rip),%rdi
mov    %rbx,%rsi
call   1030 <gpio_output@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"/sys/class/gpio/export\00"
@.str.1 = [3 x i8] c"%d\00"
define void @gpio_export(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [128 x i8]
store i32 %0, i32* %2
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8** %3
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i8*, i8** %3
%9 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%10 = call i32 @gpio_output(i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"/sys/class/gpio/export\00"
@.str.1 = [3 x i8] c"%d\00"
define void @gpio_export(i32 %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%5 = call i32 @gpio_output(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
double get_dA(const int atom_i, const int cart_i, const int cart_j,
              const double *born) {
  return born[atom_i * 9 + cart_j * 3 + cart_i];
}


x86 assembly (clang, -O0):
<get_dA>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
imul   $0x9,-0x4(%rbp),%ecx
imul   $0x3,-0xc(%rbp),%edx
add    %edx,%ecx
add    -0x8(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dA>:
lea    (%rdi,%rdi,8),%eax
lea    (%rdx,%rdx,2),%edx
add    %esi,%eax
add    %edx,%eax
cltq
movsd  (%rcx,%rax,8),%xmm0
ret

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

LLVM IR (-O2):
define double @get_dA(i32 %0, i32 %1, i32 %2, double* nocapture %3) {
%5 = mul nsw i32 %0, 9
%6 = mul nsw i32 %2, 3
%7 = add i32 %5, %1
%8 = add i32 %7, %6
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds double, double* %3, i64 %9
%11 = load double, double* %10
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Only builds on OS X :(\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"Only builds on OS X :(\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"Only builds on OS X :(\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ snprintf(char *, int, char *, long const);
char *valuedup(const long int value) {
  char *dec;
  dec = malloc(21);
  memset(dec, 0, 21);
  snprintf(dec, 21, "%ld", value);
  return dec;
}


x86 assembly (clang, -O0):
<valuedup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x15,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x15,%edx
call   1040 <memset@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x15,%esi
lea    0xe92(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<valuedup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x15,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x15,%edx
call   1040 <memset@plt>
lea    0xea6(%rip),%rdx
mov    %rbx,%rdi
mov    $0x15,%esi
mov    %r14,%rcx
call   1030 <snprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
define i8* @valuedup(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = call i8* @malloc(i32 21)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @memset(i8* %5, i32 0, i32 21)
%7 = load i8*, i8** %3
%8 = load i64, i64* %2
%9 = call i32 @snprintf(i8* %7, i32 21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %8)
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define i8* @valuedup(i64 %0) {
%2 = tail call dereferenceable_or_null(21) i8* @malloc(i32 21)
%3 = tail call i32 @memset(i8* %2, i32 0, i32 21)
%4 = tail call i32 @snprintf(i8* %2, i32 21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
ret i8* %2
}