xunge/DecIR huggingface dataset:
/* Type definitions */
struct utmpx {
  int dummy;
};
struct utmp {
  int dummy;
};

/* Variables and functions */
scalar_t__ __getutline(struct utmp const *);
struct utmpx *getutxline(const struct utmpx *line) {
  return (struct utmpx *)__getutline((const struct utmp *)line);
}


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

x86 assembly (clang, -O2):
<getutxline>:
jmp    1030 <__getutline@plt>

LLVM IR (-O0):
%struct.utmpx = type { i32 }
%struct.utmp = type { i32 }
define %struct.utmpx* @getutxline(%struct.utmpx* %0) {
%2 = alloca %struct.utmpx*
store %struct.utmpx* %0, %struct.utmpx** %2
%3 = load %struct.utmpx*, %struct.utmpx** %2
%4 = bitcast %struct.utmpx* %3 to %struct.utmp*
%5 = call i64 @__getutline(%struct.utmp* %4)
%6 = inttoptr i64 %5 to %struct.utmpx*
ret %struct.utmpx* %6
}

LLVM IR (-O2):
%struct.utmpx = type { i32 }
%struct.utmp = type { i32 }
define %struct.utmpx* @getutxline(%struct.utmpx* %0) {
%2 = bitcast %struct.utmpx* %0 to %struct.utmp*
%3 = tail call i64 @__getutline(%struct.utmp* %2)
%4 = inttoptr i64 %3 to %struct.utmpx*
ret %struct.utmpx* %4
}
int sign(int a) { return a > 0 ? 1.0f : a < 0 ? -1.0f : 0.0f; }


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1123 <sign+0x23>
movss  0xeeb(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1158 <sign+0x58>
mov    -0x4(%rbp),%eax
movss  0xed2(%rip),%xmm0
xorps  %xmm1,%xmm1
movss  %xmm1,-0x10(%rbp)
cmp    $0x0,%eax
movss  %xmm0,-0xc(%rbp)
jl     114e <sign+0x4e>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvttss2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
xor    %ecx,%ecx
test   %edi,%edi
setne  %cl
neg    %ecx
test   %edi,%edi
mov    $0x1,%eax
cmovle %ecx,%eax
ret

LLVM IR (-O0):
define i32 @sign(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, float -1.000000e+00, float 0.000000e+00
br label %11
11: ; preds = %6, %5
%12 = phi float [ 1.000000e+00, %5 ], [ %10, %6 ]
%13 = fptosi float %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @sign(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = sext i1 %2 to i32
%4 = icmp slt i32 %0, 1
%5 = select i1 %4, i32 %3, i32 1
ret i32 %5
}
/* Variables and functions */
int hex2dec(char *, int /*<<< orphan*/);
int xstr2int(char *hex) { return hex2dec(hex, 0); }


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

x86 assembly (clang, -O2):
<xstr2int>:
xor    %esi,%esi
jmp    1030 <hex2dec@plt>

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

LLVM IR (-O2):
define i32 @xstr2int(i8* %0) {
%2 = tail call i32 @hex2dec(i8* %0, i32 0)
ret i32 %2
}
int sump(int n) {
  int sum = 0;
  int i = 0;
  for (i = 1; i <= n; i++) {
    sum += i;
  }
  return sum;
}


x86 assembly (clang, -O0):
<sump>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     113f <sump+0x3f>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111c <sump+0x1c>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sump>:
test   %edi,%edi
jle    1118 <sump+0x18>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
shr    %rcx
lea    (%rcx,%rdi,2),%eax
add    $0xffffffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sump(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = shl nuw i32 %0, 1
%5 = add nsw i32 %0, -1
%6 = zext i32 %5 to i33
%7 = add nsw i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %4, %11
%13 = add i32 %12, -1
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_dvector(double *v, long nl, long nh) { free((char *)(v + nl - 1)); }


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

x86 assembly (clang, -O2):
<free_dvector>:
lea    (%rdi,%rsi,8),%rdi
add    $0xfffffffffffffff8,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_dvector(double* %0, i64 %1, i64 %2) {
%4 = alloca double*
%5 = alloca i64
%6 = alloca i64
store double* %0, double** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load double*, double** %4
%8 = load i64, i64* %5
%9 = getelementptr inbounds double, double* %7, i64 %8
%10 = getelementptr inbounds double, double* %9, i64 -1
%11 = bitcast double* %10 to i8*
%12 = call i32 @free(i8* %11)
ret void
}

LLVM IR (-O2):
define void @free_dvector(double* nocapture %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds double, double* %0, i64 %1
%5 = getelementptr inbounds double, double* %4, i64 -1
%6 = bitcast double* %5 to i8*
%7 = tail call i32 @free(i8* %6)
ret void
}
void DumpTracies(void) {}


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

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

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

LLVM IR (-O2):
define void @DumpTracies() {
ret void
}
unsigned short min(unsigned short x) { return 0; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
xor    %eax,%eax
movzwl %ax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @min(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
ret i16 0
}

LLVM IR (-O2):
define zeroext i16 @min(i16 zeroext %0) {
ret i16 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ _OSSwapInt64(int /*<<< orphan*/);
void OSWriteSwapInt64(volatile void *base, uintptr_t offset, uint64_t data) {
  *(uint64_t *)((uintptr_t)base + offset) = _OSSwapInt64(data);
}


x86 assembly (clang, -O0):
<OSWriteSwapInt64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <_OSSwapInt64@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OSWriteSwapInt64>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %edx,%edi
call   1030 <_OSSwapInt64@plt>
mov    %eax,(%rbx,%r14,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @OSWriteSwapInt64(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @_OSSwapInt64(i32 %7)
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i64
%11 = load i64, i64* %5
%12 = add i64 %10, %11
%13 = inttoptr i64 %12 to i32*
store i32 %8, i32* %13
ret void
}

LLVM IR (-O2):
define void @OSWriteSwapInt64(i8* %0, i64 %1, i32 %2) {
%4 = tail call i32 @_OSSwapInt64(i32 %2)
%5 = ptrtoint i8* %0 to i64
%6 = add i64 %5, %1
%7 = inttoptr i64 %6 to i32*
store i32 %4, i32* %7
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ PTHREAD_MUTEX_INITIALIZER;
void pthread_mutex_init_value(pthread_mutex_t *mutex) {
  pthread_mutex_t init_val = PTHREAD_MUTEX_INITIALIZER;
  if (!mutex)
    return;
  *mutex = init_val;
}


x86 assembly (clang, -O0):
<pthread_mutex_init_value>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1124 <pthread_mutex_init_value+0x24>
jmp    112d <pthread_mutex_init_value+0x2d>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_mutex_init_value>:
test   %rdi,%rdi
je     1110 <pthread_mutex_init_value+0x10>
mov    0x2ed4(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
@PTHREAD_MUTEX_INITIALIZER = global i32 0
define void @pthread_mutex_init_value(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32, i32* @PTHREAD_MUTEX_INITIALIZER
store i32 %4, i32* %3
%5 = load i32*, i32** %2
%6 = icmp ne i32* %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
br label %11
8: ; preds = %1
%9 = load i32, i32* %3
%10 = load i32*, i32** %2
store i32 %9, i32* %10
br label %11
11: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
@PTHREAD_MUTEX_INITIALIZER = global i32 0
define void @pthread_mutex_init_value(i32* writeonly %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = load i32, i32* @PTHREAD_MUTEX_INITIALIZER
store i32 %4, i32* %0
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello,World!\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 = [14 x i8] c"Hello,World!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello,World!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int raw_irqs_disabled_flags(unsigned long flags) { return (flags > 0); }


x86 assembly (clang, -O0):
<raw_irqs_disabled_flags>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<raw_irqs_disabled_flags>:
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
ret

LLVM IR (-O0):
define i32 @raw_irqs_disabled_flags(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ugt i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @raw_irqs_disabled_flags(i64 %0) {
%2 = icmp ne i64 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct addrinfo {
  int dummy;
};
typedef int /*<<< orphan*/ addr;

/* Variables and functions */
struct addrinfo **malloc(int);
struct addrinfo **create_addr() {
  struct addrinfo **addr;
  addr = malloc(sizeof(addr));
  return addr;
}


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

x86 assembly (clang, -O2):
<create_addr>:
mov    $0x8,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
%struct.addrinfo = type { i32 }
define %struct.addrinfo** @create_addr() {
%1 = alloca %struct.addrinfo**
%2 = call %struct.addrinfo** @malloc(i32 8)
store %struct.addrinfo** %2, %struct.addrinfo*** %1
%3 = load %struct.addrinfo**, %struct.addrinfo*** %1
ret %struct.addrinfo** %3
}

LLVM IR (-O2):
%struct.addrinfo = type { i32 }
define noalias %struct.addrinfo** @create_addr() {
%1 = tail call %struct.addrinfo** @malloc(i32 8)
ret %struct.addrinfo** %1
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Here's one way to print a ");
  printf("long string.\n");
  printf("Here's another way to print a long string.\n");
  printf("Here's the newest way to print a "
         "long string.\n");
  getchar();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xef5(%rip),%rdi
call   1030 <puts@plt>
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Here's one way to print a \00"
@.str.1 = [14 x i8] c"long string.\0A\00"
@.str.2 = [44 x i8] c"Here's another way to print a long string.\0A\00"
@.str.3 = [47 x i8] c"Here's the newest way to print a long string.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Here's one way to print a \00"
@str = [13 x i8] c"long string.\00"
@str.4 = [43 x i8] c"Here's another way to print a long string.\00"
@str.5 = [46 x i8] c"Here's the newest way to print a long string.\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.5, i64 0, i64 0))
%5 = tail call i32 (...) @getchar()
ret i32 0
}
int test_imm_6Eint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x6E << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_6Eint64_midword_mem>:
testb  $0x6e,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_6Eint64_midword_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, 16
%6 = and i64 %5, 110
%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_6Eint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 7208960
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
double time_diff(double t1, double t2) {
  double d;
  d = t1 - t2;
  return d < 0.00001 ? 0.0 : d;
}


x86 assembly (clang, -O0):
<time_diff>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    113d <time_diff+0x3d>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1147 <time_diff+0x47>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_diff>:
subsd  %xmm1,%xmm0
movapd %xmm0,%xmm1
cmpltsd 0xeef(%rip),%xmm1
andnpd %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @time_diff(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fsub double %6, %7
store double %8, double* %5
%9 = load double, double* %5
%10 = fcmp olt double %9, 1.000000e-05
br i1 %10, label %11, label %12
11: ; preds = %2
br label %14
12: ; preds = %2
%13 = load double, double* %5
br label %14
14: ; preds = %12, %11
%15 = phi double [ 0.000000e+00, %11 ], [ %13, %12 ]
ret double %15
}

LLVM IR (-O2):
define double @time_diff(double %0, double %1) {
%3 = fsub double %0, %1
%4 = fcmp olt double %3, 1.000000e-05
%5 = select i1 %4, double 0.000000e+00, double %3
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ IF_fct_2(char);
void IF_Ldiff(void) { IF_fct_2('#'); }


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

x86 assembly (clang, -O2):
<IF_Ldiff>:
mov    $0x23,%edi
jmp    1030 <IF_fct_2@plt>

LLVM IR (-O0):
define void @IF_Ldiff() {
%1 = call i32 @IF_fct_2(i8 signext 35)
ret void
}

LLVM IR (-O2):
define void @IF_Ldiff() {
%1 = tail call i32 @IF_fct_2(i8 signext 35)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t f3(uint32_t x, uint32_t y, uint32_t z) { return (x | ~y) ^ z; }


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
or     %ecx,%eax
xor    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
mov    %esi,%eax
not    %eax
or     %edi,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @f3(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = xor i32 %8, -1
%10 = or i32 %7, %9
%11 = load i32, i32* %6
%12 = xor i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @f3(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %1, -1
%5 = or i32 %4, %0
%6 = xor i32 %5, %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ AT_EACCESS;
int O_DIRECTORY;
int O_RDONLY;
int /*<<< orphan*/ X_OK;
int /*<<< orphan*/ close(int);
int faccessat(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int open(char *, int);
int executable_at(char *dir, char *prog) {
  int dirfd;
  int ret;
  dirfd = open(dir, O_RDONLY | O_DIRECTORY);
  ret = faccessat(dirfd, prog, AT_EACCESS, X_OK);
  close(dirfd);
  return (ret);
}


x86 assembly (clang, -O0):
<executable_at>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
mov    0x2e7c(%rip),%rax
or     (%rax),%esi
call   1050 <open@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    0x2e5c(%rip),%rax
mov    (%rax),%edx
mov    0x2e6b(%rip),%rax
mov    (%rax),%ecx
call   1030 <faccessat@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<executable_at>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x2eab(%rip),%rax
mov    0x2e8c(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
call   1050 <open@plt>
mov    %eax,%ebp
mov    0x2e72(%rip),%rax
mov    (%rax),%edx
mov    0x2e81(%rip),%rax
mov    (%rax),%ecx
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <faccessat@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1040 <close@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
@O_DIRECTORY = global i32 0
@AT_EACCESS = global i32 0
@X_OK = global i32 0
define i32 @executable_at(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = load i32, i32* @O_RDONLY
%9 = load i32, i32* @O_DIRECTORY
%10 = or i32 %8, %9
%11 = call i32 @open(i8* %7, i32 %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = load i8*, i8** %4
%14 = load i32, i32* @AT_EACCESS
%15 = load i32, i32* @X_OK
%16 = call i32 @faccessat(i32 %12, i8* %13, i32 %14, i32 %15)
store i32 %16, i32* %6
%17 = load i32, i32* %5
%18 = call i32 @close(i32 %17)
%19 = load i32, i32* %6
ret i32 %19
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
@O_DIRECTORY = global i32 0
@AT_EACCESS = global i32 0
@X_OK = global i32 0
define i32 @executable_at(i8* nocapture %0, i8* %1) {
%3 = load i32, i32* @O_RDONLY
%4 = load i32, i32* @O_DIRECTORY
%5 = or i32 %4, %3
%6 = tail call i32 @open(i8* %0, i32 %5)
%7 = load i32, i32* @AT_EACCESS
%8 = load i32, i32* @X_OK
%9 = tail call i32 @faccessat(i32 %6, i8* %1, i32 %7, i32 %8)
%10 = tail call i32 @close(i32 %6)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xa7() {
  Assert_real((isgraph(167) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              840, ("isgraph should be 0 for 0xa7"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xa7\00"
define void @t_isgraph_0xa7() {
%1 = tail call i64 @isgraph(i32 167)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 840, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
void SIG_IGN(int);
int /*<<< orphan*/ signal(int, void (*)(int));
void handle_signal_suspend(int sig) {
  (void)signal(sig, SIG_IGN);
  (void)signal(sig, handle_signal_suspend);
}


x86 assembly (clang, -O0):
<handle_signal_suspend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rsi
call   1030 <signal@plt>
mov    -0x4(%rbp),%edi
mov    0x2eb4(%rip),%rsi
call   1030 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_signal_suspend>:
push   %rbx
mov    %edi,%ebx
mov    0x2ec6(%rip),%rsi
call   1030 <signal@plt>
mov    0x2ec2(%rip),%rsi
mov    %ebx,%edi
pop    %rbx
jmp    1030 <signal@plt>

LLVM IR (-O0):
define void @handle_signal_suspend(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @signal(i32 %3, void (i32)* @SIG_IGN)
%5 = load i32, i32* %2
%6 = call i32 @signal(i32 %5, void (i32)* @handle_signal_suspend)
ret void
}

LLVM IR (-O2):
define void @handle_signal_suspend(i32 %0) {
%2 = tail call i32 @signal(i32 %0, void (i32)* @SIG_IGN)
%3 = tail call i32 @signal(i32 %0, void (i32)* @handle_signal_suspend)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void Cyc_dump_end(void) {
  puts("%%HEVEA \\begin{latexonly}\n\\end{list}\\smallskip\n%%HEVEA "
       "\\end{latexonly}\n%%HEVEA \\begin{rawhtml}</dl>\\end{rawhtml}");
}


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

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

LLVM IR (-O0):
@.str = [113 x i8] c"%%HEVEA \\begin{latexonly}\0A\\end{list}\\smallskip\0A%%HEVEA \\end{latexonly}\0A%%HEVEA \\begin{rawhtml}</dl>\\end{rawhtml}\00"
define void @Cyc_dump_end() {
%1 = call i32 @puts(i8* getelementptr inbounds ([113 x i8], [113 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [113 x i8] c"%%HEVEA \\begin{latexonly}\0A\\end{list}\\smallskip\0A%%HEVEA \\end{latexonly}\0A%%HEVEA \\begin{rawhtml}</dl>\\end{rawhtml}\00"
define void @Cyc_dump_end() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([113 x i8], [113 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vpicSetIRQ(int);
void pitOut() { vpicSetIRQ(0x00); }


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

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

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

LLVM IR (-O2):
define void @pitOut() {
%1 = tail call i32 @vpicSetIRQ(i32 0)
ret void
}
void quantum_int2char(int j, unsigned char *buf) {
  int i, size;
  size = sizeof(int);
  for (i = 0; i < size; i++) {
    buf[i] = j / (1 << ((size - i - 1) * 8));
    j %= (1 << ((size - i - 1) * 8));
  }
}


x86 assembly (clang, -O0):
<quantum_int2char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x4,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1179 <quantum_int2char+0x79>
mov    -0x4(%rbp),%eax
mov    -0x18(%rbp),%ecx
sub    -0x14(%rbp),%ecx
sub    $0x1,%ecx
shl    $0x3,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %al,%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%ecx
sub    -0x14(%rbp),%ecx
sub    $0x1,%ecx
shl    $0x3,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1119 <quantum_int2char+0x19>
pop    %rbp
ret

x86 assembly (clang, -O2):
<quantum_int2char>:
lea    0xffffff(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
mov    %eax,%ecx
sar    $0x18,%ecx
mov    %cl,(%rsi)
and    $0xff000000,%eax
mov    %edi,%ecx
sub    %eax,%ecx
neg    %eax
add    %edi,%eax
add    $0xffff,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
mov    %eax,%edx
sar    $0x10,%edx
mov    %dl,0x1(%rsi)
and    $0xffff0000,%eax
sub    %eax,%ecx
lea    0xff(%rcx),%eax
test   %ecx,%ecx
cmovns %ecx,%eax
mov    %ah,0x2(%rsi)
mov    %cl,0x3(%rsi)
ret

LLVM IR (-O0):
define void @quantum_int2char(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
store i32 4, i32* %6
store i32 0, i32* %5
br label %7
7: ; preds = %33, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %36
11: ; preds = %7
%12 = load i32, i32* %3
%13 = load i32, i32* %6
%14 = load i32, i32* %5
%15 = sub nsw i32 %13, %14
%16 = sub nsw i32 %15, 1
%17 = mul nsw i32 %16, 8
%18 = shl i32 1, %17
%19 = sdiv i32 %12, %18
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %4
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
store i8 %20, i8* %24
%25 = load i32, i32* %6
%26 = load i32, i32* %5
%27 = sub nsw i32 %25, %26
%28 = sub nsw i32 %27, 1
%29 = mul nsw i32 %28, 8
%30 = shl i32 1, %29
%31 = load i32, i32* %3
%32 = srem i32 %31, %30
store i32 %32, i32* %3
br label %33
33: ; preds = %11
%34 = load i32, i32* %5
%35 = add nsw i32 %34, 1
store i32 %35, i32* %5
br label %7
36: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @quantum_int2char(i32 %0, i8* nocapture writeonly %1) {
%3 = sdiv i32 %0, 16777216
%4 = trunc i32 %3 to i8
store i8 %4, i8* %1
%5 = srem i32 %0, 16777216
%6 = sdiv i32 %5, 65536
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %7, i8* %8
%9 = srem i32 %5, 65536
%10 = sdiv i32 %9, 256
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %11, i8* %12
%13 = trunc i32 %9 to i8
%14 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %13, i8* %14
ret void
}
int vnc__init(struct framebuffer *fb) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.framebuffer = type opaque
define i32 @vnc__init(%struct.framebuffer* nocapture readnone %0) {
ret i32 0
}
void m_exit(status) int status;
{ exit(status); }


x86 assembly (clang, -O0):
<m_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<m_exit>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @m_exit(i32 %0) {
tail call void @exit(i32 %0)
unreachable
}
void I210ToAR30Row_Any_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @I210ToAR30Row_Any_AVX2() {
ret void
}
/* Type definitions */
struct rk_dllist_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct rk_dllist_node *);
void rk_dllist_node_free(struct rk_dllist_node *ch) { free(ch); }


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

x86 assembly (clang, -O2):
<rk_dllist_node_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.rk_dllist_node = type { i32 }
define void @rk_dllist_node_free(%struct.rk_dllist_node* %0) {
%2 = alloca %struct.rk_dllist_node*
store %struct.rk_dllist_node* %0, %struct.rk_dllist_node** %2
%3 = load %struct.rk_dllist_node*, %struct.rk_dllist_node** %2
%4 = call i32 @free(%struct.rk_dllist_node* %3)
ret void
}

LLVM IR (-O2):
%struct.rk_dllist_node = type { i32 }
define void @rk_dllist_node_free(%struct.rk_dllist_node* nocapture %0) {
%2 = tail call i32 @free(%struct.rk_dllist_node* %0)
ret void
}
int tolower(int c) { return (c >= 'A' && c <= 'Z') ? (c + 32) : c; }


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1129 <tolower+0x29>
cmpl   $0x5a,-0x4(%rbp)
jg     1129 <tolower+0x29>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <tolower+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 32
br label %13
11: ; preds = %5, %1
%12 = load i32, i32* %2
br label %13
13: ; preds = %11, %8
%14 = phi i32 [ %10, %8 ], [ %12, %11 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
char ConvertColorToStorage(char c) {
  switch (c) {
  case 0:
  case '0':
    c = 'A';
    break;
  case 1:
  case '1':
    c = 'C';
    break;
  case 2:
  case '2':
    c = 'G';
    break;
  case 3:
  case '3':
    c = 'T';
    break;
  default:
    c = 'N';
    break;
  }
  return c;
}


x86 assembly (clang, -O0):
<ConvertColorToStorage>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x33,%eax
ja     1155 <ConvertColorToStorage+0x55>
mov    -0x10(%rbp),%rax
lea    0xed8(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x41,-0x1(%rbp)
jmp    1159 <ConvertColorToStorage+0x59>
movb   $0x43,-0x1(%rbp)
jmp    1159 <ConvertColorToStorage+0x59>
movb   $0x47,-0x1(%rbp)
jmp    1159 <ConvertColorToStorage+0x59>
movb   $0x54,-0x1(%rbp)
jmp    1159 <ConvertColorToStorage+0x59>
movb   $0x4e,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvertColorToStorage>:
cmp    $0x33,%edi
ja     1122 <ConvertColorToStorage+0x22>
mov    $0x41,%al
mov    %edi,%ecx
lea    0xef0(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x43,%al
ret
mov    $0x47,%al
ret
mov    $0x54,%al
ret
mov    $0x4e,%al
ret

LLVM IR (-O0):
define signext i8 @ConvertColorToStorage(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
switch i32 %4, label %9 [
i32 0, label %5
i32 48, label %5
i32 1, label %6
i32 49, label %6
i32 2, label %7
i32 50, label %7
i32 3, label %8
i32 51, label %8
]
5: ; preds = %1, %1
store i8 65, i8* %2
br label %10
6: ; preds = %1, %1
store i8 67, i8* %2
br label %10
7: ; preds = %1, %1
store i8 71, i8* %2
br label %10
8: ; preds = %1, %1
store i8 84, i8* %2
br label %10
9: ; preds = %1
store i8 78, i8* %2
br label %10
10: ; preds = %9, %8, %7, %6, %5
%11 = load i8, i8* %2
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @ConvertColorToStorage(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %6 [
i32 0, label %7
i32 48, label %7
i32 1, label %3
i32 49, label %3
i32 2, label %4
i32 50, label %4
i32 3, label %5
i32 51, label %5
]
3: ; preds = %1, %1
br label %7
4: ; preds = %1, %1
br label %7
5: ; preds = %1, %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %1, %6, %5, %4, %3
%8 = phi i8 [ 78, %6 ], [ 84, %5 ], [ 71, %4 ], [ 67, %3 ], [ 65, %1 ], [ 65, %1 ]
ret i8 %8
}
int number(char s) {
  switch (s) {
  case 'C':
    return 100;
  case 'L':
    return 50;
  case 'X':
    return 10;
  case 'V':
    return 5;
  case 'I':
    return 1;
  default:
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<number>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffbd,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x15,%eax
ja     1170 <number+0x70>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x64,-0x4(%rbp)
jmp    1177 <number+0x77>
movl   $0x32,-0x4(%rbp)
jmp    1177 <number+0x77>
movl   $0xa,-0x4(%rbp)
jmp    1177 <number+0x77>
movl   $0x5,-0x4(%rbp)
jmp    1177 <number+0x77>
movl   $0x1,-0x4(%rbp)
jmp    1177 <number+0x77>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<number>:
add    $0xffffffbd,%edi
cmp    $0x15,%edi
ja     111d <number+0x1d>
mov    $0x64,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x1,%eax
ret
mov    $0x32,%eax
ret
mov    $0x5,%eax
ret
mov    $0xa,%eax
ret

LLVM IR (-O0):
define i32 @number(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %11 [
i32 67, label %6
i32 76, label %7
i32 88, label %8
i32 86, label %9
i32 73, label %10
]
6: ; preds = %1
store i32 100, i32* %2
br label %12
7: ; preds = %1
store i32 50, i32* %2
br label %12
8: ; preds = %1
store i32 10, i32* %2
br label %12
9: ; preds = %1
store i32 5, i32* %2
br label %12
10: ; preds = %1
store i32 1, i32* %2
br label %12
11: ; preds = %1
store i32 1, i32* %2
br label %12
12: ; preds = %11, %10, %9, %8, %7, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @number(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %7 [
i32 67, label %8
i32 76, label %3
i32 88, label %4
i32 86, label %5
i32 73, label %6
]
3: ; preds = %1
br label %8
4: ; preds = %1
br label %8
5: ; preds = %1
br label %8
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %1, %7, %6, %5, %4, %3
%9 = phi i32 [ 1, %7 ], [ 1, %6 ], [ 5, %5 ], [ 10, %4 ], [ 50, %3 ], [ 100, %1 ]
ret i32 %9
}
int test_imm_9Cuint32_mem(unsigned int *val) {
  return ((*val) & (0x9C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_9Cuint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 156
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int strlen(char *);
void tvi_strip_trailing_space(char *s) {
  size_t n;
  n = strlen(s) - 1;
  while (s[n] == ' ')
    s[n--] = '\0';
}


x86 assembly (clang, -O0):
<tvi_strip_trailing_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    115f <tvi_strip_trailing_space+0x4f>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
movb   $0x0,(%rax,%rcx,1)
jmp    112e <tvi_strip_trailing_space+0x1e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tvi_strip_trailing_space>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0x20,-0x1(%rax,%rbx,1)
jne    113d <tvi_strip_trailing_space+0x2d>
add    %rbx,%rax
add    $0xffffffffffffffff,%rax
nopl   0x0(%rax)
movb   $0x0,(%rax)
cmpb   $0x20,-0x1(%rax)
lea    -0x1(%rax),%rax
je     1130 <tvi_strip_trailing_space+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @tvi_strip_trailing_space(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 32
br i1 %7, label %8, label %15
8: ; preds = %1, %8
%9 = phi i8* [ %12, %8 ], [ %5, %1 ]
%10 = phi i64 [ %11, %8 ], [ %4, %1 ]
%11 = add i64 %10, -1
store i8 0, i8* %9
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 32
br i1 %14, label %8, label %15
15: ; preds = %8, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void die(char *errtext) {
  perror(errtext);
  exit(EXIT_FAILURE);
}


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

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

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

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @die(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
long double creall(long double _Complex z) { abort(); }


x86 assembly (clang, -O0):
<creall>:
push   %rbp
mov    %rsp,%rbp
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<creall>:
push   %rax
call   1030 <abort@plt>

LLVM IR (-O0):
define x86_fp80 @creall({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %0) {
unreachable
}

LLVM IR (-O2):
define x86_fp80 @creall({ x86_fp80, x86_fp80 }* nocapture readnone byval({ x86_fp80, x86_fp80 }) align 16 %0) {
tail call void @abort()
unreachable
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int time(int *);
int main(void) {
  time_t cur = time(NULL);
  time(&cur);
  printf("%d\n", cur);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <time@plt>
mov    0x4(%rsp),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call i32 @time(i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
int titleToNumber(char *s) {
  int sum = 0;
  while (*s)
    sum = 26 * sum + (*(s++) - 'A' + 1);
  return sum;
}


x86 assembly (clang, -O0):
<titleToNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1142 <titleToNumber+0x42>
imul   $0x1a,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
sub    $0x41,%ecx
add    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <titleToNumber+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<titleToNumber>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <titleToNumber+0x2c>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
lea    (%rax,%rax,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %eax,%edx
movsbl %cl,%eax
add    %edx,%eax
add    $0xffffffc0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <titleToNumber+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @titleToNumber(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %18
8: ; preds = %4
%9 = load i32, i32* %3
%10 = mul nsw i32 26, %9
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
%13 = load i8, i8* %11
%14 = sext i8 %13 to i32
%15 = sub nsw i32 %14, 65
%16 = add nsw i32 %15, 1
%17 = add nsw i32 %10, %16
store i32 %17, i32* %3
br label %4
18: ; preds = %4
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @titleToNumber(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %12, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul nsw i32 %6, 26
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = add i32 %8, -64
%12 = add i32 %11, %10
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %12, %4 ]
ret i32 %16
}
void BN_new(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_new() {
ret void
}
/* Type definitions */
typedef int uint16_t;
struct p4_field_match_valid {
  int dummy;
};

/* Variables and functions */
struct p4_field_match_valid *unpack_p4_field_match_valid(char *buffer,
                                                         uint16_t offset) {
  return (struct p4_field_match_valid *)(buffer + offset);
}


x86 assembly (clang, -O0):
<unpack_p4_field_match_valid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpack_p4_field_match_valid>:
movslq %esi,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
%struct.p4_field_match_valid = type { i32 }
define %struct.p4_field_match_valid* @unpack_p4_field_match_valid(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = bitcast i8* %8 to %struct.p4_field_match_valid*
ret %struct.p4_field_match_valid* %9
}

LLVM IR (-O2):
%struct.p4_field_match_valid = type { i32 }
define %struct.p4_field_match_valid* @unpack_p4_field_match_valid(i8* readnone %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = bitcast i8* %4 to %struct.p4_field_match_valid*
ret %struct.p4_field_match_valid* %5
}