xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ bubbleSort(int *, int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printArray(int *, int);
int main() {
  int A[] = {10, 2, 9, 4, 1, 7, 7, 6, 3, 8, 0};
  printArray(A, 11);
  bubbleSort(A, 11);
  printArray(A, 11);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xead(%rip),%rsi
mov    $0x2c,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xb,%esi
call   1060 <printArray@plt>
lea    -0x30(%rbp),%rdi
mov    $0xb,%esi
call   1030 <bubbleSort@plt>
lea    -0x30(%rbp),%rdi
mov    $0xb,%esi
call   1060 <printArray@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movups 0xee0(%rip),%xmm0
movups %xmm0,0x1c(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeac(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xb,%esi
call   1050 <printArray@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
call   1030 <bubbleSort@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
call   1050 <printArray@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.A = [11 x i32] [i32 10, i32 2, i32 9, i32 4, i32 1, i32 7, i32 7, i32 6, i32 3, i32 8, i32 0]
define i32 @main() {
%1 = alloca [11 x i32]
%2 = bitcast [11 x i32]* %1 to i8*
%3 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
%4 = call i32 @printArray(i32* %3, i32 11)
%5 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
%6 = call i32 @bubbleSort(i32* %5, i32 11)
%7 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
%8 = call i32 @printArray(i32* %7, i32 11)
%9 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@__const.main.A = [11 x i32] [i32 10, i32 2, i32 9, i32 4, i32 1, i32 7, i32 7, i32 6, i32 3, i32 8, i32 0]
define i32 @main() {
%1 = alloca [11 x i32]
%2 = bitcast [11 x i32]* %1 to i8*
%3 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
%4 = call i32 @printArray(i32* %3, i32 11)
%5 = call i32 @bubbleSort(i32* %3, i32 11)
%6 = call i32 @printArray(i32* %3, i32 11)
%7 = call i32 (...) @getchar()
ret i32 0
}
int isEven(int a) {
  if (a % 2 == 0) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<isEven>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1127 <isEven+0x27>
movl   $0x0,-0x4(%rbp)
jmp    112e <isEven+0x2e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @isEven(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = srem i32 %4, 2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %9
8: ; preds = %1
store i32 1, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @isEven(i32 %0) {
%2 = and i32 %0, 1
ret i32 %2
}
int _falmbGenericTextExtents() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_falmbGenericTextExtents() {
ret i32 0
}
/* Variables and functions */
char shift_letter(char, int);
char vigenere_decrypt_char(char cipherchar, char keychar) {
  int keychar_value = (int)keychar - 'a';
  return shift_letter(cipherchar, -keychar_value);
}


x86 assembly (clang, -O0):
<vigenere_decrypt_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
sub    $0x61,%eax
mov    %eax,-0x8(%rbp)
mov    -0x1(%rbp),%al
xor    %esi,%esi
sub    -0x8(%rbp),%esi
movsbl %al,%edi
call   1030 <shift_letter@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vigenere_decrypt_char>:
mov    $0x61,%eax
sub    %esi,%eax
mov    %eax,%esi
jmp    1030 <shift_letter@plt>

LLVM IR (-O0):
define signext i8 @vigenere_decrypt_char(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = sub nsw i32 %7, 97
store i32 %8, i32* %5
%9 = load i8, i8* %3
%10 = load i32, i32* %5
%11 = sub nsw i32 0, %10
%12 = call signext i8 @shift_letter(i8 signext %9, i32 %11)
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @vigenere_decrypt_char(i8 signext %0, i8 signext %1) {
%3 = sext i8 %1 to i32
%4 = sub nsw i32 97, %3
%5 = tail call signext i8 @shift_letter(i8 signext %0, i32 %4)
ret i8 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int ssl3_pending(int /*<<< orphan*/ const *);
int SSL_pending(const SSL *s) { return (ssl3_pending(s)); }


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

x86 assembly (clang, -O2):
<SSL_pending>:
jmp    1030 <ssl3_pending@plt>

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

LLVM IR (-O2):
define i32 @SSL_pending(i32* %0) {
%2 = tail call i32 @ssl3_pending(i32* %0)
ret i32 %2
}
void test_promote_or_convert(float f, float _Complex fc) {
  char *cp = promote_or_convert(fc);
  int *ip2 = promote_or_convert(f);
}


x86 assembly (clang, -O0):
<test_promote_or_convert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movlpd %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
movss  %xmm1,-0x20(%rbp)
movss  %xmm0,-0x1c(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    $0x1,%al
call   1030 <promote_or_convert@plt>
cltq
mov    %rax,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
call   1030 <promote_or_convert@plt>
cltq
mov    %rax,-0x28(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_promote_or_convert>:
push   %rax
movss  %xmm0,0x4(%rsp)
movaps %xmm1,%xmm0
mov    $0x1,%al
call   1030 <promote_or_convert@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
pop    %rcx
jmp    1030 <promote_or_convert@plt>

LLVM IR (-O0):
define void @test_promote_or_convert(float %0, <2 x float> %1) {
%3 = alloca { float, float }
%4 = alloca float
%5 = alloca i8*
%6 = alloca { float, float }
%7 = alloca i32*
%8 = bitcast { float, float }* %3 to <2 x float>*
store <2 x float> %1, <2 x float>* %8
store float %0, float* %4
%9 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%10 = load float, float* %9
%11 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
%12 = load float, float* %11
%13 = getelementptr inbounds { float, float }, { float, float }* %6, i32 0, i32 0
%14 = getelementptr inbounds { float, float }, { float, float }* %6, i32 0, i32 1
store float %10, float* %13
store float %12, float* %14
%15 = bitcast { float, float }* %6 to <2 x float>*
%16 = load <2 x float>, <2 x float>* %15
%17 = call i32 (<2 x float>, ...) bitcast (i32 (...)* @promote_or_convert to i32 (<2 x float>, ...)*)(<2 x float> %16)
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i8*
store i8* %19, i8** %5
%20 = load float, float* %4
%21 = fpext float %20 to double
%22 = call i32 (double, ...) bitcast (i32 (...)* @promote_or_convert to i32 (double, ...)*)(double %21)
%23 = sext i32 %22 to i64
%24 = inttoptr i64 %23 to i32*
store i32* %24, i32** %7
ret void
}

LLVM IR (-O2):
define void @test_promote_or_convert(float %0, <2 x float> %1) {
%3 = tail call i32 (<2 x float>, ...) bitcast (i32 (...)* @promote_or_convert to i32 (<2 x float>, ...)*)(<2 x float> %1)
%4 = fpext float %0 to double
%5 = tail call i32 (double, ...) bitcast (i32 (...)* @promote_or_convert to i32 (double, ...)*)(double %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void print2(char *msg) { puts(msg); }


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

x86 assembly (clang, -O2):
<print2>:
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
define void @print2(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret void
}
double test_nearbyint(double x) { return __builtin_nearbyint(x); }


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

x86 assembly (clang, -O2):
<test_nearbyint>:
jmp    1030 <nearbyint@plt>

LLVM IR (-O0):
define double @test_nearbyint(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.nearbyint.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @test_nearbyint(double %0) {
%2 = tail call double @llvm.nearbyint.f64(double %0)
ret double %2
}
/* Variables and functions */
void bit_array_set(void *array, size_t bit) {
  if (array) {
    size_t *size = (size_t *)array;
    if (bit < *size) {
      unsigned char *ptr = (unsigned char *)(size + 1);
      ptr[bit >> 3] |= (1U << (bit & 7));
    }
  }
}


x86 assembly (clang, -O0):
<bit_array_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1167 <bit_array_set+0x67>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
jae    1162 <bit_array_set+0x62>
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
and    $0x7,%rax
mov    %eax,%ecx
mov    $0x1,%esi
shl    %cl,%esi
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    $0x3,%rcx
movzbl (%rax,%rcx,1),%edx
or     %esi,%edx
mov    %dl,(%rax,%rcx,1)
jmp    1167 <bit_array_set+0x67>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_array_set>:
test   %rdi,%rdi
je     111b <bit_array_set+0x1b>
cmp    %rsi,(%rdi)
jbe    111b <bit_array_set+0x1b>
mov    %esi,%ecx
and    $0x7,%cl
mov    $0x1,%al
shl    %cl,%al
shr    $0x3,%rsi
or     %al,0x8(%rdi,%rsi,1)
ret

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

LLVM IR (-O2):
define void @bit_array_set(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %17, label %4
4: ; preds = %2
%5 = bitcast i8* %0 to i64*
%6 = load i64, i64* %5
%7 = icmp ugt i64 %6, %1
br i1 %7, label %8, label %17
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %0, i64 8
%10 = trunc i64 %1 to i8
%11 = and i8 %10, 7
%12 = shl nuw i8 1, %11
%13 = lshr i64 %1, 3
%14 = getelementptr inbounds i8, i8* %9, i64 %13
%15 = load i8, i8* %14
%16 = or i8 %15, %12
store i8 %16, i8* %14
br label %17
17: ; preds = %4, %8, %2
ret void
}
int fun992() { return 992; }


x86 assembly (clang, -O0):
<fun992>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3e0,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fun992() {
ret i32 992
}

LLVM IR (-O2):
define i32 @fun992() {
ret i32 992
}
/* Variables and functions */
int /*<<< orphan*/ ads_debug(int, char *);
int main(int argc, char **argv) {
  ads_debug(0x0, "Debug is working");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Debug is working\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @ads_debug(i32 0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Debug is working\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @ads_debug(i32 0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ system(char *);
void *scheduler1(void *variables1) {
  int vars;
  int *p_vars = (int *)variables1;
  vars = *p_vars;
  while (1) {
    system(
        "netstat -plantu | for l in 'cat /etc/vpn-helper-allow.conf' ; do grep "
        "-v $l ; done ; | grep -v rose | grep -v charlie | grep -v '0.0.0.0' | "
        "grep -v 'lis' | grep -v 'Address' | grep -v 'and' | awk '{print $5}' "
        "| cut -d : -f1  >> /etc/vpn-helper-forbidden.conf");
    sleep(vars);
  }
}


x86 assembly (clang, -O0):
<scheduler1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
lea    0xebc(%rip),%rdi
call   1030 <system@plt>
mov    -0xc(%rbp),%edi
call   1040 <sleep@plt>
jmp    113d <scheduler1+0x1d>

x86 assembly (clang, -O2):
<scheduler1>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
call   1030 <system@plt>
mov    %ebx,%edi
call   1040 <sleep@plt>
jmp    1130 <scheduler1+0x10>

LLVM IR (-O0):
@.str = [259 x i8] c"netstat -plantu | for l in 'cat /etc/vpn-helper-allow.conf' ; do grep -v $l ; done ; | grep -v rose | grep -v charlie | grep -v '0.0.0.0' | grep -v 'lis' | grep -v 'Address' | grep -v 'and' | awk '{print $5}' | cut -d : -f1 >> /etc/vpn-helper-forbidden.conf\00"
define i8* @scheduler1(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
store i32 %8, i32* %3
br label %9
9: ; preds = %1, %9
%10 = call i32 @system(i8* getelementptr inbounds ([259 x i8], [259 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %3
%12 = call i32 @sleep(i32 %11)
br label %9
}

LLVM IR (-O2):
@.str = [259 x i8] c"netstat -plantu | for l in 'cat /etc/vpn-helper-allow.conf' ; do grep -v $l ; done ; | grep -v rose | grep -v charlie | grep -v '0.0.0.0' | grep -v 'lis' | grep -v 'Address' | grep -v 'and' | awk '{print $5}' | cut -d : -f1 >> /etc/vpn-helper-forbidden.conf\00"
define noalias i8* @scheduler1(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
br label %4
4: ; preds = %4, %1
%5 = tail call i32 @system(i8* getelementptr inbounds ([259 x i8], [259 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @sleep(i32 %3)
br label %4
}
/* Type definitions */
struct pathspec {
  int dummy;
};

/* Variables and functions */
char *find_pathspecs_matching_skip_worktree(struct pathspec const *);
int matches_skip_worktree(const struct pathspec *pathspec, int item,
                          char **seen_ptr) {
  if (!*seen_ptr)
    *seen_ptr = find_pathspecs_matching_skip_worktree(pathspec);
  return (*seen_ptr)[item];
}


x86 assembly (clang, -O0):
<matches_skip_worktree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1144 <matches_skip_worktree+0x34>
mov    -0x8(%rbp),%rdi
call   1030 <find_pathspecs_matching_skip_worktree@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matches_skip_worktree>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    (%rdx),%rax
test   %rax,%rax
jne    1128 <matches_skip_worktree+0x18>
mov    %rdx,%rbx
call   1030 <find_pathspecs_matching_skip_worktree@plt>
mov    %rax,(%rbx)
movslq %ebp,%rcx
movsbl (%rax,%rcx,1),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.pathspec = type { i32 }
define i32 @matches_skip_worktree(%struct.pathspec* %0, i32 %1, i8** %2) {
%4 = alloca %struct.pathspec*
%5 = alloca i32
%6 = alloca i8**
store %struct.pathspec* %0, %struct.pathspec** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load i8**, i8*** %6
%8 = load i8*, i8** %7
%9 = icmp ne i8* %8, null
br i1 %9, label %14, label %10
10: ; preds = %3
%11 = load %struct.pathspec*, %struct.pathspec** %4
%12 = call i8* @find_pathspecs_matching_skip_worktree(%struct.pathspec* %11)
%13 = load i8**, i8*** %6
store i8* %12, i8** %13
br label %14
14: ; preds = %10, %3
%15 = load i8**, i8*** %6
%16 = load i8*, i8** %15
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
%struct.pathspec = type { i32 }
define i32 @matches_skip_worktree(%struct.pathspec* %0, i32 %1, i8** nocapture %2) {
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i8* @find_pathspecs_matching_skip_worktree(%struct.pathspec* %0)
store i8* %7, i8** %2
br label %8
8: ; preds = %6, %3
%9 = phi i8* [ %7, %6 ], [ %4, %3 ]
%10 = sext i32 %1 to i64
%11 = getelementptr inbounds i8, i8* %9, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
ret i32 %13
}
/* Variables and functions */
long *malloc(int);
int /*<<< orphan*/ printf(char *, long);
long sum(int, long *);
long main() {
  long *a;
  a = malloc(5 * 8);
  a[0] = 4;
  a[1] = 3;
  a[2] = 1;
  a[3] = 7;
  a[4] = 6;
  long s;
  s = sum(5, a);
  printf("sum=%d\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x28,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x4,(%rax)
mov    -0x10(%rbp),%rax
movq   $0x3,0x8(%rax)
mov    -0x10(%rbp),%rax
movq   $0x1,0x10(%rax)
mov    -0x10(%rbp),%rax
movq   $0x7,0x18(%rax)
mov    -0x10(%rbp),%rax
movq   $0x6,0x20(%rax)
mov    -0x10(%rbp),%rsi
mov    $0x5,%edi
call   1040 <sum@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe62(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x28,%edi
call   1050 <malloc@plt>
movaps 0xebe(%rip),%xmm0
movups %xmm0,(%rax)
movaps 0xec4(%rip),%xmm0
movups %xmm0,0x10(%rax)
movq   $0x6,0x20(%rax)
mov    $0x5,%edi
mov    %rax,%rsi
call   1040 <sum@plt>
lea    0xeb4(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"sum=%d\0A\00"
define i64 @main() {
%1 = tail call i64* @malloc(i32 40)
%2 = bitcast i64* %1 to <2 x i64>*
store <2 x i64> <i64 4, i64 3>, <2 x i64>* %2
%3 = getelementptr inbounds i64, i64* %1, i64 2
%4 = bitcast i64* %3 to <2 x i64>*
store <2 x i64> <i64 1, i64 7>, <2 x i64>* %4
%5 = getelementptr inbounds i64, i64* %1, i64 4
store i64 6, i64* %5
%6 = tail call i64 @sum(i32 5, i64* %1)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 %6)
ret i64 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
int file_char_stream_next(void *_self_data) {
  FILE *self_data = _self_data;
  return fgetc(self_data);
}


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

x86 assembly (clang, -O2):
<file_char_stream_next>:
jmp    1030 <fgetc@plt>

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

LLVM IR (-O2):
define i32 @file_char_stream_next(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @fgetc(i32* %2)
ret i32 %3
}
/* Variables and functions */
scalar_t__ is_dir_fast(char const *);
int is_directory(char const *, int);
int is_dir(const char path[]) {
  if (is_dir_fast(path)) {
    return 1;
  }
  return is_directory(path, 1);
}


x86 assembly (clang, -O0):
<is_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <is_dir_fast@plt>
cmp    $0x0,%rax
je     114b <is_dir+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    115c <is_dir+0x3c>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1040 <is_directory@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_dir>:
push   %rbx
mov    %rdi,%rbx
call   1030 <is_dir_fast@plt>
test   %rax,%rax
je     1135 <is_dir+0x15>
mov    $0x1,%eax
pop    %rbx
ret
mov    %rbx,%rdi
mov    $0x1,%esi
pop    %rbx
jmp    1040 <is_directory@plt>

LLVM IR (-O0):
define i32 @is_dir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @is_dir_fast(i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @is_directory(i8* %9, i32 1)
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_dir(i8* %0) {
%2 = tail call i64 @is_dir_fast(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @is_directory(i8* %0, i32 1)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ 1, %1 ]
ret i32 %7
}
int RECOIL_Get729Color(int c) {
  int r = c / 81;
  int g = c / 9 % 9;
  int b = c % 9;
  return r * 255 >> 3 << 16 | g * 255 >> 3 << 8 | b * 255 >> 3;
}


x86 assembly (clang, -O0):
<RECOIL_Get729Color>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x51,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
imul   $0xff,-0x8(%rbp),%eax
sar    $0x3,%eax
shl    $0x10,%eax
imul   $0xff,-0xc(%rbp),%ecx
sar    $0x3,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
imul   $0xff,-0x10(%rbp),%ecx
sar    $0x3,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RECOIL_Get729Color>:
movslq %edi,%rcx
imul   $0x1948b0fd,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rax
add    %edx,%eax
imul   $0x38e38e39,%rcx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x21,%rdx
add    %esi,%edx
movslq %edx,%rdx
imul   $0x38e38e39,%rdx,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
sar    $0x21,%rsi
add    %edi,%esi
lea    (%rsi,%rsi,8),%esi
lea    (%rdx,%rdx,8),%edi
sub    %esi,%edx
sub    %edi,%ecx
imul   $0x1fe000,%eax,%esi
and    $0xffff0000,%esi
imul   $0x1fe0,%edx,%edx
and    $0xffffff00,%edx
mov    %ecx,%eax
shl    $0x8,%eax
sub    %ecx,%eax
sar    $0x3,%eax
or     %esi,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @RECOIL_Get729Color(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 81
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = sdiv i32 %8, 9
%10 = srem i32 %9, 9
store i32 %10, i32* %4
%11 = load i32, i32* %2
%12 = srem i32 %11, 9
store i32 %12, i32* %5
%13 = load i32, i32* %3
%14 = mul nsw i32 %13, 255
%15 = ashr i32 %14, 3
%16 = shl i32 %15, 16
%17 = load i32, i32* %4
%18 = mul nsw i32 %17, 255
%19 = ashr i32 %18, 3
%20 = shl i32 %19, 8
%21 = or i32 %16, %20
%22 = load i32, i32* %5
%23 = mul nsw i32 %22, 255
%24 = ashr i32 %23, 3
%25 = or i32 %21, %24
ret i32 %25
}

LLVM IR (-O2):
define i32 @RECOIL_Get729Color(i32 %0) {
%2 = sdiv i32 %0, 81
%3 = sdiv i32 %0, 9
%4 = srem i32 %3, 9
%5 = srem i32 %0, 9
%6 = mul i32 %2, 2088960
%7 = and i32 %6, -65536
%8 = mul nsw i32 %4, 8160
%9 = and i32 %8, -256
%10 = mul nsw i32 %5, 255
%11 = ashr i32 %10, 3
%12 = or i32 %11, %7
%13 = or i32 %12, %9
ret i32 %13
}
/* Variables and functions */
scalar_t__ getch();
int pc_getkey() { return ((int)getch()); }


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

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

LLVM IR (-O0):
define i32 @pc_getkey() {
%1 = call i64 (...) @getch()
%2 = trunc i64 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @pc_getkey() {
%1 = tail call i64 (...) @getch()
%2 = trunc i64 %1 to i32
ret i32 %2
}
int lRound(double v) {
  if ((int)v - v >= 0.5)
    return (int)v + 1;
  else
    return (int)v;
}


x86 assembly (clang, -O0):
<lRound>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%eax
cvtsi2sd %eax,%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  0xee1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1139 <lRound+0x39>
cvttsd2si -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <lRound+0x41>
cvttsd2si -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lRound>:
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
subsd  %xmm0,%xmm1
ucomisd 0xeec(%rip),%xmm1
cvttsd2si %xmm0,%eax
sbb    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @lRound(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fptosi double %4 to i32
%6 = sitofp i32 %5 to double
%7 = load double, double* %3
%8 = fsub double %6, %7
%9 = fcmp oge double %8, 5.000000e-01
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load double, double* %3
%12 = fptosi double %11 to i32
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %17
14: ; preds = %1
%15 = load double, double* %3
%16 = fptosi double %15 to i32
store i32 %16, i32* %2
br label %17
17: ; preds = %14, %10
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @lRound(double %0) {
%2 = fptosi double %0 to i32
%3 = sitofp i32 %2 to double
%4 = fsub double %3, %0
%5 = fcmp oge double %4, 5.000000e-01
%6 = zext i1 %5 to i32
%7 = add nsw i32 %6, %2
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ report(int /*<<< orphan*/, char *);
void dumptab(const char *filename) { report(LOG_INFO, "No dumptab support!"); }


x86 assembly (clang, -O0):
<dumptab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
call   1030 <report@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumptab>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <report@plt>

LLVM IR (-O0):
@LOG_INFO = global i32 0
@.str = [20 x i8] c"No dumptab support!\00"
define void @dumptab(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @LOG_INFO
%4 = call i32 @report(i32 %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@LOG_INFO = global i32 0
@.str = [20 x i8] c"No dumptab support!\00"
define void @dumptab(i8* nocapture readnone %0) {
%2 = load i32, i32* @LOG_INFO
%3 = tail call i32 @report(i32 %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct in_addr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ inet_ntoa(struct in_addr);
char const *strncpy(char *, int /*<<< orphan*/, size_t);
const char *my_inet_ntop(int af, void *src, char *dst, size_t cnt) {
  return strncpy(dst, inet_ntoa(*(struct in_addr *)src), cnt);
}


x86 assembly (clang, -O0):
<my_inet_ntop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1040 <inet_ntoa@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
mov    -0x20(%rbp),%rdx
call   1030 <strncpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_inet_ntop>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%rbx
mov    (%rsi),%edi
call   1040 <inet_ntoa@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strncpy@plt>

LLVM IR (-O0):
%struct.in_addr = type { i32 }
define i8* @my_inet_ntop(i32 %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %7
%10 = load i8*, i8** %6
%11 = bitcast i8* %10 to %struct.in_addr*
%12 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %11, i32 0, i32 0
%13 = load i32, i32* %12
%14 = call i32 @inet_ntoa(i32 %13)
%15 = load i64, i64* %8
%16 = call i8* @strncpy(i8* %9, i32 %14, i64 %15)
ret i8* %16
}

LLVM IR (-O2):
define i8* @my_inet_ntop(i32 %0, i8* nocapture %1, i8* %2, i64 %3) {
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = tail call i32 @inet_ntoa(i32 %6)
%8 = tail call i8* @strncpy(i8* %2, i32 %7, i64 %3)
ret i8* %8
}
void load_config(void) {}


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

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

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

LLVM IR (-O2):
define void @load_config() {
ret void
}
void functhatdoesthings1(int a) {
  int blah = 45;
  float flah = 33.33;
  double dah = ((flah + blah) * 3) + 35;
}


x86 assembly (clang, -O0):
<functhatdoesthings1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x2d,-0x8(%rbp)
movss  0xef2(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
addss  %xmm1,%xmm0
movss  0xecf(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xec7(%rip),%xmm1
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @functhatdoesthings1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca double
store i32 %0, i32* %2
store i32 45, i32* %3
store float 0x4040AA3D80000000, float* %4
%6 = load float, float* %4
%7 = load i32, i32* %3
%8 = sitofp i32 %7 to float
%9 = fadd float %6, %8
%10 = call float @llvm.fmuladd.f32(float %9, float 3.000000e+00, float 3.500000e+01)
%11 = fpext float %10 to double
store double %11, double* %5
ret void
}

LLVM IR (-O2):
define void @functhatdoesthings1(i32 %0) {
ret void
}
int preco(int a) {
  if (a == 1)
    return 400;
  if (a == 2)
    return 450;
  if (a == 3)
    return 500;
  if (a == 4)
    return 200;
  if (a == 5)
    return 150;
  return 0;
}


x86 assembly (clang, -O0):
<preco>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    111d <preco+0x1d>
movl   $0x190,-0x4(%rbp)
jmp    117c <preco+0x7c>
cmpl   $0x2,-0x8(%rbp)
jne    1133 <preco+0x33>
movl   $0x1c2,-0x4(%rbp)
jmp    117c <preco+0x7c>
cmpl   $0x3,-0x8(%rbp)
jne    1149 <preco+0x49>
movl   $0x1f4,-0x4(%rbp)
jmp    117c <preco+0x7c>
cmpl   $0x4,-0x8(%rbp)
jne    115f <preco+0x5f>
movl   $0xc8,-0x4(%rbp)
jmp    117c <preco+0x7c>
cmpl   $0x5,-0x8(%rbp)
jne    1175 <preco+0x75>
movl   $0x96,-0x4(%rbp)
jmp    117c <preco+0x7c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<preco>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0x4,%edi
ja     1117 <preco+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @preco(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 400, i32* %2
br label %24
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 450, i32* %2
br label %24
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 3
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 500, i32* %2
br label %24
15: ; preds = %11
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 4
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 200, i32* %2
br label %24
19: ; preds = %15
%20 = load i32, i32* %3
%21 = icmp eq i32 %20, 5
br i1 %21, label %22, label %23
22: ; preds = %19
store i32 150, i32* %2
br label %24
23: ; preds = %19
store i32 0, i32* %2
br label %24
24: ; preds = %23, %22, %18, %14, %10, %6
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
@switch.table.preco = [5 x i32] [i32 400, i32 450, i32 500, i32 200, i32 150]
define i32 @preco(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 5
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [5 x i32], [5 x i32]* @switch.table.preco, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xa6() {
  Assert_real((isgraph(166) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              835, ("isgraph should be 0 for 0xa6"));
}


x86 assembly (clang, -O0):
<t_isgraph_0xa6>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa6,%edi
call   1040 <isgraph@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x343,%edx
lea    0xf5b(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0xa6>:
push   %rax
mov    $0xa6,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x343,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xa6\00"
define void @t_isgraph_0xa6() {
%1 = call i64 @isgraph(i32 166)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 835, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xa6\00"
define void @t_isgraph_0xa6() {
%1 = tail call i64 @isgraph(i32 166)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 835, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ calloc(size_t, size_t);
void *CALLOC(size_t nmemb, size_t size) { return (void *)calloc(nmemb, size); }


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

x86 assembly (clang, -O2):
<CALLOC>:
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i8* @CALLOC(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i64 @calloc(i64 %5, i64 %6)
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @CALLOC(i64 %0, i64 %1) {
%3 = tail call i64 @calloc(i64 %0, i64 %1)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void smpte_hbrmt_set_reference_for_time_stamp(uint8_t *p_hbrmt, uint8_t r) {
  p_hbrmt[2] |= (r & 0x3) << 6;
}


x86 assembly (clang, -O0):
<smpte_hbrmt_set_reference_for_time_stamp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0x3,%ecx
shl    $0x6,%ecx
mov    -0x8(%rbp),%rax
or     0x8(%rax),%ecx
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<smpte_hbrmt_set_reference_for_time_stamp>:
shl    $0x6,%esi
movzbl %sil,%eax
or     %eax,0x8(%rdi)
ret

LLVM IR (-O0):
define void @smpte_hbrmt_set_reference_for_time_stamp(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 3
%7 = shl i32 %6, 6
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 2
%10 = load i32, i32* %9
%11 = or i32 %10, %7
store i32 %11, i32* %9
ret void
}

LLVM IR (-O2):
define void @smpte_hbrmt_set_reference_for_time_stamp(i32* nocapture %0, i32 %1) {
%3 = shl i32 %1, 6
%4 = and i32 %3, 192
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %5
%7 = or i32 %6, %4
store i32 %7, i32* %5
ret void
}
/* Variables and functions */
int crc32init_be();
int crc32init_le();
int init_crc32(void) {
  int rc1, rc2, rc;
  rc1 = crc32init_le();
  rc2 = crc32init_be();
  rc = rc1 || rc2;
  return rc;
}


x86 assembly (clang, -O0):
<init_crc32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <crc32init_le@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <crc32init_be@plt>
mov    %eax,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0xd(%rbp)
jne    1155 <init_crc32+0x35>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_crc32>:
push   %rbx
xor    %eax,%eax
call   1030 <crc32init_le@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <crc32init_be@plt>
xor    %ecx,%ecx
or     %ebx,%eax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @init_crc32() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @crc32init_le()
store i32 %4, i32* %1
%5 = call i32 (...) @crc32init_be()
store i32 %5, i32* %2
%6 = load i32, i32* %1
%7 = icmp ne i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %0
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 0
br label %11
11: ; preds = %8, %0
%12 = phi i1 [ true, %0 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
store i32 %13, i32* %3
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @init_crc32() {
%1 = tail call i32 (...) @crc32init_le()
%2 = tail call i32 (...) @crc32init_be()
%3 = icmp ne i32 %1, 0
%4 = icmp ne i32 %2, 0
%5 = select i1 %3, i1 true, i1 %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int ata_acpi_push_id(struct ata_device *dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ata_device = type opaque
define i32 @ata_acpi_push_id(%struct.ata_device* nocapture readnone %0) {
ret i32 0
}
int inside(int y, int x) { return y >= 0 && y < 6 && x >= 0 && x < 7; }


x86 assembly (clang, -O0):
<inside>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jl     1141 <inside+0x41>
xor    %eax,%eax
cmpl   $0x6,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jge    1141 <inside+0x41>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jl     1141 <inside+0x41>
cmpl   $0x7,-0x8(%rbp)
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inside>:
cmp    $0x6,%edi
setb   %al
cmp    $0x7,%esi
setb   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @inside(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 = icmp sge i32 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 6
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i32, i32* %4
%12 = icmp sge i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 7
br label %16
16: ; preds = %13, %10, %7, %2
%17 = phi i1 [ false, %10 ], [ false, %7 ], [ false, %2 ], [ %15, %13 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @inside(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, 6
%4 = icmp ult i32 %1, 7
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int add1(int x) { return x + 1; }


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

x86 assembly (clang, -O2):
<add1>:
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @add1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @add1(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
void ovly_copy(unsigned long dst, unsigned long src, long size) {}


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

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

LLVM IR (-O0):
define void @ovly_copy(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
ret void
}

LLVM IR (-O2):
define void @ovly_copy(i64 %0, i64 %1, i64 %2) {
ret void
}
void pari_warn() {}


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

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

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

LLVM IR (-O2):
define void @pari_warn() {
ret void
}
void yyerror(s) char *s;
{ printf("%s\n", s); }


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

x86 assembly (clang, -O2):
<yyerror>:
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
define void @yyerror(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret void
}
double KMtoFT(double KM) { return KM * 3280.8399; }


x86 assembly (clang, -O0):
<KMtoFT>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @KMtoFT(double %0) {
%2 = fmul double %0, 0x40A9A1AE075F6FD2
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ FileGetLine(int /*<<< orphan*/ *, char *, int);
int sscanf(char *, char *, unsigned int *);
bool FileGetUnsigned(FILE *fp, unsigned *ptr) {
  char line[100];
  if (FileGetLine(fp, line, 100) && sscanf(line, "%u", ptr) == 1) {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<FileGetUnsigned>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x80(%rbp),%rsi
mov    $0x64,%edx
call   1040 <FileGetLine@plt>
cmp    $0x0,%rax
je     1178 <FileGetUnsigned+0x58>
lea    -0x80(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xea2(%rip),%rsi
call   1030 <sscanf@plt>
cmp    $0x1,%eax
jne    1178 <FileGetUnsigned+0x58>
movl   $0x1,-0x4(%rbp)
jmp    117f <FileGetUnsigned+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FileGetUnsigned>:
push   %rbx
sub    $0x70,%rsp
mov    %rsi,%rbx
mov    %rsp,%rsi
mov    $0x64,%edx
call   1040 <FileGetLine@plt>
test   %rax,%rax
je     1158 <FileGetUnsigned+0x38>
lea    0xebf(%rip),%rsi
mov    %rsp,%rdi
mov    %rbx,%rdx
call   1030 <sscanf@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x1,%ecx
je     115a <FileGetUnsigned+0x3a>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%u\00"
define i32 @FileGetUnsigned(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca [100 x i8]
store i32* %0, i32** %4
store i32* %1, i32** %5
%7 = load i32*, i32** %4
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%9 = call i64 @FileGetLine(i32* %7, i8* %8, i32 100)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%13 = load i32*, i32** %5
%14 = call i32 @sscanf(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %13)
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %17
16: ; preds = %11
store i32 1, i32* %3
br label %18
17: ; preds = %11, %2
store i32 0, i32* %3
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
define i32 @FileGetUnsigned(i32* %0, i32* %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = call i64 @FileGetLine(i32* %0, i8* %4, i32 100)
%6 = icmp eq i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%9 = icmp eq i32 %8, 1
br i1 %9, label %11, label %10
10: ; preds = %7, %2
br label %11
11: ; preds = %7, %10
%12 = phi i32 [ 0, %10 ], [ 1, %7 ]
ret i32 %12
}