xunge/DecIR huggingface dataset:
unsigned log2_ge(unsigned long n, unsigned min_order) {
  unsigned order = min_order;
  while ((1ul << order) < n)
    ++order;
  return order;
}


x86 assembly (clang, -O0):
<log2_ge>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
cmp    -0x8(%rbp),%rax
jae    1136 <log2_ge+0x36>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1111 <log2_ge+0x11>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2_ge>:
mov    %esi,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x1,%eax
shl    %cl,%rax
add    $0x1,%ecx
cmp    %rdi,%rax
jb     1110 <log2_ge+0x10>
add    $0xffffffff,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @log2_ge(i64 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %1, %2 ], [ %8, %3 ]
%5 = zext i32 %4 to i64
%6 = shl nuw i64 1, %5
%7 = icmp ult i64 %6, %0
%8 = add i32 %4, 1
br i1 %7, label %3, label %9
9: ; preds = %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ platform_outl(int /*<<< orphan*/, unsigned long);
void __outsl(unsigned long port, void *src, unsigned long count) {
  const unsigned int *sp = src;
  while (count--)
    platform_outl(*sp++, port);
}


x86 assembly (clang, -O0):
<__outsl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     1164 <__outsl+0x54>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <platform_outl@plt>
jmp    112c <__outsl+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__outsl>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdx,%rdx
je     1145 <__outsl+0x35>
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edi
mov    %r15,%rsi
call   1030 <platform_outl@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <__outsl+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @__outsl(i64 %0, i8* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %15, label %5
5: ; preds = %3
%6 = bitcast i8* %1 to i32*
br label %7
7: ; preds = %5, %7
%8 = phi i32* [ %11, %7 ], [ %6, %5 ]
%9 = phi i64 [ %10, %7 ], [ %2, %5 ]
%10 = add i64 %9, -1
%11 = getelementptr inbounds i32, i32* %8, i64 1
%12 = load i32, i32* %8
%13 = tail call i32 @platform_outl(i32 %12, i64 %0)
%14 = icmp eq i64 %10, 0
br i1 %14, label %15, label %7
15: ; preds = %7, %3
ret void
}
/* Variables and functions */
long hash(char *);
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  long result;
  char word[200];
  scanf("%s", word);
  result = hash(word);
  printf("%li", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xe0(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1050 <scanf@plt>
lea    -0xe0(%rbp),%rdi
call   1030 <hash@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
lea    0xec1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <hash@plt>
lea    0xeaa(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%li\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca [200 x i8]
store i32 0, i32* %1
%4 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%7 = call i64 @hash(i8* %6)
store i64 %7, i64* %2
%8 = load i64, i64* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%li\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i64 @hash(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mysh_loop();
int main(int argc, char **argv) {
  mysh_loop();
  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 <mysh_loop@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <mysh_loop@plt>
xor    %eax,%eax
pop    %rcx
ret

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 (...) @mysh_loop()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @mysh_loop()
ret i32 0
}
/* Variables and functions */
float sinf(float);
float test_func_01(float x) { return sinf(x); }


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

x86 assembly (clang, -O2):
<test_func_01>:
jmp    1030 <sinf@plt>

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

LLVM IR (-O2):
define float @test_func_01(float %0) {
%2 = tail call float @sinf(float %0)
ret float %2
}
int color_offset_f4(int x, int y) {
  return ((y << 10) + (((x << 10) * 43) / 14) - (12267 << 10)) >> 10;
}


x86 assembly (clang, -O0):
<color_offset_f4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xa,%eax
imul   $0x2b,%eax,%eax
mov    $0xe,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
sub    $0xbfac00,%eax
sar    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<color_offset_f4>:
shl    $0xa,%esi
imul   $0xac00,%edi,%eax
cltq
imul   $0xffffffff92492493,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x3,%eax
add    %ecx,%eax
add    %esi,%eax
add    $0xff405400,%eax
sar    $0xa,%eax
ret

LLVM IR (-O0):
define i32 @color_offset_f4(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 %5, 10
%7 = load i32, i32* %3
%8 = shl i32 %7, 10
%9 = mul nsw i32 %8, 43
%10 = sdiv i32 %9, 14
%11 = add nsw i32 %6, %10
%12 = sub nsw i32 %11, 12561408
%13 = ashr i32 %12, 10
ret i32 %13
}

LLVM IR (-O2):
define i32 @color_offset_f4(i32 %0, i32 %1) {
%3 = shl i32 %1, 10
%4 = mul i32 %0, 44032
%5 = sdiv i32 %4, 14
%6 = add nsw i32 %5, -12561408
%7 = add i32 %6, %3
%8 = ashr i32 %7, 10
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void arg_si(void) { printf("si\n"); }


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

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

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

LLVM IR (-O2):
@str = [3 x i8] c"si\00"
define void @arg_si() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *strchr(char *, int);
int countchars(char *str, int chr) {
  char *cp;
  int res = 0;
  cp = str;
  while ((cp = strchr(cp, chr))) {
    res++;
    cp++;
  }
  return res;
}


x86 assembly (clang, -O0):
<countchars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1162 <countchars+0x52>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112e <countchars+0x1e>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<countchars>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1030 <strchr@plt>
xor    %ebp,%ebp
test   %rax,%rax
je     1146 <countchars+0x36>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
add    $0x1,%rax
mov    %rax,%rdi
mov    %ebx,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1130 <countchars+0x20>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @countchars(i8* %0, i32 %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %10, %5 ], [ %3, %2 ]
%7 = phi i32 [ %8, %5 ], [ 0, %2 ]
%8 = add nuw nsw i32 %7, 1
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = tail call i8* @strchr(i8* dereferenceable(1) %9, i32 %1)
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %13
}
int prep_direct(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @prep_direct() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fs_path_op(void *, void *, void *, int);
int file_add(unsigned char *file) {
  int retval;
  fs_path_op((void *)file, (void *)0, (void *)&retval, 5);
  return retval;
}


x86 assembly (clang, -O0):
<file_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%esi
mov    $0x5,%ecx
call   1030 <fs_path_op@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_add>:
push   %rax
lea    0x4(%rsp),%rdx
xor    %esi,%esi
mov    $0x5,%ecx
call   1030 <fs_path_op@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @file_add(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i32* %3 to i8*
%6 = call i32 @fs_path_op(i8* %4, i8* null, i8* %5, i32 5)
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @file_add(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @fs_path_op(i8* %0, i8* null, i8* %3, i32 5)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ICUnsignedRangeCalculation(int, long long);
int LLONG_MIN;
int main(int argc, const char *argv[]) {
  ICUnsignedRangeCalculation(-128, 127);
  ICUnsignedRangeCalculation(LLONG_MIN, 9223372036854775807LL);
  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    $0xffffff80,%edi
mov    $0x7f,%esi
call   1030 <ICUnsignedRangeCalculation@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
movabs $0x7fffffffffffffff,%rsi
ff ff 7f
call   1030 <ICUnsignedRangeCalculation@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7f,%esi
mov    $0xffffff80,%edi
call   1030 <ICUnsignedRangeCalculation@plt>
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
movabs $0x7fffffffffffffff,%rsi
ff ff 7f
call   1030 <ICUnsignedRangeCalculation@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@LLONG_MIN = global i32 0
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 @ICUnsignedRangeCalculation(i32 -128, i64 127)
%7 = load i32, i32* @LLONG_MIN
%8 = call i32 @ICUnsignedRangeCalculation(i32 %7, i64 9223372036854775807)
ret i32 0
}

LLVM IR (-O2):
@LLONG_MIN = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @ICUnsignedRangeCalculation(i32 -128, i64 127)
%4 = load i32, i32* @LLONG_MIN
%5 = tail call i32 @ICUnsignedRangeCalculation(i32 %4, i64 9223372036854775807)
ret i32 0
}
void g_value_init() {}


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

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

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

LLVM IR (-O2):
define void @g_value_init() {
ret void
}
/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ printf(char *, long);
void sig_hup(int signo) {
  printf("SIGHUP received, pid = %ld\n", (long)getpid());
}


x86 assembly (clang, -O0):
<sig_hup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,%rsi
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_hup>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"SIGHUP received, pid = %ld\0A\00"
define void @sig_hup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 (...) @getpid()
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %3)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"SIGHUP received, pid = %ld\0A\00"
define void @sig_hup(i32 %0) {
%2 = tail call i64 (...) @getpid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %2)
ret void
}
char *procprt_POLI_e(struct tstat *curstat, int avgval, int nsecs) {
  return "-   ";
}


x86 assembly (clang, -O0):
<procprt_POLI_e>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xeeb(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.tstat = type opaque
@.str = [5 x i8] c"- \00"
define i8* @procprt_POLI_e(%struct.tstat* %0, i32 %1, i32 %2) {
%4 = alloca %struct.tstat*
%5 = alloca i32
%6 = alloca i32
store %struct.tstat* %0, %struct.tstat** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tstat = type opaque
@.str = [5 x i8] c"- \00"
define i8* @procprt_POLI_e(%struct.tstat* nocapture readnone %0, i32 %1, i32 %2) {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("Something different.");
  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 <puts@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 = [21 x i8] c"Something different.\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Something different.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct usb_dev_handle {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ usb_close(struct usb_dev_handle *);
int /*<<< orphan*/ usb_release_interface(struct usb_dev_handle *, int);
void owon_usb_close(struct usb_dev_handle *dev_handle) {
  usb_release_interface(dev_handle, 0x0);
  usb_close(dev_handle);
}


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

x86 assembly (clang, -O2):
<owon_usb_close>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
call   1030 <usb_release_interface@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <usb_close@plt>

LLVM IR (-O0):
%struct.usb_dev_handle = type { i32 }
define void @owon_usb_close(%struct.usb_dev_handle* %0) {
%2 = alloca %struct.usb_dev_handle*
store %struct.usb_dev_handle* %0, %struct.usb_dev_handle** %2
%3 = load %struct.usb_dev_handle*, %struct.usb_dev_handle** %2
%4 = call i32 @usb_release_interface(%struct.usb_dev_handle* %3, i32 0)
%5 = load %struct.usb_dev_handle*, %struct.usb_dev_handle** %2
%6 = call i32 @usb_close(%struct.usb_dev_handle* %5)
ret void
}

LLVM IR (-O2):
%struct.usb_dev_handle = type { i32 }
define void @owon_usb_close(%struct.usb_dev_handle* %0) {
%2 = tail call i32 @usb_release_interface(%struct.usb_dev_handle* %0, i32 0)
%3 = tail call i32 @usb_close(%struct.usb_dev_handle* %0)
ret void
}
/* Variables and functions */
char *calloc(unsigned int, int);
int /*<<< orphan*/ error(char *);
char *myalloc(int size) {
  char *p;
  p = calloc((unsigned)size, 1);
  if (p == 0)
    error("out of memory");
  return (p);
}


x86 assembly (clang, -O0):
<myalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1153 <myalloc+0x33>
lea    0xeb2(%rip),%rdi
call   1040 <error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myalloc>:
push   %rbx
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <myalloc+0x1f>
lea    0xec6(%rip),%rdi
call   1040 <error@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define noalias i8* @myalloc(i32 %0) {
%2 = tail call i8* @calloc(i32 %0, i32 1)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x1a() {
  Assert_real((isalpha(26) == 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_isalpha.c",
              135, ("isalpha should be 0 for 0x1a"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x1a\00"
define void @t_isalpha_0x1a() {
%1 = call i64 @isalpha(i32 26)
%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 135, 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x1a\00"
define void @t_isalpha_0x1a() {
%1 = tail call i64 @isalpha(i32 26)
%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 135, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_record(int, int, char *, char *);
void QMWrite(int fno, char *id, char *data) { write_record(16, fno, id, data); }


x86 assembly (clang, -O0):
<QMWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x10,%edi
call   1030 <write_record@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QMWrite>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x10,%edi
jmp    1030 <write_record@plt>

LLVM IR (-O0):
define void @QMWrite(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @write_record(i32 16, i32 %7, i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
define void @QMWrite(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @write_record(i32 16, i32 %0, i8* %1, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage() {
  fprintf(stderr,
          "Usage: -p <PORT no.> -h <HOSTNAME> -l/-u <login>/<uid> [-LUGNHS]\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [66 x i8] c"Usage: -p <PORT no.> -h <HOSTNAME> -l/-u <login>/<uid> [-LUGNHS]\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [66 x i8] c"Usage: -p <PORT no.> -h <HOSTNAME> -l/-u <login>/<uid> [-LUGNHS]\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
ret void
}
int _os_strmatch(char *pattern, char *str, int str_len, int size) {
  return (1);
}


x86 assembly (clang, -O0):
<_os_strmatch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_os_strmatch(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret i32 1
}

LLVM IR (-O2):
define i32 @_os_strmatch(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i32 %3) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ free(unsigned long *);
void _pfree(unsigned long *pointer, char *module, char *function, int line) {
  free(pointer);
}


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

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

LLVM IR (-O0):
define void @_pfree(i64* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i64*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i64* %0, i64** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i64*, i64** %5
%10 = call i32 @free(i64* %9)
ret void
}

LLVM IR (-O2):
define void @_pfree(i64* nocapture %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
%5 = tail call i32 @free(i64* %0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int p2floor(int);
uint32_t wrap(uint32_t x, uint32_t i) {
  uint32_t n = p2floor(i);
  return (x & (n - 1)) + (i - n);
}


x86 assembly (clang, -O0):
<wrap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <p2floor@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrap>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
call   1030 <p2floor@plt>
lea    -0x1(%rax),%ecx
and    %ebp,%ecx
sub    %eax,%ebx
add    %ecx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @wrap(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @p2floor(i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = load i32, i32* %5
%10 = sub nsw i32 %9, 1
%11 = and i32 %8, %10
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = sub nsw i32 %12, %13
%15 = add nsw i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @wrap(i32 %0, i32 %1) {
%3 = tail call i32 @p2floor(i32 %1)
%4 = add nsw i32 %3, -1
%5 = and i32 %4, %0
%6 = sub i32 %1, %3
%7 = add nsw i32 %6, %5
ret i32 %7
}
int test_imm_ABint64_highword_reg(long long val) {
  return ((val >> 32) & (0xAB << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_ABint64_highword_reg>:
movabs $0xab00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_ABint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 171
%6 = icmp ne i64 %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_ABint64_highword_reg(i64 %0) {
%2 = and i64 %0, 734439407616
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void file_not_found(char *name) {
  printf("%s file not found\n", name);
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"%s file not found\0A\00"
define void @file_not_found(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [19 x i8] c"%s file not found\0A\00"
define void @file_not_found(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
float fmod(float, float);
float fmodf(float x, float y) { return fmod(x, y); }


x86 assembly (clang, -O0):
<fmodf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <fmod@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmodf>:
jmp    1030 <fmod@plt>

LLVM IR (-O0):
define float @fmodf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @fmod(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @fmodf(float %0, float %1) {
%3 = tail call float @fmod(float %0, float %1)
ret float %3
}
void do_msg(char format) {}


x86 assembly (clang, -O0):
<do_msg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @do_msg(i8 signext %0) {
ret void
}
/* Variables and functions */
int bar();
int omp_get_num_threads();
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int, int);
void f3(void) {
#pragma omp parallel
  {
    int bb = bar();
#pragma omp sections
    {
#pragma omp section
      printf("section1 %d/%d\n", omp_get_thread_num(), omp_get_num_threads());
#pragma omp section
      printf("section2 %d/%d\n", omp_get_thread_num(), omp_get_num_threads());
    }
  }
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <bar@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1060 <omp_get_num_threads@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xe91(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1060 <omp_get_num_threads@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xe7f(%rip),%rdi
call   1050 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
push   %rbx
xor    %eax,%eax
call   1040 <bar@plt>
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <omp_get_num_threads@plt>
lea    0xea1(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <omp_get_num_threads@plt>
lea    0xe91(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"section1 %d/%d\0A\00"
@.str.1 = [16 x i8] c"section2 %d/%d\0A\00"
define void @f3() {
%1 = alloca i32
%2 = call i32 (...) @bar()
store i32 %2, i32* %1
%3 = call i32 (...) @omp_get_thread_num()
%4 = call i32 (...) @omp_get_num_threads()
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = call i32 (...) @omp_get_thread_num()
%7 = call i32 (...) @omp_get_num_threads()
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"section1 %d/%d\0A\00"
@.str.1 = [16 x i8] c"section2 %d/%d\0A\00"
define void @f3() {
%1 = tail call i32 (...) @bar()
%2 = tail call i32 (...) @omp_get_thread_num()
%3 = tail call i32 (...) @omp_get_num_threads()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
%5 = tail call i32 (...) @omp_get_thread_num()
%6 = tail call i32 (...) @omp_get_num_threads()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6)
ret void
}
void rct_set_usb_int_clk(void) {}


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

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

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

LLVM IR (-O2):
define void @rct_set_usb_int_clk() {
ret void
}
void plugin_exit_asterisk(void) {}


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

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

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

LLVM IR (-O2):
define void @plugin_exit_asterisk() {
ret void
}
__typeof__(scanf(1)) test_scanf_214(void) { return scanf(1); }


x86 assembly (clang, -O0):
<test_scanf_214>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <scanf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_scanf_214>:
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <scanf@plt>

LLVM IR (-O0):
define i32 @test_scanf_214() {
%1 = call i32 (i8*, ...) @scanf(i8* inttoptr (i64 1 to i8*))
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_scanf_214() {
%1 = tail call i32 (i8*, ...) @scanf(i8* inttoptr (i64 1 to i8*))
ret i32 %1
}
/* Type definitions */
typedef char *time_t;

/* Variables and functions */
char *ctime(char **);
int /*<<< orphan*/ printf(char *, char *);
char *time(int /*<<< orphan*/ *);
int main(void) {
  time_t t0;
  t0 = time(NULL);
  printf("%lu sec since epoch\n", t0);
  printf("%s\n", ctime(&t0));
  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   1050 <time@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
lea    -0x10(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,%rsi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [21 x i8] c"%lu sec since epoch\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
%3 = tail call i8* @time(i32* null)
store i8* %3, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i8* @ctime(i8** %1)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int checkCltArgs(int argc) {
  if (argc != 4) {
    printf("\e[31m\n\tError: missing command arguments\n");
    printf("\n\tUsage: <EXE> <HOST> <HOST_PORT> <CLIENT_PORT>\n\n\e[0m");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<checkCltArgs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     1149 <checkCltArgs+0x39>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1150 <checkCltArgs+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkCltArgs>:
xor    %eax,%eax
cmp    $0x4,%edi
je     1149 <checkCltArgs+0x29>
push   %rax
lea    0xf07(%rip),%rdi
call   1030 <puts@plt>
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [41 x i8] c"\1B[31m\0A\09Error: missing command arguments\0A\00"
@.str.1 = [54 x i8] c"\0A\09Usage: <EXE> <HOST> <HOST_PORT> <CLIENT_PORT>\0A\0A\1B[0m\00"
define i32 @checkCltArgs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 4
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str.1 = [54 x i8] c"\0A\09Usage: <EXE> <HOST> <HOST_PORT> <CLIENT_PORT>\0A\0A\1B[0m\00"
@str = [40 x i8] c"\1B[31m\0A\09Error: missing command arguments\00"
define i32 @checkCltArgs(i32 %0) {
%2 = icmp eq i32 %0, 4
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ -1, %3 ], [ 0, %1 ]
ret i32 %7
}
void __attribute__((no)) delay(int length) {
  volatile int i;
  for (i = 0; i < length; i++)
    asm("");
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1128 <delay+0x28>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <delay+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
movl   $0x0,-0x4(%rsp)
nopl   0x0(%rax,%rax,1)
mov    -0x4(%rsp),%eax
cmp    %edi,%eax
jge    111f <delay+0x1f>
addl   $0x1,-0x4(%rsp)
jmp    1110 <delay+0x10>
ret

LLVM IR (-O0):
define void @delay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store volatile i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load volatile i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %4
br label %9
9: ; preds = %8
%10 = load volatile i32, i32* %3
%11 = add nsw i32 %10, 1
store volatile i32 %11, i32* %3
br label %4
12: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @delay(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store volatile i32 0, i32* %2
%4 = load volatile i32, i32* %2
%5 = icmp slt i32 %4, %0
br i1 %5, label %6, label %11
6: ; preds = %1, %6
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
%7 = load volatile i32, i32* %2
%8 = add nsw i32 %7, 1
store volatile i32 %8, i32* %2
%9 = load volatile i32, i32* %2
%10 = icmp slt i32 %9, %0
br i1 %10, label %6, label %11
11: ; preds = %6, %1
ret void
}
void GPIOPinIntEnable(unsigned int baseAdd, unsigned int intLine,
                      unsigned int pinNumber) {
  if ((0x0) == intLine) {
    (*((volatile unsigned int *)(baseAdd + (0x34 + (0 * 4))))) =
        (1 << pinNumber);
  } else {
    (*((volatile unsigned int *)(baseAdd + (0x34 + (1 * 4))))) =
        (1 << pinNumber);
  }
}


x86 assembly (clang, -O0):
<GPIOPinIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jne    1133 <GPIOPinIntEnable+0x33>
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    $0x34,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
jmp    1149 <GPIOPinIntEnable+0x49>
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    $0x38,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinIntEnable>:
mov    %edx,%ecx
xor    %eax,%eax
test   %esi,%esi
setne  %al
mov    $0x1,%edx
shl    %cl,%edx
lea    (%rdi,%rax,4),%eax
add    $0x34,%eax
mov    %edx,(%rax)
ret

LLVM IR (-O0):
define void @GPIOPinIntEnable(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* %5
%8 = icmp eq i32 0, %7
br i1 %8, label %9, label %16
9: ; preds = %3
%10 = load i32, i32* %6
%11 = shl i32 1, %10
%12 = load i32, i32* %4
%13 = add i32 %12, 52
%14 = zext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
store volatile i32 %11, i32* %15
br label %23
16: ; preds = %3
%17 = load i32, i32* %6
%18 = shl i32 1, %17
%19 = load i32, i32* %4
%20 = add i32 %19, 56
%21 = zext i32 %20 to i64
%22 = inttoptr i64 %21 to i32*
store volatile i32 %18, i32* %22
br label %23
23: ; preds = %16, %9
ret void
}

LLVM IR (-O2):
define void @GPIOPinIntEnable(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
%5 = shl nuw i32 1, %2
%6 = select i1 %4, i32 52, i32 56
%7 = add i32 %6, %0
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 %5, i32* %9
ret void
}
/* Variables and functions */
int bbm_long_write(void *, unsigned short, unsigned short, unsigned int);
int bbm_com_long_write(void *handle, unsigned short devid, unsigned short addr,
                       unsigned int data) {
  int res;
  res = bbm_long_write(handle, devid, addr, data);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_long_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dx,%ax
mov    %si,%dx
mov    %rdi,-0x8(%rbp)
mov    %dx,-0xa(%rbp)
mov    %ax,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%dx
mov    -0xc(%rbp),%ax
mov    -0x10(%rbp),%ecx
movzwl %dx,%esi
movzwl %ax,%edx
call   1030 <bbm_long_write@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_long_write>:
jmp    1030 <bbm_long_write@plt>

LLVM IR (-O0):
define i32 @bbm_com_long_write(i8* %0, i16 zeroext %1, i16 zeroext %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i16
%7 = alloca i16
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %5
store i16 %1, i16* %6
store i16 %2, i16* %7
store i32 %3, i32* %8
%10 = load i8*, i8** %5
%11 = load i16, i16* %6
%12 = load i16, i16* %7
%13 = load i32, i32* %8
%14 = call i32 @bbm_long_write(i8* %10, i16 zeroext %11, i16 zeroext %12, i32 %13)
store i32 %14, i32* %9
%15 = load i32, i32* %9
ret i32 %15
}

LLVM IR (-O2):
define i32 @bbm_com_long_write(i8* %0, i16 zeroext %1, i16 zeroext %2, i32 %3) {
%5 = tail call i32 @bbm_long_write(i8* %0, i16 zeroext %1, i16 zeroext %2, i32 %3)
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t endianSwap(uint32_t value) {
  return (value & 0x000000FFu) << 24 | (value & 0x0000FF00u) << 8 |
         (value & 0x00FF0000u) >> 8 | (value & 0xFF000000u) >> 24;
}


x86 assembly (clang, -O0):
<endianSwap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
shr    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff000000,%ecx
shr    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @endianSwap(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 24
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 16711680
%12 = lshr i32 %11, 8
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, -16777216
%16 = lshr i32 %15, 24
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @endianSwap(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
bool isNumericChar(char x) { return (x >= '0' && x <= '9') ? true : false; }


x86 assembly (clang, -O0):
<isNumericChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <isNumericChar+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNumericChar>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isNumericChar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
ret i32 %13
}

LLVM IR (-O2):
define i32 @isNumericChar(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}