xunge/DecIR huggingface dataset:
int compareInt(void *num1, void *num2) {
  int key1;
  int key2;
  key1 = *(int *)num1;
  key2 = *(int *)num2;
  if (key1 < key2)
    return -1;
  if (key1 == key2)
    return 0;
  return +1;
}


x86 assembly (clang, -O0):
<compareInt>:
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 <compareInt+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <compareInt+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    114e <compareInt+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1155 <compareInt+0x55>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @compareInt(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 @compareInt(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(int);
int /*<<< orphan*/ printf(char *);
void logout() {
  printf("Goodbye...\n");
  exit(1);
}


x86 assembly (clang, -O0):
<logout>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [12 x i8] c"Goodbye...\0A\00"
define void @logout() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [11 x i8] c"Goodbye...\00"
define void @logout() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
void av_sdp_create() {}


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

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

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

LLVM IR (-O2):
define void @av_sdp_create() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isalnum(char);
int isAlnum(char *str) {
  int i = 0;
  while (str[i] != 0) {
    if (!isalnum(str[i])) {
      return 0;
    }
    i++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isAlnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     116c <isAlnum+0x5c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%eax
jne    115e <isAlnum+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1173 <isAlnum+0x63>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <isAlnum+0x13>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isAlnum>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <isAlnum+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <isalnum@plt>
test   %eax,%eax
je     1149 <isAlnum+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <isAlnum+0x20>
jmp    114b <isAlnum+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @isAlnum(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %8
4: ; preds = %8
%5 = getelementptr inbounds i8, i8* %0, i64 %13
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %1, %4
%9 = phi i64 [ %13, %4 ], [ 0, %1 ]
%10 = phi i8 [ %6, %4 ], [ %2, %1 ]
%11 = tail call i32 @isalnum(i8 signext %10)
%12 = icmp eq i32 %11, 0
%13 = add nuw i64 %9, 1
br i1 %12, label %14, label %4
14: ; preds = %8, %4, %1
%15 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %8 ]
ret i32 %15
}
/* Variables and functions */
double fabs(double);
const char *get_percent_color(double percent) {
  const char *color = "";
  if (fabs(percent) >= 5.0)
    color = "\033[31m";
  else {
    if (fabs(percent) > 0.5)
      color = "\033[32m";
  }
  return color;
}


x86 assembly (clang, -O0):
<get_percent_color>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
lea    0xf15(%rip),%rax
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xef0(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xed4(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1146 <get_percent_color+0x46>
lea    0xee3(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1178 <get_percent_color+0x78>
movsd  -0x8(%rbp),%xmm0
movaps 0xebe(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xeaa(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1173 <get_percent_color+0x73>
lea    0xeb7(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1178 <get_percent_color+0x78>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_percent_color>:
andpd  0xef8(%rip),%xmm0
ucomisd 0xf00(%rip),%xmm0
jae    1124 <get_percent_color+0x24>
ucomisd 0xefe(%rip),%xmm0
jbe    112c <get_percent_color+0x2c>
lea    0xf03(%rip),%rax
ret
lea    0xef5(%rip),%rax
ret
lea    0xef2(%rip),%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [6 x i8] c"\1B[31m\00"
@.str.2 = [6 x i8] c"\1B[32m\00"
define i8* @get_percent_color(double %0) {
%2 = alloca double
%3 = alloca i8*
store double %0, double* %2
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load double, double* %2
%5 = call double @llvm.fabs.f64(double %4)
%6 = fcmp oge double %5, 5.000000e+00
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %14
8: ; preds = %1
%9 = load double, double* %2
%10 = call double @llvm.fabs.f64(double %9)
%11 = fcmp ogt double %10, 5.000000e-01
br i1 %11, label %12, label %13
12: ; preds = %8
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %13
13: ; preds = %12, %8
br label %14
14: ; preds = %13, %7
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [6 x i8] c"\1B[31m\00"
@.str.2 = [6 x i8] c"\1B[32m\00"
define i8* @get_percent_color(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
%3 = fcmp ult double %2, 5.000000e+00
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = fcmp ogt double %2, 5.000000e-01
br i1 %5, label %6, label %7
6: ; preds = %4
br label %7
7: ; preds = %1, %4, %6
%8 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), %6 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %4 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), %1 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ print_addr(int);
int /*<<< orphan*/ printf(char *, int *);
int main() {
  int num = 5;
  printf("%p\n", &num);
  print_addr(num);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x5,0x4(%rsp)
lea    0xed0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <printf@plt>
mov    0x4(%rsp),%edi
call   1030 <print_addr@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @print_addr(i32 %4)
ret i32 0
}
int fork(void) {
  printf("tcl>>> %s\n", __func__);
  return -1;
}


x86 assembly (clang, -O0):
<fork>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee9(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"tcl>>> %s\0A\00"
@__func__.fork = [5 x i8] c"fork\00"
define i32 @fork() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.fork, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [11 x i8] c"tcl>>> %s\0A\00"
@__func__.fork = [5 x i8] c"fork\00"
define i32 @fork() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.fork, i64 0, i64 0))
ret i32 -1
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t read_bit_reg32(volatile uint32_t *reg, uint8_t bit) {
  return ((*(volatile unsigned int *)((
      (((uint32_t)reg & 0xF0000000) + 0x02000000 +
       (((uint32_t)reg & 0xFFFFF) << 5) + (bit << 2))))));
}


x86 assembly (clang, -O0):
<read_bit_reg32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
and    $0xf0000000,%eax
add    $0x2000000,%eax
mov    -0x8(%rbp),%rcx
and    $0xfffff,%ecx
shl    $0x5,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
add    %ecx,%eax
mov    %eax,%eax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_bit_reg32>:
mov    %edi,%eax
and    $0xf0000000,%eax
shl    $0x5,%edi
and    $0x1ffffe0,%edi
or     %eax,%edi
lea    (%rdi,%rsi,4),%eax
add    $0x2000000,%eax
mov    (%rax),%eax
ret

LLVM IR (-O0):
define i32 @read_bit_reg32(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 = ptrtoint i32* %5 to i32
%7 = and i32 %6, -268435456
%8 = add i32 %7, 33554432
%9 = load i32*, i32** %3
%10 = ptrtoint i32* %9 to i32
%11 = and i32 %10, 1048575
%12 = shl i32 %11, 5
%13 = add i32 %8, %12
%14 = load i32, i32* %4
%15 = shl i32 %14, 2
%16 = add i32 %13, %15
%17 = zext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
%19 = load volatile i32, i32* %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @read_bit_reg32(i32* %0, i32 %1) {
%3 = ptrtoint i32* %0 to i64
%4 = trunc i64 %3 to i32
%5 = and i32 %4, -268435456
%6 = shl i32 %4, 5
%7 = and i32 %6, 33554400
%8 = or i32 %5, %7
%9 = shl i32 %1, 2
%10 = add i32 %9, 33554432
%11 = add i32 %10, %8
%12 = zext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
ret i32 %14
}
/* Variables and functions */
double astro_range(double, double);
double astro_range_360(double v) { return astro_range(v, 360.0); }


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

x86 assembly (clang, -O2):
<astro_range_360>:
movsd  0xee8(%rip),%xmm1
jmp    1030 <astro_range@plt>

LLVM IR (-O0):
define double @astro_range_360(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @astro_range(double %3, double 3.600000e+02)
ret double %4
}

LLVM IR (-O2):
define double @astro_range_360(double %0) {
%2 = tail call double @astro_range(double %0, double 3.600000e+02)
ret double %2
}
/* Type definitions */
typedef int int32_t;
typedef int int16_t;

/* Variables and functions */
int s2n_kyber_512_r3_montgomery_reduce(int);
int16_t fqmul(int16_t a, int16_t b) {
  return s2n_kyber_512_r3_montgomery_reduce((int32_t)a * b);
}


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

x86 assembly (clang, -O2):
<fqmul>:
imul   %esi,%edi
jmp    1030 <s2n_kyber_512_r3_montgomery_reduce@plt>

LLVM IR (-O0):
define i32 @fqmul(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 = call i32 @s2n_kyber_512_r3_montgomery_reduce(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @fqmul(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i32 @s2n_kyber_512_r3_montgomery_reduce(i32 %3)
ret i32 %4
}
void sd_ct_stop(void) {}


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

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

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

LLVM IR (-O2):
define void @sd_ct_stop() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ *calloc(int, int);
uint32_t *tribitmtx_alloc(int size) {
  if (size == 0)
    return NULL;
  size--;
  int bits = (size * size + size) / 2 + size + 1;
  int words = (bits + 31) / 32;
  return calloc(words, sizeof(int));
}


x86 assembly (clang, -O0):
<tribitmtx_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1132 <tribitmtx_alloc+0x22>
movq   $0x0,-0x8(%rbp)
jmp    1178 <tribitmtx_alloc+0x68>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1f,%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tribitmtx_alloc>:
test   %edi,%edi
je     1140 <tribitmtx_alloc+0x30>
lea    -0x1(%rdi),%eax
imul   %edi,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
lea    (%rdi,%rcx,1),%eax
add    $0x1f,%eax
add    %ecx,%edi
add    $0x3e,%edi
test   %eax,%eax
cmovns %eax,%edi
sar    $0x5,%edi
mov    $0x4,%esi
jmp    1030 <calloc@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i32* @tribitmtx_alloc(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = mul i32 %4, %0
%6 = sdiv i32 %5, 2
%7 = add i32 %0, 31
%8 = add i32 %7, %6
%9 = sdiv i32 %8, 32
%10 = tail call i32* @calloc(i32 %9, i32 4)
br label %11
11: ; preds = %1, %3
%12 = phi i32* [ %10, %3 ], [ null, %1 ]
ret i32* %12
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;
typedef scalar_t__ data;

/* Variables and functions */
int /*<<< orphan*/ tpi_write(int);
void tpi_sstpr(uint16_t data) {
  tpi_write((0x68));
  tpi_write(((uint8_t)((data)&0xFF)));
  tpi_write((0x69));
  tpi_write(((uint8_t)(((data) >> 8) & 0xFF)));
}


x86 assembly (clang, -O0):
<tpi_sstpr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x68,%edi
call   1030 <tpi_write@plt>
mov    -0x4(%rbp),%edi
and    $0xff,%edi
call   1030 <tpi_write@plt>
mov    $0x69,%edi
call   1030 <tpi_write@plt>
mov    -0x4(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
call   1030 <tpi_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tpi_sstpr>:
push   %rbx
mov    %edi,%ebx
mov    $0x68,%edi
call   1030 <tpi_write@plt>
movzbl %bl,%edi
call   1030 <tpi_write@plt>
mov    $0x69,%edi
call   1030 <tpi_write@plt>
movzbl %bh,%edi
pop    %rbx
jmp    1030 <tpi_write@plt>

LLVM IR (-O0):
define void @tpi_sstpr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @tpi_write(i32 104)
%4 = load i32, i32* %2
%5 = and i32 %4, 255
%6 = call i32 @tpi_write(i32 %5)
%7 = call i32 @tpi_write(i32 105)
%8 = load i32, i32* %2
%9 = ashr i32 %8, 8
%10 = and i32 %9, 255
%11 = call i32 @tpi_write(i32 %10)
ret void
}

LLVM IR (-O2):
define void @tpi_sstpr(i32 %0) {
%2 = tail call i32 @tpi_write(i32 104)
%3 = and i32 %0, 255
%4 = tail call i32 @tpi_write(i32 %3)
%5 = tail call i32 @tpi_write(i32 105)
%6 = lshr i32 %0, 8
%7 = and i32 %6, 255
%8 = tail call i32 @tpi_write(i32 %7)
ret void
}
void audit_kex(struct ssh *ssh, int ctos, char *enc, char *mac, char *comp,
               char *pfs) {}


x86 assembly (clang, -O0):
<audit_kex>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ssh = type opaque
define void @audit_kex(%struct.ssh* %0, i32 %1, i8* %2, i8* %3, i8* %4, i8* %5) {
%7 = alloca %struct.ssh*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
store %struct.ssh* %0, %struct.ssh** %7
store i32 %1, i32* %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i8* %5, i8** %12
ret void
}

LLVM IR (-O2):
%struct.ssh = type opaque
define void @audit_kex(%struct.ssh* nocapture %0, i32 %1, i8* nocapture %2, i8* nocapture %3, i8* nocapture %4, i8* nocapture %5) {
ret void
}
int rtl839x_dma_tx_base(int i) { return (0x784c) + (i << 2); }


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

x86 assembly (clang, -O2):
<rtl839x_dma_tx_base>:
lea    0x784c(,%rdi,4),%eax
ret

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

LLVM IR (-O2):
define i32 @rtl839x_dma_tx_base(i32 %0) {
%2 = shl i32 %0, 2
%3 = add nsw i32 %2, 30796
ret i32 %3
}
int MP_lichtschranke(int VV_device) {
  int PV_value = 0;
  return (PV_value);
}


x86 assembly (clang, -O0):
<MP_lichtschranke>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @MP_lichtschranke(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ test_a_to_i();
int /*<<< orphan*/ test_str_ncpy();
int /*<<< orphan*/ test_str_nlen();
int main(int argc, char *argv[]) {
  if (argc > 1) {
    printf("%s takes no arguments\n", argv[0]);
    return 1;
  }
  test_str_nlen();
  test_str_ncpy();
  test_a_to_i();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    117f <main+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    119b <main+0x5b>
mov    $0x0,%al
call   1060 <test_str_nlen@plt>
mov    $0x0,%al
call   1030 <test_str_ncpy@plt>
mov    $0x0,%al
call   1050 <test_a_to_i@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
jl     115c <main+0x1c>
mov    (%rsi),%rsi
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%ebx
jmp    1173 <main+0x33>
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <test_str_nlen@plt>
xor    %eax,%eax
call   1030 <test_str_ncpy@plt>
xor    %eax,%eax
call   1050 <test_a_to_i@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"%s takes no arguments\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %11)
store i32 1, i32* %3
br label %17
13: ; preds = %2
%14 = call i32 (...) @test_str_nlen()
%15 = call i32 (...) @test_str_ncpy()
%16 = call i32 (...) @test_a_to_i()
store i32 0, i32* %3
br label %17
17: ; preds = %13, %8
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@.str = [23 x i8] c"%s takes no arguments\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %11
7: ; preds = %2
%8 = tail call i32 (...) @test_str_nlen()
%9 = tail call i32 (...) @test_str_ncpy()
%10 = tail call i32 (...) @test_a_to_i()
br label %11
11: ; preds = %7, %4
%12 = phi i32 [ 1, %4 ], [ 0, %7 ]
ret i32 %12
}
const char *Assign_Brief(void) { return "Assignment"; }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"Assignment\00"
define i8* @Assign_Brief() {
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_spinlock_t;

/* Variables and functions */
int pthread_spin_destroy(int /*<<< orphan*/ *);
int ___pthread_spin_destroy(pthread_spinlock_t *spin) {
  ;
  return pthread_spin_destroy(spin);
}


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

x86 assembly (clang, -O2):
<___pthread_spin_destroy>:
jmp    1030 <pthread_spin_destroy@plt>

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

LLVM IR (-O2):
define i32 @___pthread_spin_destroy(i32* %0) {
%2 = tail call i32 @pthread_spin_destroy(i32* %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ chdir(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  if (argc == 1)
    exit(0);
  if (chdir(argv[1]) < 0)
    printf("cd failed!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1157 <main+0x27>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <chdir@plt>
cmp    $0x0,%rax
jge    117a <main+0x4a>
lea    0xe8b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
je     1154 <main+0x24>
mov    0x8(%rsi),%rdi
call   1040 <chdir@plt>
test   %rax,%rax
jns    1150 <main+0x20>
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"cd failed!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @exit(i32 0)
unreachable
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i64 @chdir(i8* %13)
%15 = icmp slt i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %10
%17 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %10
ret i32 0
}

LLVM IR (-O2):
@str = [11 x i8] c"cd failed!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i64 @chdir(i8* %8)
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
br label %13
13: ; preds = %11, %6
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
unsigned copy_bits(unsigned from, unsigned to, unsigned begin, unsigned end) {
  assert(begin <= end);
  unsigned mask = ~(~0 << (end - begin + 1)) << begin;
  return (to & ~mask) | (from & mask);
}


x86 assembly (clang, -O0):
<copy_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
setbe  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%ecx
sub    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x14(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x4(%rbp),%ecx
and    -0x14(%rbp),%ecx
or     %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_bits>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edx,%r15d
mov    %esi,%r14d
mov    %edi,%ebp
xor    %edi,%edi
sub    %edx,%ebx
setae  %dil
call   1030 <assert@plt>
add    $0x1,%bl
mov    $0xffffffff,%eax
mov    %ebx,%ecx
shl    %cl,%eax
not    %eax
mov    %r15d,%ecx
shl    %cl,%eax
xor    %r14d,%ebp
and    %eax,%ebp
xor    %r14d,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @copy_bits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %7
%11 = load i32, i32* %8
%12 = icmp ule i32 %10, %11
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i32, i32* %8
%16 = load i32, i32* %7
%17 = sub i32 %15, %16
%18 = add i32 %17, 1
%19 = shl i32 -1, %18
%20 = xor i32 %19, -1
%21 = load i32, i32* %7
%22 = shl i32 %20, %21
store i32 %22, i32* %9
%23 = load i32, i32* %6
%24 = load i32, i32* %9
%25 = xor i32 %24, -1
%26 = and i32 %23, %25
%27 = load i32, i32* %5
%28 = load i32, i32* %9
%29 = and i32 %27, %28
%30 = or i32 %26, %29
ret i32 %30
}

LLVM IR (-O2):
define i32 @copy_bits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp uge i32 %3, %2
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = sub i32 1, %2
%9 = add i32 %8, %3
%10 = shl nsw i32 -1, %9
%11 = xor i32 %10, -1
%12 = shl i32 %11, %2
%13 = xor i32 %12, -1
%14 = and i32 %13, %1
%15 = and i32 %12, %0
%16 = or i32 %14, %15
ret i32 %16
}
/* Variables and functions */
int atoi(char const *);
int CIntChars(const char *Src) {
  int ret = atoi(Src);
  return ret;
}


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

x86 assembly (clang, -O2):
<CIntChars>:
jmp    1030 <atoi@plt>

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

LLVM IR (-O2):
define i32 @CIntChars(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ liberties(int *, int);
int captured(int *m, int p) { return liberties(m, p) == 0; }


x86 assembly (clang, -O0):
<captured>:
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 <liberties@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @captured(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 i64 @liberties(i32* %5, i32 %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @captured(i32* %0, i32 %1) {
%3 = tail call i64 @liberties(i32* %0, i32 %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
unsigned char compare(char *first, char *second) {
  if ((unsigned int)first[0] > (unsigned int)second[0]) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jbe    112b <compare+0x2b>
movb   $0x1,-0x1(%rbp)
jmp    112f <compare+0x2f>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%al
cmp    (%rsi),%al
seta   %al
ret

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

LLVM IR (-O2):
define zeroext i8 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp ugt i8 %3, %4
%6 = zext i1 %5 to i8
ret i8 %6
}
int execute_vserver() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_vserver() {
ret i32 0
}
/* Variables and functions */
int SC_MatchString(char **);
int /*<<< orphan*/ SC_ScriptError(int /*<<< orphan*/ *);
int SC_MustMatchString(char **strings) {
  int i;
  i = SC_MatchString(strings);
  if (i == -1) {
    SC_ScriptError(NULL);
  }
  return i;
}


x86 assembly (clang, -O0):
<SC_MustMatchString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <SC_MatchString@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    114b <SC_MustMatchString+0x2b>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <SC_ScriptError@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SC_MustMatchString>:
push   %rbx
call   1030 <SC_MatchString@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    1134 <SC_MustMatchString+0x14>
xor    %edi,%edi
call   1040 <SC_ScriptError@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @SC_MustMatchString(i8** %0) {
%2 = tail call i32 @SC_MatchString(i8** %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @SC_ScriptError(i32* null)
br label %6
6: ; preds = %4, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main() {
  int x = 1;
#pragma omp parallel
#pragma omp single
  {
#pragma omp task shared(x) depend(out : x)
    x = 2;
#pragma omp task shared(x) depend(in : x)
    if (x != 2)
      abort();
#pragma omp task shared(x) depend(in : x)
    if (x != 2)
      abort();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     113e <main+0x2e>
mov    $0x0,%al
call   1030 <abort@plt>
cmpl   $0x2,-0x8(%rbp)
je     114f <main+0x3f>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalpha(int);
void t_isalpha_0x77() {
  Assert_real((isalpha(119)),
              "/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_isalpha.c",
              600, ("isalpha should be 1 for w"));
}


x86 assembly (clang, -O0):
<t_isalpha_0x77>:
push   %rbp
mov    %rsp,%rbp
mov    $0x77,%edi
call   1030 <isalpha@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x258,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0x77>:
push   %rax
mov    $0x77,%edi
call   1030 <isalpha@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x258,%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_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for w\00"
define void @t_isalpha_0x77() {
%1 = call i32 @isalpha(i32 119)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 600, i8* getelementptr inbounds ([26 x i8], [26 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_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for w\00"
define void @t_isalpha_0x77() {
%1 = tail call i32 @isalpha(i32 119)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 600, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void write_rflags(unsigned long f) {
  asm volatile("push %0; popf\n\t" : : "rm"(f));
}


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

x86 assembly (clang, -O2):
<write_rflags>:
mov    %rdi,-0x8(%rsp)
push   -0x8(%rsp)
popf
ret

LLVM IR (-O0):
define void @write_rflags(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
ret void
}

LLVM IR (-O2):
define void @write_rflags(i64 %0) {
tail call void asm sideeffect "push $0; popf\0A\09", "rm,~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void emit_help(void) {
  fputs("Usage: ... | copycat [-n]\n", stderr);
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<emit_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<emit_help>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Usage: ... | copycat [-n]\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [27 x i8] c"Usage: ... | copycat [-n]\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal_(char *, int, int, int);
void test_int_equal_fail() {
  assert_int_equal_("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/hughbien/assertive/refs/"
                    "heads/master/test/fail_test.c",
                    30, (1), (-1));
}


x86 assembly (clang, -O0):
<test_int_equal_fail>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1e,%esi
mov    $0x1,%edx
mov    $0xffffffff,%ecx
call   1030 <assert_int_equal_@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_int_equal_fail>:
lea    0xee9(%rip),%rdi
mov    $0x1e,%esi
mov    $0x1,%edx
mov    $0xffffffff,%ecx
jmp    1030 <assert_int_equal_@plt>

LLVM IR (-O0):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hughbien/assertive/refs/heads/master/test/fail_test.c\00"
define void @test_int_equal_fail() {
%1 = call i32 @assert_int_equal_(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 30, i32 1, i32 -1)
ret void
}

LLVM IR (-O2):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hughbien/assertive/refs/heads/master/test/fail_test.c\00"
define void @test_int_equal_fail() {
%1 = tail call i32 @assert_int_equal_(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 30, i32 1, i32 -1)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ prg8setBank0(int);
void m193setParams6003(uint16_t addr, uint8_t val) {
  (void)addr;
  prg8setBank0(val << 13);
}


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

x86 assembly (clang, -O2):
mov    %esi,%edi
shl    $0xd,%edi
jmp    1030 <prg8setBank0@plt>

LLVM IR (-O0):
define void @m193setParams6003(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 = shl i32 %6, 13
%8 = call i32 @prg8setBank0(i32 %7)
ret void
}

LLVM IR (-O2):
define void @m193setParams6003(i32 %0, i32 %1) {
%3 = shl i32 %1, 13
%4 = tail call i32 @prg8setBank0(i32 %3)
ret void
}
double basic_mbytes(bytes)
int bytes;
{ return ((double)bytes / 1024.0 / 1024.0); }


x86 assembly (clang, -O0):
<basic_mbytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeec(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xee0(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<basic_mbytes>:
cvtsi2sd %edi,%xmm0
movsd  0xef4(%rip),%xmm1
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @basic_mbytes(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 1.024000e+03
%6 = fdiv double %5, 1.024000e+03
ret double %6
}

LLVM IR (-O2):
define double @basic_mbytes(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 0x3F50000000000000
%4 = fmul double %3, 0x3F50000000000000
ret double %4
}
int fgen_get_bit(const unsigned char *bitstring, int bitnumber) {
  return (bitstring[bitnumber / 8] & (1 << (bitnumber & 7))) >> (bitnumber & 7);
}


x86 assembly (clang, -O0):
<fgen_get_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgen_get_bit>:
mov    %esi,%ecx
lea    0x7(%rcx),%eax
test   %esi,%esi
cmovns %esi,%eax
sar    $0x3,%eax
cltq
movzbl (%rdi,%rax,1),%edx
and    $0x7,%cl
mov    $0x1,%eax
shl    %cl,%eax
and    %edx,%eax
shr    %cl,%eax
ret

LLVM IR (-O0):
define i32 @fgen_get_bit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sdiv i32 %6, 8
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i32, i32* %4
%13 = and i32 %12, 7
%14 = shl i32 1, %13
%15 = and i32 %11, %14
%16 = load i32, i32* %4
%17 = and i32 %16, 7
%18 = ashr i32 %15, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @fgen_get_bit(i8* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 8
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = and i32 %1, 7
%9 = shl nuw nsw i32 1, %8
%10 = and i32 %9, %7
%11 = lshr i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int get_action_val_name_any(char *, char *, int, int);
int get_action_val_name_gr(char *saction, char *f_val, int len) {
  return get_action_val_name_any(saction, f_val, len, 2);
}


x86 assembly (clang, -O0):
<get_action_val_name_gr>:
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    $0x2,%ecx
call   1030 <get_action_val_name_any@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_action_val_name_gr>:
mov    $0x2,%ecx
jmp    1030 <get_action_val_name_any@plt>

LLVM IR (-O0):
define i32 @get_action_val_name_gr(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 @get_action_val_name_any(i8* %7, i8* %8, i32 %9, i32 2)
ret i32 %10
}

LLVM IR (-O2):
define i32 @get_action_val_name_gr(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @get_action_val_name_any(i8* %0, i8* %1, i32 %2, i32 2)
ret i32 %4
}
int test_imm_52uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x52 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_52uint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 82
%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_52uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 82
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int remove_proc_subtree(const char *name, struct proc_dir_entry *parent) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.proc_dir_entry = type opaque
define i32 @remove_proc_subtree(i8* %0, %struct.proc_dir_entry* %1) {
%3 = alloca i8*
%4 = alloca %struct.proc_dir_entry*
store i8* %0, i8** %3
store %struct.proc_dir_entry* %1, %struct.proc_dir_entry** %4
ret i32 0
}

LLVM IR (-O2):
%struct.proc_dir_entry = type opaque
define i32 @remove_proc_subtree(i8* nocapture readnone %0, %struct.proc_dir_entry* nocapture readnone %1) {
ret i32 0
}