xunge/DecIR huggingface dataset:
void movvv(double *dest, const double *src) {
  dest[0] = src[0];
  dest[1] = src[1];
  dest[2] = src[2];
}


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

x86 assembly (clang, -O2):
<movvv>:
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rdi)
movsd  0x8(%rsi),%xmm0
movsd  %xmm0,0x8(%rdi)
movsd  0x10(%rsi),%xmm0
movsd  %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @movvv(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %3
%9 = getelementptr inbounds double, double* %8, i64 0
store double %7, double* %9
%10 = load double*, double** %4
%11 = getelementptr inbounds double, double* %10, i64 1
%12 = load double, double* %11
%13 = load double*, double** %3
%14 = getelementptr inbounds double, double* %13, i64 1
store double %12, double* %14
%15 = load double*, double** %4
%16 = getelementptr inbounds double, double* %15, i64 2
%17 = load double, double* %16
%18 = load double*, double** %3
%19 = getelementptr inbounds double, double* %18, i64 2
store double %17, double* %19
ret void
}

LLVM IR (-O2):
define void @movvv(double* nocapture writeonly %0, double* nocapture %1) {
%3 = load double, double* %1
store double %3, double* %0
%4 = getelementptr inbounds double, double* %1, i64 1
%5 = load double, double* %4
%6 = getelementptr inbounds double, double* %0, i64 1
store double %5, double* %6
%7 = getelementptr inbounds double, double* %1, i64 2
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %0, i64 2
store double %8, double* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((no)) int foo() {
  printf("Hello world.\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello world.\00"
define i32 @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
unsigned int isOct(char ch) {
  return (ch >= '0') && (ch <= '8');
  __builtin_unreachable();
}


x86 assembly (clang, -O0):
<isOct>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <isOct+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x38,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isOct>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0x9,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isOct(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 56
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isOct(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 9
%4 = zext i1 %3 to i32
ret i32 %4
}
int msm_watchdog_resume_deferred(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @msm_watchdog_resume_deferred() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void destroy(void *ptr) {
  free(ptr);
  ptr = NULL;
}


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

x86 assembly (clang, -O2):
<destroy>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @destroy(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @free(i8* %3)
store i8* null, i8** %2
ret void
}

LLVM IR (-O2):
define void @destroy(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int main(argc, argv)
int argc;
char **argv;
{
  printf("Number of files: %d\n",
         getCountFiles("ls db/stage1_input/ -1 | wc -l"));
  generate();
  return 1;
}


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)
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1040 <getCountFiles@plt>
mov    %eax,%esi
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <generate@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedd(%rip),%rdi
xor    %eax,%eax
call   1040 <getCountFiles@plt>
lea    0xeba(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <generate@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Number of files: %d\0A\00"
@.str.1 = [31 x i8] c"ls db/stage1_input/ -1 | wc -l\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 = call i32 (i8*, ...) bitcast (i32 (...)* @getCountFiles to i32 (i8*, ...)*)(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 (...) @generate()
ret i32 1
}

LLVM IR (-O2):
@.str = [21 x i8] c"Number of files: %d\0A\00"
@.str.1 = [31 x i8] c"ls db/stage1_input/ -1 | wc -l\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @getCountFiles to i32 (i8*, ...)*)(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @generate()
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, double, int);
int main(int argc, char *argv[]) {
  struct {
    int a;
    float b;
    int c;
  } myst;
  myst.a = 4;
  myst.b = 3.37;
  myst.c = 8;
  printf("a = %d, b = %f, c = %d\n", myst.a, myst.b, myst.c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x4,-0x20(%rbp)
movss  0xecb(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movl   $0x8,-0x18(%rbp)
mov    -0x20(%rbp),%esi
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x18(%rbp),%edx
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movsd  0xee0(%rip),%xmm0
mov    $0x4,%esi
mov    $0x8,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.anon = type { i32, float, i32 }
@.str = [24 x i8] c"a = %d, b = %f, c = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.anon
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 0
store i32 4, i32* %7
%8 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 1
store float 0x400AF5C280000000, float* %8
%9 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 2
store i32 8, i32* %9
%10 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 0
%11 = load i32, i32* %10
%12 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 1
%13 = load float, float* %12
%14 = fpext float %13 to double
%15 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 2
%16 = load i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %11, double %14, i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"a = %d, b = %f, c = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 4, double 0x400AF5C280000000, i32 8)
ret i32 0
}
int pm_bitstomaxval(bits)
int bits;
{ return (1 << bits) - 1; }


x86 assembly (clang, -O0):
<pm_bitstomaxval>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm_bitstomaxval>:
mov    %edi,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @pm_bitstomaxval(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 1, %3
%5 = sub nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @pm_bitstomaxval(i32 %0) {
%2 = shl nsw i32 -1, %0
%3 = xor i32 %2, -1
ret i32 %3
}
void toChinese(char c) {
  char ch[10][5] = {"零", "一", "二", "三", "四", "五", "六", "七", "八", "九"};
  printf("%s", ch[c - '0']);
}


x86 assembly (clang, -O0):
<toChinese>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x32,%edx
call   1040 <memcpy@plt>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
cltq
lea    -0x40(%rbp),%rsi
imul   $0x5,%rax,%rax
add    %rax,%rsi
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toChinese>:
sub    $0x38,%rsp
movzwl 0xf15(%rip),%eax
mov    %ax,0x30(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,(%rsp)
movslq %edi,%rax
lea    (%rax,%rax,4),%rax
lea    (%rsp,%rax,1),%rsi
add    $0xffffffffffffff10,%rsi
lea    0xed6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.toChinese.ch = [10 x [5 x i8]] [[5 x i8] c"\E9\9B\B6\00\00", [5 x i8] c"\E4\B8\80\00\00", [5 x i8] c"\E4\BA\8C\00\00", [5 x i8] c"\E4\B8\89\00\00", [5 x i8] c"\E5\9B\9B\00\00", [5 x i8] c"\E4\BA\94\00\00", [5 x i8] c"\E5\85\AD\00\00", [5 x i8] c"\E4\B8\83\00\00", [5 x i8] c"\E5\85\AB\00\00", [5 x i8] c"\E4\B9\9D\00\00"]
@.str = [3 x i8] c"%s\00"
define void @toChinese(i8 signext %0) {
%2 = alloca i8
%3 = alloca [10 x [5 x i8]]
store i8 %0, i8* %2
%4 = bitcast [10 x [5 x i8]]* %3 to i8*
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %6, 48
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [10 x [5 x i8]], [10 x [5 x i8]]* %3, i64 0, i64 %8
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %9, i64 0, i64 0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %10)
ret void
}

LLVM IR (-O2):
@__const.toChinese.ch = [10 x [5 x i8]] [[5 x i8] c"\E9\9B\B6\00\00", [5 x i8] c"\E4\B8\80\00\00", [5 x i8] c"\E4\BA\8C\00\00", [5 x i8] c"\E4\B8\89\00\00", [5 x i8] c"\E5\9B\9B\00\00", [5 x i8] c"\E4\BA\94\00\00", [5 x i8] c"\E5\85\AD\00\00", [5 x i8] c"\E4\B8\83\00\00", [5 x i8] c"\E5\85\AB\00\00", [5 x i8] c"\E4\B9\9D\00\00"]
@.str = [3 x i8] c"%s\00"
define void @toChinese(i8 signext %0) {
%2 = alloca [10 x [5 x i8]]
%3 = getelementptr inbounds [10 x [5 x i8]], [10 x [5 x i8]]* %2, i64 0, i64 0, i64 0
%4 = sext i8 %0 to i64
%5 = add nsw i64 %4, -48
%6 = getelementptr inbounds [10 x [5 x i8]], [10 x [5 x i8]]* %2, i64 0, i64 %5, i64 0
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void os_flush_stdout(void) { fflush(stdout); }


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

x86 assembly (clang, -O2):
<os_flush_stdout>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fflush@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
define void @os_flush_stdout() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ assume(int);
int main() {
  int i;
  int k;
  int n;
  assume(i == 0 && k == n && n >= 0);
  while (i < n) {
    k--;
    i += 2;
  }
  assert(2 * k >= n - 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
jne    1159 <main+0x39>
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
cmp    -0x10(%rbp),%ecx
mov    %al,-0x11(%rbp)
jne    1159 <main+0x39>
cmpl   $0x0,-0x10(%rbp)
setge  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1189 <main+0x69>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1166 <main+0x46>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <assume@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %0
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* %4
%13 = icmp sge i32 %12, 0
br label %14
14: ; preds = %11, %7, %0
%15 = phi i1 [ false, %7 ], [ false, %0 ], [ %13, %11 ]
%16 = zext i1 %15 to i32
%17 = call i32 @assume(i32 %16)
br label %18
18: ; preds = %22, %14
%19 = load i32, i32* %2
%20 = load i32, i32* %4
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %27
22: ; preds = %18
%23 = load i32, i32* %3
%24 = add nsw i32 %23, -1
store i32 %24, i32* %3
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 2
store i32 %26, i32* %2
br label %18
27: ; preds = %18
%28 = load i32, i32* %3
%29 = mul nsw i32 2, %28
%30 = load i32, i32* %4
%31 = sub nsw i32 %30, 1
%32 = icmp sge i32 %29, %31
%33 = zext i1 %32 to i32
%34 = call i32 @assert(i32 %33)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assume(i32 0)
%2 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int execvp(const char *file, char *const argv[]) {
  fprintf(stderr, "\nAccess to dangerous function %s() denied.\n", "execvp");
  assert(0);
  ;
}


x86 assembly (clang, -O0):
<execvp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
lea    0xee5(%rip),%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execvp>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xef4(%rip),%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"\0AAccess to dangerous function %s() denied.\0A\00"
@.str.1 = [7 x i8] c"execvp\00"
define i32 @execvp(i8* %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8**
store i8* %0, i8** %4
store i8** %1, i8*** %5
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @assert(i32 0)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"\0AAccess to dangerous function %s() denied.\0A\00"
@.str.1 = [7 x i8] c"execvp\00"
define i32 @execvp(i8* nocapture readnone %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @assert(i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ compare_results(unsigned char *, unsigned char *, int);
int /*<<< orphan*/ printf(unsigned char *);
int check_test(unsigned char *result0, unsigned char *result1, int length,
               unsigned char *errormsg) {
  if (!compare_results(result0, result1, length)) {
    printf(errormsg);
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<check_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <compare_results@plt>
cmp    $0x0,%eax
jne    1165 <check_test+0x45>
mov    -0x28(%rbp),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    116c <check_test+0x4c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_test>:
push   %rbx
mov    %rcx,%rbx
call   1040 <compare_results@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
je     1136 <check_test+0x16>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @check_test(i8* %0, i8* %1, i32 %2, i8* nocapture %3) {
%5 = tail call i32 @compare_results(i8* %0, i8* %1, i32 %2)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @printf(i8* dereferenceable(1) %3)
br label %9
9: ; preds = %4, %7
%10 = phi i32 [ 0, %7 ], [ 1, %4 ]
ret i32 %10
}
/* Variables and functions */
double frexp(double, int *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, double *);
main() {
  int i;
  double x;
  double m;
  scanf("%lf", &x);
  m = frexp(x, &i);
  printf("%d", i - 1);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1050 <scanf@plt>
movsd  0x10(%rsp),%xmm0
lea    0xc(%rsp),%rdi
call   1040 <frexp@plt>
mov    0xc(%rsp),%esi
add    $0xffffffff,%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%6 = load double, double* %3
%7 = call double @frexp(double %6, i32* %2)
store double %7, double* %4
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 1
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = bitcast i32* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%6 = load double, double* %2
%7 = call double @frexp(double %6, i32* %1)
%8 = load i32, i32* %1
%9 = add nsw i32 %8, -1
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ xlosConsolePutC(int /*<<< orphan*/);
void xlosConsolePutS(char *str) {
  while (*str)
    xlosConsolePutC(*str++);
}


x86 assembly (clang, -O0):
<xlosConsolePutS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <xlosConsolePutS+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <xlosConsolePutC@plt>
jmp    111c <xlosConsolePutS+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xlosConsolePutS>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <xlosConsolePutS+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <xlosConsolePutC@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <xlosConsolePutS+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @xlosConsolePutS(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @xlosConsolePutC(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
double __subdf3(double a, double b) {
  long nb[2];
  nb[1] = ((const long *)&b)[1] ^ 0x80000000;
  nb[0] = ((const long *)&b)[0];
  return a + *(const double *)nb;
}


x86 assembly (clang, -O0):
<__subdf3>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movabs $0x80000000,%rax
xor    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__subdf3>:
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @__subdf3(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca [2 x i64]
store double %0, double* %3
store double %1, double* %4
%6 = bitcast double* %4 to i64*
%7 = getelementptr inbounds i64, i64* %6, i64 1
%8 = load i64, i64* %7
%9 = xor i64 %8, 2147483648
%10 = getelementptr inbounds [2 x i64], [2 x i64]* %5, i64 0, i64 1
store i64 %9, i64* %10
%11 = bitcast double* %4 to i64*
%12 = getelementptr inbounds i64, i64* %11, i64 0
%13 = load i64, i64* %12
%14 = getelementptr inbounds [2 x i64], [2 x i64]* %5, i64 0, i64 0
store i64 %13, i64* %14
%15 = load double, double* %3
%16 = getelementptr inbounds [2 x i64], [2 x i64]* %5, i64 0, i64 0
%17 = bitcast i64* %16 to double*
%18 = load double, double* %17
%19 = fadd double %15, %18
ret double %19
}

LLVM IR (-O2):
define double @__subdf3(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xee() {
  Assert_real((isalpha(238) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              1195, ("isalpha should be 0 for 0xee"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xee\00"
define void @t_isalpha_0xee() {
%1 = tail call i64 @isalpha(i32 238)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1195, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFD;
int /*<<< orphan*/ F_SETFD;
int fcntl(int, int /*<<< orphan*/, ...);
int setfd(int fd, int flag) {
  int flags = fcntl(fd, F_GETFD);
  flags |= flag;
  return fcntl(fd, F_SETFD, flags);
}


x86 assembly (clang, -O0):
<setfd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
mov    $0x0,%al
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setfd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    0x2eba(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1030 <fcntl@plt>
or     %eax,%ebx
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    %ebp,%edi
mov    %ebx,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_GETFD = global i32 0
@F_SETFD = global i32 0
define i32 @setfd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* @F_GETFD
%8 = call i32 (i32, i32, ...) @fcntl(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = or i32 %10, %9
store i32 %11, i32* %5
%12 = load i32, i32* %3
%13 = load i32, i32* @F_SETFD
%14 = load i32, i32* %5
%15 = call i32 (i32, i32, ...) @fcntl(i32 %12, i32 %13, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
@F_GETFD = global i32 0
@F_SETFD = global i32 0
define i32 @setfd(i32 %0, i32 %1) {
%3 = load i32, i32* @F_GETFD
%4 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %3)
%5 = or i32 %4, %1
%6 = load i32, i32* @F_SETFD
%7 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %6, i32 %5)
ret i32 %7
}
char *get_google_station_datatype_name(char *station, char *datatype) {
  char station_datatype_name[128];
  sprintf(station_datatype_name, "%s%c%s", station, '/', datatype);
  return strdup(station_datatype_name);
}


x86 assembly (clang, -O0):
<get_google_station_datatype_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%r8
lea    0xeb7(%rip),%rsi
mov    $0x2f,%ecx
mov    $0x0,%al
call   1030 <sprintf@plt>
lea    -0x90(%rbp),%rdi
call   1040 <strdup@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_google_station_datatype_name>:
push   %rbx
sub    $0x80,%rsp
mov    %rsi,%r8
mov    %rdi,%rdx
lea    0xecb(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x2f,%ecx
xor    %eax,%eax
call   1030 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <strdup@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%s%c%s\00"
define i8* @get_google_station_datatype_name(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [128 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 (i8*, i8*, ...) @sprintf(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %7, i32 47, i8* %8)
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%11 = call i8* @strdup(i8* %10)
ret i8* %11
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s%c%s\00"
define noalias i8* @get_google_station_datatype_name(i8* %0, i8* %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 (i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i32 47, i8* %1)
%6 = call i8* @strdup(i8* %4)
ret i8* %6
}
/* Variables and functions */
char *strchr(char *, char);
char *popCommaName(char *s) {
  char *t;
  if (s == NULL || *s == '\0')
    return NULL;
  t = strchr(s, ',');
  if (!t)
    return NULL;
  *t = '\0';
  return t + 1;
}


x86 assembly (clang, -O0):
<popCommaName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1137 <popCommaName+0x27>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1144 <popCommaName+0x34>
movq   $0x0,-0x8(%rbp)
jmp    1181 <popCommaName+0x71>
mov    -0x10(%rbp),%rdi
mov    $0x2c,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116e <popCommaName+0x5e>
movq   $0x0,-0x8(%rbp)
jmp    1181 <popCommaName+0x71>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<popCommaName>:
push   %rax
test   %rdi,%rdi
je     1133 <popCommaName+0x23>
cmpb   $0x0,(%rdi)
je     1133 <popCommaName+0x23>
mov    $0x2c,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1133 <popCommaName+0x23>
movb   $0x0,(%rax)
add    $0x1,%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @popCommaName(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = tail call i8* @strchr(i8* %0, i8 signext 44)
%8 = icmp eq i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %6
store i8 0, i8* %7
%10 = getelementptr inbounds i8, i8* %7, i64 1
br label %11
11: ; preds = %6, %1, %3, %9
%12 = phi i8* [ %10, %9 ], [ null, %3 ], [ null, %1 ], [ null, %6 ]
ret i8* %12
}
/* Variables and functions */
int getline_alt(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  int maxline = 1000;
  int len;
  char line[maxline];
  while ((len = getline_alt(line, maxline)) > 0) {
    printf("%s", line);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3e8,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1040 <getline_alt@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jle    1189 <main+0x69>
mov    -0x28(%rbp),%rsi
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
jmp    115c <main+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <getline_alt@plt>
test   %eax,%eax
jle    116c <main+0x4c>
lea    0xebe(%rip),%r14
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <getline_alt@plt>
test   %eax,%eax
jg     1150 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
store i32 0, i32* %1
store i32 1000, i32* %2
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %4
%9 = alloca i8, i64 %7
store i64 %7, i64* %5
br label %10
10: ; preds = %14, %0
%11 = load i32, i32* %2
%12 = call i32 @getline_alt(i8* %9, i32 %11)
store i32 %12, i32* %3
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %10
16: ; preds = %10
store i32 0, i32* %1
%17 = load i8*, i8** %4
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @getline_alt(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %0, %5
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%7 = call i32 @getline_alt(i8* %2, i32 1000)
%8 = icmp sgt i32 %7, 0
br i1 %8, label %5, label %9
9: ; preds = %5, %0
ret i32 0
}
long long gi4(long long j, unsigned short *b, int i) { return j + b[i]; }


x86 assembly (clang, -O0):
<gi4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movzwl (%rcx,%rdx,2),%ecx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gi4>:
movslq %edx,%rax
movzwl (%rsi,%rax,2),%eax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @gi4(i64 %0, i16* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i16*
%6 = alloca i32
store i64 %0, i64* %4
store i16* %1, i16** %5
store i32 %2, i32* %6
%7 = load i64, i64* %4
%8 = load i16*, i16** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i16, i16* %8, i64 %10
%12 = load i16, i16* %11
%13 = zext i16 %12 to i64
%14 = add nsw i64 %7, %13
ret i64 %14
}

LLVM IR (-O2):
define i64 @gi4(i64 %0, i16* nocapture %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i16, i16* %1, i64 %4
%6 = load i16, i16* %5
%7 = zext i16 %6 to i64
%8 = add nsw i64 %7, %0
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned char);
int /*<<< orphan*/ writeLint(char *, unsigned long);
int setPeriodPWM(unsigned char n, unsigned long int period) {
  char f[40];
  sprintf(f, "/sys/class/pwm/pwmchip0/pwm%d/period", n);
  writeLint(f, period);
}


x86 assembly (clang, -O0):
<setPeriodPWM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xec3(%rip),%rsi
movzbl -0x5(%rbp),%edx
call   1040 <sprintf@plt>
lea    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <writeLint@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setPeriodPWM>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
mov    %edi,%edx
lea    0xecd(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <sprintf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <writeLint@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [37 x i8] c"/sys/class/pwm/pwmchip0/pwm%d/period\00"
define i32 @setPeriodPWM(i8 zeroext %0, i64 %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i64
%6 = alloca [40 x i8]
store i8 %0, i8* %4
store i64 %1, i64* %5
%7 = getelementptr inbounds [40 x i8], [40 x i8]* %6, i64 0, i64 0
%8 = load i8, i8* %4
%9 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8 zeroext %8)
%10 = getelementptr inbounds [40 x i8], [40 x i8]* %6, i64 0, i64 0
%11 = load i64, i64* %5
%12 = call i32 @writeLint(i8* %10, i64 %11)
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@.str = [37 x i8] c"/sys/class/pwm/pwmchip0/pwm%d/period\00"
define i32 @setPeriodPWM(i8 zeroext %0, i64 %1) {
%3 = alloca [40 x i8]
%4 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8 zeroext %0)
%6 = call i32 @writeLint(i8* %4, i64 %1)
ret i32 undef
}
int do_739() { return 739; }


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

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

LLVM IR (-O0):
define i32 @do_739() {
ret i32 739
}

LLVM IR (-O2):
define i32 @do_739() {
ret i32 739
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_BLOCK;
scalar_t__ sigaddset(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int sighold(int sig) {
  sigset_t mask;
  sigemptyset(&mask);
  if (sigaddset(&mask, sig) < 0)
    return -1;
  return sigprocmask(SIG_BLOCK, &mask, NULL);
}


x86 assembly (clang, -O0):
<sighold>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <sigemptyset@plt>
mov    -0x8(%rbp),%esi
lea    -0xc(%rbp),%rdi
call   1050 <sigaddset@plt>
cmp    $0x0,%rax
jge    1166 <sighold+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    117f <sighold+0x4f>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
lea    -0xc(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sighold>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1040 <sigemptyset@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1050 <sigaddset@plt>
test   %rax,%rax
js     1169 <sighold+0x39>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0x4(%rsp),%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
jmp    116e <sighold+0x3e>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SIG_BLOCK = global i32 0
define i32 @sighold(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = call i32 @sigemptyset(i32* %4)
%6 = load i32, i32* %3
%7 = call i64 @sigaddset(i32* %4, i32 %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %13
10: ; preds = %1
%11 = load i32, i32* @SIG_BLOCK
%12 = call i32 @sigprocmask(i32 %11, i32* %4, i32* null)
store i32 %12, i32* %2
br label %13
13: ; preds = %10, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@SIG_BLOCK = global i32 0
define i32 @sighold(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sigemptyset(i32* %2)
%5 = call i64 @sigaddset(i32* %2, i32 %0)
%6 = icmp slt i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i32, i32* @SIG_BLOCK
%9 = call i32 @sigprocmask(i32 %8, i32* %2, i32* null)
br label %10
10: ; preds = %1, %7
%11 = phi i32 [ %9, %7 ], [ -1, %1 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ *BIO_new(int /*<<< orphan*/);
int /*<<< orphan*/ BIO_s_tou_socket();
int /*<<< orphan*/ BIO_set_fd(int /*<<< orphan*/ *, int, int);
BIO *BIO_new_tou_socket(int fd, int close_flag) {
  BIO *ret;
  ret = BIO_new(BIO_s_tou_socket());
  if (ret == NULL)
    return (NULL);
  BIO_set_fd(ret, fd, close_flag);
  return (ret);
}


x86 assembly (clang, -O0):
<BIO_new_tou_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <BIO_s_tou_socket@plt>
mov    %eax,%edi
call   1040 <BIO_new@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1168 <BIO_new_tou_socket+0x38>
movq   $0x0,-0x8(%rbp)
jmp    117f <BIO_new_tou_socket+0x4f>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1050 <BIO_set_fd@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BIO_new_tou_socket>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <BIO_s_tou_socket@plt>
mov    %eax,%edi
call   1040 <BIO_new@plt>
mov    %rax,%rbx
test   %rax,%rax
je     115c <BIO_new_tou_socket+0x2c>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1050 <BIO_set_fd@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32* @BIO_new_tou_socket(i32 %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = call i32 (...) @BIO_s_tou_socket()
%8 = call i32* @BIO_new(i32 %7)
store i32* %8, i32** %6
%9 = load i32*, i32** %6
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %12
11: ; preds = %2
store i32* null, i32** %3
br label %18
12: ; preds = %2
%13 = load i32*, i32** %6
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = call i32 @BIO_set_fd(i32* %13, i32 %14, i32 %15)
%17 = load i32*, i32** %6
store i32* %17, i32** %3
br label %18
18: ; preds = %12, %11
%19 = load i32*, i32** %3
ret i32* %19
}

LLVM IR (-O2):
define i32* @BIO_new_tou_socket(i32 %0, i32 %1) {
%3 = tail call i32 (...) @BIO_s_tou_socket()
%4 = tail call i32* @BIO_new(i32 %3)
%5 = icmp eq i32* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @BIO_set_fd(i32* %4, i32 %0, i32 %1)
br label %8
8: ; preds = %2, %6
ret i32* %4
}
int test_imm_2Eint16_mem(short *val) {
  return ((*val) & (-0x2E << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_2Eint16_mem>:
movzwl (%rdi),%eax
test   $0xffd2,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_2Eint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -46
%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_2Eint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -46
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void wifi_rsp_sme_set_operating_mode(
    const struct wifi_msg_sme_set_operating_mode_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_sme_set_operating_mode_rsp_t = type opaque
define void @wifi_rsp_sme_set_operating_mode(%struct.wifi_msg_sme_set_operating_mode_rsp_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
void port_convert_system_error_message_to_utf8(char *converted_message,
                                               int buffer_size,
                                               char *system_message) {
  strncpy(converted_message, system_message, buffer_size - 1);
  converted_message[buffer_size - 1] = '\0';
}


x86 assembly (clang, -O0):
<port_convert_system_error_message_to_utf8>:
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    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<port_convert_system_error_message_to_utf8>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movslq %esi,%rbx
lea    -0x1(%rbx),%rax
mov    %rdx,%rsi
mov    %eax,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%r14,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @port_convert_system_error_message_to_utf8(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %6
%9 = load i32, i32* %5
%10 = sub nsw i32 %9, 1
%11 = call i32 @strncpy(i8* %7, i8* %8, i32 %10)
%12 = load i8*, i8** %4
%13 = load i32, i32* %5
%14 = sub nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %12, i64 %15
store i8 0, i8* %16
ret void
}

LLVM IR (-O2):
define void @port_convert_system_error_message_to_utf8(i8* %0, i32 %1, i8* %2) {
%4 = add nsw i32 %1, -1
%5 = tail call i32 @strncpy(i8* %0, i8* %2, i32 %4)
%6 = sext i32 %4 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %7
ret void
}
void _show_desc_list_cfg(void) { return; }


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

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

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

LLVM IR (-O2):
define void @_show_desc_list_cfg() {
ret void
}