xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ isdigit(int /*<<< orphan*/);
int digits_only(const char *s) {
  while (*s)
    if (!isdigit(*s++))
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<digits_only>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <digits_only+0x4a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1155 <digits_only+0x45>
movl   $0x0,-0x4(%rbp)
jmp    1161 <digits_only+0x51>
jmp    111c <digits_only+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<digits_only>:
movsbl (%rdi),%eax
test   %eax,%eax
je     1116 <digits_only+0x16>
add    $0x1,%rdi
add    $0xffffffd0,%eax
cmp    $0xa,%eax
jb     1100 <digits_only>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @digits_only(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = sext i8 %4 to i32
%9 = add nsw i32 %8, -48
%10 = icmp ult i32 %9, 10
br i1 %10, label %2, label %11
11: ; preds = %2, %6
%12 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %12
}
void ajTextoutExit(void) { return; }


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

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

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

LLVM IR (-O2):
define void @ajTextoutExit() {
ret void
}
short test_hisi(int x) { return (short)x; }


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

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

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

LLVM IR (-O2):
define signext i16 @test_hisi(i32 %0) {
%2 = trunc i32 %0 to i16
ret i16 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ arr;

/* Variables and functions */
int printArray(int *, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sortByFrequency(int *, int);
int main() {
  int p;
  int arr[] = {2, 3, 2, 4, 5, 12, 2, 3, 3, 3, 12};
  int n = sizeof(arr) / sizeof(arr[0]);
  sortByFrequency(arr, n);
  p = printArray(arr, n);
  printf("%d", (n - p));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xea6(%rip),%rsi
mov    $0x2c,%edx
call   1040 <memcpy@plt>
movl   $0xb,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%esi
call   1050 <sortByFrequency@plt>
lea    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%esi
call   1060 <printArray@plt>
mov    %eax,-0x8(%rbp)
mov    -0x44(%rbp),%esi
sub    -0x8(%rbp),%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x38,%rsp
movups 0xedf(%rip),%xmm0
movups %xmm0,0x1c(%rsp)
movaps 0xec7(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeab(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    $0xb,%ebp
mov    %rbx,%rdi
mov    $0xb,%esi
call   1040 <sortByFrequency@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
call   1050 <printArray@plt>
sub    %eax,%ebp
lea    0xea8(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.arr = [11 x i32] [i32 2, i32 3, i32 2, i32 4, i32 5, i32 12, i32 2, i32 3, i32 3, i32 3, i32 12]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [11 x i32]
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [11 x i32]* %3 to i8*
store i32 11, i32* %4
%6 = getelementptr inbounds [11 x i32], [11 x i32]* %3, i64 0, i64 0
%7 = load i32, i32* %4
%8 = call i32 @sortByFrequency(i32* %6, i32 %7)
%9 = getelementptr inbounds [11 x i32], [11 x i32]* %3, i64 0, i64 0
%10 = load i32, i32* %4
%11 = call i32 @printArray(i32* %9, i32 %10)
store i32 %11, i32* %2
%12 = load i32, i32* %4
%13 = load i32, i32* %2
%14 = sub nsw i32 %12, %13
%15 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [11 x i32] [i32 2, i32 3, i32 2, i32 4, i32 5, i32 12, i32 2, i32 3, i32 3, i32 3, i32 12]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [11 x i32]
%2 = bitcast [11 x i32]* %1 to i8*
%3 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
%4 = call i32 @sortByFrequency(i32* %3, i32 11)
%5 = call i32 @printArray(i32* %3, i32 11)
%6 = sub nsw i32 11, %5
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
void rdns_libevent_repeat_timer(void *priv_data, void *ev_data) {}


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

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

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

LLVM IR (-O2):
define void @rdns_libevent_repeat_timer(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t SuperNET_narrowcast(char *destip, unsigned char *msg, int32_t len) {
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @SuperNET_narrowcast(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int _ctype_lookup(int);
int isalnum(int c) { return _ctype_lookup(c) & (0x01 | 0x02 | 0x04); }


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

x86 assembly (clang, -O2):
<isalnum>:
push   %rax
call   1030 <_ctype_lookup@plt>
and    $0x7,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isalnum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_ctype_lookup(i32 %3)
%5 = and i32 %4, 7
ret i32 %5
}

LLVM IR (-O2):
define i32 @isalnum(i32 %0) {
%2 = tail call i32 @_ctype_lookup(i32 %0)
%3 = and i32 %2, 7
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ test();
int main(int argc, char **argv) {
  test();
  while (--argc)
    puts(*++argv);
  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   1040 <test@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     116c <main+0x4c>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
call   1030 <puts@plt>
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <test@plt>
cmp    $0x1,%ebp
je     1151 <main+0x31>
mov    %ebp,%ebp
mov    $0x1,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <puts@plt>
add    $0x1,%rbx
cmp    %ebx,%ebp
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
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 (...) @test()
br label %7
7: ; preds = %11, %2
%8 = load i32, i32* %4
%9 = add nsw i32 %8, -1
store i32 %9, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i32 1
store i8** %13, i8*** %5
%14 = load i8*, i8** %13
%15 = call i32 @puts(i8* %14)
br label %7
16: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @test()
%4 = add nsw i32 %0, -1
%5 = icmp eq i32 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %12, %6 ], [ %4, %2 ]
%8 = phi i8** [ %9, %6 ], [ %1, %2 ]
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @puts(i8* dereferenceable(1) %10)
%12 = add nsw i32 %7, -1
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void *_wmo_read_any_from_file_malloc(int /*<<< orphan*/ *, int *, int,
                                     int /*<<< orphan*/);
void *wmo_read_grib_from_file_malloc(FILE *f, int *err) {
  return _wmo_read_any_from_file_malloc(f, err, 1, 0);
}


x86 assembly (clang, -O0):
<wmo_read_grib_from_file_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <_wmo_read_any_from_file_malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wmo_read_grib_from_file_malloc>:
mov    $0x1,%edx
xor    %ecx,%ecx
jmp    1030 <_wmo_read_any_from_file_malloc@plt>

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

LLVM IR (-O2):
define i8* @wmo_read_grib_from_file_malloc(i32* %0, i32* %1) {
%3 = tail call i8* @_wmo_read_any_from_file_malloc(i32* %0, i32* %1, i32 1, i32 0)
ret i8* %3
}
double absol(double x) { return x >= 0 ? x : -x; }


x86 assembly (clang, -O0):
<absol>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112a <absol+0x2a>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    114b <absol+0x4b>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<absol>:
movapd 0xef8(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
cmplesd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @absol(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oge double %3, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load double, double* %2
br label %10
7: ; preds = %1
%8 = load double, double* %2
%9 = fneg double %8
br label %10
10: ; preds = %7, %5
%11 = phi double [ %6, %5 ], [ %9, %7 ]
ret double %11
}

LLVM IR (-O2):
define double @absol(double %0) {
%2 = fcmp oge double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %0, double %3
ret double %4
}
void remove() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fget32_(int /*<<< orphan*/ *);
void get_uint32(FILE *fp, int *next_offset, uint32_t *val) {
  *val = fget32_(fp);
  *next_offset = *next_offset + 4;
}


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

x86 assembly (clang, -O2):
<get_uint32>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
call   1030 <fget32_@plt>
mov    %eax,(%rbx)
addl   $0x4,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @get_uint32(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 = call i32 @fget32_(i32* %7)
%9 = load i32*, i32** %6
store i32 %8, i32* %9
%10 = load i32*, i32** %5
%11 = load i32, i32* %10
%12 = add nsw i32 %11, 4
%13 = load i32*, i32** %5
store i32 %12, i32* %13
ret void
}

LLVM IR (-O2):
define void @get_uint32(i32* %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = tail call i32 @fget32_(i32* %0)
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 4
store i32 %6, i32* %1
ret void
}
/* Variables and functions */
bool non_ascii(int ch) {
  if (ch == '\n')
    return false;
  return !(ch >= 32 && ch <= 126);
}


x86 assembly (clang, -O0):
<non_ascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jne    111d <non_ascii+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1143 <non_ascii+0x43>
xor    %eax,%eax
cmpl   $0x20,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jl     1136 <non_ascii+0x36>
cmpl   $0x7e,-0x8(%rbp)
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<non_ascii>:
cmp    $0xa,%edi
setne  %al
add    $0xffffff81,%edi
cmp    $0xffffffa1,%edi
setb   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @non_ascii(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 10
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %17
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sge i32 %8, 32
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %3
%12 = icmp sle i32 %11, 126
br label %13
13: ; preds = %10, %7
%14 = phi i1 [ false, %7 ], [ %12, %10 ]
%15 = xor i1 %14, true
%16 = zext i1 %15 to i32
store i32 %16, i32* %2
br label %17
17: ; preds = %13, %6
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @non_ascii(i32 %0) {
%2 = icmp ne i32 %0, 10
%3 = add i32 %0, -127
%4 = icmp ult i32 %3, -95
%5 = and i1 %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
double pow(double, double);
double nearest_planet(double star_mass_r) {
  return (0.3 * pow(star_mass_r, (1.0 / 3.0)));
}


x86 assembly (clang, -O0):
<nearest_planet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xec6(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nearest_planet>:
push   %rax
movsd  0xee7(%rip),%xmm1
call   1030 <pow@plt>
mulsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @nearest_planet(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double %3, double 0x3FD5555555555555)
%5 = fmul double 3.000000e-01, %4
ret double %5
}

LLVM IR (-O2):
define double @nearest_planet(double %0) {
%2 = tail call double @pow(double %0, double 0x3FD5555555555555)
%3 = fmul double %2, 3.000000e-01
ret double %3
}
void element2hex() {}


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

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

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

LLVM IR (-O2):
define void @element2hex() {
ret void
}
void M_parsearguments() {
  extern int m_argc;
  extern char **m_argv;
  if (m_argc == 1)
    return;
  m_argv[1][0] = '\0';
}


x86 assembly (clang, -O0):
<M_parsearguments>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
cmpl   $0x1,(%rax)
jne    1119 <M_parsearguments+0x19>
jmp    112a <M_parsearguments+0x2a>
mov    0x2eb8(%rip),%rax
mov    (%rax),%rax
mov    0x8(%rax),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<M_parsearguments>:
mov    0x2ee1(%rip),%rax
cmpl   $0x1,(%rax)
je     111d <M_parsearguments+0x1d>
mov    0x2ec5(%rip),%rax
mov    (%rax),%rax
mov    0x8(%rax),%rax
movb   $0x0,(%rax)
ret

LLVM IR (-O0):
@m_argc = external global i32
@m_argv = external global i8**
define void @M_parsearguments() {
%1 = load i32, i32* @m_argc
%2 = icmp eq i32 %1, 1
br i1 %2, label %3, label %4
3: ; preds = %0
br label %9
4: ; preds = %0
%5 = load i8**, i8*** @m_argv
%6 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %6
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 0, i8* %8
br label %9
9: ; preds = %4, %3
ret void
}

LLVM IR (-O2):
@m_argc = external global i32
@m_argv = external global i8**
define void @M_parsearguments() {
%1 = load i32, i32* @m_argc
%2 = icmp eq i32 %1, 1
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = load i8**, i8*** @m_argv
%5 = getelementptr inbounds i8*, i8** %4, i64 1
%6 = load i8*, i8** %5
store i8 0, i8* %6
br label %7
7: ; preds = %0, %3
ret void
}
float _cam_def(float val, float def) { return ((val == 0.0f) ? def : val); }


x86 assembly (clang, -O0):
<_cam_def>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1134 <_cam_def+0x34>
jp     1134 <_cam_def+0x34>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    113e <_cam_def+0x3e>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cam_def>:
xorps  %xmm2,%xmm2
cmpeqss %xmm0,%xmm2
andps  %xmm2,%xmm1
andnps %xmm0,%xmm2
orps   %xmm1,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @_cam_def(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 = fcmp oeq float %5, 0.000000e+00
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load float, float* %4
br label %11
9: ; preds = %2
%10 = load float, float* %3
br label %11
11: ; preds = %9, %7
%12 = phi float [ %8, %7 ], [ %10, %9 ]
ret float %12
}

LLVM IR (-O2):
define float @_cam_def(float %0, float %1) {
%3 = fcmp oeq float %0, 0.000000e+00
%4 = select i1 %3, float %1, float %0
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void call_by_ref(int *p) {
  printf("In function: Address of p = %p\n", &p);
  printf("In function: Address p is pointing to = %p\n", p);
}


x86 assembly (clang, -O0):
<call_by_ref>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xee7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_by_ref>:
push   %rax
mov    %rdi,(%rsp)
lea    0xee4(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rsp),%rsi
lea    0xeef(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [32 x i8] c"In function: Address of p = %p\0A\00"
@.str.1 = [44 x i8] c"In function: Address p is pointing to = %p\0A\00"
define void @call_by_ref(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32** %2)
%4 = load i32*, i32** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i32* %4)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"In function: Address of p = %p\0A\00"
@.str.1 = [44 x i8] c"In function: Address p is pointing to = %p\0A\00"
define void @call_by_ref(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32** %2)
%4 = load i32*, i32** %2
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i32* %4)
ret void
}
unsigned foo(void) { return *(unsigned *)foo(); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
call   1030 <foo@plt>
mov    %eax,%eax
mov    (%rax),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo() {
%1 = call i32 @foo()
%2 = zext i32 %1 to i64
%3 = inttoptr i64 %2 to i32*
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i32 @foo()
%2 = zext i32 %1 to i64
%3 = inttoptr i64 %2 to i32*
%4 = load i32, i32* %3
ret i32 %4
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int l_file_read_sections(int, int, struct list *);
int file_read_sections(int fd, struct list *names) {
  return l_file_read_sections(fd, 32 * 1024, names);
}


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

x86 assembly (clang, -O2):
<file_read_sections>:
mov    %rsi,%rdx
mov    $0x8000,%esi
jmp    1030 <l_file_read_sections@plt>

LLVM IR (-O0):
%struct.list = type { i32 }
define i32 @file_read_sections(i32 %0, %struct.list* %1) {
%3 = alloca i32
%4 = alloca %struct.list*
store i32 %0, i32* %3
store %struct.list* %1, %struct.list** %4
%5 = load i32, i32* %3
%6 = load %struct.list*, %struct.list** %4
%7 = call i32 @l_file_read_sections(i32 %5, i32 32768, %struct.list* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.list = type { i32 }
define i32 @file_read_sections(i32 %0, %struct.list* %1) {
%3 = tail call i32 @l_file_read_sections(i32 %0, i32 32768, %struct.list* %1)
ret i32 %3
}
int pthread_cond_signal() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pthread_cond_signal() {
ret i32 0
}
void *thread_3(void *arg) {
  printf("fun = %s thread_id = %u, arg = %d \n", __func__, (int)pthread_self(),
         (int)(long)arg);
}


x86 assembly (clang, -O0):
<thread_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,%edx
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
lea    0xebe(%rip),%rdi
lea    0xedb(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_3>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xece(%rip),%rdi
lea    0xeeb(%rip),%rsi
mov    %eax,%edx
mov    %ebx,%ecx
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"fun = %s thread_id = %u, arg = %d \0A\00"
@__func__.thread_3 = [9 x i8] c"thread_3\00"
define i8* @thread_3(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (...) @pthread_self()
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i64
%7 = trunc i64 %6 to i32
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.thread_3, i64 0, i64 0), i32 %4, i32 %7)
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [36 x i8] c"fun = %s thread_id = %u, arg = %d \0A\00"
@__func__.thread_3 = [9 x i8] c"thread_3\00"
define noalias i8* @thread_3(i8* %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.thread_3, i64 0, i64 0), i32 %2, i32 %4)
ret i8* undef
}
/* Type definitions */
struct n {
  int dummy;
};

/* Variables and functions */
int n_cmp_hex(struct n *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ slen(char *);
int n_cmp_hexz(struct n *v, char *hex) { return n_cmp_hex(v, hex, slen(hex)); }


x86 assembly (clang, -O0):
<n_cmp_hexz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <slen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <n_cmp_hex@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<n_cmp_hexz>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <slen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <n_cmp_hex@plt>

LLVM IR (-O0):
%struct.n = type { i32 }
define i32 @n_cmp_hexz(%struct.n* %0, i8* %1) {
%3 = alloca %struct.n*
%4 = alloca i8*
store %struct.n* %0, %struct.n** %3
store i8* %1, i8** %4
%5 = load %struct.n*, %struct.n** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @slen(i8* %7)
%9 = call i32 @n_cmp_hex(%struct.n* %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.n = type { i32 }
define i32 @n_cmp_hexz(%struct.n* %0, i8* %1) {
%3 = tail call i32 @slen(i8* %1)
%4 = tail call i32 @n_cmp_hex(%struct.n* %0, i8* %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ func(char *, char *);
void stricmp_equal_lower() {
  Assert_real((func("equal", "equal") == 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/string/stricmp.c",
              12, ("Should be == 0"));
}


x86 assembly (clang, -O0):
<stricmp_equal_lower>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rsi
mov    %rsi,%rdi
call   1030 <func@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0xc,%edx
lea    0xf58(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stricmp_equal_lower>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rdi,%rsi
call   1030 <func@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec6(%rip),%rsi
lea    0xf63(%rip),%rcx
mov    $0xc,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"equal\00"
@.str.1 = [164 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/string/stricmp.c\00"
@.str.2 = [15 x i8] c"Should be == 0\00"
define void @stricmp_equal_lower() {
%1 = call i64 @func(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str.1, i64 0, i64 0), i32 12, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"equal\00"
@.str.1 = [164 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/string/stricmp.c\00"
@.str.2 = [15 x i8] c"Should be == 0\00"
define void @stricmp_equal_lower() {
%1 = tail call i64 @func(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str.1, i64 0, i64 0), i32 12, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ set_bit_false(int /*<<< orphan*/ volatile *, int);
void set_led_white(volatile uint8_t *buffer) {
  set_bit_false(buffer, 1);
  set_bit_false(buffer, 3);
  set_bit_false(buffer, 2);
}


x86 assembly (clang, -O0):
<set_led_white>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <set_bit_false@plt>
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
call   1030 <set_bit_false@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1030 <set_bit_false@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_led_white>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%esi
call   1030 <set_bit_false@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <set_bit_false@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
pop    %rbx
jmp    1030 <set_bit_false@plt>

LLVM IR (-O0):
define void @set_led_white(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @set_bit_false(i32* %3, i32 1)
%5 = load i32*, i32** %2
%6 = call i32 @set_bit_false(i32* %5, i32 3)
%7 = load i32*, i32** %2
%8 = call i32 @set_bit_false(i32* %7, i32 2)
ret void
}

LLVM IR (-O2):
define void @set_led_white(i32* %0) {
%2 = tail call i32 @set_bit_false(i32* %0, i32 1)
%3 = tail call i32 @set_bit_false(i32* %0, i32 3)
%4 = tail call i32 @set_bit_false(i32* %0, i32 2)
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int cmp(const void *p, const void *q) {
  char const *pp = *(char const **)p;
  char const *qq = *(char const **)q;
  return strcmp(pp, qq);
}


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

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
%9 = load i8*, i8** %8
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i8**
%12 = load i8*, i8** %11
store i8* %12, i8** %6
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i32 @strcmp(i8* %13, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Type definitions */
struct wpa_ctrl {
  int dummy;
};

/* Variables and functions */
int wpa_ctrl_command(struct wpa_ctrl *, char *);
int wpa_cli_cmd_status(struct wpa_ctrl *ctrl, int argc, const char *argv[]) {
  return wpa_ctrl_command(ctrl, "STATUS");
}


x86 assembly (clang, -O0):
<wpa_cli_cmd_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
call   1030 <wpa_ctrl_command@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wpa_cli_cmd_status>:
lea    0xee9(%rip),%rsi
jmp    1030 <wpa_ctrl_command@plt>

LLVM IR (-O0):
%struct.wpa_ctrl = type { i32 }
@.str = [7 x i8] c"STATUS\00"
define i32 @wpa_cli_cmd_status(%struct.wpa_ctrl* %0, i32 %1, i8** %2) {
%4 = alloca %struct.wpa_ctrl*
%5 = alloca i32
%6 = alloca i8**
store %struct.wpa_ctrl* %0, %struct.wpa_ctrl** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load %struct.wpa_ctrl*, %struct.wpa_ctrl** %4
%8 = call i32 @wpa_ctrl_command(%struct.wpa_ctrl* %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 %8
}

LLVM IR (-O2):
%struct.wpa_ctrl = type { i32 }
@.str = [7 x i8] c"STATUS\00"
define i32 @wpa_cli_cmd_status(%struct.wpa_ctrl* %0, i32 %1, i8** nocapture readnone %2) {
%4 = tail call i32 @wpa_ctrl_command(%struct.wpa_ctrl* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}
__attribute__((always_)) int min_int(int a, int b) { return a < b ? a : b; }


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

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

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

LLVM IR (-O2):
define i32 @min_int(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int didUsernameHasOnlyAlhabet(char *nick) {
  int flag = 0;
  int i = 0;
  for (i = 0; nick[i] != 0; i++) {
    if (nick[i] < 'a' || nick[i] > 'z')
      flag = 1;
  }
  return flag;
}


x86 assembly (clang, -O0):
<didUsernameHasOnlyAlhabet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1176 <didUsernameHasOnlyAlhabet+0x76>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x61,%eax
jl     115c <didUsernameHasOnlyAlhabet+0x5c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x7a,%eax
jle    1163 <didUsernameHasOnlyAlhabet+0x63>
movl   $0x1,-0xc(%rbp)
jmp    1168 <didUsernameHasOnlyAlhabet+0x68>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111d <didUsernameHasOnlyAlhabet+0x1d>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<didUsernameHasOnlyAlhabet>:
mov    (%rdi),%cl
test   %cl,%cl
je     1135 <didUsernameHasOnlyAlhabet+0x35>
add    $0x1,%rdi
xor    %eax,%eax
mov    $0x1,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x85,%cl
cmp    $0xe6,%cl
cmovb  %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1120 <didUsernameHasOnlyAlhabet+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @didUsernameHasOnlyAlhabet(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %11, %4 ], [ 0, %1 ]
%6 = phi i8 [ %13, %4 ], [ %2, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = add i8 %6, -123
%9 = icmp ult i8 %8, -26
%10 = select i1 %9, i32 1, i32 %7
%11 = add nuw nsw i64 %5, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %16
}
unsigned xrop3_152_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = T | S;
  stk3 = ~stk3;
  stk2 = D | stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_152_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_152_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
shl    $0x8,%esi
not    %eax
and    %esi,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_152_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = load i32, i32* %6
%25 = or i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %10
%27 = xor i32 %26, -1
store i32 %27, i32* %10
%28 = load i32, i32* %5
%29 = load i32, i32* %10
%30 = or i32 %28, %29
store i32 %30, i32* %9
%31 = load i32, i32* %6
%32 = load i32, i32* %9
%33 = xor i32 %31, %32
store i32 %33, i32* %8
%34 = load i32, i32* %8
%35 = xor i32 %34, -1
store i32 %35, i32* %8
%36 = load i32, i32* %8
%37 = load i32, i32* %6
%38 = xor i32 %37, -1
%39 = and i32 %36, %38
%40 = load i32, i32* %5
%41 = load i32, i32* %6
%42 = and i32 %40, %41
%43 = or i32 %39, %42
ret i32 %43
}

LLVM IR (-O2):
define i32 @xrop3_152_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = xor i32 %4, -1
%8 = and i32 %6, %7
%9 = or i32 %8, %3
ret i32 %9
}
/* Variables and functions */
int getmaxx(int /*<<< orphan*/);
int /*<<< orphan*/ stdscr;
int t_getmaxx() { return getmaxx(stdscr); }


x86 assembly (clang, -O0):
<t_getmaxx>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <getmaxx@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_getmaxx>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <getmaxx@plt>

LLVM IR (-O0):
@stdscr = global i32 0
define i32 @t_getmaxx() {
%1 = load i32, i32* @stdscr
%2 = call i32 @getmaxx(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@stdscr = global i32 0
define i32 @t_getmaxx() {
%1 = load i32, i32* @stdscr
%2 = tail call i32 @getmaxx(i32 %1)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ temp;

/* Variables and functions */
int extract_perc(char *, float *);
int read(int /*<<< orphan*/, void *, int);
int /*<<< orphan*/ strip_shit(char *, int);
int ogg_read_stat(float *perc) {
  char temp[2048];
  int bytes_read;
  char input[2048];
  bytes_read = read(0, (void *)temp, sizeof(temp));
  if (bytes_read) {
    strip_shit(temp, bytes_read);
    return extract_perc(temp, perc);
  }
  return (-1);
}


x86 assembly (clang, -O0):
<ogg_read_stat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1020,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x810(%rbp),%rsi
xor    %edi,%edi
mov    $0x800,%edx
call   1040 <read@plt>
mov    %eax,-0x814(%rbp)
cmpl   $0x0,-0x814(%rbp)
je     118f <ogg_read_stat+0x5f>
lea    -0x810(%rbp),%rdi
mov    -0x814(%rbp),%esi
call   1030 <strip_shit@plt>
lea    -0x810(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <extract_perc@plt>
mov    %eax,-0x4(%rbp)
jmp    1196 <ogg_read_stat+0x66>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ogg_read_stat>:
push   %r14
push   %rbx
sub    $0x808,%rsp
mov    %rdi,%rbx
mov    %rsp,%rsi
xor    %edi,%edi
mov    $0x800,%edx
call   1040 <read@plt>
test   %eax,%eax
je     116a <ogg_read_stat+0x3a>
mov    %rsp,%r14
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <strip_shit@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <extract_perc@plt>
jmp    116f <ogg_read_stat+0x3f>
mov    $0xffffffff,%eax
add    $0x808,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @ogg_read_stat(float* %0) {
%2 = alloca i32
%3 = alloca float*
%4 = alloca [2048 x i8]
%5 = alloca i32
%6 = alloca [2048 x i8]
store float* %0, float** %3
%7 = getelementptr inbounds [2048 x i8], [2048 x i8]* %4, i64 0, i64 0
%8 = call i32 @read(i32 0, i8* %7, i32 2048)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %1
%12 = getelementptr inbounds [2048 x i8], [2048 x i8]* %4, i64 0, i64 0
%13 = load i32, i32* %5
%14 = call i32 @strip_shit(i8* %12, i32 %13)
%15 = getelementptr inbounds [2048 x i8], [2048 x i8]* %4, i64 0, i64 0
%16 = load float*, float** %3
%17 = call i32 @extract_perc(i8* %15, float* %16)
store i32 %17, i32* %2
br label %19
18: ; preds = %1
store i32 -1, i32* %2
br label %19
19: ; preds = %18, %11
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @ogg_read_stat(float* %0) {
%2 = alloca [2048 x i8]
%3 = getelementptr inbounds [2048 x i8], [2048 x i8]* %2, i64 0, i64 0
%4 = call i32 @read(i32 0, i8* %3, i32 2048)
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = call i32 @strip_shit(i8* %3, i32 %4)
%8 = call i32 @extract_perc(i8* %3, float* %0)
br label %9
9: ; preds = %1, %6
%10 = phi i32 [ %8, %6 ], [ -1, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ __analyzer_eval(int);
int only_called_by_test_34(int);
void test_34(void) {
  int result = only_called_by_test_34(42);
  __analyzer_eval(result == 84);
}


x86 assembly (clang, -O0):
<test_34>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2a,%edi
call   1040 <only_called_by_test_34@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x54,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_34>:
push   %rax
mov    $0x2a,%edi
call   1040 <only_called_by_test_34@plt>
xor    %edi,%edi
cmp    $0x54,%eax
sete   %dil
pop    %rax
jmp    1030 <__analyzer_eval@plt>

LLVM IR (-O0):
define void @test_34() {
%1 = alloca i32
%2 = call i32 @only_called_by_test_34(i32 42)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 84
%5 = zext i1 %4 to i32
%6 = call i32 @__analyzer_eval(i32 %5)
ret void
}

LLVM IR (-O2):
define void @test_34() {
%1 = tail call i32 @only_called_by_test_34(i32 42)
%2 = icmp eq i32 %1, 84
%3 = zext i1 %2 to i32
%4 = tail call i32 @__analyzer_eval(i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
struct FragFile {
  int dummy;
};

/* Variables and functions */
int writeFragments(struct FragFile *f, char *s, int nf, uint64_t xtotal,
                   uint64_t ytotal) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.FragFile = type { i32 }
define i32 @writeFragments(%struct.FragFile* %0, i8* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.FragFile*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.FragFile* %0, %struct.FragFile** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret i32 0
}

LLVM IR (-O2):
%struct.FragFile = type { i32 }
define i32 @writeFragments(%struct.FragFile* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i32 %3, i32 %4) {
ret i32 0
}
void ldl(int *stack, int *spointer, int operand) {
  (*spointer)++;
  *(stack + *spointer) = operand;
}


x86 assembly (clang, -O0):
<ldl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldl>:
movslq (%rsi),%rax
lea    0x1(%rax),%rcx
mov    %ecx,(%rsi)
mov    %edx,0x4(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @ldl(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 = load i32, i32* %7
%9 = add nsw i32 %8, 1
store i32 %9, i32* %7
%10 = load i32, i32* %6
%11 = load i32*, i32** %4
%12 = load i32*, i32** %5
%13 = load i32, i32* %12
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %11, i64 %14
store i32 %10, i32* %15
ret void
}

LLVM IR (-O2):
define void @ldl(i32* nocapture writeonly %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
store i32 %5, i32* %1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
store i32 %2, i32* %7
ret void
}
void __DELETE_java_lang_Number(void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_java_lang_Number(i8* nocapture %0, i8* nocapture %1) {
ret void
}