xunge/DecIR huggingface dataset:
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISREG(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int file_exists(const char *dirname) {
  struct stat finfo;
  return (stat(dirname, &finfo) == 0) && S_ISREG(finfo.st_mode);
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    115d <file_exists+0x3d>
mov    -0x10(%rbp),%edi
call   1040 <S_ISREG@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <file_exists+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1040 <S_ISREG@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @file_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%9 = load i32, i32* %8
%10 = call i64 @S_ISREG(i32 %9)
%11 = icmp ne i64 %10, 0
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ false, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_exists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i64 @S_ISREG(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
void wake_lock_destroy(struct wake_lock *lock) {}


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

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

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

LLVM IR (-O2):
%struct.wake_lock = type opaque
define void @wake_lock_destroy(%struct.wake_lock* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("halabaloooo!!!!!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [17 x i8] c"halabaloooo!!!!!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
char *put_padding_r(const unsigned w, const char wc, char *p, char *e) {
  char *const b = e - w;
  for (; b < p; *--p = wc) {
  }
  return p;
}


x86 assembly (clang, -O0):
<put_padding_r>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x4(%rbp),%ecx
mov    %ecx,%edx
xor    %ecx,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1157 <put_padding_r+0x57>
jmp    113d <put_padding_r+0x3d>
mov    -0x5(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,-0x1(%rax)
jmp    112a <put_padding_r+0x2a>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_padding_r>:
push   %rbx
mov    %edi,%eax
mov    %rcx,%rbx
sub    %rax,%rbx
cmp    %rdx,%rbx
jae    1132 <put_padding_r+0x22>
add    %rax,%rdx
sub    %rcx,%rdx
movzbl %sil,%esi
mov    %rbx,%rdi
call   1030 <memset@plt>
jmp    1135 <put_padding_r+0x25>
mov    %rdx,%rbx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @put_padding_r(i32 %0, i8 signext %1, i8* writeonly %2, i8* readnone %3) {
%5 = ptrtoint i8* %2 to i64
%6 = ptrtoint i8* %3 to i64
%7 = zext i32 %0 to i64
%8 = sub nsw i64 0, %7
%9 = getelementptr inbounds i8, i8* %3, i64 %8
%10 = icmp ult i8* %9, %2
br i1 %10, label %11, label %17
11: ; preds = %4
%12 = add i64 %5, %7
%13 = sub i64 %6, %12
%14 = getelementptr i8, i8* %2, i64 %13
%15 = add i64 %5, %7
%16 = sub i64 %15, %6
br label %17
17: ; preds = %11, %4
%18 = phi i8* [ %2, %4 ], [ %14, %11 ]
ret i8* %18
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t test_tagged_nonint_bitmask2(uint32_t val) { return val; }


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

x86 assembly (clang, -O2):
<test_tagged_nonint_bitmask2>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @test_tagged_nonint_bitmask2(i32 returned %0) {
ret i32 %0
}
PHP_METHOD(IPv6Address, __construct) {}


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

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

LLVM IR (-O0):
define i32 @PHP_METHOD(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @PHP_METHOD(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() { printf("Usage: ./grocery 8080"); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"Usage: ./grocery 8080\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Usage: ./grocery 8080\00"
define void @print_help() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}
float obdConvert_11(unsigned int A, unsigned int B, unsigned int C,
                    unsigned int D) {
  return (float)A * 100.0f / 255.0f;
}


x86 assembly (clang, -O0):
<obdConvert_11>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  0xee4(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xed4(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<obdConvert_11>:
mov    %edi,%eax
cvtsi2ss %rax,%xmm0
mulss  0xef1(%rip),%xmm0
divss  0xeed(%rip),%xmm0
ret

LLVM IR (-O0):
define float @obdConvert_11(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = uitofp i32 %9 to float
%11 = fmul float %10, 1.000000e+02
%12 = fdiv float %11, 2.550000e+02
ret float %12
}

LLVM IR (-O2):
define float @obdConvert_11(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = uitofp i32 %0 to float
%6 = fmul float %5, 1.000000e+02
%7 = fdiv float %6, 2.550000e+02
ret float %7
}
char *strchr(const char *s, int c) {
  for (; *s; s++)
    if (*s == c)
      return (char *)s;
  return 0;
}


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

x86 assembly (clang, -O2):
<strchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <strchr+0x23>
mov    %rdi,%rax
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %esi,%ecx
je     1125 <strchr+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = sext i8 %6 to i32
%9 = icmp eq i32 %8, %1
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %2
%15 = phi i8* [ null, %2 ], [ null, %10 ], [ %7, %5 ]
ret i8* %15
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void freeVector(double *v) {
  {
    if (v) {
      free(v);
      v = NULL;
    }
  };
}


x86 assembly (clang, -O0):
<freeVector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <freeVector+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeVector>:
test   %rdi,%rdi
je     111a <freeVector+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @freeVector(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = icmp ne double* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double*, double** %2
%7 = call i32 @free(double* %6)
store double* null, double** %2
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @freeVector(double* %0) {
%2 = icmp eq double* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(double* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/);
void dishonorFamily(int tab[9][9]) {
  srand(time(0));
  for (int i = 0; i < 9 * 9; i++)
    tab[i / 9][i % 9] = 0;
}


x86 assembly (clang, -O0):
<dishonorFamily>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x51,-0xc(%rbp)
jge    1199 <dishonorFamily+0x79>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    -0x18(%rbp),%rax
movslq %edx,%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1141 <dishonorFamily+0x21>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dishonorFamily>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x144,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @dishonorFamily([9 x i32]* %0) {
%2 = alloca [9 x i32]*
%3 = alloca i32
store [9 x i32]* %0, [9 x i32]** %2
%4 = call i32 @time(i32 0)
%5 = call i32 @srand(i32 %4)
store i32 0, i32* %3
br label %6
6: ; preds = %19, %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 81
br i1 %8, label %9, label %22
9: ; preds = %6
%10 = load [9 x i32]*, [9 x i32]** %2
%11 = load i32, i32* %3
%12 = sdiv i32 %11, 9
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [9 x i32], [9 x i32]* %10, i64 %13
%15 = load i32, i32* %3
%16 = srem i32 %15, 9
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [9 x i32], [9 x i32]* %14, i64 0, i64 %17
store i32 0, i32* %18
br label %19
19: ; preds = %9
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %6
22: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @dishonorFamily([9 x i32]* nocapture writeonly %0) {
%2 = bitcast [9 x i32]* %0 to i8*
%3 = tail call i32 @time(i32 0)
%4 = tail call i32 @srand(i32 %3)
ret void
}
int test_imm_4Eint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x4E << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_4Eint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 335007449088
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void do_pushb_neg(void) {
  unsigned long long int block[3];
  __asm__ __volatile__("movq  %0, %%rdx\n\t"
                       "pushq $0x55555555\n\t"
                       "movq  %%rsp, 0(%%rdx)\n\t"
                       ".byte 0x6A,0xEE\n\t"
                       "movq  %%rsp, 8(%%rdx)\n\t"
                       "popq  %%rax\n\t"
                       "movq  %%rax,16(%%rdx)\n\t"
                       "movq  0(%%rdx),%%rsp\n\t"
                       "addq  $8, %%rsp"
                       :
                       : "r"(&block)
                       : "rax", "rdx", "cc", "memory");
  printf("  pushb_neg: delta %lld, top64 0x%016llx\n", block[0] - block[1],
         block[2]);
}


x86 assembly (clang, -O0):
<do_pushb_neg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rcx
mov    %rcx,%rdx
push   $0x55555555
mov    %rsp,(%rdx)
push   $0xffffffffffffffee
mov    %rsp,0x8(%rdx)
pop    %rax
mov    %rax,0x10(%rdx)
mov    (%rdx),%rsp
add    $0x8,%rsp
mov    -0x20(%rbp),%rsi
sub    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_pushb_neg>:
sub    $0x18,%rsp
mov    %rsp,%rcx
mov    %rcx,%rdx
push   $0x55555555
mov    %rsp,(%rdx)
push   $0xffffffffffffffee
mov    %rsp,0x8(%rdx)
pop    %rax
mov    %rax,0x10(%rdx)
mov    (%rdx),%rsp
add    $0x8,%rsp
mov    (%rsp),%rsi
mov    0x10(%rsp),%rdx
sub    0x8(%rsp),%rsi
lea    0xeb7(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [42 x i8] c" pushb_neg: delta %lld, top64 0x%016llx\0A\00"
define void @do_pushb_neg() {
%1 = alloca [3 x i64]
%2 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 0
%3 = load i64, i64* %2
%4 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 1
%5 = load i64, i64* %4
%6 = sub i64 %3, %5
%7 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 2
%8 = load i64, i64* %7
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c" pushb_neg: delta %lld, top64 0x%016llx\0A\00"
define void @do_pushb_neg() {
%1 = alloca [3 x i64]
%2 = bitcast [3 x i64]* %1 to i8*
%3 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 0
%4 = load i64, i64* %3
%5 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 1
%6 = load i64, i64* %5
%7 = sub i64 %4, %6
%8 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 2
%9 = load i64, i64* %8
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i64 %7, i64 %9)
ret void
}
int fun445() { return 445; }


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

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

LLVM IR (-O0):
define i32 @fun445() {
ret i32 445
}

LLVM IR (-O2):
define i32 @fun445() {
ret i32 445
}
void movback(i) int i;
{
  int j;
  for (j = i - 1; j >= 0; j--)
    backone(j);
}


x86 assembly (clang, -O0):
<movback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1146 <movback+0x36>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <backone@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <movback+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<movback>:
push   %rbx
test   %edi,%edi
jle    1132 <movback+0x22>
mov    %edi,%ebx
add    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
lea    -0x2(%rbx),%edi
xor    %eax,%eax
call   1030 <backone@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1120 <movback+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @movback(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1
store i32 %5, i32* %3
br label %6
6: ; preds = %12, %1
%7 = load i32, i32* %3
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = load i32, i32* %3
%11 = call i32 (i32, ...) bitcast (i32 (...)* @backone to i32 (i32, ...)*)(i32 %10)
br label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = add nsw i32 %13, -1
store i32 %14, i32* %3
br label %6
15: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @movback(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @backone to i32 (i32, ...)*)(i32 %5)
%7 = icmp ugt i32 %4, 1
br i1 %7, label %3, label %8
8: ; preds = %3, %1
ret void
}
char *nullprotect(char *s) { return s ? s : "NULL"; }


x86 assembly (clang, -O0):
<nullprotect>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1120 <nullprotect+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <nullprotect+0x30>
lea    0xed9(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <nullprotect+0x30>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nullprotect>:
test   %rdi,%rdi
lea    0xef6(%rip),%rax
cmovne %rdi,%rax
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"NULL\00"
define i8* @nullprotect(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0
ret i8* %3
}
int main() {
  struct foo {
    int a, b;
  };
  extern struct foo *bar();
  extern int baz();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fputs(const char *str, FILE *stream) {
  int rc;
  return rc;
}


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

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

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

LLVM IR (-O2):
define i32 @fputs(i8* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 undef
}
char *langDbgDevV9958() { return "V9958"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"V9958\00"
define i8* @langDbgDevV9958() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
int alphabetic(c)
int c;
{ return rl_alphabetic(c); }


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

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

LLVM IR (-O0):
define i32 @alphabetic(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @rl_alphabetic to i32 (i32, ...)*)(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @alphabetic(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @rl_alphabetic to i32 (i32, ...)*)(i32 %0)
ret i32 %2
}
void kmpx(m, buf, len) char *m, *buf;
int len;
{
  printf("\nunsigned char %skey[] ={\n", m);
  print_c_hex_string(buf, len);
  printf("\n};\n");
}


x86 assembly (clang, -O0):
<kmpx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x0,%al
call   1040 <print_c_hex_string@plt>
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kmpx>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xebe(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <print_c_hex_string@plt>
lea    0xebf(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"\0Aunsigned char %skey[] ={\0A\00"
@.str.1 = [5 x i8] c"\0A};\0A\00"
define void @kmpx(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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @print_c_hex_string to i32 (i8*, i32, ...)*)(i8* %9, i32 %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"\0Aunsigned char %skey[] ={\0A\00"
@str = [4 x i8] c"\0A};\00"
define void @kmpx(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @print_c_hex_string to i32 (i8*, i32, ...)*)(i8* %1, i32 %2)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
void foo461(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo461(i32 %0) {
ret void
}
void yy_1_LinkTarget(char *yytext, int yyleng) {
  ;
  ;
}


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

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

LLVM IR (-O0):
define void @yy_1_LinkTarget(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @yy_1_LinkTarget(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
char *station_datatype_where(char *station, char *datatype) {
  static char where[256];
  sprintf(where, "station = '%s' and datatype = '%s'", station, datatype);
  return where;
}


x86 assembly (clang, -O0):
<station_datatype_where>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0x2f11(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2efe(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<station_datatype_where>:
push   %rbx
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0x2f22(%rip),%rbx
lea    0xedb(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@station_datatype_where.where = internal global [256 x i8] zeroinitializer
@.str = [35 x i8] c"station = '%s' and datatype = '%s'\00"
define i8* @station_datatype_where(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @sprintf(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @station_datatype_where.where, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @station_datatype_where.where, i64 0, i64 0)
}

LLVM IR (-O2):
@station_datatype_where.where = internal global [256 x i8] zeroinitializer
@.str = [35 x i8] c"station = '%s' and datatype = '%s'\00"
define i8* @station_datatype_where(i8* %0, i8* %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([256 x i8], [256 x i8]* @station_datatype_where.where, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @station_datatype_where.where, i64 0, i64 0)
}
/* Variables and functions */
void *realloc(void *, size_t);
void *rpl_realloc(void *p, size_t n) {
  if (n == 0)
    n = 1;
  return realloc(p, n);
}


x86 assembly (clang, -O0):
<rpl_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <rpl_realloc+0x23>
movq   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpl_realloc>:
test   %rsi,%rsi
mov    $0x1,%eax
cmove  %rax,%rsi
jmp    1030 <realloc@plt>

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

LLVM IR (-O2):
define noalias i8* @rpl_realloc(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)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void FindUnderscores_(void) {
  printf("#ifndef F77_SINGLE_UNDERSCORE\n");
  printf("#define F77_SINGLE_UNDERSCORE\n");
  printf("#endif\n");
}


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

x86 assembly (clang, -O2):
<FindUnderscores_>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xefa(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0c(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"#ifndef F77_SINGLE_UNDERSCORE\0A\00"
@.str.1 = [31 x i8] c"#define F77_SINGLE_UNDERSCORE\0A\00"
@.str.2 = [8 x i8] c"#endif\0A\00"
define void @FindUnderscores_() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c"#ifndef F77_SINGLE_UNDERSCORE\00"
@str.3 = [30 x i8] c"#define F77_SINGLE_UNDERSCORE\00"
@str.4 = [7 x i8] c"#endif\00"
define void @FindUnderscores_() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vdmprintf(char *);
void vdmend() { vdmprintf("}p\x1e"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"}p\1E\00"
define void @vdmend() {
%1 = call i32 @vdmprintf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"}p\1E\00"
define void @vdmend() {
%1 = tail call i32 @vdmprintf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int iis_s3c2410_set_samplesize(unsigned int);
int iis_set_samplesize(unsigned size) {
  return iis_s3c2410_set_samplesize(size);
}


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

x86 assembly (clang, -O2):
<iis_set_samplesize>:
jmp    1030 <iis_s3c2410_set_samplesize@plt>

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

LLVM IR (-O2):
define i32 @iis_set_samplesize(i32 %0) {
%2 = tail call i32 @iis_s3c2410_set_samplesize(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert_in_range_2(int, int);
int /*<<< orphan*/ assert_in_wide_range(int);
int /*<<< orphan*/ clang_analyzer_eval(int);
void less_or_equal(int m, int n) {
  assert_in_range_2(m, n);
  if (m < n)
    return;
  assert_in_wide_range(m - n);
  clang_analyzer_eval(n <= m);
}


x86 assembly (clang, -O0):
<less_or_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <assert_in_range_2@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115a <less_or_equal+0x2a>
jmp    1178 <less_or_equal+0x48>
mov    -0x4(%rbp),%edi
sub    -0x8(%rbp),%edi
call   1040 <assert_in_wide_range@plt>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<less_or_equal>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <assert_in_range_2@plt>
sub    %ebp,%ebx
jge    1147 <less_or_equal+0x17>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %ebx,%edi
call   1040 <assert_in_wide_range@plt>
mov    $0x1,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <clang_analyzer_eval@plt>

LLVM IR (-O0):
define void @less_or_equal(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @assert_in_range_2(i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %2
br label %22
12: ; preds = %2
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = sub nsw i32 %13, %14
%16 = call i32 @assert_in_wide_range(i32 %15)
%17 = load i32, i32* %4
%18 = load i32, i32* %3
%19 = icmp sle i32 %17, %18
%20 = zext i1 %19 to i32
%21 = call i32 @clang_analyzer_eval(i32 %20)
br label %22
22: ; preds = %12, %11
ret void
}

LLVM IR (-O2):
define void @less_or_equal(i32 %0, i32 %1) {
%3 = tail call i32 @assert_in_range_2(i32 %0, i32 %1)
%4 = icmp slt i32 %0, %1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = sub nsw i32 %0, %1
%7 = tail call i32 @assert_in_wide_range(i32 %6)
%8 = tail call i32 @clang_analyzer_eval(i32 1)
br label %9
9: ; preds = %2, %5
ret void
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ setenv(char *, char *, int);
int /*<<< orphan*/ strcat(char *, char *);
void addPath(char *add) {
  char *path = getenv("PATH");
  strcat(path, ":");
  strcat(path, add);
  setenv("PATH", path, 1);
}


x86 assembly (clang, -O0):
<addPath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeae(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <strcat@plt>
mov    -0x10(%rbp),%rsi
lea    0xe8c(%rip),%rdi
mov    $0x1,%edx
call   1040 <setenv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addPath>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
lea    0xec1(%rip),%r14
mov    %r14,%rdi
call   1030 <getenv@plt>
mov    %rax,%rbx
lea    0xeb4(%rip),%rsi
mov    %rax,%rdi
call   1050 <strcat@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <strcat@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <setenv@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"PATH\00"
@.str.1 = [2 x i8] c":\00"
define void @addPath(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = load i8*, i8** %3
%8 = load i8*, i8** %2
%9 = call i32 @strcat(i8* %7, i8* %8)
%10 = load i8*, i8** %3
%11 = call i32 @setenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %10, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"PATH\00"
@.str.1 = [2 x i8] c":\00"
define void @addPath(i8* %0) {
%2 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @strcat(i8* %2, i8* %0)
%5 = tail call i32 @setenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2, i32 1)
ret void
}
void search_colour_position(unsigned int *colour_and_position,
                            char guessword_element, char codeword_element,
                            char *code_position_count,
                            char *guess_position_count) {
  if (guessword_element == codeword_element) {
    *colour_and_position = *colour_and_position + 1;
    *code_position_count = 1;
    *guess_position_count = 1;
  }
}


x86 assembly (clang, -O0):
<search_colour_position>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%dl
mov    %rdi,-0x8(%rbp)
mov    %dl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
movsbl -0x9(%rbp),%eax
movsbl -0xa(%rbp),%ecx
cmp    %ecx,%eax
jne    1148 <search_colour_position+0x48>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
movb   $0x1,(%rax)
mov    -0x20(%rbp),%rax
movb   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<search_colour_position>:
cmp    %dl,%sil
jne    110f <search_colour_position+0xf>
addl   $0x1,(%rdi)
movb   $0x1,(%rcx)
movb   $0x1,(%r8)
ret

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

LLVM IR (-O2):
define void @search_colour_position(i32* nocapture %0, i8 signext %1, i8 signext %2, i8* nocapture writeonly %3, i8* nocapture writeonly %4) {
%6 = icmp eq i8 %1, %2
br i1 %6, label %7, label %10
7: ; preds = %5
%8 = load i32, i32* %0
%9 = add i32 %8, 1
store i32 %9, i32* %0
store i8 1, i8* %3
store i8 1, i8* %4
br label %10
10: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void init_abort(char *str) {
  perror(str);
  exit(1);
}


x86 assembly (clang, -O0):
<init_abort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<init_abort>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @init_abort(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @init_abort(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
int GLMin(int x, int y) { return ((x < y) ? x : y); }


x86 assembly (clang, -O0):
<GLMin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <GLMin+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <GLMin+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GLMin>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @GLMin(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @GLMin(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
struct ibv_context {
  int dummy;
};
struct ibv_comp_channel {
  int dummy;
};

/* Variables and functions */
struct ibv_comp_channel *_create_comp_channel(struct ibv_context *);
int /*<<< orphan*/ dmtcp_plugin_disable_ckpt();
int /*<<< orphan*/ dmtcp_plugin_enable_ckpt();
struct ibv_comp_channel *ibv_create_comp_channel(struct ibv_context *context) {
  dmtcp_plugin_disable_ckpt();
  struct ibv_comp_channel *rslt = _create_comp_channel(context);
  dmtcp_plugin_enable_ckpt();
  return rslt;
}


x86 assembly (clang, -O0):
<ibv_create_comp_channel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <dmtcp_plugin_disable_ckpt@plt>
mov    -0x8(%rbp),%rdi
call   1040 <_create_comp_channel@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <dmtcp_plugin_enable_ckpt@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ibv_create_comp_channel>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <dmtcp_plugin_disable_ckpt@plt>
mov    %rbx,%rdi
call   1040 <_create_comp_channel@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <dmtcp_plugin_enable_ckpt@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.ibv_comp_channel = type { i32 }
%struct.ibv_context = type { i32 }
define %struct.ibv_comp_channel* @ibv_create_comp_channel(%struct.ibv_context* %0) {
%2 = alloca %struct.ibv_context*
%3 = alloca %struct.ibv_comp_channel*
store %struct.ibv_context* %0, %struct.ibv_context** %2
%4 = call i32 (...) @dmtcp_plugin_disable_ckpt()
%5 = load %struct.ibv_context*, %struct.ibv_context** %2
%6 = call %struct.ibv_comp_channel* @_create_comp_channel(%struct.ibv_context* %5)
store %struct.ibv_comp_channel* %6, %struct.ibv_comp_channel** %3
%7 = call i32 (...) @dmtcp_plugin_enable_ckpt()
%8 = load %struct.ibv_comp_channel*, %struct.ibv_comp_channel** %3
ret %struct.ibv_comp_channel* %8
}

LLVM IR (-O2):
%struct.ibv_comp_channel = type { i32 }
%struct.ibv_context = type { i32 }
define %struct.ibv_comp_channel* @ibv_create_comp_channel(%struct.ibv_context* %0) {
%2 = tail call i32 (...) @dmtcp_plugin_disable_ckpt()
%3 = tail call %struct.ibv_comp_channel* @_create_comp_channel(%struct.ibv_context* %0)
%4 = tail call i32 (...) @dmtcp_plugin_enable_ckpt()
ret %struct.ibv_comp_channel* %3
}
int foo(int theNum) {
  int newNum;
  newNum = theNum + 2;
  return (newNum);
}


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = add nsw i32 %0, 2
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x2f() {
  Assert_real((isprint(47)),
              "/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_isprint.c",
              240, ("isprint should be 1 for /"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x2f>:
push   %rax
mov    $0x2f,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0xf0,%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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for /\00"
define void @t_isprint_0x2f() {
%1 = call i32 @isprint(i32 47)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 240, 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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for /\00"
define void @t_isprint_0x2f() {
%1 = tail call i32 @isprint(i32 47)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 240, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}