xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int m_conf_isequal(char *ope, char *opestr, char *val, char *valstr) {
  if (strcmp(ope, opestr) == 0) {
    if (strcmp(val, valstr) == 0)
      return 2;
    else
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<m_conf_isequal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    116e <m_conf_isequal+0x5e>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1162 <m_conf_isequal+0x52>
movl   $0x2,-0x4(%rbp)
jmp    1175 <m_conf_isequal+0x65>
movl   $0x1,-0x4(%rbp)
jmp    1175 <m_conf_isequal+0x65>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_conf_isequal>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%rbx
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    1140 <m_conf_isequal+0x30>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcmp@plt>
cmp    $0x1,%rax
mov    $0x1,%eax
adc    $0x0,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @m_conf_isequal(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i64 @strcmp(i8* %0, i8* %1)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i64 @strcmp(i8* %2, i8* %3)
%9 = icmp eq i64 %8, 0
%10 = select i1 %9, i32 2, i32 1
br label %11
11: ; preds = %4, %7
%12 = phi i32 [ %10, %7 ], [ 0, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int open(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int open_pty() {
  int pty_fd;
  pty_fd = open("/dev/ptyqf", O_RDWR, 0);
  if (pty_fd < 0) {
    fprintf(stderr, "failed to open pty.\n");
    exit(1);
  }
  return pty_fd;
}


x86 assembly (clang, -O0):
<open_pty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
lea    0xeb8(%rip),%rdi
xor    %edx,%edx
call   1040 <open@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    117b <open_pty+0x4b>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
lea    0xe9f(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_pty>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
xor    %edx,%edx
call   1040 <open@plt>
test   %eax,%eax
js     114e <open_pty+0x1e>
pop    %rcx
ret
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
lea    0xead(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"/dev/ptyqf\00"
@O_RDWR = global i32 0
@stderr = global i32 0
@.str.1 = [21 x i8] c"failed to open pty.\0A\00"
define i32 @open_pty() {
%1 = alloca i32
%2 = load i32, i32* @O_RDWR
%3 = call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2, i32 0)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %0
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [11 x i8] c"/dev/ptyqf\00"
@O_RDWR = global i32 0
@stderr = global i32 0
@.str.1 = [21 x i8] c"failed to open pty.\0A\00"
define i32 @open_pty() {
%1 = load i32, i32* @O_RDWR
%2 = tail call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1, i32 0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %0
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int fio_write_float32(int /*<<< orphan*/ *, int, float);
scalar_t__ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
int fio_abs_write_float32(FILE *f, long offset, int is_big_endian, float val) {
  if (fseek(f, offset, SEEK_SET) != 0)
    return -1;
  return (fio_write_float32(f, is_big_endian, val));
}


x86 assembly (clang, -O0):
<fio_abs_write_float32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movss  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
cmp    $0x0,%rax
je     1164 <fio_abs_write_float32+0x44>
movl   $0xffffffff,-0x4(%rbp)
jmp    1178 <fio_abs_write_float32+0x58>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
movss  -0x20(%rbp),%xmm0
call   1030 <fio_write_float32@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fio_abs_write_float32>:
push   %rbp
push   %rbx
push   %rax
movss  %xmm0,0x4(%rsp)
mov    %edx,%ebp
mov    %rdi,%rbx
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
test   %rax,%rax
je     114d <fio_abs_write_float32+0x2d>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
mov    %ebp,%esi
movss  0x4(%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fio_write_float32@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @fio_abs_write_float32(i32* %0, i64 %1, i32 %2, float %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i32
%9 = alloca float
store i32* %0, i32** %6
store i64 %1, i64* %7
store i32 %2, i32* %8
store float %3, float* %9
%10 = load i32*, i32** %6
%11 = load i64, i64* %7
%12 = load i32, i32* @SEEK_SET
%13 = call i64 @fseek(i32* %10, i64 %11, i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %4
store i32 -1, i32* %5
br label %21
16: ; preds = %4
%17 = load i32*, i32** %6
%18 = load i32, i32* %8
%19 = load float, float* %9
%20 = call i32 @fio_write_float32(i32* %17, i32 %18, float %19)
store i32 %20, i32* %5
br label %21
21: ; preds = %16, %15
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @fio_abs_write_float32(i32* %0, i64 %1, i32 %2, float %3) {
%5 = load i32, i32* @SEEK_SET
%6 = tail call i64 @fseek(i32* %0, i64 %1, i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @fio_write_float32(i32* %0, i32 %2, float %3)
br label %10
10: ; preds = %4, %8
%11 = phi i32 [ %9, %8 ], [ -1, %4 ]
ret i32 %11
}
/* Variables and functions */
scalar_t__ rand();
void random_matrix_float(float *a, const unsigned int rows,
                         const unsigned int cols) {
  for (unsigned int i = 0; i < rows * cols; i++) {
    a[i] = (float)rand();
  }
}


x86 assembly (clang, -O0):
<random_matrix_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0x10(%rbp),%ecx
cmp    %ecx,%eax
jae    1161 <random_matrix_float+0x51>
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <random_matrix_float+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_matrix_float>:
push   %r15
push   %r14
push   %rbx
imul   %edx,%esi
test   %esi,%esi
je     114e <random_matrix_float+0x3e>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  %xmm0,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <random_matrix_float+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @random_matrix_float(float* %0, i32 %1, i32 %2) {
%4 = alloca float*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store float* %0, float** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %21, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = mul i32 %10, %11
%13 = icmp ult i32 %9, %12
br i1 %13, label %14, label %24
14: ; preds = %8
%15 = call i64 (...) @rand()
%16 = sitofp i64 %15 to float
%17 = load float*, float** %4
%18 = load i32, i32* %7
%19 = zext i32 %18 to i64
%20 = getelementptr inbounds float, float* %17, i64 %19
store float %16, float* %20
br label %21
21: ; preds = %14
%22 = load i32, i32* %7
%23 = add i32 %22, 1
store i32 %23, i32* %7
br label %8
24: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @random_matrix_float(float* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = mul i32 %2, %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = zext i32 %4 to i64
br label %9
8: ; preds = %9, %3
ret void
9: ; preds = %6, %9
%10 = phi i64 [ 0, %6 ], [ %14, %9 ]
%11 = tail call i64 (...) @rand()
%12 = sitofp i64 %11 to float
%13 = getelementptr inbounds float, float* %0, i64 %10
store float %12, float* %13
%14 = add nuw nsw i64 %10, 1
%15 = icmp eq i64 %14, %7
br i1 %15, label %8, label %9
}
double lerp_double(const double a, const double b, const double t) {
  return (1.0 - t) * a + t * b;
}


x86 assembly (clang, -O0):
<lerp_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xee5(%rip),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lerp_double>:
movsd  0xef8(%rip),%xmm3
subsd  %xmm2,%xmm3
mulsd  %xmm2,%xmm1
mulsd  %xmm3,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @lerp_double(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %6
%8 = fsub double 1.000000e+00, %7
%9 = load double, double* %4
%10 = load double, double* %6
%11 = load double, double* %5
%12 = fmul double %10, %11
%13 = call double @llvm.fmuladd.f64(double %8, double %9, double %12)
ret double %13
}

LLVM IR (-O2):
define double @lerp_double(double %0, double %1, double %2) {
%4 = fsub double 1.000000e+00, %2
%5 = fmul double %1, %2
%6 = tail call double @llvm.fmuladd.f64(double %4, double %0, double %5)
ret double %6
}
/* Variables and functions */
char *strdup(char const *);
char toupper(char);
char *covertToUpper(const char *str) {
  char *newstr, *p;
  p = newstr = strdup(str);
  while (*p++ = toupper(*p))
    ;
  return newstr;
}


x86 assembly (clang, -O0):
<covertToUpper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1167 <covertToUpper+0x47>
jmp    113d <covertToUpper+0x1d>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<covertToUpper>:
push   %r14
push   %rbx
push   %rax
call   1040 <strdup@plt>
mov    %rax,%r14
mov    %rax,%rbx
nop
movsbl (%rbx),%edi
call   1030 <toupper@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
test   %al,%al
jne    1130 <covertToUpper+0x10>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @covertToUpper(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
br label %3
3: ; preds = %3, %1
%4 = phi i8* [ %2, %1 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = tail call signext i8 @toupper(i8 signext %5)
%7 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %6, i8* %4
%8 = icmp eq i8 %6, 0
br i1 %8, label %9, label %3
9: ; preds = %3
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ *stdin;
FILE *get_input_source(int argc, char **argv) {
  FILE *input;
  if (argc > 1) {
    input = fopen(argv[1], "r+");
  } else {
    input = stdin;
  }
  return input;
}


x86 assembly (clang, -O0):
<get_input_source>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1146 <get_input_source+0x36>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xec8(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x18(%rbp)
jmp    1154 <get_input_source+0x44>
mov    0x2e9b(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_input_source>:
cmp    $0x2,%edi
jl     1125 <get_input_source+0x15>
mov    0x8(%rsi),%rdi
lea    0xee0(%rip),%rsi
jmp    1030 <fopen@plt>
mov    0x2ebc(%rip),%rax
mov    (%rax),%rax
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"r+\00"
@stdin = global i32* null
define i32* @get_input_source(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32* @fopen(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %2
%9 = load i32*, i32** @stdin
br label %10
10: ; preds = %8, %4
%11 = phi i32* [ %7, %4 ], [ %9, %8 ]
ret i32* %11
}
/* Variables and functions */
scalar_t__ isemptyline(char *);
scalar_t__ strtol(char *, char **, int);
int parseint(char *buf, int *val) {
  char *end;
  val[0] = (int)strtol(buf, &end, 10);
  if (isemptyline(end))
    return (0);
  else
    return (1);
}


x86 assembly (clang, -O0):
<parseint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rdi
call   1030 <isemptyline@plt>
cmp    $0x0,%rax
je     1169 <parseint+0x49>
movl   $0x0,-0x4(%rbp)
jmp    1170 <parseint+0x50>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseint>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %eax,(%rbx)
mov    0x8(%rsp),%rdi
call   1030 <isemptyline@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @parseint(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i64 @strtol(i8* %0, i8** %3, i32 10)
%6 = trunc i64 %5 to i32
store i32 %6, i32* %1
%7 = load i8*, i8** %3
%8 = tail call i64 @isemptyline(i8* %7)
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ xip_fpo_log_d(double *, double);
double xil_fpo_log_d(double a) {
  double res_d;
  xip_fpo_log_d(&res_d, a);
  return res_d;
}


x86 assembly (clang, -O0):
<xil_fpo_log_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0x10(%rbp),%rdi
call   1030 <xip_fpo_log_d@plt>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xil_fpo_log_d>:
push   %rax
mov    %rsp,%rdi
call   1030 <xip_fpo_log_d@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @xil_fpo_log_d(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call i32 @xip_fpo_log_d(double* %3, double %4)
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @xil_fpo_log_d(double %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
%4 = call i32 @xip_fpo_log_d(double* %2, double %0)
%5 = load double, double* %2
ret double %5
}
void rop3_168_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T | S;
  stk1 = *D & stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_168_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_168_0_1>:
or     %edx,%esi
and    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_168_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = and i8 %5, %4
store i8 %6, i8* %0
ret void
}
void sock_cleanup() {}


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

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

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

LLVM IR (-O2):
define void @sock_cleanup() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void set_data(uint32_t data) {
  if (data == 0) {
    (*((volatile uint32_t *)0xE0200C04)) &= ~(0x08);
  } else {
    (*((volatile uint32_t *)0xE0200C04)) |= 0x08;
  }
}


x86 assembly (clang, -O0):
<set_data>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <set_data+0x2c>
mov    $0xe0200c04,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffff7,%rcx
mov    $0xe0200c04,%eax
mov    %rcx,(%rax)
jmp    1140 <set_data+0x40>
mov    $0xe0200c04,%eax
mov    (%rax),%rcx
or     $0x8,%rcx
mov    $0xe0200c04,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_data>:
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
mov    $0xe0200c04,%ecx
mov    (%rcx),%rdx
and    $0xfffffffffffffff7,%rdx
lea    (%rdx,%rax,8),%rax
mov    %rax,(%rcx)
ret

LLVM IR (-O0):
define void @set_data(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 %8
5: ; preds = %1
%6 = load volatile i64, i64* inttoptr (i64 3760196612 to i64*)
%7 = and i64 %6, -9
store volatile i64 %7, i64* inttoptr (i64 3760196612 to i64*)
br label %11
8: ; preds = %1
%9 = load volatile i64, i64* inttoptr (i64 3760196612 to i64*)
%10 = or i64 %9, 8
store volatile i64 %10, i64* inttoptr (i64 3760196612 to i64*)
br label %11
11: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
define void @set_data(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = load volatile i64, i64* inttoptr (i64 3760196612 to i64*)
%4 = and i64 %3, -9
%5 = select i1 %2, i64 0, i64 8
%6 = or i64 %4, %5
store volatile i64 %6, i64* inttoptr (i64 3760196612 to i64*)
ret void
}
void proc_net_remove(struct net *net, const char *name) {}


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

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

LLVM IR (-O0):
%struct.net = type opaque
define void @proc_net_remove(%struct.net* %0, i8* %1) {
%3 = alloca %struct.net*
%4 = alloca i8*
store %struct.net* %0, %struct.net** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.net = type opaque
define void @proc_net_remove(%struct.net* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ g5_close();
void(g5_close_)() { g5_close(); }


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

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

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

LLVM IR (-O2):
define void @g5_close_() {
%1 = tail call i32 (...) @g5_close()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void g(uint8_t *x) {
  uint8_t y[8];
  memcpy(x, y, 1);
}


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

x86 assembly (clang, -O2):
<g>:
sub    $0x28,%rsp
mov    %rsp,%rsi
mov    $0x1,%edx
call   1030 <memcpy@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @g(i32* %0) {
%2 = alloca i32*
%3 = alloca [8 x i32]
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%6 = call i32 @memcpy(i32* %4, i32* %5, i32 1)
ret void
}

LLVM IR (-O2):
define void @g(i32* %0) {
%2 = alloca [8 x i32]
%3 = bitcast [8 x i32]* %2 to i8*
%4 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%5 = call i32 @memcpy(i32* %0, i32* %4, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int _mm_comilt_ss(int /*<<< orphan*/, int /*<<< orphan*/);
int test_mm_comilt_ss(__m128 A, __m128 B) { return _mm_comilt_ss(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_comilt_ss>:
jmp    1030 <_mm_comilt_ss@plt>

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

LLVM IR (-O2):
define i32 @test_mm_comilt_ss(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_comilt_ss(i32 %0, i32 %1)
ret i32 %3
}
void clear_perf_event_pending(void) {}


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

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

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

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

/* Variables and functions */
int read_x8(int);
uint32_t read_mem_32(uint32_t addr) {
  return read_x8(addr) | (read_x8(addr + 1) << 8) | (read_x8(addr + 2) << 16) |
         (read_x8(addr + 3) << 24);
}


x86 assembly (clang, -O0):
<read_mem_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <read_x8@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1030 <read_x8@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
add    $0x2,%edi
call   1030 <read_x8@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
shl    $0x10,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
add    $0x3,%edi
call   1030 <read_x8@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
shl    $0x18,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_mem_32>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
call   1030 <read_x8@plt>
mov    %eax,%r14d
lea    0x1(%rbx),%edi
call   1030 <read_x8@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
or     %r14d,%ebp
lea    0x2(%rbx),%edi
call   1030 <read_x8@plt>
mov    %eax,%r14d
shl    $0x10,%r14d
add    $0x3,%ebx
mov    %ebx,%edi
call   1030 <read_x8@plt>
shl    $0x18,%eax
or     %r14d,%eax
or     %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @read_mem_32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @read_x8(i32 %3)
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
%7 = call i32 @read_x8(i32 %6)
%8 = shl i32 %7, 8
%9 = or i32 %4, %8
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 2
%12 = call i32 @read_x8(i32 %11)
%13 = shl i32 %12, 16
%14 = or i32 %9, %13
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 3
%17 = call i32 @read_x8(i32 %16)
%18 = shl i32 %17, 24
%19 = or i32 %14, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @read_mem_32(i32 %0) {
%2 = tail call i32 @read_x8(i32 %0)
%3 = add nsw i32 %0, 1
%4 = tail call i32 @read_x8(i32 %3)
%5 = shl i32 %4, 8
%6 = or i32 %5, %2
%7 = add nsw i32 %0, 2
%8 = tail call i32 @read_x8(i32 %7)
%9 = shl i32 %8, 16
%10 = or i32 %6, %9
%11 = add nsw i32 %0, 3
%12 = tail call i32 @read_x8(i32 %11)
%13 = shl i32 %12, 24
%14 = or i32 %10, %13
ret i32 %14
}
void clearBss(void) {
  extern void *__bss_start;
  extern void *__bss_end;
  unsigned int *p;
  unsigned int *start = (unsigned int *)&__bss_start;
  unsigned int *end = (unsigned int *)&__bss_end;
  for (p = start; p < end; p++) {
    *p = 0x00;
  }
}


x86 assembly (clang, -O0):
<clearBss>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2eca(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    114b <clearBss+0x4b>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    1122 <clearBss+0x22>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearBss>:
push   %rax
mov    0x2ed0(%rip),%rdi
cmp    0x2ec1(%rip),%rdi
jae    114c <clearBss+0x3c>
lea    0x4(%rdi),%rax
mov    0x2eb4(%rip),%rcx
cmp    %rax,%rcx
cmova  %rcx,%rax
mov    %rdi,%rcx
not    %rcx
lea    (%rcx,%rax,1),%rdx
add    $0x4,%rdx
and    $0xfffffffffffffffc,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
pop    %rax
ret

LLVM IR (-O0):
@__bss_start = external global i8*
@__bss_end = external global i8*
define void @clearBss() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32*
store i32* bitcast (i8** @__bss_start to i32*), i32** %2
store i32* bitcast (i8** @__bss_end to i32*), i32** %3
%4 = load i32*, i32** %2
store i32* %4, i32** %1
br label %5
5: ; preds = %11, %0
%6 = load i32*, i32** %1
%7 = load i32*, i32** %3
%8 = icmp ult i32* %6, %7
br i1 %8, label %9, label %14
9: ; preds = %5
%10 = load i32*, i32** %1
store i32 0, i32* %10
br label %11
11: ; preds = %9
%12 = load i32*, i32** %1
%13 = getelementptr inbounds i32, i32* %12, i32 1
store i32* %13, i32** %1
br label %5
14: ; preds = %5
ret void
}

LLVM IR (-O2):
@__bss_start = external global i8*
@__bss_end = external global i8*
define void @clearBss() {
br i1 icmp ult (i8** @__bss_start, i8** @__bss_end), label %1, label %5
1: ; preds = %0
%2 = call i64 @llvm.umax.i64(i64 ptrtoint (i8** @__bss_end to i64), i64 add (i64 ptrtoint (i8** @__bss_start to i64), i64 4))
%3 = add i64 %2, add (i64 xor (i64 ptrtoint (i8** @__bss_start to i64), i64 -1), i64 4)
%4 = and i64 %3, -4
br label %5
5: ; preds = %1, %0
ret void
}
void buffer_dtor(struct data_buffer *buffer) { (void)buffer; }


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

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

LLVM IR (-O0):
%struct.data_buffer = type opaque
define void @buffer_dtor(%struct.data_buffer* %0) {
%2 = alloca %struct.data_buffer*
store %struct.data_buffer* %0, %struct.data_buffer** %2
%3 = load %struct.data_buffer*, %struct.data_buffer** %2
ret void
}

LLVM IR (-O2):
%struct.data_buffer = type opaque
define void @buffer_dtor(%struct.data_buffer* nocapture %0) {
ret void
}
double grib_op_le_d(double a, double b) { return a <= b; }


x86 assembly (clang, -O0):
<grib_op_le_d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<grib_op_le_d>:
cmplesd %xmm1,%xmm0
movsd  0xef3(%rip),%xmm1
andpd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @grib_op_le_d(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ole double %5, %6
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @grib_op_le_d(double %0, double %1) {
%3 = fcmp ole double %0, %1
%4 = uitofp i1 %3 to double
ret double %4
}
int test_imm_C8uint8_mem(unsigned char *val) {
  return ((*val) & (0xC8 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_C8uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 200
%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_C8uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -56
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void vde_chain_nm6_decref(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, char *,
                           char *);
void xmlprinttext(FILE *fd, char *el, char *content) {
  if (content != NULL)
    if (content[0] != '\0')
      fprintf(fd, "<%s>%s</%s>\n", el, content, el);
}


x86 assembly (clang, -O0):
<xmlprinttext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1160 <xmlprinttext+0x50>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115b <xmlprinttext+0x4b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    0xeaa(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1160 <xmlprinttext+0x50>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlprinttext>:
mov    %rdx,%rcx
test   %rdx,%rdx
je     112f <xmlprinttext+0x1f>
cmpb   $0x0,(%rcx)
je     112f <xmlprinttext+0x1f>
mov    %rsi,%rdx
lea    0xed9(%rip),%rsi
mov    %rdx,%r8
jmp    1030 <fprintf@plt>
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"<%s>%s</%s>\0A\00"
define void @xmlprinttext(i32* nocapture %0, i8* %1, i8* %2) {
%4 = icmp eq i8* %2, null
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = load i8, i8* %2
%7 = icmp eq i8 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %1)
br label %10
10: ; preds = %5, %8, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const);
int /*<<< orphan*/ stderr;
void print_error(char const c) {
  fprintf(stderr, "pattern error: Unexpected character '%c'\n", c);
}


x86 assembly (clang, -O0):
<print_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
lea    0xed2(%rip),%rsi
movsbl -0x1(%rbp),%edx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_error>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"pattern error: Unexpected character '%c'\0A\00"
define void @print_error(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i32, i32* @stderr
%4 = load i8, i8* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8 signext %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"pattern error: Unexpected character '%c'\0A\00"
define void @print_error(i8 signext %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8 signext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *, int);
int /*<<< orphan*/ stderr;
void cli_memalloc_err(const char *file, const char *func, int line) {
  fprintf(stderr, "failed to alloc at %s %s %u\n", file, func, line);
}


x86 assembly (clang, -O0):
<cli_memalloc_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
lea    0xec1(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_memalloc_err>:
mov    %edx,%r8d
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
lea    0xed7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"failed to alloc at %s %s %u\0A\00"
define void @cli_memalloc_err(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9, i32 %10)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"failed to alloc at %s %s %u\0A\00"
define void @cli_memalloc_err(i8* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isgreater(long double, long double);
void uninitvar_isgreater(void) {
  float f1, f2;
  (void)isgreater(f1, f2);
  double d1, d2;
  (void)isgreater(d1, d2);
  long double ld1, ld2;
  (void)isgreater(ld1, ld2);
}


x86 assembly (clang, -O0):
<uninitvar_isgreater>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
flds   -0x4(%rbp)
flds   -0x8(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <isgreater@plt>
fldl   -0x10(%rbp)
fldl   -0x18(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <isgreater@plt>
fldt   -0x30(%rbp)
fldt   -0x40(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <isgreater@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_isgreater>:
sub    $0x28,%rsp
call   1030 <isgreater@plt>
call   1030 <isgreater@plt>
call   1030 <isgreater@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_isgreater() {
%1 = alloca float
%2 = alloca float
%3 = alloca double
%4 = alloca double
%5 = alloca x86_fp80
%6 = alloca x86_fp80
%7 = load float, float* %1
%8 = fpext float %7 to x86_fp80
%9 = load float, float* %2
%10 = fpext float %9 to x86_fp80
%11 = call i32 @isgreater(x86_fp80 %8, x86_fp80 %10)
%12 = load double, double* %3
%13 = fpext double %12 to x86_fp80
%14 = load double, double* %4
%15 = fpext double %14 to x86_fp80
%16 = call i32 @isgreater(x86_fp80 %13, x86_fp80 %15)
%17 = load x86_fp80, x86_fp80* %5
%18 = load x86_fp80, x86_fp80* %6
%19 = call i32 @isgreater(x86_fp80 %17, x86_fp80 %18)
ret void
}

LLVM IR (-O2):
define void @uninitvar_isgreater() {
%1 = tail call i32 @isgreater(x86_fp80 undef, x86_fp80 undef)
%2 = tail call i32 @isgreater(x86_fp80 undef, x86_fp80 undef)
%3 = tail call i32 @isgreater(x86_fp80 undef, x86_fp80 undef)
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int int64_t;

/* Variables and functions */
int read_leb128(unsigned char **, int *);
int64_t read_sleb128(unsigned char **data) {
  int bits;
  uint64_t uleb = read_leb128(data, &bits);
  if (uleb >> (bits - 1) == 1) {
    uleb |= ((int64_t)-1) << bits;
  }
  return (int64_t)uleb;
}


x86 assembly (clang, -O0):
<read_sleb128>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <read_leb128@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
sar    %cl,%eax
cmp    $0x1,%eax
jne    1150 <read_sleb128+0x40>
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_sleb128>:
push   %rax
lea    0x4(%rsp),%rsi
call   1030 <read_leb128@plt>
mov    0x4(%rsp),%dl
lea    -0x1(%rdx),%ecx
mov    %eax,%esi
sar    %cl,%esi
mov    $0xffffffff,%edi
mov    %edx,%ecx
shl    %cl,%edi
xor    %ecx,%ecx
cmp    $0x1,%esi
cmove  %edi,%ecx
or     %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @read_sleb128(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
%4 = alloca i32
store i8** %0, i8*** %2
%5 = load i8**, i8*** %2
%6 = call i32 @read_leb128(i8** %5, i32* %3)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 1
%10 = ashr i32 %7, %9
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %17
12: ; preds = %1
%13 = load i32, i32* %3
%14 = shl i32 -1, %13
%15 = load i32, i32* %4
%16 = or i32 %15, %14
store i32 %16, i32* %4
br label %17
17: ; preds = %12, %1
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
define i32 @read_sleb128(i8** %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @read_leb128(i8** %0, i32* %2)
%5 = load i32, i32* %2
%6 = add nsw i32 %5, -1
%7 = ashr i32 %4, %6
%8 = icmp eq i32 %7, 1
%9 = shl nsw i32 -1, %5
%10 = select i1 %8, i32 %9, i32 0
%11 = or i32 %10, %4
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
scalar_t__ ENOENT;
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
scalar_t__ errno;
int /*<<< orphan*/ *opendir(char const *);
int dir_exists(const char *dirname) {
  DIR *dir;
  dir = opendir(dirname);
  if (dir == NULL) {
    if (errno == ENOENT)
      return 0;
    return -1;
  }
  closedir(dir);
  return 1;
}


x86 assembly (clang, -O0):
<dir_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <opendir@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1176 <dir_exists+0x56>
mov    0x2e95(%rip),%rax
mov    (%rax),%rax
mov    0x2e7b(%rip),%rcx
cmp    (%rcx),%rax
jne    116a <dir_exists+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1186 <dir_exists+0x66>
movl   $0xffffffff,-0x4(%rbp)
jmp    1186 <dir_exists+0x66>
mov    -0x18(%rbp),%rdi
call   1040 <closedir@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dir_exists>:
push   %rax
call   1030 <opendir@plt>
test   %rax,%rax
je     113a <dir_exists+0x1a>
mov    %rax,%rdi
call   1040 <closedir@plt>
mov    $0x1,%eax
pop    %rcx
ret
mov    0x2e9f(%rip),%rax
mov    (%rax),%rcx
mov    0x2e85(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
setne  %al
neg    %eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i64 0
@ENOENT = global i64 0
define i32 @dir_exists(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32* @opendir(i8* %5)
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %15
9: ; preds = %1
%10 = load i64, i64* @errno
%11 = load i64, i64* @ENOENT
%12 = icmp eq i64 %10, %11
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 0, i32* %2
br label %18
14: ; preds = %9
store i32 -1, i32* %2
br label %18
15: ; preds = %1
%16 = load i32*, i32** %4
%17 = call i32 @closedir(i32* %16)
store i32 1, i32* %2
br label %18
18: ; preds = %15, %14, %13
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@errno = global i64 0
@ENOENT = global i64 0
define i32 @dir_exists(i8* nocapture %0) {
%2 = tail call i32* @opendir(i8* %0)
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i64, i64* @errno
%6 = load i64, i64* @ENOENT
%7 = icmp ne i64 %5, %6
%8 = sext i1 %7 to i32
br label %11
9: ; preds = %1
%10 = tail call i32 @closedir(i32* %2)
br label %11
11: ; preds = %4, %9
%12 = phi i32 [ 1, %9 ], [ %8, %4 ]
ret i32 %12
}
/* Type definitions */
struct iphdr {
  int ihl;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
unsigned int GetIpHeaderLength(unsigned char *ipPacket) {
  struct iphdr *iph;
  assert(ipPacket != NULL);
  iph = (struct iphdr *)ipPacket;
  return iph->ihl << 2;
}


x86 assembly (clang, -O0):
<GetIpHeaderLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
shl    $0x2,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetIpHeaderLength>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    (%rbx),%eax
shl    $0x2,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.iphdr = type { i32 }
define i32 @GetIpHeaderLength(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.iphdr*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to %struct.iphdr*
store %struct.iphdr* %9, %struct.iphdr** %3
%10 = load %struct.iphdr*, %struct.iphdr** %3
%11 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = shl i32 %12, 2
ret i32 %13
}

LLVM IR (-O2):
define i32 @GetIpHeaderLength(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* %5
%7 = shl i32 %6, 2
ret i32 %7
}
int foo(int x, int y) {
  if (~x & y)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
and    -0xc(%rbp),%eax
cmp    $0x0,%eax
je     1128 <foo+0x28>
movl   $0x1,-0x4(%rbp)
jmp    112f <foo+0x2f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
not    %edi
xor    %eax,%eax
test   %esi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @foo(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* %4
%7 = xor i32 %6, -1
%8 = load i32, i32* %5
%9 = and i32 %7, %8
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 1, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = xor i32 %0, -1
%4 = and i32 %3, %1
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}