xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int);
int /*<<< orphan*/ stderr;
int strlen(char *);
int keylen(char *str) {
  int len = strlen(str);
  if (len < 0 || len >= 128)
    fprintf(stderr, "Warning: rxt key (%d) exceeds limit (%d)\n", len, 128);
  return 8 * (len + 1) - 1;
}


x86 assembly (clang, -O0):
<keylen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     114f <keylen+0x2f>
cmpl   $0x80,-0xc(%rbp)
jl     116c <keylen+0x4c>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
lea    0xe9e(%rip),%rsi
mov    $0x80,%ecx
call   1040 <fprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
shl    $0x3,%eax
sub    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keylen>:
push   %rbx
call   1030 <strlen@plt>
mov    %eax,%ebx
cmp    $0x80,%eax
jb     114b <keylen+0x2b>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
mov    %ebx,%edx
mov    $0x80,%ecx
call   1040 <fprintf@plt>
lea    0x7(,%rbx,8),%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"Warning: rxt key (%d) exceeds limit (%d)\0A\00"
define i32 @keylen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp sge i32 %9, 128
br i1 %10, label %11, label %15
11: ; preds = %8, %1
%12 = load i32, i32* @stderr
%13 = load i32, i32* %3
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %13, i32 128)
br label %15
15: ; preds = %11, %8
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
%18 = mul nsw i32 8, %17
%19 = sub nsw i32 %18, 1
ret i32 %19
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"Warning: rxt key (%d) exceeds limit (%d)\0A\00"
define i32 @keylen(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp ugt i32 %2, 127
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %2, i32 128)
br label %7
7: ; preds = %1, %4
%8 = shl i32 %2, 3
%9 = or i32 %8, 7
ret i32 %9
}
int adds_si_test2(int a, int b, int c) {
  int d = a + 0xff;
  if (d == 0)
    return a + c;
  else
    return b + d + c;
}


x86 assembly (clang, -O0):
<adds_si_test2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xff,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1130 <adds_si_test2+0x30>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113c <adds_si_test2+0x3c>
mov    -0xc(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adds_si_test2>:
mov    %edi,%eax
add    $0xff,%eax
lea    0xff(%rdi,%rsi,1),%eax
cmove  %edi,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @adds_si_test2(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %0, 255
%5 = icmp eq i32 %4, 0
%6 = add nsw i32 %4, %1
%7 = select i1 %5, i32 %0, i32 %6
%8 = add nsw i32 %7, %2
ret i32 %8
}
/* Type definitions */
struct parser {
  int dummy;
};

/* Variables and functions */
scalar_t__ isspace(int);
int /*<<< orphan*/ next(struct parser *);
int peek(struct parser *);
int skip_wsp(struct parser *p) {
  int ch;
  while ((ch = peek(p)) != (-1) && isspace(ch))
    next(p);
  return ch;
}


x86 assembly (clang, -O0):
<skip_wsp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <peek@plt>
mov    %eax,%ecx
mov    %ecx,-0xc(%rbp)
xor    %eax,%eax
cmp    $0xffffffff,%ecx
mov    %al,-0xd(%rbp)
je     116a <skip_wsp+0x3a>
mov    -0xc(%rbp),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    117a <skip_wsp+0x4a>
jmp    1188 <skip_wsp+0x58>
mov    -0x8(%rbp),%rdi
call   1050 <next@plt>
jmp    113c <skip_wsp+0xc>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_wsp>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <peek@plt>
cmp    $0xffffffff,%eax
je     1173 <skip_wsp+0x43>
mov    %eax,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebp,%edi
call   1040 <isspace@plt>
test   %rax,%rax
je     1178 <skip_wsp+0x48>
mov    %rbx,%rdi
call   1050 <next@plt>
mov    %rbx,%rdi
call   1030 <peek@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
jne    1150 <skip_wsp+0x20>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.parser = type { i32 }
define i32 @skip_wsp(%struct.parser* %0) {
%2 = alloca %struct.parser*
%3 = alloca i32
store %struct.parser* %0, %struct.parser** %2
br label %4
4: ; preds = %14, %1
%5 = load %struct.parser*, %struct.parser** %2
%6 = call i32 @peek(%struct.parser* %5)
store i32 %6, i32* %3
%7 = icmp ne i32 %6, -1
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i32, i32* %3
%10 = call i64 @isspace(i32 %9)
%11 = icmp ne i64 %10, 0
br label %12
12: ; preds = %8, %4
%13 = phi i1 [ false, %4 ], [ %11, %8 ]
br i1 %13, label %14, label %17
14: ; preds = %12
%15 = load %struct.parser*, %struct.parser** %2
%16 = call i32 @next(%struct.parser* %15)
br label %4
17: ; preds = %12
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
%struct.parser = type { i32 }
define i32 @skip_wsp(%struct.parser* %0) {
%2 = tail call i32 @peek(%struct.parser* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %12, label %4
4: ; preds = %1, %8
%5 = phi i32 [ %10, %8 ], [ %2, %1 ]
%6 = tail call i64 @isspace(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %4
%9 = tail call i32 @next(%struct.parser* %0)
%10 = tail call i32 @peek(%struct.parser* %0)
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %4
12: ; preds = %4, %8, %1
%13 = phi i32 [ -1, %1 ], [ -1, %8 ], [ %5, %4 ]
ret i32 %13
}
void foo(volatile int (*a)[3]) {
  (*a)[3] = 1;
  a[0][0] = 1;
  a[1][0] = 1;
  a[1][4] = 1;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,0xc(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0xc(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0x1c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0x1,0xc(%rdi)
movl   $0x1,(%rdi)
movl   $0x1,0xc(%rdi)
movl   $0x1,0x1c(%rdi)
ret

LLVM IR (-O0):
define void @foo([3 x i32]* %0) {
%2 = alloca [3 x i32]*
store [3 x i32]* %0, [3 x i32]** %2
%3 = load [3 x i32]*, [3 x i32]** %2
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 3
store volatile i32 1, i32* %4
%5 = load [3 x i32]*, [3 x i32]** %2
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
store volatile i32 1, i32* %7
%8 = load [3 x i32]*, [3 x i32]** %2
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %8, i64 1
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 0
store volatile i32 1, i32* %10
%11 = load [3 x i32]*, [3 x i32]** %2
%12 = getelementptr inbounds [3 x i32], [3 x i32]* %11, i64 1
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %12, i64 0, i64 4
store volatile i32 1, i32* %13
ret void
}

LLVM IR (-O2):
define void @foo([3 x i32]* %0) {
%2 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 0, i64 3
store volatile i32 1, i32* %2
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 0, i64 0
store volatile i32 1, i32* %3
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 1, i64 0
store volatile i32 1, i32* %4
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 1, i64 4
store volatile i32 1, i32* %5
ret void
}
/* Variables and functions */
int system(char *);
int main(void) { return system("xscpu64.exe -sounddev dummy"); }


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"xscpu64.exe -sounddev dummy\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @system(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}

LLVM IR (-O2):
@.str = [28 x i8] c"xscpu64.exe -sounddev dummy\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ __pr_out(char *, char *);
int /*<<< orphan*/ print_time_unit(scalar_t__);
void print_time_or_dash(uint64_t time_nsec) {
  if (time_nsec)
    print_time_unit(time_nsec);
  else
    __pr_out("%10s", "-");
}


x86 assembly (clang, -O0):
<print_time_or_dash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1145 <print_time_or_dash+0x25>
mov    -0x8(%rbp),%rdi
call   1040 <print_time_unit@plt>
jmp    1158 <print_time_or_dash+0x38>
lea    0xeb4(%rip),%rdi
lea    0xeb2(%rip),%rsi
call   1030 <__pr_out@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_time_or_dash>:
test   %rdi,%rdi
je     112a <print_time_or_dash+0xa>
jmp    1040 <print_time_unit@plt>
lea    0xecf(%rip),%rdi
lea    0xecd(%rip),%rsi
jmp    1030 <__pr_out@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%10s\00"
@.str.1 = [2 x i8] c"-\00"
define void @print_time_or_dash(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @print_time_unit(i64 %0)
br label %7
5: ; preds = %1
%6 = tail call i32 @__pr_out(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}
int test_imm_93uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x93 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_93uint64_highword_reg>:
movabs $0x9300000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_93uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 147
%6 = icmp ne i64 %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_93uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 631360192512
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
float float32_le_read(unsigned char *);
void bf2f_array(float *buffer, int count) {
  while (--count >= 0) {
    buffer[count] = float32_le_read((unsigned char *)(buffer + count));
  };
}


x86 assembly (clang, -O0):
<bf2f_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jl     1157 <bf2f_array+0x47>
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <float32_le_read@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
jmp    111f <bf2f_array+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bf2f_array>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    114d <bf2f_array+0x3d>
mov    %rdi,%r14
mov    %esi,%ebx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x2(%rbx),%r15d
lea    (%r14,%r15,4),%rdi
call   1030 <float32_le_read@plt>
movss  %xmm0,(%r14,%r15,4)
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1130 <bf2f_array+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @bf2f_array(float* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds float, float* %0, i64 %9
%11 = bitcast float* %10 to i8*
%12 = tail call float @float32_le_read(i8* %11)
store float %12, float* %10
%13 = icmp ugt i64 %7, 1
br i1 %13, label %6, label %14
14: ; preds = %6, %2
ret void
}
int foo(int x) { return x + 42; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = add nsw i32 %0, 42
ret i32 %2
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
time_t time(time_t *t) { return (1234567890); }


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

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

LLVM IR (-O0):
define i32 @time(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
ret i32 1234567890
}

LLVM IR (-O2):
define i32 @time(i32* nocapture readnone %0) {
ret i32 1234567890
}
const char *except_str(unsigned int _TYPE) {
  switch (_TYPE) {
  case 0x1:
    return "DATA ABORT EXCEPTION ";
  case 0x2:
    return "PREFETCH ABORT EXCEPT";
  case 0x3:
    return "UNDEFINED INSTRUCTION";
  default:
    return "  UNKNOWN EXCEPTION  ";
  }
}


x86 assembly (clang, -O0):
<except_str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     113d <except_str+0x3d>
jmp    111b <except_str+0x1b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     114d <except_str+0x4d>
jmp    112c <except_str+0x2c>
mov    -0x10(%rbp),%eax
sub    $0x3,%eax
je     115d <except_str+0x5d>
jmp    116d <except_str+0x6d>
lea    0xebc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <except_str+0x78>
lea    0xec2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <except_str+0x78>
lea    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <except_str+0x78>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<except_str>:
add    $0xffffffff,%edi
cmp    $0x2,%edi
ja     111a <except_str+0x1a>
movslq %edi,%rax
lea    0xf46(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xf21(%rip),%rax
ret

LLVM IR (-O0):
@.str = [22 x i8] c"DATA ABORT EXCEPTION \00"
@.str.1 = [22 x i8] c"PREFETCH ABORT EXCEPT\00"
@.str.2 = [22 x i8] c"UNDEFINED INSTRUCTION\00"
@.str.3 = [22 x i8] c" UNKNOWN EXCEPTION \00"
define i8* @except_str(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 1, label %5
i32 2, label %6
i32 3, label %7
]
5: ; preds = %1
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
6: ; preds = %1
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [22 x i8] c"DATA ABORT EXCEPTION \00"
@.str.1 = [22 x i8] c"PREFETCH ABORT EXCEPT\00"
@.str.2 = [22 x i8] c"UNDEFINED INSTRUCTION\00"
@.str.3 = [22 x i8] c" UNKNOWN EXCEPTION \00"
@reltable.except_str = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([22 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.except_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([22 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.except_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([22 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.except_str to i64)) to i32)]
define i8* @except_str(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 3
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = shl i64 %5, 2
%7 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.except_str to i8*), i64 %6)
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %7, %4 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), %1 ]
ret i8* %9
}
__attribute__((noipa)) int fn15(int x) { return x & 7; }


x86 assembly (clang, -O0):
<fn15>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fn15(i32 %0) {
%2 = and i32 %0, 7
ret i32 %2
}
/* Variables and functions */
float CelsiusParaFah(float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float celsius, fah;
  printf("\nEntre com temperatura em Celsius:");
  scanf("%f", &celsius);
  fah = CelsiusParaFah(celsius);
  printf("\nTemperatura convertida para Fahreinheit=%.2f", fah);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x8(%rbp),%xmm0
call   1040 <CelsiusParaFah@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeaa(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
call   1040 <CelsiusParaFah@plt>
cvtss2sd %xmm0,%xmm0
lea    0xec0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"\0AEntre com temperatura em Celsius:\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [46 x i8] c"\0ATemperatura convertida para Fahreinheit=%.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%6 = load float, float* %2
%7 = call float @CelsiusParaFah(float %6)
store float %7, float* %3
%8 = load float, float* %3
%9 = fpext float %8 to double
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0), double %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"\0AEntre com temperatura em Celsius:\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [46 x i8] c"\0ATemperatura convertida para Fahreinheit=%.2f\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = call float @CelsiusParaFah(float %5)
%7 = fpext float %6 to double
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}
/* Variables and functions */
int strlen(char *);
int message_extra_length(char *message) { return strlen(message) - 140; }


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

x86 assembly (clang, -O2):
<message_extra_length>:
push   %rax
call   1030 <strlen@plt>
add    $0xffffff74,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @message_extra_length(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strlen(i8* %3)
%5 = sub nsw i32 %4, 140
ret i32 %5
}

LLVM IR (-O2):
define i32 @message_extra_length(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -140
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ RSA;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ *ASN1_item_d2i_bio(int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ **);
int /*<<< orphan*/ RSAPrivateKey_it;
RSA *d2i_RSAPrivateKey_bio(BIO *bp, RSA **rsa) {
  return ASN1_item_d2i_bio(&RSAPrivateKey_it, bp, rsa);
}


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

x86 assembly (clang, -O2):
<d2i_RSAPrivateKey_bio>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec3(%rip),%rdi
jmp    1030 <ASN1_item_d2i_bio@plt>

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

LLVM IR (-O2):
@RSAPrivateKey_it = global i32 0
define i32* @d2i_RSAPrivateKey_bio(i32* %0, i32** %1) {
%3 = tail call i32* @ASN1_item_d2i_bio(i32* @RSAPrivateKey_it, i32* %0, i32** %1)
ret i32* %3
}
unsigned long __maxindex(unsigned int height) {
  unsigned int width = height * 3;
  int shift = (8 * sizeof(unsigned long)) - width;
  if (shift < 0)
    return ~0UL;
  if (shift >= 64)
    return 0UL;
  return ~0UL >> shift;
}


x86 assembly (clang, -O0):
<__maxindex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
imul   $0x3,-0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
mov    $0x40,%eax
sub    %rcx,%rax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1135 <__maxindex+0x35>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    115f <__maxindex+0x5f>
cmpl   $0x40,-0x14(%rbp)
jl     114c <__maxindex+0x4c>
movq   $0x0,-0x8(%rbp)
jmp    115f <__maxindex+0x5f>
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
mov    $0xffffffffffffffff,%rax
shr    %cl,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__maxindex>:
lea    (%rdi,%rdi,2),%eax
mov    $0x40,%ecx
sub    %eax,%ecx
js     1118 <__maxindex+0x18>
neg    %eax
cmp    $0x7fffffc0,%eax
jae    1120 <__maxindex+0x20>
xor    %eax,%eax
ret
mov    $0xffffffffffffffff,%rax
ret
mov    $0xffffffffffffffff,%rax
shr    %cl,%rax
ret

LLVM IR (-O0):
define i64 @__maxindex(i32 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = mul i32 %6, 3
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = zext i32 %8 to i64
%10 = sub i64 64, %9
%11 = trunc i64 %10 to i32
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %1
store i64 -1, i64* %2
br label %23
15: ; preds = %1
%16 = load i32, i32* %5
%17 = icmp sge i32 %16, 64
br i1 %17, label %18, label %19
18: ; preds = %15
store i64 0, i64* %2
br label %23
19: ; preds = %15
%20 = load i32, i32* %5
%21 = zext i32 %20 to i64
%22 = lshr i64 -1, %21
store i64 %22, i64* %2
br label %23
23: ; preds = %19, %18, %14
%24 = load i64, i64* %2
ret i64 %24
}

LLVM IR (-O2):
define i64 @__maxindex(i32 %0) {
%2 = mul i32 %0, -3
%3 = add i32 %2, 64
%4 = icmp slt i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = icmp ult i32 %2, 2147483584
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = zext i32 %3 to i64
%9 = lshr i64 -1, %8
br label %10
10: ; preds = %5, %1, %7
%11 = phi i64 [ %9, %7 ], [ -1, %1 ], [ 0, %5 ]
ret i64 %11
}
int Kit_DsdVar2Lit(int Var, int fCompl) { return Var + Var + fCompl; }


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

x86 assembly (clang, -O2):
<Kit_DsdVar2Lit>:
lea    (%rsi,%rdi,2),%eax
ret

LLVM IR (-O0):
define i32 @Kit_DsdVar2Lit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %3
%7 = add nsw i32 %5, %6
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @Kit_DsdVar2Lit(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 1
%4 = add nsw i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ isalpha(char);
int is_file_name_to_ignore(char *file_name) { return !isalpha(file_name[0]); }


x86 assembly (clang, -O0):
<is_file_name_to_ignore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isalpha@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @is_file_name_to_ignore(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = call i32 @isalpha(i8 signext %5)
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @is_file_name_to_ignore(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @isalpha(i8 signext %2)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int RTLD_GLOBAL;
int RTLD_NOW;
void *dlopen(char *, int);
char *svz_file_path(char *, char *);
int /*<<< orphan*/ svz_free(char *);
void *dyn_get_library(char *path, char *file) {
  void *handle = NULL;
  char *lib;
  lib = svz_file_path(path, file);
  handle = dlopen(lib, RTLD_NOW | RTLD_GLOBAL);
  svz_free(lib);
  return handle;
}


x86 assembly (clang, -O0):
<dyn_get_library>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <svz_file_path@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    0x2e7c(%rip),%rax
mov    (%rax),%esi
mov    0x2e7b(%rip),%rax
or     (%rax),%esi
call   1040 <dlopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <svz_free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dyn_get_library>:
push   %r14
push   %rbx
push   %rax
call   1050 <svz_file_path@plt>
mov    %rax,%rbx
mov    0x2e9d(%rip),%rax
mov    0x2e9e(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    %rbx,%rdi
call   1040 <dlopen@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <svz_free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@RTLD_NOW = global i32 0
@RTLD_GLOBAL = global i32 0
define i8* @dyn_get_library(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
store i8* null, i8** %5
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i8* @svz_file_path(i8* %7, i8* %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = load i32, i32* @RTLD_NOW
%12 = load i32, i32* @RTLD_GLOBAL
%13 = or i32 %11, %12
%14 = call i8* @dlopen(i8* %10, i32 %13)
store i8* %14, i8** %5
%15 = load i8*, i8** %6
%16 = call i32 @svz_free(i8* %15)
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@RTLD_NOW = global i32 0
@RTLD_GLOBAL = global i32 0
define i8* @dyn_get_library(i8* %0, i8* %1) {
%3 = tail call i8* @svz_file_path(i8* %0, i8* %1)
%4 = load i32, i32* @RTLD_NOW
%5 = load i32, i32* @RTLD_GLOBAL
%6 = or i32 %5, %4
%7 = tail call i8* @dlopen(i8* %3, i32 %6)
%8 = tail call i32 @svz_free(i8* %3)
ret i8* %7
}
double clamp_angle(double angle) {
  if (angle < -180.0) {
    return -180.0;
  } else if (angle > 180.0) {
    return 180.0;
  } else {
    return angle;
  }
}


x86 assembly (clang, -O0):
<clamp_angle>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112e <clamp_angle+0x2e>
movsd  0xedc(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1161 <clamp_angle+0x61>
movsd  -0x10(%rbp),%xmm0
movsd  0xecd(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1157 <clamp_angle+0x57>
movsd  0xebb(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1161 <clamp_angle+0x61>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp_angle>:
movsd  0xef8(%rip),%xmm1
minsd  %xmm0,%xmm1
movsd  0xef4(%rip),%xmm2
cmpltsd %xmm2,%xmm0
movapd %xmm0,%xmm3
andnpd %xmm1,%xmm3
andpd  %xmm2,%xmm0
orpd   %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @clamp_angle(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, -1.800000e+02
br i1 %5, label %6, label %7
6: ; preds = %1
store double -1.800000e+02, double* %2
br label %13
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp ogt double %8, 1.800000e+02
br i1 %9, label %10, label %11
10: ; preds = %7
store double 1.800000e+02, double* %2
br label %13
11: ; preds = %7
%12 = load double, double* %3
store double %12, double* %2
br label %13
13: ; preds = %11, %10, %6
%14 = load double, double* %2
ret double %14
}

LLVM IR (-O2):
define double @clamp_angle(double %0) {
%2 = fcmp olt double %0, -1.800000e+02
%3 = fcmp ogt double %0, 1.800000e+02
%4 = select i1 %3, double 1.800000e+02, double %0
%5 = select i1 %2, double -1.800000e+02, double %4
ret double %5
}
int is_coefficient_null(double coefficient) {
  return (coefficient > -0.0001 && coefficient < 0.0001);
}


x86 assembly (clang, -O0):
<is_coefficient_null>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %eax,%eax
movsd  0xee8(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x9(%rbp)
jbe    1138 <is_coefficient_null+0x38>
movsd  0xedb(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
seta   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_coefficient_null>:
ucomisd 0xef8(%rip),%xmm0
seta   %al
movsd  0xef5(%rip),%xmm1
ucomisd %xmm0,%xmm1
seta   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_coefficient_null(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, -1.000000e-04
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fcmp olt double %6, 1.000000e-04
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @is_coefficient_null(double %0) {
%2 = fcmp ogt double %0, -1.000000e-04
%3 = fcmp olt double %0, 1.000000e-04
%4 = and i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
int icmp(const void *p1, const void *p2) {
  int v1, v2;
  v1 = *(int *)p1;
  v2 = *(int *)p2;
  if (v1 < v2)
    return -1;
  else if (v1 == v2)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<icmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1136 <icmp+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <icmp+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    114e <icmp+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1155 <icmp+0x55>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<icmp>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @icmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp ne i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
double *malloc(unsigned int);
int /*<<< orphan*/ printf(char *);
double *alloc_doubles(unsigned card) {
  double *val;
  val = malloc(card * sizeof(double));
  if (val == NULL) {
    printf("fatal error: alloc failed due to OOM. exit.");
    exit(EXIT_FAILURE);
  }
  return val;
}


x86 assembly (clang, -O0):
<alloc_doubles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1172 <alloc_doubles+0x42>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_doubles>:
push   %rax
shl    $0x3,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1140 <alloc_doubles+0x10>
pop    %rcx
ret
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"fatal error: alloc failed due to OOM. exit.\00"
@EXIT_FAILURE = global i32 0
define double* @alloc_doubles(i32 %0) {
%2 = alloca i32
%3 = alloca double*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = mul i64 %5, 8
%7 = trunc i64 %6 to i32
%8 = call double* @malloc(i32 %7)
store double* %8, double** %3
%9 = load double*, double** %3
%10 = icmp eq double* %9, null
br i1 %10, label %11, label %15
11: ; preds = %1
%12 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %1
%16 = load double*, double** %3
ret double* %16
}

LLVM IR (-O2):
@.str = [44 x i8] c"fatal error: alloc failed due to OOM. exit.\00"
@EXIT_FAILURE = global i32 0
define noalias double* @alloc_doubles(i32 %0) {
%2 = shl i32 %0, 3
%3 = tail call double* @malloc(i32 %2)
%4 = icmp eq double* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret double* %3
}
void term_sync(void) {}


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

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

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

LLVM IR (-O2):
define void @term_sync() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar();
unsigned short foo(unsigned char x, unsigned short y) {
  unsigned char t = (unsigned char)((x & 1) ^ ((unsigned char)y & 1));
  if (t == 1)
    bar();
  return y;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x1,%eax
mov    -0x4(%rbp),%cx
movzbl %cl,%ecx
and    $0x1,%ecx
xor    %ecx,%eax
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x1,%eax
jne    114f <foo+0x3f>
mov    $0x0,%al
call   1030 <bar@plt>
movzwl -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %esi,%ebx
xor    %esi,%edi
test   $0x1,%dil
je     1122 <foo+0x12>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @foo(i8 zeroext %0, i16 zeroext %1) {
%3 = alloca i8
%4 = alloca i16
%5 = alloca i8
store i8 %0, i8* %3
store i16 %1, i16* %4
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
%8 = and i32 %7, 1
%9 = load i16, i16* %4
%10 = trunc i16 %9 to i8
%11 = zext i8 %10 to i32
%12 = and i32 %11, 1
%13 = xor i32 %8, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %5
%15 = load i8, i8* %5
%16 = zext i8 %15 to i32
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %20
18: ; preds = %2
%19 = call i32 (...) @bar()
br label %20
20: ; preds = %18, %2
%21 = load i16, i16* %4
ret i16 %21
}

LLVM IR (-O2):
define zeroext i16 @foo(i8 zeroext %0, i16 returned zeroext %1) {
%3 = trunc i16 %1 to i8
%4 = xor i8 %3, %0
%5 = and i8 %4, 1
%6 = icmp eq i8 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 (...) @bar()
br label %9
9: ; preds = %7, %2
ret i16 %1
}
char *dcgettext(domainname, msgid, category) const char *domainname;
const char *msgid;
int category;
{ return dcgettext__(domainname, msgid, category); }


x86 assembly (clang, -O0):
<dcgettext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x0,%al
call   1030 <dcgettext__@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcgettext>:
push   %rax
xor    %eax,%eax
call   1030 <dcgettext__@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @dcgettext(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @dcgettext__ to i32 (i8*, i8*, i32, ...)*)(i8* %7, i8* %8, i32 %9)
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i8*
ret i8* %12
}

LLVM IR (-O2):
define i8* @dcgettext(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @dcgettext__ to i32 (i8*, i8*, i32, ...)*)(i8* %0, i8* %1, i32 %2)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xdb() {
  Assert_real((iscntrl(219) == 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_iscntrl.c",
              1100, ("iscntrl should be 0 for 0xdb"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0xdb>:
push   %rax
mov    $0xdb,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x44c,%edx
pop    %rax
jmp    1040 <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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xdb\00"
define void @t_iscntrl_0xdb() {
%1 = call i64 @iscntrl(i32 219)
%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 1100, 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xdb\00"
define void @t_iscntrl_0xdb() {
%1 = tail call i64 @iscntrl(i32 219)
%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 1100, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void UYVYToYRow_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @UYVYToYRow_SSE2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int fibonacci(int n) {
  if (n <= 1) {
    printf("%d\n", n);
    return n;
  }
  return fibonacci(n - 2) + fibonacci(n - 1);
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     114f <fibonacci+0x2f>
mov    -0x8(%rbp),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1172 <fibonacci+0x52>
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1040 <fibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1040 <fibonacci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jl     1157 <fibonacci+0x37>
add    $0x1,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x3(%rbx),%edi
call   1040 <fibonacci@plt>
add    %eax,%ebp
add    $0xffffffff,%ebx
cmp    $0x3,%ebx
jae    1140 <fibonacci+0x20>
mov    $0x1,%ebx
lea    0xea2(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @fibonacci(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %3, label %8
3: ; preds = %8, %1
%4 = phi i32 [ 0, %1 ], [ %14, %8 ]
%5 = phi i32 [ %0, %1 ], [ 1, %8 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = add nsw i32 %5, %4
ret i32 %7
8: ; preds = %1, %8
%9 = phi i32 [ %13, %8 ], [ %0, %1 ]
%10 = phi i32 [ %14, %8 ], [ 0, %1 ]
%11 = add nsw i32 %9, -2
%12 = tail call i32 @fibonacci(i32 %11)
%13 = add nsw i32 %9, -1
%14 = add nsw i32 %12, %10
%15 = icmp ult i32 %9, 3
br i1 %15, label %3, label %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sair(void) {
  printf("\nJa vai??? Nao! Nao! Espere! Naa...\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"\0AJa vai??? Nao! Nao! Espere! Naa...\0A\00"
define void @sair() {
%1 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [36 x i8] c"\0AJa vai??? Nao! Nao! Espere! Naa...\00"
define void @sair() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret void
}
long int f8(unsigned char *x) { return ~(1ULL << x[0]); }


x86 assembly (clang, -O0):
<f8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
xor    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f8>:
mov    (%rdi),%cl
mov    $0xfffffffffffffffe,%rax
rol    %cl,%rax
ret

LLVM IR (-O0):
define i64 @f8(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = zext i32 %6 to i64
%8 = shl i64 1, %7
%9 = xor i64 %8, -1
ret i64 %9
}

LLVM IR (-O2):
define i64 @f8(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = shl nuw i64 1, %3
%5 = xor i64 %4, -1
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ eeconfig_init_quantum();
void eeconfig_init(void) { eeconfig_init_quantum(); }


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

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

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

LLVM IR (-O2):
define void @eeconfig_init() {
%1 = tail call i32 (...) @eeconfig_init_quantum()
ret void
}