xunge/DecIR huggingface dataset:
double objfun(double x[]) {
  double Req;
  double VL;
  double PL;
  double Vs = 9.0;
  double RL = x[0];
  Req = 470 * RL / (470 + RL);
  VL = Vs * Req / (1000 + Req);
  PL = VL * VL / RL;
  return -PL;
}


x86 assembly (clang, -O0):
<objfun>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  0xf00(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xede(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  0xed1(%rip),%xmm1
addsd  -0x30(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xea9(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<objfun>:
movsd  (%rdi),%xmm1
movsd  0xef4(%rip),%xmm0
movapd %xmm1,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm2
movsd  0xee4(%rip),%xmm3
mulsd  %xmm2,%xmm3
addsd  0xee0(%rip),%xmm2
divsd  %xmm2,%xmm3
movapd 0xee4(%rip),%xmm0
xorpd  %xmm3,%xmm0
mulsd  %xmm3,%xmm0
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @objfun(double* %0) {
%2 = alloca double*
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double* %0, double** %2
store double 9.000000e+00, double* %6
%8 = load double*, double** %2
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
store double %10, double* %7
%11 = load double, double* %7
%12 = fmul double 4.700000e+02, %11
%13 = load double, double* %7
%14 = fadd double 4.700000e+02, %13
%15 = fdiv double %12, %14
store double %15, double* %3
%16 = load double, double* %6
%17 = load double, double* %3
%18 = fmul double %16, %17
%19 = load double, double* %3
%20 = fadd double 1.000000e+03, %19
%21 = fdiv double %18, %20
store double %21, double* %4
%22 = load double, double* %4
%23 = load double, double* %4
%24 = fmul double %22, %23
%25 = load double, double* %7
%26 = fdiv double %24, %25
store double %26, double* %5
%27 = load double, double* %5
%28 = fneg double %27
ret double %28
}

LLVM IR (-O2):
define double @objfun(double* nocapture %0) {
%2 = load double, double* %0
%3 = fmul double %2, 4.700000e+02
%4 = fadd double %2, 4.700000e+02
%5 = fdiv double %3, %4
%6 = fmul double %5, 9.000000e+00
%7 = fadd double %5, 1.000000e+03
%8 = fdiv double %6, %7
%9 = fneg double %8
%10 = fmul double %8, %9
%11 = fdiv double %10, %2
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x;
  x = 5;
  do {
    int x = x * x;
    printf("%i\n", x);
  } while (0);
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 undef)
ret i32 0
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ printf(char *, int);
void sig_handler(int signum) {
  printf("signal %d received\n", signum);
  errno = signum;
}


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%ecx
mov    0x2eac(%rip),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_handler>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    0x2eb8(%rip),%rax
mov    %ebx,(%rax)
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"signal %d received\0A\00"
@errno = global i32 0
define void @sig_handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
store i32 %0, i32* @errno
ret void
}
/* Variables and functions */
int /*<<< orphan*/ has_double_pair(char *);
int /*<<< orphan*/ has_repeating_letter(char *);
bool string_is_nice(char *text) {
  if (!has_double_pair(text)) {
    return false;
  } else if (!has_repeating_letter(text)) {
    return false;
  } else {
    return true;
  }
}


x86 assembly (clang, -O0):
<string_is_nice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <has_double_pair@plt>
cmp    $0x0,%eax
jne    114a <string_is_nice+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    116f <string_is_nice+0x4f>
mov    -0x10(%rbp),%rdi
call   1030 <has_repeating_letter@plt>
cmp    $0x0,%eax
jne    1168 <string_is_nice+0x48>
movl   $0x0,-0x4(%rbp)
jmp    116f <string_is_nice+0x4f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_is_nice>:
push   %rbx
mov    %rdi,%rbx
call   1040 <has_double_pair@plt>
test   %eax,%eax
je     1140 <string_is_nice+0x20>
mov    %rbx,%rdi
call   1030 <has_repeating_letter@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @string_is_nice(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @has_double_pair(i8* %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 0, i32* %2
br label %14
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @has_repeating_letter(i8* %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %8
store i32 0, i32* %2
br label %14
13: ; preds = %8
store i32 1, i32* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @string_is_nice(i8* %0) {
%2 = tail call i32 @has_double_pair(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @has_repeating_letter(i8* %0)
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
int globus_state_module_activate() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @globus_state_module_activate() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sink_test(char *);
int main(int argc, char *argv[]) {
  sink_test(argv[1]);
  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    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <sink_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <sink_test@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @sink_test(i8* %4)
ret i32 0
}
void phyUartDebug_state(char byte) {}


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

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

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

LLVM IR (-O2):
define void @phyUartDebug_state(i8 signext %0) {
ret void
}
unsigned char hex_get(unsigned char data) {
  if (data >= '0' && data <= '9')
    return data - '0';
  if (data >= 'A' && data <= 'F')
    return data - 'A' + 10;
  return 0;
}


x86 assembly (clang, -O0):
<hex_get>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x30,%eax
jl     1133 <hex_get+0x33>
movzbl -0x2(%rbp),%eax
cmp    $0x39,%eax
jg     1133 <hex_get+0x33>
movzbl -0x2(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1163 <hex_get+0x63>
movzbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     115f <hex_get+0x5f>
movzbl -0x2(%rbp),%eax
cmp    $0x46,%eax
jg     115f <hex_get+0x5f>
movzbl -0x2(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %al,-0x1(%rbp)
jmp    1163 <hex_get+0x63>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_get>:
lea    -0x30(%rdi),%eax
lea    -0x41(%rdi),%ecx
add    $0xc9,%dil
xor    %edx,%edx
cmp    $0x6,%cl
movzbl %dil,%ecx
cmovae %edx,%ecx
cmp    $0xa,%al
movzbl %al,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @hex_get(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, 48
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, 57
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = sub nsw i32 %13, 48
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
br label %31
16: ; preds = %7, %1
%17 = load i8, i8* %3
%18 = zext i8 %17 to i32
%19 = icmp sge i32 %18, 65
br i1 %19, label %20, label %30
20: ; preds = %16
%21 = load i8, i8* %3
%22 = zext i8 %21 to i32
%23 = icmp sle i32 %22, 70
br i1 %23, label %24, label %30
24: ; preds = %20
%25 = load i8, i8* %3
%26 = zext i8 %25 to i32
%27 = sub nsw i32 %26, 65
%28 = add nsw i32 %27, 10
%29 = trunc i32 %28 to i8
store i8 %29, i8* %2
br label %31
30: ; preds = %20, %16
store i8 0, i8* %2
br label %31
31: ; preds = %30, %24, %11
%32 = load i8, i8* %2
ret i8 %32
}

LLVM IR (-O2):
define zeroext i8 @hex_get(i8 zeroext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = add i8 %0, -65
%5 = icmp ult i8 %4, 6
%6 = add i8 %0, -55
%7 = select i1 %5, i8 %6, i8 0
%8 = select i1 %3, i8 %2, i8 %7
ret i8 %8
}
/* Variables and functions */
char *filename_non_directory(char *);
char *filename_part(char *filename) {
  char *basename = filename_non_directory(filename);
  return basename;
}


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

x86 assembly (clang, -O2):
<filename_part>:
jmp    1030 <filename_non_directory@plt>

LLVM IR (-O0):
define i8* @filename_part(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @filename_non_directory(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @filename_part(i8* %0) {
%2 = tail call i8* @filename_non_directory(i8* %0)
ret i8* %2
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ fstat(int, struct stat *);
int open_rdonly(char *);
int execute_fstat() {
  struct stat fileStat;
  int fd = open_rdonly("syscalls.txt");
  fstat(fd, &fileStat);
  close(fd);
  fstat(fd, &fileStat);
  return 0;
}


x86 assembly (clang, -O0):
<execute_fstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <open_rdonly@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1050 <fstat@plt>
mov    -0xc(%rbp),%edi
call   1040 <close@plt>
mov    -0xc(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1050 <fstat@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execute_fstat>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
call   1030 <open_rdonly@plt>
mov    %eax,%ebx
mov    %rsp,%r14
mov    %eax,%edi
mov    %r14,%rsi
call   1050 <fstat@plt>
mov    %ebx,%edi
call   1040 <close@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1050 <fstat@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [13 x i8] c"syscalls.txt\00"
define i32 @execute_fstat() {
%1 = alloca %struct.stat
%2 = alloca i32
%3 = call i32 @open_rdonly(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @fstat(i32 %4, %struct.stat* %1)
%6 = load i32, i32* %2
%7 = call i32 @close(i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @fstat(i32 %8, %struct.stat* %1)
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [13 x i8] c"syscalls.txt\00"
define i32 @execute_fstat() {
%1 = alloca %struct.stat
%2 = bitcast %struct.stat* %1 to i8*
%3 = tail call i32 @open_rdonly(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @fstat(i32 %3, %struct.stat* %1)
%5 = tail call i32 @close(i32 %3)
%6 = call i32 @fstat(i32 %3, %struct.stat* %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int isSQRT(const char *tok) { return strcmp(tok, "sqrt") == 0; }


x86 assembly (clang, -O0):
<isSQRT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSQRT>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"sqrt\00"
define i32 @isSQRT(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [5 x i8] c"sqrt\00"
define i32 @isSQRT(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
double knobf_linear(double v, double min, double max, double *arg,
                    const int mode) {
  if (mode == 0)
    return v * (max - min) + min;
  else
    return (v - min) / (max - min);
}


x86 assembly (clang, -O0):
<knobf_linear>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    %rdi,-0x28(%rbp)
mov    %esi,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jne    114a <knobf_linear+0x4a>
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
subsd  -0x18(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1167 <knobf_linear+0x67>
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<knobf_linear>:
test   %esi,%esi
je     1111 <knobf_linear+0x11>
subsd  %xmm1,%xmm0
subsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
ret
subsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @knobf_linear(double %0, double %1, double %2, double* %3, i32 %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double*
%11 = alloca i32
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double* %3, double** %10
store i32 %4, i32* %11
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %21
14: ; preds = %5
%15 = load double, double* %7
%16 = load double, double* %9
%17 = load double, double* %8
%18 = fsub double %16, %17
%19 = load double, double* %8
%20 = call double @llvm.fmuladd.f64(double %15, double %18, double %19)
store double %20, double* %6
br label %29
21: ; preds = %5
%22 = load double, double* %7
%23 = load double, double* %8
%24 = fsub double %22, %23
%25 = load double, double* %9
%26 = load double, double* %8
%27 = fsub double %25, %26
%28 = fdiv double %24, %27
store double %28, double* %6
br label %29
29: ; preds = %21, %14
%30 = load double, double* %6
ret double %30
}

LLVM IR (-O2):
define double @knobf_linear(double %0, double %1, double %2, double* nocapture readnone %3, i32 %4) {
%6 = icmp eq i32 %4, 0
br i1 %6, label %7, label %10
7: ; preds = %5
%8 = fsub double %2, %1
%9 = tail call double @llvm.fmuladd.f64(double %0, double %8, double %1)
br label %14
10: ; preds = %5
%11 = fsub double %0, %1
%12 = fsub double %2, %1
%13 = fdiv double %11, %12
br label %14
14: ; preds = %10, %7
%15 = phi double [ %9, %7 ], [ %13, %10 ]
ret double %15
}
char *procprt_EUID_e(struct tstat *curstat, int avgval, int nsecs) {
  return "-       ";
}


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

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

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

LLVM IR (-O2):
%struct.tstat = type opaque
@.str = [9 x i8] c"- \00"
define i8* @procprt_EUID_e(%struct.tstat* nocapture readnone %0, i32 %1, i32 %2) {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct timeval {
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
char *get_sys_time_string(void) {
  struct timeval now;
  if (gettimeofday(&now, 0) < 0) {
    perror("gettimeofday");
    exit(1);
  }
  return ctime(&now.tv_sec);
}


x86 assembly (clang, -O0):
<get_sys_time_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
cmp    $0x0,%rax
jge    1173 <get_sys_time_string+0x33>
lea    0xe9c(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
lea    -0x8(%rbp),%rdi
call   1030 <ctime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sys_time_string>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
test   %rax,%rax
js     115a <get_sys_time_string+0x1a>
mov    %rsp,%rdi
call   1030 <ctime@plt>
pop    %rcx
ret
lea    0xe9f(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
@.str = [13 x i8] c"gettimeofday\00"
define i8* @get_sys_time_string() {
%1 = alloca %struct.timeval
%2 = call i64 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @exit(i32 1)
unreachable
7: ; preds = %0
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%9 = call i8* @ctime(i32* %8)
ret i8* %9
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@.str = [13 x i8] c"gettimeofday\00"
define i8* @get_sys_time_string() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i64 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %0
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%10 = call i8* @ctime(i32* %9)
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ex1() { printf("Hello World Ex1\n"); }


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

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

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

LLVM IR (-O2):
@str = [16 x i8] c"Hello World Ex1\00"
define void @ex1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
void XSetFont() {}


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

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

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

LLVM IR (-O2):
define void @XSetFont() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_DEPTH_BUFFER_BIT;
int /*<<< orphan*/ glClear(int /*<<< orphan*/);
void zlClrDepth(void) { glClear(GL_DEPTH_BUFFER_BIT); }


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

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

LLVM IR (-O0):
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @zlClrDepth() {
%1 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%2 = call i32 @glClear(i32 %1)
ret void
}

LLVM IR (-O2):
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @zlClrDepth() {
%1 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%2 = tail call i32 @glClear(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x0a() {
  Assert_real((isdigit(10) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              55, ("isdigit should be 0 for 0x0a"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x0a\00"
define void @t_isdigit_0x0a() {
%1 = tail call i64 @isdigit(i32 10)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 55, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
void f3() {}


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

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

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

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

/* Variables and functions */
struct SN_env *SN_create_env(int /*<<< orphan*/, int, int);
extern struct SN_env *porter_ISO_8859_1_create_env(void) {
  return SN_create_env(0, 2, 1);
}


x86 assembly (clang, -O0):
<porter_ISO_8859_1_create_env>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <SN_create_env@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<porter_ISO_8859_1_create_env>:
xor    %edi,%edi
mov    $0x2,%esi
mov    $0x1,%edx
jmp    1030 <SN_create_env@plt>

LLVM IR (-O0):
%struct.SN_env = type { i32 }
define %struct.SN_env* @porter_ISO_8859_1_create_env() {
%1 = call %struct.SN_env* @SN_create_env(i32 0, i32 2, i32 1)
ret %struct.SN_env* %1
}

LLVM IR (-O2):
%struct.SN_env = type { i32 }
define %struct.SN_env* @porter_ISO_8859_1_create_env() {
%1 = tail call %struct.SN_env* @SN_create_env(i32 0, i32 2, i32 1)
ret %struct.SN_env* %1
}
void RTTimeLocalDeltaNano(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTimeLocalDeltaNano() {
ret void
}
/* Variables and functions */
scalar_t__ isupper(int);
int tolower(int c) { return isupper(c) ? c + 32 : c; }


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     113b <tolower+0x2b>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <tolower+0x31>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <isupper@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
struct udp_protocol *udp_convert(struct common_protocol *proto) {
  return (struct udp_protocol *)proto;
}


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

x86 assembly (clang, -O2):
<udp_convert>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
%struct.udp_protocol = type opaque
%struct.common_protocol = type opaque
define %struct.udp_protocol* @udp_convert(%struct.common_protocol* %0) {
%2 = alloca %struct.common_protocol*
store %struct.common_protocol* %0, %struct.common_protocol** %2
%3 = load %struct.common_protocol*, %struct.common_protocol** %2
%4 = bitcast %struct.common_protocol* %3 to %struct.udp_protocol*
ret %struct.udp_protocol* %4
}

LLVM IR (-O2):
%struct.udp_protocol = type opaque
%struct.common_protocol = type opaque
define %struct.udp_protocol* @udp_convert(%struct.common_protocol* readnone %0) {
%2 = bitcast %struct.common_protocol* %0 to %struct.udp_protocol*
ret %struct.udp_protocol* %2
}
void foo_2_2_2_1_2_2_1_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_2_1_2_2_1_2_2() {
ret void
}
/* Variables and functions */
unsigned long __raw_local_save_flags();
int raw_irqs_disabled_flags(unsigned long);
__attribute__((always_)) int raw_irqs_disabled(void) {
  unsigned long flags = __raw_local_save_flags();
  return raw_irqs_disabled_flags(flags);
}


x86 assembly (clang, -O0):
<raw_irqs_disabled>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <__raw_local_save_flags@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <raw_irqs_disabled_flags@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raw_irqs_disabled>:
push   %rax
xor    %eax,%eax
call   1030 <__raw_local_save_flags@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <raw_irqs_disabled_flags@plt>

LLVM IR (-O0):
define i32 @raw_irqs_disabled() {
%1 = alloca i64
%2 = call i64 (...) @__raw_local_save_flags()
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = call i32 @raw_irqs_disabled_flags(i64 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @raw_irqs_disabled() {
%1 = tail call i64 (...) @__raw_local_save_flags()
%2 = tail call i32 @raw_irqs_disabled_flags(i64 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void document_output_content_type(void) {
  printf("Content-type: text/html\n\n");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<document_output_content_type>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<document_output_content_type>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Content-type: text/html\0A\0A\00"
@stdout = global i32 0
define void @document_output_content_type() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [25 x i8] c"Content-type: text/html\0A\00"
define void @document_output_content_type() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret void
}
int main() {
  char t[] = "asdf";
  return "asdf" == t;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeef(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xeea(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x9(%rbp),%rcx
lea    0xed8(%rip),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.t = [5 x i8] c"asdf\00"
@.str = [5 x i8] c"asdf\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8]
store i32 0, i32* %1
%3 = bitcast [5 x i8]* %2 to i8*
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%5 = icmp eq i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int test_imm_92int16_mem(short *val) {
  return ((*val) & (0x92 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_92int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 146
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void slang_init(void) {}


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

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

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

LLVM IR (-O2):
define void @slang_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int main(void) {
  write(1, "Hello, World\n", 13);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
lea    0xed5(%rip),%rsi
mov    $0xd,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
mov    $0xd,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, World\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @write(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, World\0A\00"
define i32 @main() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
ret i32 0
}
extern unsigned short unsigned_short_to_unsigned_short(unsigned short x,
                                                       int k) {
  return x + k;
}


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

x86 assembly (clang, -O2):
<unsigned_short_to_unsigned_short>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define zeroext i16 @unsigned_short_to_unsigned_short(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
%9 = trunc i32 %8 to i16
ret i16 %9
}

LLVM IR (-O2):
define zeroext i16 @unsigned_short_to_unsigned_short(i16 zeroext %0, i32 %1) {
%3 = trunc i32 %1 to i16
%4 = add i16 %3, %0
ret i16 %4
}
/* Variables and functions */
int /*<<< orphan*/ munmap(void *, unsigned long);
void blob_free(void *addr, unsigned long size) {
  size = (size + 4095) & ~4095;
  munmap(addr, size);
}


x86 assembly (clang, -O0):
<blob_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0xfff,%rax
and    $0xfffffffffffff000,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <munmap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blob_free>:
add    $0xfff,%rsi
and    $0xfffffffffffff000,%rsi
jmp    1030 <munmap@plt>

LLVM IR (-O0):
define void @blob_free(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = add i64 %5, 4095
%7 = and i64 %6, -4096
store i64 %7, i64* %4
%8 = load i8*, i8** %3
%9 = load i64, i64* %4
%10 = call i32 @munmap(i8* %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @blob_free(i8* %0, i64 %1) {
%3 = add i64 %1, 4095
%4 = and i64 %3, -4096
%5 = tail call i32 @munmap(i8* %0, i64 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fscanf(int /*<<< orphan*/ *, char *, int *, float *);
float file_next(FILE *file) {
  int num;
  int tag;
  float time;
  num = fscanf(file, "%d,%f", &tag, &time);
  if (num != 2)
    return -1.0f;
  return time;
}


x86 assembly (clang, -O0):
<file_next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xedd(%rip),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
call   1030 <fscanf@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
je     1153 <file_next+0x43>
movss  0xeb7(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <file_next+0x4d>
movss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_next>:
push   %rax
lea    0xeec(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    %rsp,%rcx
call   1030 <fscanf@plt>
cmp    $0x2,%eax
je     1134 <file_next+0x24>
movss  0xece(%rip),%xmm0
pop    %rax
ret
movss  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d,%f\00"
define float @file_next(i32* %0) {
%2 = alloca float
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
store i32* %0, i32** %3
%7 = load i32*, i32** %3
%8 = call i32 @fscanf(i32* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %5, float* %6)
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 2
br i1 %10, label %11, label %12
11: ; preds = %1
store float -1.000000e+00, float* %2
br label %14
12: ; preds = %1
%13 = load float, float* %6
store float %13, float* %2
br label %14
14: ; preds = %12, %11
%15 = load float, float* %2
ret float %15
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d,%f\00"
define float @file_next(i32* nocapture %0) {
%2 = alloca i32
%3 = alloca float
%4 = bitcast i32* %2 to i8*
%5 = bitcast float* %3 to i8*
%6 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, float* %3)
%7 = icmp eq i32 %6, 2
%8 = load float, float* %3
%9 = select i1 %7, float %8, float -1.000000e+00
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ camera_unlock();
void level_unlock_camera() { camera_unlock(); }


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

x86 assembly (clang, -O2):
<level_unlock_camera>:
xor    %eax,%eax
jmp    1030 <camera_unlock@plt>

LLVM IR (-O0):
define void @level_unlock_camera() {
%1 = call i32 (...) @camera_unlock()
ret void
}

LLVM IR (-O2):
define void @level_unlock_camera() {
%1 = tail call i32 (...) @camera_unlock()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void emit_help(void) {
  fputs("Usage: ip6tomac [-f | -V] [-s sep] ipv6-address\n", stderr);
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<emit_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<emit_help>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"Usage: ip6tomac [-f | -V] [-s sep] ipv6-address\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [49 x i8] c"Usage: ip6tomac [-f | -V] [-s sep] ipv6-address\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ GenExtendRegAIfNeeded(int);
int /*<<< orphan*/ GenPrintInstr2Operands(int, int /*<<< orphan*/,
                                          int /*<<< orphan*/,
                                          int /*<<< orphan*/, int, int);
int /*<<< orphan*/ GenSelectByteOrWord(int, int);
void GenReadLocal(int opSz, int ofs) {
  GenPrintInstr2Operands(0x00, 0, GenSelectByteOrWord(0x0B, opSz), 0, 0x15,
                         ofs);
  GenExtendRegAIfNeeded(opSz);
}


x86 assembly (clang, -O0):
<GenReadLocal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    $0xb,%edi
call   1030 <GenSelectByteOrWord@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%r9d
xor    %ecx,%ecx
mov    $0x15,%r8d
mov    %ecx,%edi
mov    %ecx,%esi
call   1040 <GenPrintInstr2Operands@plt>
mov    -0x4(%rbp),%edi
call   1050 <GenExtendRegAIfNeeded@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenReadLocal>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0xb,%edi
mov    %ebp,%esi
call   1030 <GenSelectByteOrWord@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %eax,%edx
xor    %ecx,%ecx
mov    $0x15,%r8d
mov    %ebx,%r9d
call   1040 <GenPrintInstr2Operands@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <GenExtendRegAIfNeeded@plt>

LLVM IR (-O0):
define void @GenReadLocal(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 @GenSelectByteOrWord(i32 11, i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @GenPrintInstr2Operands(i32 0, i32 0, i32 %6, i32 0, i32 21, i32 %7)
%9 = load i32, i32* %3
%10 = call i32 @GenExtendRegAIfNeeded(i32 %9)
ret void
}

LLVM IR (-O2):
define void @GenReadLocal(i32 %0, i32 %1) {
%3 = tail call i32 @GenSelectByteOrWord(i32 11, i32 %0)
%4 = tail call i32 @GenPrintInstr2Operands(i32 0, i32 0, i32 %3, i32 0, i32 21, i32 %1)
%5 = tail call i32 @GenExtendRegAIfNeeded(i32 %0)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t ip_get_version(const uint8_t *data, int size) {
  if (size < 20)
    return 0;
  return data[0] >> 4;
}


x86 assembly (clang, -O0):
<ip_get_version>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x14,-0x14(%rbp)
jge    1121 <ip_get_version+0x21>
movl   $0x0,-0x4(%rbp)
jmp    112d <ip_get_version+0x2d>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
sar    $0x4,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip_get_version>:
xor    %eax,%eax
cmp    $0x14,%esi
jl     110c <ip_get_version+0xc>
mov    (%rdi),%eax
sar    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @ip_get_version(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp slt i32 %6, 20
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %14
9: ; preds = %2
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 0
%12 = load i32, i32* %11
%13 = ashr i32 %12, 4
store i32 %13, i32* %3
br label %14
14: ; preds = %9, %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @ip_get_version(i32* nocapture %0, i32 %1) {
%3 = icmp slt i32 %1, 20
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i32, i32* %0
%6 = ashr i32 %5, 4
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ %6, %4 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ get_7(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  if (argc != 2)
    exit(0);
  (void)get_7(atoi(argv[1]));
  exit(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)
cmpl   $0x2,-0x8(%rbp)
je     1157 <main+0x27>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1030 <get_7@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    114d <main+0x1d>
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1030 <get_7@plt>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %edi,%edi
call   1050 <exit@plt>

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 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @exit(i32 0)
unreachable
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @atoi(i8* %13)
%15 = call i32 @get_7(i32 %14)
%16 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
%10 = tail call i32 @get_7(i32 %9)
%11 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf("ip options:\n"
         "--ip-src    [!] address[/mask]: ip source specification\n"
         "--ip-dst    [!] address[/mask]: ip destination specification\n"
         "--ip-tos    [!] tos           : ip tos specification\n"
         "--ip-proto  [!] protocol      : ip protocol specification\n"
         "--ip-sport  [!] port[:port]   : tcp/udp source port or port range\n"
         "--ip-dport  [!] port[:port]   : tcp/udp destination port or port "
         "range\n");
}


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

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

LLVM IR (-O0):
@.str = [378 x i8] c"ip options:\0A--ip-src [!] address[/mask]: ip source specification\0A--ip-dst [!] address[/mask]: ip destination specification\0A--ip-tos [!] tos : ip tos specification\0A--ip-proto [!] protocol : ip protocol specification\0A--ip-sport [!] port[:port] : tcp/udp source port or port range\0A--ip-dport [!] port[:port] : tcp/udp destination port or port range\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([378 x i8], [378 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [377 x i8] c"ip options:\0A--ip-src [!] address[/mask]: ip source specification\0A--ip-dst [!] address[/mask]: ip destination specification\0A--ip-tos [!] tos : ip tos specification\0A--ip-proto [!] protocol : ip protocol specification\0A--ip-sport [!] port[:port] : tcp/udp source port or port range\0A--ip-dport [!] port[:port] : tcp/udp destination port or port range\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([377 x i8], [377 x i8]* @str, i64 0, i64 0))
ret void
}
f() {
  static void *p = &&L;
  goto *p;
L:
  return 5;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f15(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    111b <f+0x1b>
mov    $0x5,%eax
pop    %rbp
ret
mov    -0x8(%rbp),%rax
jmp    *%rax

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

LLVM IR (-O0):
@f.p = internal global i8* blockaddress(@f, %2)
define i32 @f() {
%1 = load i8*, i8** @f.p
br label %3
2: ; preds = %3
ret i32 5
3: ; preds = %0
%4 = phi i8* [ %1, %0 ]
indirectbr i8* %4, [label %2]
}

LLVM IR (-O2):
define i32 @f() {
ret i32 5
}