xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ATLTRACE(char *, char *);
int /*<<< orphan*/ exit(int);
void die(char *why) {
  ATLTRACE("FATAL: %s\n", why);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <ATLTRACE@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <ATLTRACE@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"FATAL: %s\0A\00"
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @ATLTRACE(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"FATAL: %s\0A\00"
define void @die(i8* %0) {
%2 = tail call i32 @ATLTRACE(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
unsigned int hash(const char *str, unsigned int hash_length) {
  unsigned int hash = 5381;
  int c;
  while ((c = *str++) != 0)
    hash = ((hash << 5) + hash) + c;
  return (hash % hash_length);
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1144 <hash+0x44>
mov    -0x10(%rbp),%eax
shl    $0x5,%eax
add    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <hash+0x12>
mov    -0x10(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1139 <hash+0x39>
add    $0x1,%rdi
mov    $0x1505,%edx
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1120 <hash+0x20>
jmp    113e <hash+0x3e>
mov    $0x1505,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i32 [ %12, %5 ], [ 5381, %2 ]
%9 = sext i8 %6 to i32
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = mul i32 %8, 33
%12 = add i32 %11, %9
%13 = load i8, i8* %10
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 5381, %2 ], [ %12, %5 ]
%17 = urem i32 %16, %1
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main(void) {
  float x = 1001.02F;
  printf("floating point with 6 precission: %f\n", x);
  double y = 1002.02;
  printf("floating point with 10 precission: %f\n", y);
  long double z = 1002.02L;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x447a4148,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
movabs $0x408f5028f5c28f5c,%rax
50 8f 40
mov    %rax,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
fldt   0xea0(%rip)
fstpt  -0x20(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef8(%rip),%rdi
movsd  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xf0a(%rip),%rdi
movsd  0xed4(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"floating point with 6 precission: %f\0A\00"
@.str.1 = [39 x i8] c"floating point with 10 precission: %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca double
%4 = alloca x86_fp80
store i32 0, i32* %1
store float 0x408F482900000000, float* %2
%5 = load float, float* %2
%6 = fpext float %5 to double
%7 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), double %6)
store double 1.002020e+03, double* %3
%8 = load double, double* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), double %8)
store x86_fp80 0xK4008FA8147AE147AE148, x86_fp80* %4
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"floating point with 6 precission: %f\0A\00"
@.str.1 = [39 x i8] c"floating point with 10 precission: %f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), double 0x408F482900000000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), double 1.002020e+03)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ matmul(float **, float **, float **);
void matmul_wrap(float A[64][64], float B[64][64], float C[64][64]) {
  matmul(A, B, C);
}


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

x86 assembly (clang, -O2):
<matmul_wrap>:
jmp    1030 <matmul@plt>

LLVM IR (-O0):
define void @matmul_wrap([64 x float]* %0, [64 x float]* %1, [64 x float]* %2) {
%4 = alloca [64 x float]*
%5 = alloca [64 x float]*
%6 = alloca [64 x float]*
store [64 x float]* %0, [64 x float]** %4
store [64 x float]* %1, [64 x float]** %5
store [64 x float]* %2, [64 x float]** %6
%7 = load [64 x float]*, [64 x float]** %4
%8 = bitcast [64 x float]* %7 to float**
%9 = load [64 x float]*, [64 x float]** %5
%10 = bitcast [64 x float]* %9 to float**
%11 = load [64 x float]*, [64 x float]** %6
%12 = bitcast [64 x float]* %11 to float**
%13 = call i32 @matmul(float** %8, float** %10, float** %12)
ret void
}

LLVM IR (-O2):
define void @matmul_wrap([64 x float]* %0, [64 x float]* %1, [64 x float]* %2) {
%4 = bitcast [64 x float]* %0 to float**
%5 = bitcast [64 x float]* %1 to float**
%6 = bitcast [64 x float]* %2 to float**
%7 = tail call i32 @matmul(float** %4, float** %5, float** %6)
ret void
}
void __attribute__((weak)) user_loop(void) {}


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

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

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

LLVM IR (-O2):
define weak void @user_loop() {
ret void
}
int btic1h_sgnfold(int a) {
  int c;
  c = (a << 1) ^ (a >> 31);
  return (c);
}


x86 assembly (clang, -O0):
<btic1h_sgnfold>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
sar    $0x1f,%ecx
xor    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<btic1h_sgnfold>:
lea    (%rdi,%rdi,1),%eax
sar    $0x1f,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @btic1h_sgnfold(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = shl i32 %4, 1
%6 = load i32, i32* %2
%7 = ashr i32 %6, 31
%8 = xor i32 %5, %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @btic1h_sgnfold(i32 %0) {
%2 = shl i32 %0, 1
%3 = ashr i32 %0, 31
%4 = xor i32 %2, %3
ret i32 %4
}
__attribute__((always_)) void return_void(int ret) { return; }


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

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

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

LLVM IR (-O2):
define void @return_void(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void foo1(void) { sleep(100); }


x86 assembly (clang, -O0):
<foo1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x64,%edi
call   1030 <sleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo1>:
mov    $0x64,%edi
jmp    1030 <sleep@plt>

LLVM IR (-O0):
define void @foo1() {
%1 = call i32 @sleep(i32 100)
ret void
}

LLVM IR (-O2):
define void @foo1() {
%1 = tail call i32 @sleep(i32 100)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lcd_op(int, int, int /*<<< orphan*/);
void lcd_home(void) { lcd_op(0x2, 0x1, 0); }


x86 assembly (clang, -O0):
<lcd_home>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <lcd_op@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_home>:
mov    $0x2,%edi
mov    $0x1,%esi
xor    %edx,%edx
jmp    1030 <lcd_op@plt>

LLVM IR (-O0):
define void @lcd_home() {
%1 = call i32 @lcd_op(i32 2, i32 1, i32 0)
ret void
}

LLVM IR (-O2):
define void @lcd_home() {
%1 = tail call i32 @lcd_op(i32 2, i32 1, i32 0)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int scale8(int, int);
uint8_t dim8_lin(uint8_t x) {
  if (x & 0x80) {
    x = scale8(x, x);
  } else {
    x += 1;
    x /= 2;
  }
  return x;
}


x86 assembly (clang, -O0):
<dim8_lin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     113f <dim8_lin+0x2f>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <scale8@plt>
mov    %eax,-0x4(%rbp)
jmp    1156 <dim8_lin+0x46>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dim8_lin>:
test   $0x80,%dil
jne    1126 <dim8_lin+0x16>
mov    %edi,%eax
add    $0x1,%eax
shr    $0x1f,%eax
add    %edi,%eax
add    $0x1,%eax
sar    %eax
ret
mov    %edi,%esi
jmp    1030 <scale8@plt>

LLVM IR (-O0):
define i32 @dim8_lin(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 128
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @scale8(i32 %7, i32 %8)
store i32 %9, i32* %2
br label %15
10: ; preds = %1
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = sdiv i32 %13, 2
store i32 %14, i32* %2
br label %15
15: ; preds = %10, %6
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @dim8_lin(i32 %0) {
%2 = and i32 %0, 128
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @scale8(i32 %0, i32 %0)
br label %9
6: ; preds = %1
%7 = add nuw nsw i32 %0, 1
%8 = sdiv i32 %7, 2
br label %9
9: ; preds = %6, %4
%10 = phi i32 [ %5, %4 ], [ %8, %6 ]
ret i32 %10
}
int uxmi_etc_write() { return (1); }


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

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

LLVM IR (-O0):
define i32 @uxmi_etc_write() {
ret i32 1
}

LLVM IR (-O2):
define i32 @uxmi_etc_write() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ minmax(int *, int, int *, int *);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int arr[5] = {3, 5, -1, 0, 2};
  int maximum = 0, minium = 0;
  minmax(arr, 5, &maximum, &minium);
  printf("max=%d min=%d/n", maximum, minium);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
lea    -0x24(%rbp),%rdx
lea    -0x28(%rbp),%rcx
call   1040 <minmax@plt>
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    $0x5,%esi
call   1040 <minmax@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [5 x i32] [i32 3, i32 5, i32 -1, i32 0, i32 2]
@.str = [16 x i8] c"max=%d min=%d/n\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [5 x i32]* %1 to i8*
store i32 0, i32* %2
store i32 0, i32* %3
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%6 = call i32 @minmax(i32* %5, i32 5, i32* %2, i32* %3)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [5 x i32] [i32 3, i32 5, i32 -1, i32 0, i32 2]
@.str = [16 x i8] c"max=%d min=%d/n\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [5 x i32]* %1 to i8*
%5 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%6 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%8 = call i32 @minmax(i32* %7, i32 5, i32* %2, i32* %3)
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
ret i32 0
}
int test_imm_A3int64_lowword_reg(long long val) {
  return ((val) & (0xA3 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_A3int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 163
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ core13_print(char *, char const *);
void U_EMRTRANSPARENTBLT_print(const char *contents) {
  core13_print("U_EMRTRANSPARENTBLT", contents);
}


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

x86 assembly (clang, -O2):
<U_EMRTRANSPARENTBLT_print>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <core13_print@plt>

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

LLVM IR (-O2):
@.str = [20 x i8] c"U_EMRTRANSPARENTBLT\00"
define void @U_EMRTRANSPARENTBLT_print(i8* %0) {
%2 = tail call i32 @core13_print(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ matches(int /*<<< orphan*/);
void op_matches() { matches(0); }


x86 assembly (clang, -O0):
<op_matches>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <matches@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_matches>:
xor    %edi,%edi
jmp    1030 <matches@plt>

LLVM IR (-O0):
define void @op_matches() {
%1 = call i32 @matches(i32 0)
ret void
}

LLVM IR (-O2):
define void @op_matches() {
%1 = tail call i32 @matches(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ keyput_c(char *, char *);
void keyputc_c(char *string) { keyput_c("unknown", string); }


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

x86 assembly (clang, -O2):
<keyputc_c>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <keyput_c@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"unknown\00"
define void @keyputc_c(i8* %0) {
%2 = tail call i32 @keyput_c(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int omap_rev();
int is_omap850(void) {
  return (((omap_rev() >> 16) & 0xffff) == (0x0850)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<is_omap850>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <omap_rev@plt>
mov    %eax,%edx
sar    $0x10,%edx
and    $0xffff,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x850,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_omap850>:
push   %rax
xor    %eax,%eax
call   1030 <omap_rev@plt>
and    $0xffff0000,%eax
xor    %ecx,%ecx
cmp    $0x8500000,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_omap850() {
%1 = call i32 (...) @omap_rev()
%2 = ashr i32 %1, 16
%3 = and i32 %2, 65535
%4 = icmp eq i32 %3, 2128
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_omap850() {
%1 = tail call i32 (...) @omap_rev()
%2 = and i32 %1, -65536
%3 = icmp eq i32 %2, 139460608
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int main() {
  int x = 5;
  write(1, "hello\n", 6);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"hello\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
%3 = call i32 @write(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"hello\0A\00"
define i32 @main() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
ret i32 0
}
void rl_restore_prompt(void) {}


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

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

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

LLVM IR (-O2):
define void @rl_restore_prompt() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ os_error(char *);
void *realloc(void *, size_t);
void *xrealloc(void *ptr, size_t size) {
  if (size == 0)
    size = 1;
  void *newp = realloc(ptr, size);
  if (!newp)
    os_error("Memory allocation failure in xrealloc");
  return newp;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1143 <xrealloc+0x23>
movq   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116b <xrealloc+0x4b>
lea    0xe9a(%rip),%rdi
call   1040 <os_error@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
test   %rsi,%rsi
mov    $0x1,%eax
cmove  %rax,%rsi
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1146 <xrealloc+0x26>
lea    0xebf(%rip),%rdi
call   1040 <os_error@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [38 x i8] c"Memory allocation failure in xrealloc\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
%4 = select i1 %3, i64 1, i64 %1
%5 = tail call i8* @realloc(i8* %0, i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @os_error(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int kfVecDot(float *, float *, int);
int test(void) {
  float xBasis[] = {1, 0};
  float yBasis[] = {0, 1};
  assert(kfVecDot(xBasis, xBasis, 2) == 1);
  assert(kfVecDot(yBasis, xBasis, 2) == 0);
  return 0;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x2,%edx
call   1040 <kfVecDot@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    -0x10(%rbp),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x2,%edx
call   1040 <kfVecDot@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
sub    $0x10,%rsp
movq   $0x3f800000,0x8(%rsp)
80 3f
movabs $0x3f80000000000000,%rax
mov    %rax,(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    %rbx,%rsi
mov    $0x2,%edx
call   1040 <kfVecDot@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1030 <assert@plt>
mov    %rsp,%rdi
mov    %rbx,%rsi
mov    $0x2,%edx
call   1040 <kfVecDot@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test.xBasis = [2 x float] [float 1.000000e+00, float 0.000000e+00]
@__const.test.yBasis = [2 x float] [float 0.000000e+00, float 1.000000e+00]
define i32 @test() {
%1 = alloca [2 x float]
%2 = alloca [2 x float]
%3 = bitcast [2 x float]* %1 to i8*
%4 = bitcast [2 x float]* %2 to i8*
%5 = getelementptr inbounds [2 x float], [2 x float]* %1, i64 0, i64 0
%6 = getelementptr inbounds [2 x float], [2 x float]* %1, i64 0, i64 0
%7 = call i32 @kfVecDot(float* %5, float* %6, i32 2)
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 0
%12 = getelementptr inbounds [2 x float], [2 x float]* %1, i64 0, i64 0
%13 = call i32 @kfVecDot(float* %11, float* %12, i32 2)
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
ret i32 0
}

LLVM IR (-O2):
define i32 @test() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
store i64 1065353216, i64* %1
%4 = bitcast i64* %2 to i8*
store i64 4575657221408423936, i64* %2
%5 = bitcast i64* %1 to float*
%6 = call i32 @kfVecDot(float* %5, float* %5, i32 2)
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = bitcast i64* %2 to float*
%11 = call i32 @kfVecDot(float* %10, float* %5, i32 2)
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xf1() {
  Assert_real((iscntrl(241) == 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",
              1210, ("iscntrl should be 0 for 0xf1"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0xf1>:
push   %rax
mov    $0xf1,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4ba,%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 0xf1\00"
define void @t_iscntrl_0xf1() {
%1 = call i64 @iscntrl(i32 241)
%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 1210, 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 0xf1\00"
define void @t_iscntrl_0xf1() {
%1 = tail call i64 @iscntrl(i32 241)
%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 1210, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int config_get_bool(char *);
int daemon(int /*<<< orphan*/, int);
int util_daemonize() {
  int debug = config_get_bool("debug");
  if (debug == 1)
    return daemon(0, 1);
  else
    return daemon(0, 0);
}


x86 assembly (clang, -O0):
<util_daemonize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <config_get_bool@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1155 <util_daemonize+0x35>
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <daemon@plt>
mov    %eax,-0x4(%rbp)
jmp    1161 <util_daemonize+0x41>
xor    %esi,%esi
mov    %esi,%edi
call   1040 <daemon@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_daemonize>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <config_get_bool@plt>
xor    %esi,%esi
cmp    $0x1,%eax
sete   %sil
xor    %edi,%edi
pop    %rax
jmp    1040 <daemon@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"debug\00"
define i32 @util_daemonize() {
%1 = tail call i32 @config_get_bool(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @daemon(i32 0, i32 %3)
ret i32 %4
}
/* Variables and functions */
unsigned int log2(int x) {
  unsigned int i, j;
  i = 0;
  j = 1;
  while (x >= j * 2) {
    i++;
    j = j * 2;
  }
  return i;
}


x86 assembly (clang, -O0):
<log2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jb     113d <log2+0x3d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <log2+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2>:
mov    $0x1,%ecx
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    %ecx,%ecx
add    $0x1,%eax
cmp    %edi,%ecx
jbe    1110 <log2+0x10>
ret

LLVM IR (-O0):
define i32 @log2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 1, i32* %4
br label %5
5: ; preds = %10, %1
%6 = load i32, i32* %2
%7 = load i32, i32* %4
%8 = mul i32 %7, 2
%9 = icmp uge i32 %6, %8
br i1 %9, label %10, label %15
10: ; preds = %5
%11 = load i32, i32* %3
%12 = add i32 %11, 1
store i32 %12, i32* %3
%13 = load i32, i32* %4
%14 = mul i32 %13, 2
store i32 %14, i32* %4
br label %5
15: ; preds = %5
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @log2(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %7, %2 ]
%4 = phi i32 [ 1, %1 ], [ %5, %2 ]
%5 = shl i32 %4, 1
%6 = icmp ugt i32 %5, %0
%7 = add i32 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *twkb2geoJSON_fromIndexedFile2D(char *, double, double, double, double);
char *test_filereading2geoJSONindexed() {
  char *file_name = "testdata/arealdekke_indexed.twkb";
  char *txt =
      twkb2geoJSON_fromIndexedFile2D(file_name, 11.79, 60.58, 11.93, 60.67);
  free(txt);
  return 0;
}


x86 assembly (clang, -O0):
<test_filereading2geoJSONindexed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xef1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
movsd  0xec1(%rip),%xmm0
movsd  0xec1(%rip),%xmm1
movsd  0xec1(%rip),%xmm2
movsd  0xec1(%rip),%xmm3
call   1030 <twkb2geoJSON_fromIndexedFile2D@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_filereading2geoJSONindexed>:
push   %rax
lea    0xef8(%rip),%rdi
movsd  0xed0(%rip),%xmm0
movsd  0xed0(%rip),%xmm1
movsd  0xed0(%rip),%xmm2
movsd  0xed0(%rip),%xmm3
call   1030 <twkb2geoJSON_fromIndexedFile2D@plt>
mov    %rax,%rdi
call   1040 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"testdata/arealdekke_indexed.twkb\00"
define i8* @test_filereading2geoJSONindexed() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = load i8*, i8** %1
%4 = call i8* @twkb2geoJSON_fromIndexedFile2D(i8* %3, double 1.179000e+01, double 6.058000e+01, double 1.193000e+01, double 6.067000e+01)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @free(i8* %5)
ret i8* null
}

LLVM IR (-O2):
@.str = [33 x i8] c"testdata/arealdekke_indexed.twkb\00"
define noalias i8* @test_filereading2geoJSONindexed() {
%1 = tail call i8* @twkb2geoJSON_fromIndexedFile2D(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), double 1.179000e+01, double 6.058000e+01, double 1.193000e+01, double 6.067000e+01)
%2 = tail call i32 @free(i8* %1)
ret i8* null
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR53_set(void) { return U_WMRCORENONE_set("U_WMR53"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR53\00"
define i8* @U_WMR53_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR53\00"
define i8* @U_WMR53_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
void mygreta(char *path) {}


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

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

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

LLVM IR (-O2):
define void @mygreta(i8* nocapture %0) {
ret void
}
void OPM_FPrint(long long *fp, long long val) {
  *fp =
      ((long long)((unsigned long long)((long long)((unsigned long long)*fp ^
                                                    (unsigned long long)val))
                       << (1) |
                   (unsigned long long)((long long)((unsigned long long)*fp ^
                                                    (unsigned long long)val)) >>
                       (8 * sizeof(long long) - (1))));
}


x86 assembly (clang, -O0):
<OPM_FPrint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
xor    -0x10(%rbp),%rcx
shl    $0x1,%rcx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
xor    -0x10(%rbp),%rax
shr    $0x3f,%rax
or     %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<OPM_FPrint>:
xor    (%rdi),%rsi
rol    %rsi
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @OPM_FPrint(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* %5
%7 = load i64, i64* %4
%8 = xor i64 %6, %7
%9 = shl i64 %8, 1
%10 = load i64*, i64** %3
%11 = load i64, i64* %10
%12 = load i64, i64* %4
%13 = xor i64 %11, %12
%14 = lshr i64 %13, 63
%15 = or i64 %9, %14
%16 = load i64*, i64** %3
store i64 %15, i64* %16
ret void
}

LLVM IR (-O2):
define void @OPM_FPrint(i64* nocapture %0, i64 %1) {
%3 = load i64, i64* %0
%4 = xor i64 %3, %1
%5 = tail call i64 @llvm.fshl.i64(i64 %4, i64 %4, i64 1)
store i64 %5, i64* %0
ret void
}
char *langTextUnknown() { return "Unknown"; }


x86 assembly (clang, -O0):
<langTextUnknown>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langTextUnknown>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Unknown\00"
define i8* @langTextUnknown() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [8 x i8] c"Unknown\00"
define i8* @langTextUnknown() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
unsigned int zlx_digit_to_char(unsigned int);
__attribute__((visibility("default"))) unsigned int
zlxni_digit_to_char(unsigned int digit) {
  return zlx_digit_to_char(digit);
}


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

x86 assembly (clang, -O2):
<zlxni_digit_to_char>:
jmp    1030 <zlx_digit_to_char@plt>

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

LLVM IR (-O2):
define i32 @zlxni_digit_to_char(i32 %0) {
%2 = tail call i32 @zlx_digit_to_char(i32 %0)
ret i32 %2
}
int hash(void *key) { return (int)key; }


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

x86 assembly (clang, -O2):
<hash>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i32 @hash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @hash(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Type definitions */
struct sync_track {
  int dummy;
};

/* Variables and functions */
scalar_t__ sync_find_key(struct sync_track const *, int);
int is_key_frame(const struct sync_track *t, int row) {
  return sync_find_key(t, row) >= 0;
}


x86 assembly (clang, -O0):
<is_key_frame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <sync_find_key@plt>
cmp    $0x0,%rax
setge  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_key_frame>:
push   %rax
call   1030 <sync_find_key@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sync_track = type { i32 }
define i32 @is_key_frame(%struct.sync_track* %0, i32 %1) {
%3 = alloca %struct.sync_track*
%4 = alloca i32
store %struct.sync_track* %0, %struct.sync_track** %3
store i32 %1, i32* %4
%5 = load %struct.sync_track*, %struct.sync_track** %3
%6 = load i32, i32* %4
%7 = call i64 @sync_find_key(%struct.sync_track* %5, i32 %6)
%8 = icmp sge i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
%struct.sync_track = type { i32 }
define i32 @is_key_frame(%struct.sync_track* %0, i32 %1) {
%3 = tail call i64 @sync_find_key(%struct.sync_track* %0, i32 %1)
%4 = lshr i64 %3, 63
%5 = trunc i64 %4 to i32
%6 = xor i32 %5, 1
ret i32 %6
}
void ft_get_values(int *data, int *nb, int *actual) {
  *nb = data[0];
  *actual = data[1];
}


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

x86 assembly (clang, -O2):
<ft_get_values>:
mov    (%rdi),%eax
mov    %eax,(%rsi)
mov    0x4(%rdi),%eax
mov    %eax,(%rdx)
ret

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

LLVM IR (-O2):
define void @ft_get_values(i32* nocapture %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %0
store i32 %4, i32* %1
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
store i32 %6, i32* %2
ret void
}
/* Type definitions */
typedef scalar_t__ const uint8_t;

/* Variables and functions */
const uint8_t *find_last_uint8_t(const uint8_t *it, const uint8_t *end,
                                 uint8_t val) {
  while (it != end) {
    --end;
    if (*end == val)
      return end;
  }
  return 0;
}


x86 assembly (clang, -O0):
<find_last_uint8_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     114d <find_last_uint8_t+0x4d>
mov    -0x18(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
cmp    -0x20(%rbp),%rax
jne    1148 <find_last_uint8_t+0x48>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1155 <find_last_uint8_t+0x55>
jmp    1110 <find_last_uint8_t+0x10>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_last_uint8_t>:
cmp    %rdi,%rsi
je     1113 <find_last_uint8_t+0x13>
lea    -0x8(%rsi),%rax
cmp    %rdx,-0x8(%rsi)
mov    %rax,%rsi
jne    1100 <find_last_uint8_t>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64* @find_last_uint8_t(i64* readnone %0, i64* %1, i64 %2) {
br label %4
4: ; preds = %7, %3
%5 = phi i64* [ %1, %3 ], [ %8, %7 ]
%6 = icmp eq i64* %5, %0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = getelementptr inbounds i64, i64* %5, i64 -1
%9 = load i64, i64* %8
%10 = icmp eq i64 %9, %2
br i1 %10, label %11, label %4
11: ; preds = %4, %7
%12 = phi i64* [ %8, %7 ], [ null, %4 ]
ret i64* %12
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t scale_color(uint8_t color, uint8_t scale) {
  return ((int)color * (int)(scale)) >> 9;
}


x86 assembly (clang, -O0):
<scale_color>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
sar    $0x9,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale_color>:
mov    %edi,%eax
imul   %esi,%eax
sar    $0x9,%eax
ret

LLVM IR (-O0):
define i32 @scale_color(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 = mul nsw i32 %5, %6
%8 = ashr i32 %7, 9
ret i32 %8
}

LLVM IR (-O2):
define i32 @scale_color(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = ashr i32 %3, 9
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pr() {
  printf("hello world");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"hello world\00"
define i32 @pr() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
char *skip_chars(string)
char *string;
{
  while (*string && !isspace(*string))
    string++;
  return string;
}


x86 assembly (clang, -O0):
<skip_chars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1148 <skip_chars+0x38>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1158 <skip_chars+0x48>
jmp    1169 <skip_chars+0x59>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skip_chars+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_chars>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1138 <skip_chars+0x28>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
jne    1138 <skip_chars+0x28>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <skip_chars+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @skip_chars(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %17, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = call i32 @isspace(i32 %11)
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
br label %15
15: ; preds = %8, %3
%16 = phi i1 [ false, %3 ], [ %14, %8 ]
br i1 %16, label %17, label %20
17: ; preds = %15
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %2
br label %3
20: ; preds = %15
%21 = load i8*, i8** %2
ret i8* %21
}

LLVM IR (-O2):
define i8* @skip_chars(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %10
%5 = phi i8 [ %12, %10 ], [ %2, %1 ]
%6 = phi i8* [ %11, %10 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i32 @isspace(i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %4
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %10, %1
%15 = phi i8* [ %0, %1 ], [ %11, %10 ], [ %6, %4 ]
ret i8* %15
}
/* Variables and functions */
void arch_check_bugs(void) {}


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

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

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

LLVM IR (-O2):
define void @arch_check_bugs() {
ret void
}
/* Variables and functions */
int Fibonacci(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n = 0;
  printf("\nWhich Fibonacci number? ");
  scanf("%d", &n);
  printf("\nValue : %d\n", Fibonacci(n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <Fibonacci@plt>
mov    %eax,%esi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <Fibonacci@plt>
lea    0xeb5(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"\0AWhich Fibonacci number? \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [13 x i8] c"\0AValue : %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 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), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @Fibonacci(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"\0AWhich Fibonacci number? \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [13 x i8] c"\0AValue : %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 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), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @Fibonacci(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}