xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ close_log();
int /*<<< orphan*/ close_pid();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ write_log(int, char *, char *);
void clean_exit() {
  write_log(3,
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/blueness/hwmultd/refs/heads/master/src/"
            "signalhandler.c",
            "doing a clean_exit()");
  close_pid();
  close_log();
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<clean_exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
lea    0xeb0(%rip),%rsi
lea    0xf3a(%rip),%rdx
call   1050 <write_log@plt>
mov    $0x0,%al
call   1040 <close_pid@plt>
mov    $0x0,%al
call   1030 <close_log@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<clean_exit>:
push   %rax
lea    0xeb8(%rip),%rsi
lea    0xf42(%rip),%rdx
mov    $0x3,%edi
call   1050 <write_log@plt>
xor    %eax,%eax
call   1040 <close_pid@plt>
xor    %eax,%eax
call   1030 <close_log@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/blueness/hwmultd/refs/heads/master/src/signalhandler.c\00"
@.str.1 = [21 x i8] c"doing a clean_exit()\00"
@EXIT_SUCCESS = global i32 0
define void @clean_exit() {
%1 = call i32 @write_log(i32 3, i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (...) @close_pid()
%3 = call i32 (...) @close_log()
%4 = load i32, i32* @EXIT_SUCCESS
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/blueness/hwmultd/refs/heads/master/src/signalhandler.c\00"
@.str.1 = [21 x i8] c"doing a clean_exit()\00"
@EXIT_SUCCESS = global i32 0
define void @clean_exit() {
%1 = tail call i32 @write_log(i32 3, i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (...) @close_pid()
%3 = tail call i32 (...) @close_log()
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ jffs2_lzma_exit();
int /*<<< orphan*/ jffs2_rtime_exit();
int /*<<< orphan*/ jffs2_zlib_exit();
int jffs2_compressors_exit(void) {
  jffs2_rtime_exit();
  jffs2_zlib_exit();
  jffs2_lzma_exit();
  return 0;
}


x86 assembly (clang, -O0):
<jffs2_compressors_exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <jffs2_rtime_exit@plt>
mov    $0x0,%al
call   1030 <jffs2_zlib_exit@plt>
mov    $0x0,%al
call   1040 <jffs2_lzma_exit@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jffs2_compressors_exit>:
push   %rax
xor    %eax,%eax
call   1050 <jffs2_rtime_exit@plt>
xor    %eax,%eax
call   1030 <jffs2_zlib_exit@plt>
xor    %eax,%eax
call   1040 <jffs2_lzma_exit@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @jffs2_compressors_exit() {
%1 = call i32 (...) @jffs2_rtime_exit()
%2 = call i32 (...) @jffs2_zlib_exit()
%3 = call i32 (...) @jffs2_lzma_exit()
ret i32 0
}

LLVM IR (-O2):
define i32 @jffs2_compressors_exit() {
%1 = tail call i32 (...) @jffs2_rtime_exit()
%2 = tail call i32 (...) @jffs2_zlib_exit()
%3 = tail call i32 (...) @jffs2_lzma_exit()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
double stdlib_strided_dapxsumkbn(int /*<<< orphan*/ const, double const,
                                 double const *, int /*<<< orphan*/ const);
double stdlib_strided_dapxsum(const int64_t N, const double alpha,
                              const double *X, const int64_t stride) {
  return stdlib_strided_dapxsumkbn(N, alpha, X, stride);
}


x86 assembly (clang, -O0):
<stdlib_strided_dapxsum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <stdlib_strided_dapxsumkbn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_strided_dapxsum>:
jmp    1030 <stdlib_strided_dapxsumkbn@plt>

LLVM IR (-O0):
define double @stdlib_strided_dapxsum(i32 %0, double %1, double* %2, i32 %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca double*
%8 = alloca i32
store i32 %0, i32* %5
store double %1, double* %6
store double* %2, double** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load double, double* %6
%11 = load double*, double** %7
%12 = load i32, i32* %8
%13 = call double @stdlib_strided_dapxsumkbn(i32 %9, double %10, double* %11, i32 %12)
ret double %13
}

LLVM IR (-O2):
define double @stdlib_strided_dapxsum(i32 %0, double %1, double* %2, i32 %3) {
%5 = tail call double @stdlib_strided_dapxsumkbn(i32 %0, double %1, double* %2, i32 %3)
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t pos_uint32_t(uint32_t number) { return number; }


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

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

LLVM IR (-O0):
define i32 @pos_uint32_t(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @pos_uint32_t(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int);
int /*<<< orphan*/ printByte(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void printValue(int valor) {
  printf("( 0b");
  printByte(valor);
  fprintf(stdout, " | 0x%X | %d )", valor, valor);
}


x86 assembly (clang, -O0):
<printValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1050 <printByte@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x4(%rbp),%ecx
lea    0xea0(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printValue>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1050 <printByte@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
lea    0xeaf(%rip),%rsi
mov    %ebx,%edx
mov    %ebx,%ecx
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"( 0b\00"
@stdout = global i32 0
@.str.1 = [15 x i8] c" | 0x%X | %d )\00"
define void @printValue(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @printByte(i32 %4)
%6 = load i32, i32* @stdout
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"( 0b\00"
@stdout = global i32 0
@.str.1 = [15 x i8] c" | 0x%X | %d )\00"
define void @printValue(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printByte(i32 %0)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 %0)
ret void
}
/* Variables and functions */
char *malloc(size_t);
size_t strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, size_t);
char *getInfo() {
  char *name;
  size_t size;
  size = strlen("Sines (C) 2004 Panayotis Katsaloulis http://www.panayotis.com "
                "under GNU GPL");
  name = malloc(size + 1);
  strncpy(name,
          ("Sines (C) 2004 Panayotis Katsaloulis http://www.panayotis.com "
           "under GNU GPL"),
          size + 1);
  return name;
}


x86 assembly (clang, -O0):
<getInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
add    $0x1,%rdx
lea    0xe94(%rip),%rsi
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getInfo>:
push   %rbx
mov    $0x4c,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rsi
mov    $0x4c,%edx
mov    %rax,%rdi
call   1030 <strncpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [76 x i8] c"Sines (C) 2004 Panayotis Katsaloulis http://www.panayotis.com under GNU GPL\00"
define i8* @getInfo() {
%1 = alloca i8*
%2 = alloca i64
%3 = call i64 @strlen(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = add i64 %4, 1
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %1
%7 = load i8*, i8** %1
%8 = load i64, i64* %2
%9 = add i64 %8, 1
%10 = call i32 @strncpy(i8* %7, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = load i8*, i8** %1
ret i8* %11
}

LLVM IR (-O2):
@.str = [76 x i8] c"Sines (C) 2004 Panayotis Katsaloulis http://www.panayotis.com under GNU GPL\00"
define i8* @getInfo() {
%1 = tail call dereferenceable_or_null(76) i8* @malloc(i64 76)
%2 = tail call i32 @strncpy(i8* %1, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i64 76)
ret i8* %1
}
float fab(float tmp) {
  if (tmp < 0)
    return -tmp;
  return tmp;
}


x86 assembly (clang, -O0):
<fab>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1132 <fab+0x32>
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    113c <fab+0x3c>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fab>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @fab(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
int buscarElemPos() { return -1; }


x86 assembly (clang, -O0):
<buscarElemPos>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @buscarElemPos() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @buscarElemPos() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *, int, int);
int /*<<< orphan*/ output_w32(int);
void emit_fcvtsd(int s, int d) {
  assem_debug("fcvtsd s%d,d%d", d, s);
  output_w32(0xeeb70bc0 | ((d & 14) << 11) | ((d & 1) << 22) | (s & 7));
}


x86 assembly (clang, -O0):
<emit_fcvtsd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xec5(%rip),%rdi
call   1030 <assem_debug@plt>
mov    -0x8(%rbp),%edi
and    $0xe,%edi
shl    $0xb,%edi
or     $0xeeb70bc0,%edi
mov    -0x8(%rbp),%eax
and    $0x1,%eax
shl    $0x16,%eax
or     %eax,%edi
mov    -0x4(%rbp),%eax
and    $0x7,%eax
or     %eax,%edi
call   1040 <output_w32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fcvtsd>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%r14d
lea    0xed0(%rip),%rdi
mov    %r14d,%edx
call   1030 <assem_debug@plt>
mov    %ebx,%eax
and    $0xe,%eax
shl    $0xb,%eax
and    $0x1,%ebx
shl    $0x16,%ebx
and    $0x7,%r14d
or     %ebx,%r14d
lea    (%rax,%r14,1),%edi
add    $0xeeb70bc0,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"fcvtsd s%d,d%d\00"
define void @emit_fcvtsd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @assem_debug(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %4
%9 = and i32 %8, 14
%10 = shl i32 %9, 11
%11 = or i32 -289993792, %10
%12 = load i32, i32* %4
%13 = and i32 %12, 1
%14 = shl i32 %13, 22
%15 = or i32 %11, %14
%16 = load i32, i32* %3
%17 = and i32 %16, 7
%18 = or i32 %15, %17
%19 = call i32 @output_w32(i32 %18)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"fcvtsd s%d,d%d\00"
define void @emit_fcvtsd(i32 %0, i32 %1) {
%3 = tail call i32 @assem_debug(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
%4 = shl i32 %1, 11
%5 = and i32 %4, 28672
%6 = shl i32 %1, 22
%7 = and i32 %6, 4194304
%8 = and i32 %0, 7
%9 = or i32 %8, %7
%10 = or i32 %9, %5
%11 = or i32 %10, -289993792
%12 = tail call i32 @output_w32(i32 %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pru_set_reg(int, int, int);
void MOTORTerminate(unsigned char motor) {
  pru_set_reg((1), (0), 0x0);
  pru_set_reg((1), (1), 0x0);
}


x86 assembly (clang, -O0):
<MOTORTerminate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <pru_set_reg@plt>
mov    $0x1,%esi
xor    %edx,%edx
mov    %esi,%edi
call   1030 <pru_set_reg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MOTORTerminate>:
push   %rax
mov    $0x1,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <pru_set_reg@plt>
mov    $0x1,%edi
mov    $0x1,%esi
xor    %edx,%edx
pop    %rax
jmp    1030 <pru_set_reg@plt>

LLVM IR (-O0):
define void @MOTORTerminate(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @pru_set_reg(i32 1, i32 0, i32 0)
%4 = call i32 @pru_set_reg(i32 1, i32 1, i32 0)
ret void
}

LLVM IR (-O2):
define void @MOTORTerminate(i8 zeroext %0) {
%2 = tail call i32 @pru_set_reg(i32 1, i32 0, i32 0)
%3 = tail call i32 @pru_set_reg(i32 1, i32 1, i32 0)
ret void
}
void gtk_tree_model_sort_new_with_model() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_model_sort_new_with_model() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  if (argc > 2) {
    puts("Warning\n");
    puts("Arguments limit (1) exceeded !");
  }
  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)
cmpl   $0x2,-0x8(%rbp)
jle    1148 <main+0x38>
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x3,%edi
jl     1132 <main+0x22>
push   %rax
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Warning\0A\00"
@.str.1 = [31 x i8] c"Arguments limit (1) exceeded !\00"
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 sgt i32 %6, 2
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %8, %2
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"Warning\0A\00"
@.str.1 = [31 x i8] c"Arguments limit (1) exceeded !\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp sgt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %4, %2
ret i32 0
}
isdigit(c) char c;
{
  if (c >= '0' & c <= '9')
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
movsbl -0x5(%rbp),%ecx
cmp    $0x39,%ecx
setle  %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1140 <isdigit+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1147 <isdigit+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
shl    $0x18,%edi
add    $0xd0ffffff,%edi
xor    %eax,%eax
cmp    $0xaffffff,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isdigit(i32 %0) {
%2 = shl i32 %0, 24
%3 = add i32 %2, -788529153
%4 = icmp ult i32 %3, 184549375
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
scalar_t__ EINVAL;
scalar_t__ errno;
long strtol(char const *, int /*<<< orphan*/ *, int);
int value_to_int(const char *val, int *result) {
  long res = strtol(val, NULL, 10);
  if (res == 0 && errno == EINVAL) {
    return 0;
  }
  *result = res;
  return 1;
}


x86 assembly (clang, -O0):
<value_to_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1167 <value_to_int+0x57>
mov    0x2e98(%rip),%rax
mov    (%rax),%rax
mov    0x2e86(%rip),%rcx
cmp    (%rcx),%rax
jne    1167 <value_to_int+0x57>
movl   $0x0,-0x4(%rbp)
jmp    117a <value_to_int+0x6a>
mov    -0x20(%rbp),%rax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<value_to_int>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
xor    %ebx,%ebx
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
test   %rax,%rax
jne    1140 <value_to_int+0x30>
mov    0x2eaf(%rip),%rcx
mov    (%rcx),%rcx
mov    0x2e9d(%rip),%rdx
cmp    (%rdx),%rcx
je     1148 <value_to_int+0x38>
mov    %eax,(%r14)
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@errno = global i64 0
@EINVAL = global i64 0
define i32 @value_to_int(i8* nocapture %0, i32* nocapture writeonly %1) {
%3 = tail call i64 @strtol(i8* nocapture %0, i32* null, i32 10)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i64, i64* @errno
%7 = load i64, i64* @EINVAL
%8 = icmp eq i64 %6, %7
br i1 %8, label %11, label %9
9: ; preds = %5, %2
%10 = trunc i64 %3 to i32
store i32 %10, i32* %1
br label %11
11: ; preds = %5, %9
%12 = phi i32 [ 1, %9 ], [ 0, %5 ]
ret i32 %12
}
/* Variables and functions */
int fwcfg_get_nb_cpus();
int cpu_count(void) { return fwcfg_get_nb_cpus(); }


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

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

LLVM IR (-O0):
define i32 @cpu_count() {
%1 = call i32 (...) @fwcfg_get_nb_cpus()
ret i32 %1
}

LLVM IR (-O2):
define i32 @cpu_count() {
%1 = tail call i32 (...) @fwcfg_get_nb_cpus()
ret i32 %1
}
int authless_authenticate(struct authhandle *auth, struct socket *sk,
                          char *data) {
  return (0);
}


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

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

LLVM IR (-O0):
%struct.authhandle = type opaque
%struct.socket = type opaque
define i32 @authless_authenticate(%struct.authhandle* %0, %struct.socket* %1, i8* %2) {
%4 = alloca %struct.authhandle*
%5 = alloca %struct.socket*
%6 = alloca i8*
store %struct.authhandle* %0, %struct.authhandle** %4
store %struct.socket* %1, %struct.socket** %5
store i8* %2, i8** %6
ret i32 0
}

LLVM IR (-O2):
%struct.authhandle = type opaque
%struct.socket = type opaque
define i32 @authless_authenticate(%struct.authhandle* nocapture readnone %0, %struct.socket* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
scalar_t__ getcwd(char *, int);
int strlen(char *);
int fb_hGetCurrentDir(char *dst, int maxlen) {
  if (getcwd(dst, maxlen) != 0)
    return strlen(dst);
  return 0;
}


x86 assembly (clang, -O0):
<fb_hGetCurrentDir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <getcwd@plt>
cmp    $0x0,%rax
je     1156 <fb_hGetCurrentDir+0x36>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x4(%rbp)
jmp    115d <fb_hGetCurrentDir+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_hGetCurrentDir>:
push   %rbx
mov    %rdi,%rbx
call   1040 <getcwd@plt>
test   %rax,%rax
je     1137 <fb_hGetCurrentDir+0x17>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strlen@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @fb_hGetCurrentDir(i8* %0, i32 %1) {
%3 = tail call i64 @getcwd(i8* %0, i32 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @strlen(i8* %0)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ 0, %2 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_condattr_t;
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
int /*<<< orphan*/ _unsupported();
int pthread_condattr_setclock(pthread_condattr_t *attr, clockid_t clock_id) {
  _unsupported();
  return -1;
}


x86 assembly (clang, -O0):
<pthread_condattr_setclock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <_unsupported@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_condattr_setclock>:
push   %rax
xor    %eax,%eax
call   1030 <_unsupported@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @pthread_condattr_setclock(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = call i32 (...) @_unsupported()
ret i32 -1
}

LLVM IR (-O2):
define i32 @pthread_condattr_setclock(i32* nocapture readnone %0, i32 %1) {
%3 = tail call i32 (...) @_unsupported()
ret i32 -1
}
unsigned char testme(unsigned char input) {
  unsigned char retval = 0;
  if (input == 0x55) {
    retval = 0xAA;
  }
  return retval;
}


x86 assembly (clang, -O0):
<testme>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x55,%eax
jne    111f <testme+0x1f>
movb   $0xaa,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testme>:
xor    %ecx,%ecx
cmp    $0x55,%dil
mov    $0xaa,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @testme(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
store i8 0, i8* %3
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = icmp eq i32 %5, 85
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 -86, i8* %3
br label %8
8: ; preds = %7, %1
%9 = load i8, i8* %3
ret i8 %9
}

LLVM IR (-O2):
define zeroext i8 @testme(i8 zeroext %0) {
%2 = icmp eq i8 %0, 85
%3 = select i1 %2, i8 -86, i8 0
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ srand48(long);
__attribute__((__weak__, __always___)) void
softboundcets_srand48(long int seed) {
  srand48(seed);
}


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

x86 assembly (clang, -O2):
<softboundcets_srand48>:
jmp    1030 <srand48@plt>

LLVM IR (-O0):
define weak void @softboundcets_srand48(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @srand48(i64 %3)
ret void
}

LLVM IR (-O2):
define weak void @softboundcets_srand48(i64 %0) {
%2 = tail call i32 @srand48(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kr(char const *, int, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ v(char const *, int, int, int, int /*<<< orphan*/);
void f(const char *f) {
  v(f, 1, 2, 3, 0);
  kr(f, 1, 2, 3, 0);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
xor    %r8d,%r8d
call   1030 <v@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
xor    %r8d,%r8d
call   1040 <kr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
xor    %r8d,%r8d
call   1030 <v@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <kr@plt>

LLVM IR (-O0):
define void @f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @v(i8* %3, i32 1, i32 2, i32 3, i32 0)
%5 = load i8*, i8** %2
%6 = call i32 @kr(i8* %5, i32 1, i32 2, i32 3, i32 0)
ret void
}

LLVM IR (-O2):
define void @f(i8* %0) {
%2 = tail call i32 @v(i8* %0, i32 1, i32 2, i32 3, i32 0)
%3 = tail call i32 @kr(i8* %0, i32 1, i32 2, i32 3, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ done_making_trace_files();
int /*<<< orphan*/ write_basic_trace_file();
int main(int argc, char **argv, char **envp) {
  write_basic_trace_file();
  done_making_trace_files();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1040 <write_basic_trace_file@plt>
mov    $0x0,%al
call   1030 <done_making_trace_files@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = call i32 (...) @write_basic_trace_file()
%9 = call i32 (...) @done_making_trace_files()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 (...) @write_basic_trace_file()
%5 = tail call i32 (...) @done_making_trace_files()
ret i32 0
}
double pathconN_nm6_sign(double x) { return x < 0 ? -1 : x > 0 ? 1 : x; }


x86 assembly (clang, -O0):
<pathconN_nm6_sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1129 <pathconN_nm6_sign+0x29>
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1161 <pathconN_nm6_sign+0x61>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <pathconN_nm6_sign+0x4d>
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1157 <pathconN_nm6_sign+0x57>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathconN_nm6_sign>:
xorpd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
movsd  0xeeb(%rip),%xmm3
andpd  %xmm2,%xmm3
andnpd %xmm0,%xmm2
orpd   %xmm3,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm1
andnpd %xmm2,%xmm1
movsd  0xed2(%rip),%xmm2
andpd  %xmm2,%xmm0
orpd   %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @pathconN_nm6_sign(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp ogt double %0, 0.000000e+00
%4 = select i1 %3, double 1.000000e+00, double %0
%5 = select i1 %2, double -1.000000e+00, double %4
ret double %5
}
void print_stack_pointer(char *info) {
  long stackp = 0;
  long basep = 0;
  __asm__ __volatile__("mov %%ebp, %%eax" : "=a"(basep));
  __asm__ __volatile__("mov %%esp, %%eax" : "=a"(stackp));
  printf("%s Stackpointer : %lu Basepointer: %lu\n", info, stackp, basep);
  return;
}


x86 assembly (clang, -O0):
<print_stack_pointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    %ebp,%eax
mov    %rax,-0x18(%rbp)
mov    %esp,%eax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_stack_pointer>:
mov    %rdi,%rsi
mov    %ebp,%eax
mov    %rax,%rcx
mov    %esp,%eax
lea    0xedf(%rip),%rdi
mov    %rax,%rdx
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"%s Stackpointer : %lu Basepointer: %lu\0A\00"
define void @print_stack_pointer(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
store i64 0, i64* %4
%5 = call i64 asm sideeffect "mov %ebp, %eax", "={ax},~{dirflag},~{fpsr},~{flags}"()
store i64 %5, i64* %4
%6 = call i64 asm sideeffect "mov %esp, %eax", "={ax},~{dirflag},~{fpsr},~{flags}"()
store i64 %6, i64* %3
%7 = load i8*, i8** %2
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %7, i64 %8, i64 %9)
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"%s Stackpointer : %lu Basepointer: %lu\0A\00"
define void @print_stack_pointer(i8* %0) {
%2 = tail call i64 asm sideeffect "mov %ebp, %eax", "={ax},~{dirflag},~{fpsr},~{flags}"()
%3 = tail call i64 asm sideeffect "mov %esp, %eax", "={ax},~{dirflag},~{fpsr},~{flags}"()
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %3, i64 %2)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t websocket_wrapped_len(uint64_t len) {
  if (len < 126)
    return len + 2;
  if (len < (1UL << 16))
    return len + 4;
  return len + 10;
}


x86 assembly (clang, -O0):
<websocket_wrapped_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x7e,-0x8(%rbp)
jge    111f <websocket_wrapped_len+0x1f>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <websocket_wrapped_len+0x46>
movslq -0x8(%rbp),%rax
cmp    $0x10000,%rax
jae    113d <websocket_wrapped_len+0x3d>
mov    -0x8(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <websocket_wrapped_len+0x46>
mov    -0x8(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<websocket_wrapped_len>:
cmp    $0x10000,%edi
mov    $0x4,%eax
mov    $0xa,%ecx
cmovb  %eax,%ecx
cmp    $0x7e,%edi
mov    $0x2,%eax
cmovge %ecx,%eax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @websocket_wrapped_len(i32 %0) {
%2 = icmp slt i32 %0, 126
%3 = icmp ult i32 %0, 65536
%4 = select i1 %3, i32 4, i32 10
%5 = select i1 %2, i32 2, i32 %4
%6 = add nsw i32 %5, %0
ret i32 %6
}
/* Variables and functions */
double palDat(double);
double palDtt(double utc) { return 32.184 + palDat(utc); }


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

x86 assembly (clang, -O2):
<palDtt>:
push   %rax
call   1030 <palDat@plt>
addsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @palDtt(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @palDat(double %3)
%5 = fadd double 3.218400e+01, %4
ret double %5
}

LLVM IR (-O2):
define double @palDtt(double %0) {
%2 = tail call double @palDat(double %0)
%3 = fadd double %2, 3.218400e+01
ret double %3
}
void atomic_clear_bit(unsigned long nr, volatile unsigned long *addr) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ write(int, void *, size_t);
ssize_t __write(int fd, void *buf, size_t count) {
  return write(fd, buf, count);
}


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

x86 assembly (clang, -O2):
<__write>:
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @__write(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
void ConvertBS(char *p) {
  while (*p) {
    if (*p == '\\')
      *p = '/';
    p++;
  }
}


x86 assembly (clang, -O0):
<ConvertBS>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113d <ConvertBS+0x3d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    112c <ConvertBS+0x2c>
mov    -0x8(%rbp),%rax
movb   $0x2f,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <ConvertBS+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvertBS>:
jmp    1117 <ConvertBS+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x2f,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x5c,%al
je     1110 <ConvertBS+0x10>
test   %al,%al
jne    1113 <ConvertBS+0x13>
ret

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

LLVM IR (-O2):
define void @ConvertBS(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 92, label %5
]
5: ; preds = %2
store i8 47, i8* %3
br label %6
6: ; preds = %2, %5
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int pthread_kill(int /*<<< orphan*/, int);
__attribute__((weak)) int __real_pthread_kill(pthread_t tid, int sig) {
  return pthread_kill(tid, sig);
}


x86 assembly (clang, -O0):
<__real_pthread_kill>:
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 <pthread_kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__real_pthread_kill>:
jmp    1030 <pthread_kill@plt>

LLVM IR (-O0):
define weak i32 @__real_pthread_kill(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 @pthread_kill(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define weak i32 @__real_pthread_kill(i32 %0, i32 %1) {
%3 = tail call i32 @pthread_kill(i32 %0, i32 %1)
ret i32 %3
}
int sd_check_right(struct virtual_item *vi, int free) { return -1; }


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

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

LLVM IR (-O0):
%struct.virtual_item = type opaque
define i32 @sd_check_right(%struct.virtual_item* %0, i32 %1) {
%3 = alloca %struct.virtual_item*
%4 = alloca i32
store %struct.virtual_item* %0, %struct.virtual_item** %3
store i32 %1, i32* %4
ret i32 -1
}

LLVM IR (-O2):
%struct.virtual_item = type opaque
define i32 @sd_check_right(%struct.virtual_item* nocapture readnone %0, i32 %1) {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
wchar_t *fgetws(wchar_t *ws, int n, FILE *stream) {
  return (wchar_t *)fgets((char *)ws, n, stream);
}


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

x86 assembly (clang, -O2):
<fgetws>:
jmp    1030 <fgets@plt>

LLVM IR (-O0):
define i32* @fgetws(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = bitcast i32* %7 to i8*
%9 = load i32, i32* %5
%10 = load i32*, i32** %6
%11 = call i64 @fgets(i8* %8, i32 %9, i32* %10)
%12 = inttoptr i64 %11 to i32*
ret i32* %12
}

LLVM IR (-O2):
define i32* @fgetws(i32* %0, i32 %1, i32* nocapture %2) {
%4 = bitcast i32* %0 to i8*
%5 = tail call i64 @fgets(i8* %4, i32 %1, i32* %2)
%6 = inttoptr i64 %5 to i32*
ret i32* %6
}
int is_bit_i_set(unsigned char c, int i) {
  unsigned char mask = 1 << i;
  return mask & c;
}


x86 assembly (clang, -O0):
<is_bit_i_set>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0x1(%rbp),%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_bit_i_set>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @is_bit_i_set(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
%5 = alloca i8
store i8 %0, i8* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = shl i32 1, %6
%8 = trunc i32 %7 to i8
store i8 %8, i8* %5
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = and i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @is_bit_i_set(i8 zeroext %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = zext i8 %0 to i32
%5 = and i32 %3, %4
ret i32 %5
}
long WRITEA(fd, buf, nbyte, status, signo)
long *fd, *buf, *nbyte, *status, *signo;
{ return ((long)writea(*fd, (char *)buf, *nbyte, status, *signo)); }


x86 assembly (clang, -O0):
<WRITEA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    (%rax),%r8
mov    $0x0,%al
call   1030 <writea@plt>
cltq
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WRITEA>:
push   %rax
mov    (%rdi),%rdi
mov    (%rdx),%rdx
mov    (%r8),%r8
xor    %eax,%eax
call   1030 <writea@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @WRITEA(i64* %0, i64* %1, i64* %2, i64* %3, i64* %4) {
%6 = alloca i64*
%7 = alloca i64*
%8 = alloca i64*
%9 = alloca i64*
%10 = alloca i64*
store i64* %0, i64** %6
store i64* %1, i64** %7
store i64* %2, i64** %8
store i64* %3, i64** %9
store i64* %4, i64** %10
%11 = load i64*, i64** %6
%12 = load i64, i64* %11
%13 = load i64*, i64** %7
%14 = bitcast i64* %13 to i8*
%15 = load i64*, i64** %8
%16 = load i64, i64* %15
%17 = load i64*, i64** %9
%18 = load i64*, i64** %10
%19 = load i64, i64* %18
%20 = call i32 (i64, i8*, i64, i64*, i64, ...) bitcast (i32 (...)* @writea to i32 (i64, i8*, i64, i64*, i64, ...)*)(i64 %12, i8* %14, i64 %16, i64* %17, i64 %19)
%21 = sext i32 %20 to i64
ret i64 %21
}

LLVM IR (-O2):
define i64 @WRITEA(i64* nocapture %0, i64* %1, i64* nocapture %2, i64* %3, i64* nocapture %4) {
%6 = load i64, i64* %0
%7 = bitcast i64* %1 to i8*
%8 = load i64, i64* %2
%9 = load i64, i64* %4
%10 = tail call i32 (i64, i8*, i64, i64*, i64, ...) bitcast (i32 (...)* @writea to i32 (i64, i8*, i64, i64*, i64, ...)*)(i64 %6, i8* %7, i64 %8, i64* %3, i64 %9)
%11 = sext i32 %10 to i64
ret i64 %11
}
/* Variables and functions */
int serial_iec_lib_directory(unsigned int, char const *, unsigned char **);
int machine_bus_lib_directory(unsigned int unit, const char *pattern,
                              unsigned char **buf) {
  return serial_iec_lib_directory(unit, pattern, buf);
}


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

x86 assembly (clang, -O2):
<machine_bus_lib_directory>:
jmp    1030 <serial_iec_lib_directory@plt>

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

LLVM IR (-O2):
define i32 @machine_bus_lib_directory(i32 %0, i8* %1, i8** %2) {
%4 = tail call i32 @serial_iec_lib_directory(i32 %0, i8* %1, i8** %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int f(int);
main() {
  assert(f(0) == 5);
  assert(f(1) == 4);
  assert(f(2) == 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <f@plt>
cmp    $0x5,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x1,%edi
call   1030 <f@plt>
cmp    $0x4,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x2,%edi
call   1030 <f@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <f@plt>
xor    %edi,%edi
cmp    $0x5,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x1,%edi
call   1030 <f@plt>
xor    %edi,%edi
cmp    $0x4,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x2,%edi
call   1030 <f@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i32 0)
%3 = icmp eq i32 %2, 5
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = call i32 @f(i32 1)
%7 = icmp eq i32 %6, 4
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = call i32 @f(i32 2)
%11 = icmp eq i32 %10, 3
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 0)
%2 = icmp eq i32 %1, 5
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @f(i32 1)
%6 = icmp eq i32 %5, 4
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @f(i32 2)
%10 = icmp eq i32 %9, 3
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
ret i32 0
}