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

/* Variables and functions */
int S_IFDIR;
int S_IFMT;
scalar_t__ stat(char const *, struct stat *);
int ftype(const char *f) {
  struct stat statb;
  if (stat(f, &statb) < 0)
    return (0);
  if ((statb.st_mode & S_IFMT) == S_IFDIR)
    return (1);
  return (2);
}


x86 assembly (clang, -O0):
<ftype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jge    113f <ftype+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    116d <ftype+0x5d>
mov    -0x18(%rbp),%eax
mov    0x2e97(%rip),%rcx
and    (%rcx),%eax
mov    0x2e7e(%rip),%rcx
cmp    (%rcx),%eax
jne    1166 <ftype+0x56>
movl   $0x1,-0x4(%rbp)
jmp    116d <ftype+0x5d>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftype>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %rax,%rax
js     1141 <ftype+0x31>
mov    0x2ebb(%rip),%rax
mov    (%rax),%eax
and    (%rsp),%eax
mov    0x2e9f(%rip),%rcx
xor    %edx,%edx
cmp    (%rcx),%eax
sete   %dl
mov    $0x2,%eax
sub    %edx,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@S_IFMT = global i32 0
@S_IFDIR = global i32 0
define i32 @ftype(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %18
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = load i32, i32* @S_IFMT
%13 = and i32 %11, %12
%14 = load i32, i32* @S_IFDIR
%15 = icmp eq i32 %13, %14
br i1 %15, label %16, label %17
16: ; preds = %9
store i32 1, i32* %2
br label %18
17: ; preds = %9
store i32 2, i32* %2
br label %18
18: ; preds = %17, %16, %8
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@S_IFMT = global i32 0
@S_IFDIR = global i32 0
define i32 @ftype(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = load i32, i32* @S_IFMT
%10 = and i32 %9, %8
%11 = load i32, i32* @S_IFDIR
%12 = icmp eq i32 %10, %11
%13 = select i1 %12, i32 1, i32 2
br label %14
14: ; preds = %6, %1
%15 = phi i32 [ 0, %1 ], [ %13, %6 ]
ret i32 %15
}
void musicon(void) {}


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

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

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

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

/* Variables and functions */
int _mode_alpha(char const *, int /*<<< orphan*/ *);
scalar_t__ _mode_digit(char const *, int /*<<< orphan*/ *);
int _mode(char const *mode, mode_t *mask) {
  if (*mode == '\0')
    return 1;
  if (_mode_digit(mode, mask) == 0)
    return 0;
  return _mode_alpha(mode, mask);
}


x86 assembly (clang, -O0):
<_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    114c <_mode+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    117f <_mode+0x5f>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <_mode_digit@plt>
cmp    $0x0,%rax
jne    116f <_mode+0x4f>
movl   $0x0,-0x4(%rbp)
jmp    117f <_mode+0x5f>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <_mode_alpha@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mode>:
push   %r14
push   %rbx
push   %rax
cmpb   $0x0,(%rdi)
je     114b <_mode+0x2b>
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <_mode_digit@plt>
test   %rax,%rax
je     1152 <_mode+0x32>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <_mode_alpha@plt>
mov    $0x1,%eax
jmp    1154 <_mode+0x34>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @_mode(i8* %0, i32* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i64 @_mode_digit(i8* %0, i32* %1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @_mode_alpha(i8* %0, i32* %1)
br label %10
10: ; preds = %5, %2, %8
%11 = phi i32 [ %9, %8 ], [ 1, %2 ], [ 0, %5 ]
ret i32 %11
}
unsigned char getUChar(unsigned const char hexChar) {
  if (hexChar >= 0x00 && hexChar <= 0x09)
    return hexChar + 0x30;
  if (hexChar >= 0x0A && hexChar <= 0x0F)
    return hexChar + 0x37;
  return 0x00;
}


x86 assembly (clang, -O0):
<getUChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x0,%eax
jl     1133 <getUChar+0x33>
movzbl -0x2(%rbp),%eax
cmp    $0x9,%eax
jg     1133 <getUChar+0x33>
movzbl -0x2(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1160 <getUChar+0x60>
movzbl -0x2(%rbp),%eax
cmp    $0xa,%eax
jl     115c <getUChar+0x5c>
movzbl -0x2(%rbp),%eax
cmp    $0xf,%eax
jg     115c <getUChar+0x5c>
movzbl -0x2(%rbp),%eax
add    $0x37,%eax
mov    %al,-0x1(%rbp)
jmp    1160 <getUChar+0x60>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getUChar>:
lea    0x30(%rdi),%eax
lea    0x37(%rdi),%ecx
xor    %edx,%edx
cmp    $0x10,%dil
movzbl %cl,%ecx
cmovae %edx,%ecx
cmp    $0xa,%dil
movzbl %al,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @getUChar(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp sle i32 %9, 9
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = add nsw i32 %13, 48
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
br label %30
16: ; preds = %7, %1
%17 = load i8, i8* %3
%18 = zext i8 %17 to i32
%19 = icmp sge i32 %18, 10
br i1 %19, label %20, label %29
20: ; preds = %16
%21 = load i8, i8* %3
%22 = zext i8 %21 to i32
%23 = icmp sle i32 %22, 15
br i1 %23, label %24, label %29
24: ; preds = %20
%25 = load i8, i8* %3
%26 = zext i8 %25 to i32
%27 = add nsw i32 %26, 55
%28 = trunc i32 %27 to i8
store i8 %28, i8* %2
br label %30
29: ; preds = %20, %16
store i8 0, i8* %2
br label %30
30: ; preds = %29, %24, %11
%31 = load i8, i8* %2
ret i8 %31
}

LLVM IR (-O2):
define zeroext i8 @getUChar(i8 zeroext %0) {
%2 = icmp ult i8 %0, 10
%3 = add i8 %0, 48
%4 = icmp ult i8 %0, 16
%5 = add i8 %0, 55
%6 = select i1 %4, i8 %5, i8 0
%7 = select i1 %2, i8 %3, i8 %6
ret i8 %7
}
/* Variables and functions */
void *malloc(size_t);
void *rpl_malloc(size_t n) {
  if (n == 0)
    n = 1;
  return malloc(n);
}


x86 assembly (clang, -O0):
<rpl_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112f <rpl_malloc+0x1f>
movq   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @rpl_malloc(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = select i1 %2, i64 1, i64 %0
%4 = tail call i8* @malloc(i64 %3)
ret i8* %4
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, double);
void count_char() {
  double nc;
  for (nc = 0; getchar() != EOF; ++nc)
    ;
  printf("%.0f\n", nc);
}


x86 assembly (clang, -O0):
<count_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2eaa(%rip),%rcx
cmp    (%rcx),%rax
je     1163 <count_char+0x43>
jmp    114c <count_char+0x2c>
movsd  0xeac(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1130 <count_char+0x10>
movsd  -0x8(%rbp),%xmm0
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_char>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb5(%rip),%rbx
xorpd  %xmm0,%xmm0
cmp    (%rbx),%rax
je     1160 <count_char+0x40>
xorpd  %xmm0,%xmm0
addsd  0xeb8(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1040 <getchar@plt>
movsd  0x8(%rsp),%xmm0
cmp    (%rbx),%rax
jne    1140 <count_char+0x20>
lea    0xea1(%rip),%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@EOF = global i64 0
@.str = [6 x i8] c"%.0f\0A\00"
define void @count_char() {
%1 = alloca double
store double 0.000000e+00, double* %1
br label %2
2: ; preds = %7, %0
%3 = call i64 (...) @getchar()
%4 = load i64, i64* @EOF
%5 = icmp ne i64 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %2
br label %7
7: ; preds = %6
%8 = load double, double* %1
%9 = fadd double %8, 1.000000e+00
store double %9, double* %1
br label %2
10: ; preds = %2
%11 = load double, double* %1
%12 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %11)
ret void
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [6 x i8] c"%.0f\0A\00"
define void @count_char() {
%1 = tail call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp eq i64 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi double [ %6, %4 ], [ 0.000000e+00, %0 ]
%6 = fadd double %5, 1.000000e+00
%7 = tail call i64 (...) @getchar()
%8 = load i64, i64* @EOF
%9 = icmp eq i64 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
%11 = phi double [ 0.000000e+00, %0 ], [ %6, %4 ]
%12 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %11)
ret void
}
/* Variables and functions */
void ndb_crash(void) {
  long *ptr;
  ptr = NULL;
  *ptr = 0x7fffffff;
}


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

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @ndb_crash() {
%1 = alloca i64*
store i64* null, i64** %1
%2 = load i64*, i64** %1
store i64 2147483647, i64* %2
ret void
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_sys_cfg_bcast_ssid_ctl_usage(void) {
  printf("\nUsage : sys_cfg_bcast_ssid_ctl [0|1]\n");
  printf("\nOptions: 0     - Disable SSID broadcast");
  printf("\n         1     - Enable SSID broadcast");
  printf("\n         empty - Get current SSID broadcast setting\n");
  return;
}


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

x86 assembly (clang, -O2):
<print_sys_cfg_bcast_ssid_ctl_usage>:
push   %rax
lea    0xf29(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
lea    0xee9(%rip),%rdi
call   1040 <printf@plt>
lea    0xf2b(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"\0AUsage : sys_cfg_bcast_ssid_ctl [0|1]\0A\00"
@.str.1 = [41 x i8] c"\0AOptions: 0 - Disable SSID broadcast\00"
@.str.2 = [40 x i8] c"\0A 1 - Enable SSID broadcast\00"
@.str.3 = [54 x i8] c"\0A empty - Get current SSID broadcast setting\0A\00"
define void @print_sys_cfg_bcast_ssid_ctl_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [41 x i8] c"\0AOptions: 0 - Disable SSID broadcast\00"
@.str.2 = [40 x i8] c"\0A 1 - Enable SSID broadcast\00"
@str = [38 x i8] c"\0AUsage : sys_cfg_bcast_ssid_ctl [0|1]\00"
@str.4 = [53 x i8] c"\0A empty - Get current SSID broadcast setting\00"
define void @print_sys_cfg_bcast_ssid_ctl_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.4, i64 0, i64 0))
ret void
}
double do_pow_0_5_default(double a) { return __builtin_pow(a, 0.5); }


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

x86 assembly (clang, -O2):
<do_pow_0_5_default>:
movsd  0xee8(%rip),%xmm1
jmp    1030 <pow@plt>

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

LLVM IR (-O2):
define double @do_pow_0_5_default(double %0) {
%2 = tail call double @pow(double %0, double 5.000000e-01)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ func_1(int);
int /*<<< orphan*/ printf(char *, char, int);
void func_2(char bb, int aa) {
  printf("func_2. bb=%c aa=%d\n", bb, aa);
  func_1(aa + 5);
}


x86 assembly (clang, -O0):
<func_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%edx
lea    0xec2(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
add    $0x5,%edi
call   1040 <func_1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_2>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%esi
lea    0xed4(%rip),%rdi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x5,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1040 <func_1@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"func_2. bb=%c aa=%d\0A\00"
define void @func_2(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8 signext %5, i32 %6)
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 5
%10 = call i32 @func_1(i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"func_2. bb=%c aa=%d\0A\00"
define void @func_2(i8 signext %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8 signext %0, i32 %1)
%4 = add nsw i32 %1, 5
%5 = tail call i32 @func_1(i32 %4)
ret void
}
int test5(const float x, float float_number) {
  return __builtin_isless(x, float_number);
}


x86 assembly (clang, -O0):
<test5>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test5>:
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @test5(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 = fcmp olt float %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @test5(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int sscanf(char const *, char *, int *, int *);
int cpuset_getrange(const char *c, int *a, int *b) {
  int ret;
  ret = sscanf(c, "%d-%d", a, b);
  return ret;
}


x86 assembly (clang, -O0):
<cpuset_getrange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xec9(%rip),%rsi
call   1030 <sscanf@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuset_getrange>:
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0xee3(%rip),%rsi
jmp    1030 <sscanf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d-%d\00"
define i32 @cpuset_getrange(i8* nocapture %0, i32* %1, i32* %2) {
%4 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
double rint(double);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double a, b;
  printf("Input a real number:");
  scanf("%lf", &a);
  printf("\tInteger:%f\n", rint(a));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
call   1040 <rint@plt>
lea    0xeab(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
call   1040 <rint@plt>
lea    0xeba(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Input a real number:\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [13 x i8] c"\09Integer:%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%6 = load double, double* %2
%7 = call double @llvm.rint.f64(double %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Input a real number:\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [13 x i8] c"\09Integer:%f\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = call double @llvm.rint.f64(double %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double %6)
ret i32 0
}
/* Variables and functions */
void *hgetHdr(void *ptr) { return ptr - *((size_t *)ptr - 1); }


x86 assembly (clang, -O0):
<hgetHdr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rdx
xor    %ecx,%ecx
sub    -0x8(%rdx),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hgetHdr>:
mov    %rdi,%rax
sub    -0x8(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @hgetHdr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i64*
%6 = getelementptr inbounds i64, i64* %5, i64 -1
%7 = load i64, i64* %6
%8 = sub i64 0, %7
%9 = getelementptr i8, i8* %3, i64 %8
ret i8* %9
}

LLVM IR (-O2):
define i8* @hgetHdr(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -8
%3 = bitcast i8* %2 to i64*
%4 = load i64, i64* %3
%5 = sub i64 0, %4
%6 = getelementptr i8, i8* %0, i64 %5
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ address_tabcontrol_show(int /*<<< orphan*/ *);
void search_menu_search_offline(void) { address_tabcontrol_show(NULL); }


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

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

LLVM IR (-O0):
define void @search_menu_search_offline() {
%1 = call i32 @address_tabcontrol_show(i32* null)
ret void
}

LLVM IR (-O2):
define void @search_menu_search_offline() {
%1 = tail call i32 @address_tabcontrol_show(i32* null)
ret void
}
/* Variables and functions */
bool empty_or_dash(const char *str) {
  return !str || str[0] == 0 || (str[0] == '-' && str[1] == 0);
}


x86 assembly (clang, -O0):
<empty_or_dash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1159 <empty_or_dash+0x59>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1159 <empty_or_dash+0x59>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2d,%ecx
mov    %al,-0xa(%rbp)
jne    1153 <empty_or_dash+0x53>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<empty_or_dash>:
mov    $0x1,%eax
test   %rdi,%rdi
je     111e <empty_or_dash+0x1e>
mov    (%rdi),%cl
test   %cl,%cl
je     111e <empty_or_dash+0x1e>
xor    %eax,%eax
cmp    $0x2d,%cl
jne    111e <empty_or_dash+0x1e>
cmpb   $0x0,0x1(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @empty_or_dash(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = load i8, i8* %0
switch i8 %4, label %10 [
i8 0, label %11
i8 45, label %5
]
5: ; preds = %3
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
%9 = zext i1 %8 to i32
br label %11
10: ; preds = %3
br label %11
11: ; preds = %3, %10, %5, %1
%12 = phi i32 [ 1, %3 ], [ 1, %1 ], [ %9, %5 ], [ 0, %10 ]
ret i32 %12
}
void init() {}


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

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

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

LLVM IR (-O2):
define void @init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
scalar_t__ putenv(char *);
int /*<<< orphan*/ puts(char *);
void __attribute((constructor)) init(void) {
  puts("init DSO");
  static char str[] = "SOMETHING_NOBODY_USES=something_else";
  if (putenv(str) != 0) {
    puts("putenv failed");
    _exit(1);
  }
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <puts@plt>
lea    0x2ef9(%rip),%rdi
call   1050 <putenv@plt>
cmp    $0x0,%rax
je     116c <init+0x3c>
lea    0xeac(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
lea    0x2efc(%rip),%rdi
call   1050 <putenv@plt>
test   %rax,%rax
jne    1150 <init+0x20>
pop    %rax
ret
lea    0xeb2(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"init DSO\00"
@init.str = internal global [37 x i8] c"SOMETHING_NOBODY_USES=something_else\00"
@.str.1 = [14 x i8] c"putenv failed\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @init, i8* null }]
define void @init() {
%1 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i64 @putenv(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @init.str, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @_exit(i32 1)
unreachable
7: ; preds = %0
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"init DSO\00"
@init.str = internal global [37 x i8] c"SOMETHING_NOBODY_USES=something_else\00"
@.str.1 = [14 x i8] c"putenv failed\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @init, i8* null }]
define void @init() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i64 @putenv(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @init.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @_exit(i32 1)
unreachable
7: ; preds = %0
ret void
}
double probvec_likelihood(double *probvec, int tail_index) {
  return probvec[tail_index];
}


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

x86 assembly (clang, -O2):
<probvec_likelihood>:
movslq %esi,%rax
movsd  (%rdi,%rax,8),%xmm0
ret

LLVM IR (-O0):
define double @probvec_likelihood(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load double*, double** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds double, double* %5, i64 %7
%9 = load double, double* %8
ret double %9
}

LLVM IR (-O2):
define double @probvec_likelihood(double* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds double, double* %0, i64 %3
%5 = load double, double* %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ PrintErrorCode();
int /*<<< orphan*/ dxl_write_word(int, int, int);
void setMaxLoad(int Id, int load) {
  if (Id == 254) {
    Id = (254);
  }
  load = (int)load / 0.09765625;
  dxl_write_word(Id, 14, load);
  PrintErrorCode();
}


x86 assembly (clang, -O0):
<setMaxLoad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xfe,-0x4(%rbp)
jne    1142 <setMaxLoad+0x22>
movl   $0xfe,-0x4(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xeb1(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0xe,%esi
call   1040 <dxl_write_word@plt>
mov    $0x0,%al
call   1030 <PrintErrorCode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setMaxLoad>:
push   %rax
cvtsi2sd %esi,%xmm0
divsd  0xed3(%rip),%xmm0
cvttsd2si %xmm0,%edx
mov    $0xe,%esi
call   1040 <dxl_write_word@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <PrintErrorCode@plt>

LLVM IR (-O0):
define void @setMaxLoad(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 = icmp eq i32 %5, 254
br i1 %6, label %7, label %8
7: ; preds = %2
store i32 254, i32* %3
br label %8
8: ; preds = %7, %2
%9 = load i32, i32* %4
%10 = sitofp i32 %9 to double
%11 = fdiv double %10, 0x3FB9000000000000
%12 = fptosi double %11 to i32
store i32 %12, i32* %4
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = call i32 @dxl_write_word(i32 %13, i32 14, i32 %14)
%16 = call i32 (...) @PrintErrorCode()
ret void
}

LLVM IR (-O2):
define void @setMaxLoad(i32 %0, i32 %1) {
%3 = sitofp i32 %1 to double
%4 = fdiv double %3, 0x3FB9000000000000
%5 = fptosi double %4 to i32
%6 = tail call i32 @dxl_write_word(i32 %0, i32 14, i32 %5)
%7 = tail call i32 (...) @PrintErrorCode()
ret void
}
int ioCanOpenFileOfSizeWritable(char *pathString, int pathStringLength,
                                int writeFlag) {
  return 1;
}


x86 assembly (clang, -O0):
<ioCanOpenFileOfSizeWritable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ioCanOpenFileOfSizeWritable(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ SIGALRM;
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, int);
int kill_fun() {
  printf("%s:%d\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/fengbohello/practice/refs/heads/master/"
         "clang/posix/raise.c",
         42);
  kill(getpid(), SIGALRM);
  return 0;
}


x86 assembly (clang, -O0):
<kill_fun>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
lea    0xec5(%rip),%rsi
mov    $0x2a,%edx
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    0x2e8c(%rip),%rax
mov    (%rax),%esi
call   1050 <kill@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kill_fun>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xec8(%rip),%rsi
mov    $0x2a,%edx
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
mov    0x2e91(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1050 <kill@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%s:%d\0A\00"
@.str.1 = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fengbohello/practice/refs/heads/master/clang/posix/raise.c\00"
@SIGALRM = global i32 0
define i32 @kill_fun() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 42)
%2 = call i32 (...) @getpid()
%3 = load i32, i32* @SIGALRM
%4 = call i32 @kill(i32 %2, i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s:%d\0A\00"
@.str.1 = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fengbohello/practice/refs/heads/master/clang/posix/raise.c\00"
@SIGALRM = global i32 0
define i32 @kill_fun() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 42)
%2 = tail call i32 (...) @getpid()
%3 = load i32, i32* @SIGALRM
%4 = tail call i32 @kill(i32 %2, i32 %3)
ret i32 0
}
int NextFibonacci() {
  static int prev[2] = {0, 1};
  int next;
  next = prev[0] + prev[1];
  prev[0] = prev[1];
  prev[1] = next;
  return next;
}


x86 assembly (clang, -O0):
<NextFibonacci>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
add    0x2f14(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    0x2f0b(%rip),%eax
mov    %eax,0x2f01(%rip)
mov    -0x4(%rbp),%eax
mov    %eax,0x2efc(%rip)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<NextFibonacci>:
mov    0x2f1a(%rip),%ecx
mov    0x2f1c(%rip),%eax
add    %ecx,%eax
mov    %ecx,0x2f14(%rip)
mov    %eax,0x2f06(%rip)
ret

LLVM IR (-O0):
@NextFibonacci.prev = internal global [2 x i32] [i32 0, i32 1]
define i32 @NextFibonacci() {
%1 = alloca i32
%2 = load i32, i32* getelementptr inbounds ([2 x i32], [2 x i32]* @NextFibonacci.prev, i64 0, i64 0)
%3 = load i32, i32* getelementptr inbounds ([2 x i32], [2 x i32]* @NextFibonacci.prev, i64 0, i64 1)
%4 = add nsw i32 %2, %3
store i32 %4, i32* %1
%5 = load i32, i32* getelementptr inbounds ([2 x i32], [2 x i32]* @NextFibonacci.prev, i64 0, i64 1)
store i32 %5, i32* getelementptr inbounds ([2 x i32], [2 x i32]* @NextFibonacci.prev, i64 0, i64 0)
%6 = load i32, i32* %1
store i32 %6, i32* getelementptr inbounds ([2 x i32], [2 x i32]* @NextFibonacci.prev, i64 0, i64 1)
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@NextFibonacci.prev.0 = internal unnamed_addr global i32 0
@NextFibonacci.prev.1 = internal unnamed_addr global i32 1
define i32 @NextFibonacci() {
%1 = load i32, i32* @NextFibonacci.prev.0
%2 = load i32, i32* @NextFibonacci.prev.1
%3 = add nsw i32 %2, %1
store i32 %2, i32* @NextFibonacci.prev.0
store i32 %3, i32* @NextFibonacci.prev.1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct wl_resource {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ wl_resource_post_event(struct wl_resource *, int,
                                          int /*<<< orphan*/,
                                          int /*<<< orphan*/,
                                          int /*<<< orphan*/);
void wl_shell_surface_send_configure(struct wl_resource *resource_,
                                     uint32_t edges, int32_t width,
                                     int32_t height) {
  wl_resource_post_event(resource_, 1, edges, width, height);
}


x86 assembly (clang, -O0):
<wl_shell_surface_send_configure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    $0x1,%esi
call   1030 <wl_resource_post_event@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_shell_surface_send_configure>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    $0x1,%esi
jmp    1030 <wl_resource_post_event@plt>

LLVM IR (-O0):
%struct.wl_resource = type { i32 }
define void @wl_shell_surface_send_configure(%struct.wl_resource* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.wl_resource*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.wl_resource* %0, %struct.wl_resource** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load %struct.wl_resource*, %struct.wl_resource** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @wl_resource_post_event(%struct.wl_resource* %9, i32 1, i32 %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
%struct.wl_resource = type { i32 }
define void @wl_shell_surface_send_configure(%struct.wl_resource* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @wl_resource_post_event(%struct.wl_resource* %0, i32 1, i32 %1, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, long);
int main(int argc, char *argv[]) {
  long nc;
  nc = 0;
  while (getchar() != EOF) {
    nc++;
  }
  printf("%ld\n", nc);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2e9c(%rip),%rcx
cmp    (%rcx),%rax
je     1166 <main+0x46>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    113e <main+0x1e>
mov    -0x18(%rbp),%rsi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xffffffffffffffff,%rbx
mov    0x2eb6(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%rbx
cmp    (%r14),%rax
jne    1140 <main+0x20>
lea    0xea9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@EOF = global i64 0
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %8, %3 ]
%5 = tail call i64 (...) @getchar()
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
%8 = add nuw nsw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ F_SETLKW;
int lockReg(int, int /*<<< orphan*/, int, int, int, int);
int lockRegionWait(int fd, int type, int whence, int start, int len) {
  return lockReg(fd, F_SETLKW, type, whence, start, len);
}


x86 assembly (clang, -O0):
<lockRegionWait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r9d
call   1030 <lockReg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lockRegionWait>:
mov    %r8d,%r9d
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%esi
jmp    1030 <lockReg@plt>

LLVM IR (-O0):
@F_SETLKW = global i32 0
define i32 @lockRegionWait(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i32, i32* @F_SETLKW
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = call i32 @lockReg(i32 %11, i32 %12, i32 %13, i32 %14, i32 %15, i32 %16)
ret i32 %17
}

LLVM IR (-O2):
@F_SETLKW = global i32 0
define i32 @lockRegionWait(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = load i32, i32* @F_SETLKW
%7 = tail call i32 @lockReg(i32 %0, i32 %6, i32 %1, i32 %2, i32 %3, i32 %4)
ret i32 %7
}
unsigned int f81(unsigned int x, int y) {
  return (x << (8 * 4 - y)) + (x >> y);
}


x86 assembly (clang, -O0):
<f81>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f81>:
mov    %esi,%ecx
neg    %cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f81(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 = sub nsw i32 32, %6
%8 = shl i32 %5, %7
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = lshr i32 %9, %10
%12 = add i32 %8, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @f81(i32 %0, i32 %1) {
%3 = sub nsw i32 32, %1
%4 = shl i32 %0, %3
%5 = lshr i32 %0, %1
%6 = add i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ kill(int, int /*<<< orphan*/);
void my_pclose(int fd, int pid) {
  close(fd);
  (void)kill(pid, SIGTERM);
}


x86 assembly (clang, -O0):
<my_pclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    -0x8(%rbp),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
call   1040 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_pclose>:
push   %rbx
mov    %esi,%ebx
call   1030 <close@plt>
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
pop    %rbx
jmp    1040 <kill@plt>

LLVM IR (-O0):
@SIGTERM = global i32 0
define void @my_pclose(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 = call i32 @close(i32 %5)
%7 = load i32, i32* %4
%8 = load i32, i32* @SIGTERM
%9 = call i32 @kill(i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
@SIGTERM = global i32 0
define void @my_pclose(i32 %0, i32 %1) {
%3 = tail call i32 @close(i32 %0)
%4 = load i32, i32* @SIGTERM
%5 = tail call i32 @kill(i32 %1, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void fmt_println(char *str) { printf("%s\n", str); }


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

x86 assembly (clang, -O2):
<fmt_println>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @fmt_println(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stdout;
int main(int argc, const char *argv[]) {
  int i = 0;
  for (; i < argc; ++i) {
    fprintf(stdout, "%s\n", argv[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1168 <main+0x58>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeab(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %edi,%edi
jle    1159 <main+0x49>
mov    %rsi,%r15
mov    %edi,%r12d
xor    %ebx,%ebx
mov    0x2eb4(%rip),%r13
lea    0xecd(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x0(%r13),%edi
mov    (%r15,%rbx,8),%rdx
mov    %r14,%rsi
call   1030 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <main+0x30>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %7
7: ; preds = %19, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %7
%12 = load i32, i32* @stdout
%13 = load i8**, i8*** %5
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %17)
br label %19
19: ; preds = %11
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %7
22: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = load i32, i32* @stdout
%9 = getelementptr inbounds i8*, i8** %1, i64 %7
%10 = load i8*, i8** %9
%11 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ equalizer_next();
int /*<<< orphan*/ update_eq_name();
void req_equalizer_next() {
  equalizer_next();
  update_eq_name();
}


x86 assembly (clang, -O0):
<req_equalizer_next>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <equalizer_next@plt>
mov    $0x0,%al
call   1040 <update_eq_name@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<req_equalizer_next>:
push   %rax
xor    %eax,%eax
call   1030 <equalizer_next@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <update_eq_name@plt>

LLVM IR (-O0):
define void @req_equalizer_next() {
%1 = call i32 (...) @equalizer_next()
%2 = call i32 (...) @update_eq_name()
ret void
}

LLVM IR (-O2):
define void @req_equalizer_next() {
%1 = tail call i32 (...) @equalizer_next()
%2 = tail call i32 (...) @update_eq_name()
ret void
}