xunge/DecIR huggingface dataset:
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double get_timestamp(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return ((double)tv.tv_sec + ((double)tv.tv_usec / 1000000));
}


x86 assembly (clang, -O0):
<get_timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xec7(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_timestamp>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @get_timestamp() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @get_timestamp() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %10, %6
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int scanf(char *, int *, int *);
int main() {
  int s, v, t;
  while (scanf("%d %d", &v, &t) == 2) {
    printf("%d\n", s = 2 * v * t);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    116a <main+0x4a>
mov    -0xc(%rbp),%esi
shl    $0x1,%esi
imul   -0x10(%rbp),%esi
mov    %esi,-0x8(%rbp)
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    1185 <main+0x65>
lea    0xebe(%rip),%r14
lea    0xeb1(%rip),%r15
lea    0x4(%rsp),%r12
mov    %rsp,%rbx
nopw   0x0(%rax,%rax,1)
mov    0x4(%rsp),%esi
imul   (%rsp),%esi
add    %esi,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
je     1160 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %15
7: ; preds = %0, %7
%8 = load i32, i32* %1
%9 = shl nsw i32 %8, 1
%10 = load i32, i32* %2
%11 = mul nsw i32 %9, %10
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%14 = icmp eq i32 %13, 2
br i1 %14, label %7, label %15
15: ; preds = %7, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ log_part_end(char);
void log_array_end() { log_part_end(']'); }


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

x86 assembly (clang, -O2):
<log_array_end>:
mov    $0x5d,%edi
jmp    1030 <log_part_end@plt>

LLVM IR (-O0):
define void @log_array_end() {
%1 = call i32 @log_part_end(i8 signext 93)
ret void
}

LLVM IR (-O2):
define void @log_array_end() {
%1 = tail call i32 @log_part_end(i8 signext 93)
ret void
}
XSetWindowBackgroundPixmap() {}


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

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

LLVM IR (-O0):
define i32 @XSetWindowBackgroundPixmap() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XSetWindowBackgroundPixmap() {
ret i32 undef
}
/* Type definitions */
typedef unsigned int uint64_t;
typedef unsigned int uint32_t;

/* Variables and functions */
unsigned int aeron_hash_code(unsigned int);
size_t aeron_even_hash(uint64_t value, size_t mask) {
  uint64_t hash = aeron_hash_code(value);
  uint32_t folded_hash = (uint32_t)hash ^ (uint32_t)(hash >> 32u);
  uint32_t even_hash = (folded_hash << 1u) - (folded_hash << 8u);
  return (size_t)(even_hash & mask);
}


x86 assembly (clang, -O0):
<aeron_even_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <aeron_hash_code@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x14(%rbp),%edx
mov    $0x20,%ecx
shr    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
shl    $0x1,%eax
mov    -0x18(%rbp),%ecx
shl    $0x8,%ecx
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
and    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeron_even_hash>:
jmp    1030 <aeron_hash_code@plt>

LLVM IR (-O0):
define i64 @aeron_even_hash(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i64 %1, i64* %4
%8 = load i32, i32* %3
%9 = call i32 @aeron_hash_code(i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i32, i32* %5
%12 = lshr i32 %11, 32
%13 = xor i32 %10, %12
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = shl i32 %14, 1
%16 = load i32, i32* %6
%17 = shl i32 %16, 8
%18 = sub i32 %15, %17
store i32 %18, i32* %7
%19 = load i32, i32* %7
%20 = zext i32 %19 to i64
%21 = load i64, i64* %4
%22 = and i64 %20, %21
ret i64 %22
}

LLVM IR (-O2):
define i64 @aeron_even_hash(i32 %0, i64 %1) {
%3 = tail call i32 @aeron_hash_code(i32 %0)
ret i64 poison
}
char *skipTillColon(char *p) {
  while (*p != ':' && *p != '\0')
    ++p;
  return p;
}


x86 assembly (clang, -O0):
<skipTillColon>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x3a,%ecx
mov    %al,-0x9(%rbp)
je     112d <skipTillColon+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <skipTillColon+0x3d>
jmp    114e <skipTillColon+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skipTillColon+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipTillColon>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
test   %cl,%cl
je     1122 <skipTillColon+0x22>
cmp    $0x3a,%cl
je     1122 <skipTillColon+0x22>
add    $0x1,%rax
jmp    1110 <skipTillColon+0x10>
ret

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

LLVM IR (-O2):
define i8* @skipTillColon(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 58, label %7
i8 0, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ getbits(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
uint8_t pak_get_bits_uint8(uint8_t value, uint8_t position, uint8_t no_bits) {
  return getbits(value, position, no_bits);
}


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

x86 assembly (clang, -O2):
<pak_get_bits_uint8>:
jmp    1030 <getbits@plt>

LLVM IR (-O0):
define i32 @pak_get_bits_uint8(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 = load i32, i32* %6
%10 = call i32 @getbits(i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @pak_get_bits_uint8(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @getbits(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
long C_i_fixnum_arithmetic_shift(long n, long c) {
  if (((c) >> 1) < 0)
    return (((n) >> (((-(c) + 2 * 0x00000001)) >> 1)) | 0x00000001);
  else
    return ((((long)(((n) >> 1) << ((c) >> 1)) << 1) | 0x00000001));
}


x86 assembly (clang, -O0):
<C_i_fixnum_arithmetic_shift>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
sar    $0x1,%rax
cmp    $0x0,%rax
jge    1140 <C_i_fixnum_arithmetic_shift+0x40>
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
sub    -0x18(%rbp),%rcx
add    $0x2,%rcx
sar    $0x1,%rcx
sar    %cl,%rax
or     $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    115f <C_i_fixnum_arithmetic_shift+0x5f>
mov    -0x10(%rbp),%rax
sar    $0x1,%rax
mov    -0x18(%rbp),%rcx
sar    $0x1,%rcx
shl    %cl,%rax
shl    $0x1,%rax
or     $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_i_fixnum_arithmetic_shift>:
mov    %rdi,%rax
test   %rsi,%rsi
js     111b <C_i_fixnum_arithmetic_shift+0x1b>
shr    %rsi
shr    %rax
mov    %esi,%ecx
shl    %cl,%rax
add    %rax,%rax
or     $0x1,%rax
ret
mov    $0x2,%ecx
sub    %esi,%ecx
shr    %ecx
sar    %cl,%rax
or     $0x1,%rax
ret

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

LLVM IR (-O2):
define i64 @C_i_fixnum_arithmetic_shift(i64 %0, i64 %1) {
%3 = icmp slt i64 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = sub i64 2, %1
%6 = ashr i64 %5, 1
%7 = ashr i64 %0, %6
br label %13
8: ; preds = %2
%9 = lshr i64 %1, 1
%10 = lshr i64 %0, 1
%11 = shl i64 %10, %9
%12 = shl i64 %11, 1
br label %13
13: ; preds = %8, %4
%14 = phi i64 [ %7, %4 ], [ %12, %8 ]
%15 = or i64 %14, 1
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
inc() { ol("incl %eax"); }


x86 assembly (clang, -O0):
<inc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"incl %eax\00"
define i32 @inc() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [10 x i8] c"incl %eax\00"
define i32 @inc() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
void memcg_kmem_commit_charge(struct page *page, struct mem_cgroup *memcg,
                              int order) {}


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

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

LLVM IR (-O0):
%struct.page = type opaque
%struct.mem_cgroup = type opaque
define void @memcg_kmem_commit_charge(%struct.page* %0, %struct.mem_cgroup* %1, i32 %2) {
%4 = alloca %struct.page*
%5 = alloca %struct.mem_cgroup*
%6 = alloca i32
store %struct.page* %0, %struct.page** %4
store %struct.mem_cgroup* %1, %struct.mem_cgroup** %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
%struct.page = type opaque
%struct.mem_cgroup = type opaque
define void @memcg_kmem_commit_charge(%struct.page* nocapture %0, %struct.mem_cgroup* nocapture %1, i32 %2) {
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
void double_to_timeval(double d, struct timeval *tv) {
  tv->tv_sec = (int)d;
  tv->tv_usec = (int)(100000.0 * (d - tv->tv_sec));
  return;
}


x86 assembly (clang, -O0):
<double_to_timeval>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
cvttsd2si -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movsd  -0x8(%rbp),%xmm1
mov    -0x10(%rbp),%rax
cvtsi2sdl (%rax),%xmm0
subsd  %xmm0,%xmm1
movsd  0xecf(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_to_timeval>:
cvttsd2si %xmm0,%eax
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
subsd  %xmm1,%xmm0
mulsd  0xee8(%rip),%xmm0
mov    %eax,(%rdi)
cvttsd2si %xmm0,%eax
mov    %eax,0x4(%rdi)
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define void @double_to_timeval(double %0, %struct.timeval* %1) {
%3 = alloca double
%4 = alloca %struct.timeval*
store double %0, double* %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load double, double* %3
%6 = fptosi double %5 to i32
%7 = load %struct.timeval*, %struct.timeval** %4
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
store i32 %6, i32* %8
%9 = load double, double* %3
%10 = load %struct.timeval*, %struct.timeval** %4
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = sitofp i32 %12 to double
%14 = fsub double %9, %13
%15 = fmul double 1.000000e+05, %14
%16 = fptosi double %15 to i32
%17 = load %struct.timeval*, %struct.timeval** %4
%18 = getelementptr inbounds %struct.timeval, %struct.timeval* %17, i32 0, i32 1
store i32 %16, i32* %18
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define void @double_to_timeval(double %0, %struct.timeval* nocapture writeonly %1) {
%3 = fptosi double %0 to i32
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
store i32 %3, i32* %4
%5 = sitofp i32 %3 to double
%6 = fsub double %0, %5
%7 = fmul double %6, 1.000000e+05
%8 = fptosi double %7 to i32
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
store i32 %8, i32* %9
ret void
}
void dd_pbl_ios_push_clear_badges() {}


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

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

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

LLVM IR (-O2):
define void @dd_pbl_ios_push_clear_badges() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GMP_RNDU;
int /*<<< orphan*/ mpfr_set_default_rounding_mode(int /*<<< orphan*/);
double mul_hi(double x, double y) {
  mpfr_set_default_rounding_mode(GMP_RNDU);
  ;
  return (x * y);
}


x86 assembly (clang, -O0):
<mul_hi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
call   1030 <mpfr_set_default_rounding_mode@plt>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul_hi>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
call   1030 <mpfr_set_default_rounding_mode@plt>
movsd  0x8(%rsp),%xmm0
mulsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@GMP_RNDU = global i32 0
define double @mul_hi(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load i32, i32* @GMP_RNDU
%6 = call i32 @mpfr_set_default_rounding_mode(i32 %5)
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fmul double %7, %8
ret double %9
}

LLVM IR (-O2):
@GMP_RNDU = global i32 0
define double @mul_hi(double %0, double %1) {
%3 = load i32, i32* @GMP_RNDU
%4 = tail call i32 @mpfr_set_default_rounding_mode(i32 %3)
%5 = fmul double %0, %1
ret double %5
}
int test_imm_18int16_mem(short *val) {
  return ((*val) & (0x18 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_18int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 24
%7 = icmp ne i32 %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_18int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 24
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char const *argv[]) {
  int answer = 0;
  do {
    scanf("%d", &answer);
    if (answer != 42) {
      printf("%d\n", answer);
    }
  } while (answer != 42);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x2a,-0x14(%rbp)
je     1166 <main+0x46>
mov    -0x14(%rbp),%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
jmp    116b <main+0x4b>
cmpl   $0x2a,-0x14(%rbp)
jne    113d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xec8(%rip),%r14
lea    0xc(%rsp),%rbx
lea    0xebf(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
cmp    $0x2a,%esi
je     1173 <main+0x53>
mov    %r15,%rdi
call   1030 <printf@plt>
cmpl   $0x2a,0xc(%rsp)
jne    1150 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
br label %5
5: ; preds = %9, %2
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 42
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 42
br i1 %12, label %13, label %5
13: ; preds = %5, %9
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void write_str(char *dev, char *str) {
  FILE *file;
  file = fopen(dev, "wb");
  if (file) {
    fprintf(file, "%s", str);
    fclose(file);
  }
}


x86 assembly (clang, -O0):
<write_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     117c <write_str+0x4c>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe95(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_str>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
lea    0xec2(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1165 <write_str+0x35>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <fputs@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"wb\00"
@.str.1 = [3 x i8] c"%s\00"
define void @write_str(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i32*, i32** %5
%12 = load i8*, i8** %4
%13 = call i32 @fprintf(i32* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = load i32*, i32** %5
%15 = call i32 @fclose(i32* %14)
br label %16
16: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"wb\00"
define void @write_str(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @fputs(i8* %1, i32* %3)
%7 = tail call i32 @fclose(i32* %3)
br label %8
8: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ start_daemon();
int main(int argc, char **argv) {
  start_daemon();
  while (1) {
    sleep(100);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <start_daemon@plt>
mov    $0x64,%edi
call   1040 <sleep@plt>
jmp    113d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <start_daemon@plt>
nopl   0x0(%rax,%rax,1)
mov    $0x64,%edi
call   1040 <sleep@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @start_daemon()
br label %7
7: ; preds = %2, %7
%8 = call i32 @sleep(i32 100)
br label %7
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @start_daemon()
br label %4
4: ; preds = %2, %4
%5 = tail call i32 @sleep(i32 100)
br label %4
}
/* Variables and functions */
int main() {
  char *p = NULL;
  *p = 0;
}


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

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = load i8*, i8** %1
store i8 0, i8* %2
ret i32 0
}

LLVM IR (-O2):
void av_hwframe_map() {}


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

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

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

LLVM IR (-O2):
define void @av_hwframe_map() {
ret void
}
void dummyvideo_FBWrite(unsigned int addr, unsigned int size) {}


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

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

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

LLVM IR (-O2):
define void @dummyvideo_FBWrite(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void another_long_file_name(void) { printf("another_long_file_name()\n"); }


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

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

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

LLVM IR (-O2):
@str = [25 x i8] c"another_long_file_name()\00"
define void @another_long_file_name() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t etna_bits_ones(unsigned num) { return (1 << num) - 1; }


x86 assembly (clang, -O0):
<etna_bits_ones>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<etna_bits_ones>:
mov    %edi,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
ret

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

LLVM IR (-O2):
define i32 @etna_bits_ones(i32 %0) {
%2 = shl nsw i32 -1, %0
%3 = xor i32 %2, -1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t hash_int(uint32_t i) { return i; }


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

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

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

LLVM IR (-O2):
define i32 @hash_int(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, int /*<<< orphan*/ *, int);
void pack_to_h32(void *v, uint32_t u) { memcpy(v, &u, sizeof(uint32_t)); }


x86 assembly (clang, -O0):
<pack_to_h32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack_to_h32>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @pack_to_h32(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 = call i32 @memcpy(i8* %5, i32* %4, i32 4)
ret void
}

LLVM IR (-O2):
define void @pack_to_h32(i8* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @memcpy(i8* %0, i32* %3, i32 4)
ret void
}
/* Variables and functions */
bool isOdd(int number) { return (number % 2) == 1; }


x86 assembly (clang, -O0):
<isOdd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isOdd>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
and    $0xfffffffe,%eax
sub    %eax,%edi
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isOdd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 2
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isOdd(i32 %0) {
%2 = srem i32 %0, 2
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned addval_171(unsigned x) { return x + 3527987593U; }


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

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

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

LLVM IR (-O2):
define i32 @addval_171(i32 %0) {
%2 = add i32 %0, -766979703
ret i32 %2
}
unsigned int is_nonzero_uint(unsigned int val) {
  return ((val & 1) | (!!(val)) | (val & 1));
}


x86 assembly (clang, -O0):
<is_nonzero_uint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmpl   $0x0,-0x4(%rbp)
setne  %cl
xor    $0xff,%cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x1,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_nonzero_uint>:
mov    %edi,%ecx
and    $0x1,%ecx
xor    %eax,%eax
test   %edi,%edi
setne  %al
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @is_nonzero_uint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
%10 = or i32 %4, %9
%11 = load i32, i32* %2
%12 = and i32 %11, 1
%13 = or i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @is_nonzero_uint(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp ne i32 %0, 0
%4 = zext i1 %3 to i32
%5 = or i32 %2, %4
ret i32 %5
}
int validate_range(int number) { return number >= 0 && number <= 39; }


x86 assembly (clang, -O0):
<validate_range>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <validate_range+0x20>
cmpl   $0x27,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<validate_range>:
xor    %eax,%eax
cmp    $0x28,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @validate_range(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 39
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @validate_range(i32 %0) {
%2 = icmp ult i32 %0, 40
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalnum(int);
void t_isalnum_0x55() {
  Assert_real((isalnum(85)),
              "/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_isalnum.c",
              430, ("isalnum should be 1 for U"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0x55>:
push   %rax
mov    $0x55,%edi
call   1030 <isalnum@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x1ae,%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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for U\00"
define void @t_isalnum_0x55() {
%1 = call i32 @isalnum(i32 85)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 430, 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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for U\00"
define void @t_isalnum_0x55() {
%1 = tail call i32 @isalnum(i32 85)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 430, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int main(int argc, char *argv[]) {
  volatile int arr[1000] = {0};
  return main(arr[argc % 2], 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xfb0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0xfb0(%rbp),%rdi
xor    %esi,%esi
mov    $0xfa0,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
mov    -0xfb0(%rbp,%rax,4),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <main@plt>
add    $0xfb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0xfa8,%rsp
mov    %edi,%ebp
mov    %rsp,%rbx
xchg   %ax,%ax
mov    $0xfa0,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    %ebp,%eax
shr    $0x1f,%eax
add    %ebp,%eax
and    $0xfffffffe,%eax
sub    %eax,%ebp
movslq %ebp,%rax
mov    (%rsp,%rax,4),%ebp
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1000 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [1000 x i32]* %6 to i8*
%8 = load i32, i32* %4
%9 = srem i32 %8, 2
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [1000 x i32], [1000 x i32]* %6, i64 0, i64 %10
%12 = load volatile i32, i32* %11
%13 = call i32 @main(i32 %12, i8** null)
ret i32 %13
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1000 x i32]
%4 = bitcast [1000 x i32]* %3 to i8*
br label %5
5: ; preds = %5, %2
%6 = phi i32 [ %0, %2 ], [ %10, %5 ]
%7 = srem i32 %6, 2
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 %8
%10 = load volatile i32, i32* %9
br label %5
}
void gpioset(volatile unsigned int *gpioptr, int portn) {
  *(gpioptr + 7 + (portn / 32)) = 1 << portn;
}


x86 assembly (clang, -O0):
<gpioset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    -0x1c(%rbp),%edx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
mov    %edx,0x1c(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpioset>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
lea    0x1f(%rcx),%edx
test   %esi,%esi
cmovns %ecx,%edx
sar    $0x5,%edx
movslq %edx,%rcx
mov    %eax,0x1c(%rdi,%rcx,4)
ret

LLVM IR (-O0):
define void @gpioset(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 1, %5
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 7
%9 = load i32, i32* %4
%10 = sdiv i32 %9, 32
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %8, i64 %11
store volatile i32 %6, i32* %12
ret void
}

LLVM IR (-O2):
define void @gpioset(i32* %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = getelementptr inbounds i32, i32* %0, i64 7
%5 = sdiv i32 %1, 32
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %4, i64 %6
store volatile i32 %3, i32* %7
ret void
}
void POMP2_On() {}


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

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

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

LLVM IR (-O2):
define void @POMP2_On() {
ret void
}
/* Variables and functions */
int has_nul(const char *s, size_t l) {
  if (l == 0)
    return 0;
  do {
    if (*s++ == '\0')
      return 1;
  } while (--l != 0);
  return 0;
}


x86 assembly (clang, -O0):
<has_nul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1123 <has_nul+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1171 <has_nul+0x71>
jmp    1128 <has_nul+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    114f <has_nul+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1171 <has_nul+0x71>
jmp    1154 <has_nul+0x54>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1128 <has_nul+0x28>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_nul>:
test   %rsi,%rsi
je     111f <has_nul+0x1f>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
je     1122 <has_nul+0x22>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <has_nul+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @has_nul(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %9
%5 = phi i8* [ %10, %9 ], [ %0, %2 ]
%6 = phi i64 [ %11, %9 ], [ %1, %2 ]
%7 = load i8, i8* %5
%8 = icmp eq i8 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = add i64 %6, -1
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %9, %4, %2
%14 = phi i32 [ 0, %2 ], [ 0, %9 ], [ 1, %4 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char colour[50];
  printf("What's your favourite colour?\n");
  scanf("%49s", colour);
  colour[1] = '\0';
  printf("The First Letter of your Favourite Colour is: %s\n", colour);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x40(%rbp),%rsi
lea    0xed7(%rip),%rdi
call   1040 <scanf@plt>
movb   $0x0,-0x3f(%rbp)
lea    -0x40(%rbp),%rsi
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
lea    0xefb(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
movb   $0x0,0x1(%rsp)
lea    0xea6(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"What's your favourite colour?\0A\00"
@.str.1 = [5 x i8] c"%49s\00"
@.str.2 = [50 x i8] c"The First Letter of your Favourite Colour is: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x i8]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 1
store i8 0, i8* %6
%7 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"%49s\00"
@.str.2 = [50 x i8] c"The First Letter of your Favourite Colour is: %s\0A\00"
@str = [30 x i8] c"What's your favourite colour?\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 1
store i8 0, i8* %5
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
struct timeval {
  unsigned int tv_sec;
  unsigned int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
unsigned getticks(void) {
  unsigned s, us;
  struct timeval tv;
  gettimeofday(&tv, 0);
  s = tv.tv_sec;
  us = tv.tv_usec;
  return (s % 10) * 1000 * 1000 + us;
}


x86 assembly (clang, -O0):
<getticks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
imul   $0x3e8,%edx,%eax
imul   $0x3e8,%eax,%eax
add    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getticks>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    (%rsp),%eax
mov    $0xcccccccd,%ecx
imul   %rax,%rcx
shr    $0x23,%rcx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
imul   $0xf4240,%eax,%eax
add    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @getticks() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.timeval
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32 0)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%6 = load i32, i32* %5
store i32 %6, i32* %1
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%8 = load i32, i32* %7
store i32 %8, i32* %2
%9 = load i32, i32* %1
%10 = urem i32 %9, 10
%11 = mul i32 %10, 1000
%12 = mul i32 %11, 1000
%13 = load i32, i32* %2
%14 = add i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @getticks() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i32, i32* %6
%8 = urem i32 %5, 10
%9 = mul nuw nsw i32 %8, 1000000
%10 = add i32 %9, %7
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_codename(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
void fgmvwrite_codename_(char codename[]) {
  char name[10];
  strncpy(name, codename, 8);
  *(name + 8) = '\0';
  gmvwrite_codename(name);
}


x86 assembly (clang, -O0):
<fgmvwrite_codename_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x12(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x8,%edx
call   1040 <strncpy@plt>
movb   $0x0,-0xa(%rbp)
lea    -0x12(%rbp),%rdi
call   1030 <gmvwrite_codename@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgmvwrite_codename_>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rsi
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x8,%edx
call   1040 <strncpy@plt>
movb   $0x0,0xe(%rsp)
mov    %rbx,%rdi
call   1030 <gmvwrite_codename@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @fgmvwrite_codename_(i8* %0) {
%2 = alloca i8*
%3 = alloca [10 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strncpy(i8* %4, i8* %5, i32 8)
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds i8, i8* %7, i64 8
store i8 0, i8* %8
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%10 = call i32 @gmvwrite_codename(i8* %9)
ret void
}

LLVM IR (-O2):
define void @fgmvwrite_codename_(i8* %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = call i32 @strncpy(i8* %3, i8* %0, i32 8)
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 8
store i8 0, i8* %5
%6 = call i32 @gmvwrite_codename(i8* %3)
ret void
}