xunge/DecIR huggingface dataset:
/* Type definitions */
struct predicate {
  int dummy;
};

/* Variables and functions */
bool pred_closeparen(const char *path, int flags, struct predicate *pred) {
  return true;
}


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

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

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

LLVM IR (-O2):
%struct.predicate = type { i32 }
define i32 @pred_closeparen(i8* nocapture readnone %0, i32 %1, %struct.predicate* nocapture readnone %2) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ mj_println(int);
void mj_main() { mj_println(10); }


x86 assembly (clang, -O0):
<mj_main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <mj_println@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mj_main>:
mov    $0xa,%edi
jmp    1030 <mj_println@plt>

LLVM IR (-O0):
define void @mj_main() {
%1 = call i32 @mj_println(i32 10)
ret void
}

LLVM IR (-O2):
define void @mj_main() {
%1 = tail call i32 @mj_println(i32 10)
ret void
}
/* Variables and functions */
char cBlockComment();
char cLineComment();
int /*<<< orphan*/ errc(char *, char);
char ccom(char c) {
  if (c == '*')
    return cBlockComment();
  if (c == '/')
    return cLineComment();
  else
    errc("not a comment start /", c);
  return c;
}


x86 assembly (clang, -O0):
<ccom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x2a,%eax
jne    115a <ccom+0x2a>
mov    $0x0,%al
call   1040 <cBlockComment@plt>
mov    %al,-0x1(%rbp)
jmp    118c <ccom+0x5c>
movsbl -0x2(%rbp),%eax
cmp    $0x2f,%eax
jne    1176 <ccom+0x46>
mov    $0x0,%al
call   1030 <cLineComment@plt>
mov    %al,-0x1(%rbp)
jmp    118c <ccom+0x5c>
lea    0xe83(%rip),%rdi
movsbl -0x2(%rbp),%esi
call   1050 <errc@plt>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccom>:
push   %rbx
mov    %edi,%ebx
cmp    $0x2f,%bl
je     1145 <ccom+0x15>
cmp    $0x2a,%bl
jne    114d <ccom+0x1d>
xor    %eax,%eax
pop    %rbx
jmp    1040 <cBlockComment@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <cLineComment@plt>
movsbl %bl,%esi
lea    0xea9(%rip),%rdi
call   1050 <errc@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"not a comment start /\00"
define signext i8 @ccom(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 42
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call signext i8 (...) @cBlockComment()
store i8 %8, i8* %2
br label %20
9: ; preds = %1
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 47
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = call signext i8 (...) @cLineComment()
store i8 %14, i8* %2
br label %20
15: ; preds = %9
%16 = load i8, i8* %3
%17 = call i32 @errc(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8 signext %16)
br label %18
18: ; preds = %15
%19 = load i8, i8* %3
store i8 %19, i8* %2
br label %20
20: ; preds = %18, %13, %7
%21 = load i8, i8* %2
ret i8 %21
}

LLVM IR (-O2):
@.str = [22 x i8] c"not a comment start /\00"
define signext i8 @ccom(i8 signext %0) {
switch i8 %0, label %6 [
i8 42, label %2
i8 47, label %4
]
2: ; preds = %1
%3 = tail call signext i8 (...) @cBlockComment()
br label %8
4: ; preds = %1
%5 = tail call signext i8 (...) @cLineComment()
br label %8
6: ; preds = %1
%7 = tail call i32 @errc(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8 signext %0)
br label %8
8: ; preds = %6, %4, %2
%9 = phi i8 [ %3, %2 ], [ %5, %4 ], [ %0, %6 ]
ret i8 %9
}
/* Variables and functions */
int f_time_processing(int, unsigned char **, float *, unsigned int, char *,
                      void **, char *, char *, char const *, char const *);
int f_ave(int mode, unsigned char **sec, float *data, unsigned int ndata,
          char *inv_out, void **local, const char *arg1, const char *arg2) {
  return f_time_processing(mode, sec, data, ndata, inv_out, local, "0", "1",
                           arg1, arg2);
}


x86 assembly (clang, -O0):
<f_ave>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x58,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x30(%rbp),%r8
mov    -0x38(%rbp),%r9
mov    0x10(%rbp),%r10
mov    0x18(%rbp),%rax
lea    0xea4(%rip),%rbx
lea    0xe9f(%rip),%r11
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
call   1030 <f_time_processing@plt>
add    $0x58,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_ave>:
sub    $0x28,%rsp
movaps 0x30(%rsp),%xmm0
movups %xmm0,0x10(%rsp)
lea    0xedd(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0xecf(%rip),%rax
mov    %rax,(%rsp)
call   1030 <f_time_processing@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"0\00"
@.str.1 = [2 x i8] c"1\00"
define i32 @f_ave(i32 %0, i8** %1, float* %2, i32 %3, i8* %4, i8** %5, i8* %6, i8* %7) {
%9 = alloca i32
%10 = alloca i8**
%11 = alloca float*
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i8**
%15 = alloca i8*
%16 = alloca i8*
store i32 %0, i32* %9
store i8** %1, i8*** %10
store float* %2, float** %11
store i32 %3, i32* %12
store i8* %4, i8** %13
store i8** %5, i8*** %14
store i8* %6, i8** %15
store i8* %7, i8** %16
%17 = load i32, i32* %9
%18 = load i8**, i8*** %10
%19 = load float*, float** %11
%20 = load i32, i32* %12
%21 = load i8*, i8** %13
%22 = load i8**, i8*** %14
%23 = load i8*, i8** %15
%24 = load i8*, i8** %16
%25 = call i32 @f_time_processing(i32 %17, i8** %18, float* %19, i32 %20, i8* %21, i8** %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* %23, i8* %24)
ret i32 %25
}

LLVM IR (-O2):
@.str = [2 x i8] c"0\00"
@.str.1 = [2 x i8] c"1\00"
define i32 @f_ave(i32 %0, i8** %1, float* %2, i32 %3, i8* %4, i8** %5, i8* %6, i8* %7) {
%9 = tail call i32 @f_time_processing(i32 %0, i8** %1, float* %2, i32 %3, i8* %4, i8** %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* %6, i8* %7)
ret i32 %9
}
int count(int n) {
  if (n == 1) {
    return 1;
  } else if (n == 2) {
    return 2;
  } else {
    return count(n - 1) + count(n - 2);
  }
}


x86 assembly (clang, -O0):
<count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1131 <count+0x21>
movl   $0x1,-0x4(%rbp)
jmp    116a <count+0x5a>
cmpl   $0x2,-0x8(%rbp)
jne    1147 <count+0x37>
movl   $0x2,-0x4(%rbp)
jmp    116a <count+0x5a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <count@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <count@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
lea    -0x1(%rbx),%edi
cmp    $0x2,%edi
jb     1134 <count+0x24>
call   1030 <count@plt>
add    $0xfffffffe,%ebx
add    %eax,%ebp
jmp    1120 <count+0x10>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @count(i32 %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i32 [ 0, %1 ], [ %11, %7 ]
%4 = phi i32 [ %0, %1 ], [ %10, %7 ]
%5 = add i32 %4, -1
%6 = icmp ult i32 %5, 2
br i1 %6, label %12, label %7
7: ; preds = %2
%8 = add nsw i32 %4, -1
%9 = tail call i32 @count(i32 %8)
%10 = add nsw i32 %4, -2
%11 = add nsw i32 %9, %3
br label %2
12: ; preds = %2
%13 = add nsw i32 %4, %3
ret i32 %13
}
/* Variables and functions */
int IPC_CREAT;
int *shmat(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
int shmget(int, int, int);
int /*<<< orphan*/ wait(int /*<<< orphan*/ *);
void myHandler(int p) {
  wait(NULL);
  int shmid = shmget(1234, 512, IPC_CREAT | 0644);
  int *max = shmat(shmid, NULL, 0);
  (*max)--;
  return;
}


x86 assembly (clang, -O0):
<myHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <wait@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edx
or     $0x1a4,%edx
mov    $0x4d2,%edi
mov    $0x200,%esi
call   1040 <shmget@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <shmat@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0xffffffff,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myHandler>:
push   %rax
xor    %edi,%edi
call   1050 <wait@plt>
mov    0x2ea1(%rip),%rax
mov    $0x1a4,%edx
or     (%rax),%edx
mov    $0x4d2,%edi
mov    $0x200,%esi
call   1040 <shmget@plt>
mov    %eax,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <shmat@plt>
addl   $0xffffffff,(%rax)
pop    %rax
ret

LLVM IR (-O0):
@IPC_CREAT = global i32 0
define void @myHandler(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %2
%5 = call i32 @wait(i32* null)
%6 = load i32, i32* @IPC_CREAT
%7 = or i32 %6, 420
%8 = call i32 @shmget(i32 1234, i32 512, i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32* @shmat(i32 %9, i32* null, i32 0)
store i32* %10, i32** %4
%11 = load i32*, i32** %4
%12 = load i32, i32* %11
%13 = add nsw i32 %12, -1
store i32 %13, i32* %11
ret void
}

LLVM IR (-O2):
@IPC_CREAT = global i32 0
define void @myHandler(i32 %0) {
%2 = tail call i32 @wait(i32* null)
%3 = load i32, i32* @IPC_CREAT
%4 = or i32 %3, 420
%5 = tail call i32 @shmget(i32 1234, i32 512, i32 %4)
%6 = tail call i32* @shmat(i32 %5, i32* null, i32 0)
%7 = load i32, i32* %6
%8 = add nsw i32 %7, -1
store i32 %8, i32* %6
ret void
}
/* Variables and functions */
void *CreateV4l2Context();
void *CreateCameraContext() { return CreateV4l2Context(); }


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

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

LLVM IR (-O0):
define i8* @CreateCameraContext() {
%1 = call i8* (...) @CreateV4l2Context()
ret i8* %1
}

LLVM IR (-O2):
define i8* @CreateCameraContext() {
%1 = tail call i8* (...) @CreateV4l2Context()
ret i8* %1
}
int finenumbit(int num) {
  if (num == 0) {
    return -1;
  }
  return finenumbit(num / 2) + 1;
}


x86 assembly (clang, -O0):
<finenumbit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <finenumbit+0x21>
movl   $0xffffffff,-0x4(%rbp)
jmp    1149 <finenumbit+0x39>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <finenumbit@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<finenumbit>:
mov    $0xffffffff,%eax
test   %edi,%edi
je     1124 <finenumbit+0x24>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
shr    $0x1f,%ecx
add    %edi,%ecx
sar    %ecx
add    $0x1,%edi
add    $0x1,%eax
cmp    $0x2,%edi
mov    %ecx,%edi
ja     1110 <finenumbit+0x10>
ret

LLVM IR (-O0):
define i32 @finenumbit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -1, i32* %2
br label %12
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sdiv i32 %8, 2
%10 = call i32 @finenumbit(i32 %9)
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %12
12: ; preds = %7, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @finenumbit(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = sdiv i32 %4, 2
%7 = add nuw nsw i32 %5, 1
%8 = add i32 %4, 1
%9 = icmp ult i32 %8, 3
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ -1, %1 ], [ %5, %3 ]
ret i32 %11
}
/* Variables and functions */
float floor(float);
float mod(float x, float base) { return x - floor(x / base) * base; }


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
movss  -0xc(%rbp),%xmm1
movss  -0x8(%rbp),%xmm2
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
push   %rax
movss  %xmm1,(%rsp)
movss  %xmm0,0x4(%rsp)
divss  %xmm1,%xmm0
call   1030 <floorf@plt>
mulss  (%rsp),%xmm0
movss  0x4(%rsp),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @mod(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %3
%7 = load float, float* %4
%8 = fdiv float %6, %7
%9 = call float @floor(float %8)
%10 = load float, float* %4
%11 = fneg float %9
%12 = call float @llvm.fmuladd.f32(float %11, float %10, float %5)
ret float %12
}

LLVM IR (-O2):
define float @mod(float %0, float %1) {
%3 = fdiv float %0, %1
%4 = tail call float @llvm.floor.f32(float %3)
%5 = fneg float %4
%6 = tail call float @llvm.fmuladd.f32(float %5, float %1, float %0)
ret float %6
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_BLOCK;
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
void sys_sigblock(int sig) {
  sigset_t mask;
  sigemptyset(&mask);
  sigaddset(&mask, sig);
  sigprocmask(SIG_BLOCK, &mask, (sigset_t *)NULL);
}


x86 assembly (clang, -O0):
<sys_sigblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <sigemptyset@plt>
mov    -0x4(%rbp),%esi
lea    -0x8(%rbp),%rdi
call   1050 <sigaddset@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_sigblock>:
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>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
mov    %r14,%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SIG_BLOCK = global i32 0
define void @sys_sigblock(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @sigemptyset(i32* %3)
%5 = load i32, i32* %2
%6 = call i32 @sigaddset(i32* %3, i32 %5)
%7 = load i32, i32* @SIG_BLOCK
%8 = call i32 @sigprocmask(i32 %7, i32* %3, i32* null)
ret void
}

LLVM IR (-O2):
@SIG_BLOCK = global i32 0
define void @sys_sigblock(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sigemptyset(i32* %2)
%5 = call i32 @sigaddset(i32* %2, i32 %0)
%6 = load i32, i32* @SIG_BLOCK
%7 = call i32 @sigprocmask(i32 %6, i32* %2, i32* null)
ret void
}
void __attribute__((visibility("default"))) tsdrplugin_cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @tsdrplugin_cleanup() {
ret void
}
int fun(int x) {
  int i;
  int count = 0;
  int number_of_reds_to_consume = 5;
  (void)number_of_reds_to_consume;
  for (i = 0; i < 100; i++) {
    count = count + 2;
    ;
  }
  return count + x;
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x5,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    113d <fun+0x3d>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111c <fun+0x1c>
mov    -0xc(%rbp),%eax
add    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
lea    0xc8(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @fun(i32 %0) {
%2 = add nsw i32 %0, 200
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ dhcp_packet(int, char *, int /*<<< orphan*/ *, char *,
                               char *);
void dhcp_inform(char *ipaddr, char *gwaddr, char *hardware) {
  dhcp_packet(8, ipaddr, NULL, gwaddr, hardware);
}


x86 assembly (clang, -O0):
<dhcp_inform>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    $0x8,%edi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <dhcp_packet@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dhcp_inform>:
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rsi
mov    $0x8,%edi
xor    %edx,%edx
jmp    1030 <dhcp_packet@plt>

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

LLVM IR (-O2):
define void @dhcp_inform(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @dhcp_packet(i32 8, i8* %0, i32* null, i8* %1, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ triple(char *);
int main() {
  triple("/testbin/sort");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"/testbin/sort\00"
define i32 @main() {
%1 = tail call i32 @triple(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ localme(int, char *);
int /*<<< orphan*/ localyou(int, char *);
int main(int argc, char *argv[]) {
  localme(10, "cxxxxxxxx");
  localyou(10, "cxxxxxxxx");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xa,%edi
lea    0xec5(%rip),%rsi
call   1040 <localme@plt>
mov    $0xa,%edi
lea    0xeb4(%rip),%rsi
call   1030 <localyou@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    $0xa,%edi
mov    %rbx,%rsi
call   1040 <localme@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1030 <localyou@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"cxxxxxxxx\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @localme(i32 10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @localyou(i32 10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"cxxxxxxxx\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @localme(i32 10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @localyou(i32 10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
float abs(float);
float saturate(float);
float GetOrientationAdaptiveScaleFactor(float fEdgeDotProduct,
                                        float fSilhouetteEpsilon) {
  float fScale = 1.0f - abs(fEdgeDotProduct);
  fScale =
      saturate((fScale - fSilhouetteEpsilon) / (1.0f - fSilhouetteEpsilon));
  return fScale;
}


x86 assembly (clang, -O0):
<GetOrientationAdaptiveScaleFactor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <abs@plt>
movaps %xmm0,%xmm1
movss  0xeb9(%rip),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  0xe9e(%rip),%xmm1
subss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
call   1040 <saturate@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetOrientationAdaptiveScaleFactor>:
push   %rax
movss  %xmm1,0x4(%rsp)
call   1030 <abs@plt>
movss  0xecc(%rip),%xmm2
movaps %xmm2,%xmm1
subss  %xmm0,%xmm1
movss  0x4(%rsp),%xmm0
subss  %xmm0,%xmm1
subss  %xmm0,%xmm2
divss  %xmm2,%xmm1
movaps %xmm1,%xmm0
pop    %rax
jmp    1040 <saturate@plt>

LLVM IR (-O0):
define float @GetOrientationAdaptiveScaleFactor(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = call float @abs(float %6)
%8 = fsub float 1.000000e+00, %7
store float %8, float* %5
%9 = load float, float* %5
%10 = load float, float* %4
%11 = fsub float %9, %10
%12 = load float, float* %4
%13 = fsub float 1.000000e+00, %12
%14 = fdiv float %11, %13
%15 = call float @saturate(float %14)
store float %15, float* %5
%16 = load float, float* %5
ret float %16
}

LLVM IR (-O2):
define float @GetOrientationAdaptiveScaleFactor(float %0, float %1) {
%3 = tail call float @abs(float %0)
%4 = fsub float 1.000000e+00, %3
%5 = fsub float %4, %1
%6 = fsub float 1.000000e+00, %1
%7 = fdiv float %5, %6
%8 = tail call float @saturate(float %7)
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_usage(char *name) {
  printf("Usage: %s [-ahtsfmbcru] FILE1 [FILE2] [FILEn]\n\n\t Use the -h "
         "switch for help or see the man page.\n\n",
         name);
}


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

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

LLVM IR (-O0):
@.str = [99 x i8] c"Usage: %s [-ahtsfmbcru] FILE1 [FILE2] [FILEn]\0A\0A\09 Use the -h switch for help or see the man page.\0A\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [99 x i8] c"Usage: %s [-ahtsfmbcru] FILE1 [FILE2] [FILEn]\0A\0A\09 Use the -h switch for help or see the man page.\0A\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int Pop();
int /*<<< orphan*/ Push(int);
int CmdDivide(void) {
  int operand2;
  operand2 = Pop();
  Push(Pop() / operand2);
  return 0;
}


x86 assembly (clang, -O0):
<CmdDivide>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <Pop@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <Pop@plt>
cltd
idivl  -0x4(%rbp)
mov    %eax,%edi
call   1040 <Push@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdDivide>:
push   %rbx
xor    %eax,%eax
call   1030 <Pop@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <Pop@plt>
cltd
idiv   %ebx
mov    %eax,%edi
call   1040 <Push@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @CmdDivide() {
%1 = alloca i32
%2 = call i32 (...) @Pop()
store i32 %2, i32* %1
%3 = call i32 (...) @Pop()
%4 = load i32, i32* %1
%5 = sdiv i32 %3, %4
%6 = call i32 @Push(i32 %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @CmdDivide() {
%1 = tail call i32 (...) @Pop()
%2 = tail call i32 (...) @Pop()
%3 = sdiv i32 %2, %1
%4 = tail call i32 @Push(i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ amaret_local_A1_clear__E();
void pollen_hardware_Led_off__E() {
  { amaret_local_A1_clear__E(); }
}


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

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

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

LLVM IR (-O2):
define void @pollen_hardware_Led_off__E() {
%1 = tail call i32 (...) @amaret_local_A1_clear__E()
ret void
}
int maxi(int x, int y) { return (x > y ? x : y); }


x86 assembly (clang, -O0):
<maxi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <maxi+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <maxi+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxi>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @maxi(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @maxi(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ radix_tree_init_maxindex();
void radix_tree_init(void) { radix_tree_init_maxindex(); }


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

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

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

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

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ GENERAL_NAMES_it;
int i2d_GENERAL_NAMES(GENERAL_NAMES *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &GENERAL_NAMES_it);
}


x86 assembly (clang, -O0):
<i2d_GENERAL_NAMES>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2eb1(%rip),%rdx
call   1030 <ASN1_item_i2d@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2d_GENERAL_NAMES>:
mov    0x2ec9(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

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

LLVM IR (-O2):
@GENERAL_NAMES_it = global i32 0
define i32 @i2d_GENERAL_NAMES(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @GENERAL_NAMES_it)
ret i32 %3
}
char *PolyStrchr(string, class) register char *string;
register char class;
{
  while (*string) {
    if (MatchClass(class, *string)) {
      return (string);
    }
    string++;
  }
  return ((char *)0);
}


x86 assembly (clang, -O0):
<PolyStrchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1168 <PolyStrchr+0x58>
movsbl -0x11(%rbp),%edi
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
mov    $0x0,%al
call   1030 <MatchClass@plt>
cmp    $0x0,%eax
je     1157 <PolyStrchr+0x47>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1170 <PolyStrchr+0x60>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1122 <PolyStrchr+0x12>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PolyStrchr>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     113c <PolyStrchr+0x2c>
mov    %rdi,%rbx
movsbl %sil,%ebp
movsbl %al,%esi
mov    %ebp,%edi
xor    %eax,%eax
call   1030 <MatchClass@plt>
test   %eax,%eax
jne    113e <PolyStrchr+0x2e>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <PolyStrchr+0x10>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @PolyStrchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %17, label %7
7: ; preds = %2, %13
%8 = phi i8 [ %15, %13 ], [ %5, %2 ]
%9 = phi i8* [ %14, %13 ], [ %0, %2 ]
%10 = sext i8 %8 to i32
%11 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @MatchClass to i32 (i32, i32, ...)*)(i32 %4, i32 %10)
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %7
%14 = getelementptr inbounds i8, i8* %9, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %7
17: ; preds = %7, %13, %2
%18 = phi i8* [ null, %2 ], [ null, %13 ], [ %9, %7 ]
ret i8* %18
}
int is_valid_ascii(char c) { return (!(c & 0x80)) && c; }


x86 assembly (clang, -O0):
<is_valid_ascii>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
and    $0x80,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x2(%rbp)
jne    112f <is_valid_ascii+0x2f>
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_ascii>:
xor    %eax,%eax
test   %dil,%dil
setg   %al
ret

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

LLVM IR (-O2):
define i32 @is_valid_ascii(i8 signext %0) {
%2 = icmp sgt i8 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
void rowboat() { printf(1, "Rowboat sent\n"); }


x86 assembly (clang, -O0):
<rowboat>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rowboat>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"Rowboat sent\0A\00"
define void @rowboat() {
%1 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double RAND_MAX;
double rand();
unsigned uniform_rand(unsigned min, unsigned max) {
  if (min == max)
    return min;
  return (min + (unsigned)(max * (rand() / (RAND_MAX + 1.0))));
}


x86 assembly (clang, -O0):
<uniform_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1135 <uniform_rand+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1183 <uniform_rand+0x73>
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
xor    %eax,%eax
call   1030 <rand@plt>
mov    -0x1c(%rbp),%eax
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mov    0x2e87(%rip),%rcx
movsd  (%rcx),%xmm2
movsd  0xe93(%rip),%xmm3
addsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rcx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uniform_rand>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
cmp    %esi,%edi
je     1155 <uniform_rand+0x45>
mov    %esi,%eax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2eb2(%rip),%rax
movsd  (%rax),%xmm1
addsd  0xebe(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  0x8(%rsp),%xmm0
cvttsd2si %xmm0,%rax
add    %ebx,%eax
mov    %eax,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i32 @uniform_rand(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %22
11: ; preds = %2
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = uitofp i32 %13 to double
%15 = call double (...) @rand()
%16 = load double, double* @RAND_MAX
%17 = fadd double %16, 1.000000e+00
%18 = fdiv double %15, %17
%19 = fmul double %14, %18
%20 = fptoui double %19 to i32
%21 = add i32 %12, %20
store i32 %21, i32* %3
br label %22
22: ; preds = %11, %9
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i32 @uniform_rand(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = uitofp i32 %1 to double
%6 = tail call double (...) @rand()
%7 = load double, double* @RAND_MAX
%8 = fadd double %7, 1.000000e+00
%9 = fdiv double %6, %8
%10 = fmul double %9, %5
%11 = fptoui double %10 to i32
%12 = add i32 %11, %0
br label %13
13: ; preds = %2, %4
%14 = phi i32 [ %12, %4 ], [ %0, %2 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ DH;

/* Variables and functions */
int /*<<< orphan*/ *ASN1_item_dup(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ DHparams_it;
DH *DHparams_dup(DH *dh) { return ASN1_item_dup(&DHparams_it, dh); }


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

x86 assembly (clang, -O2):
<DHparams_dup>:
mov    %rdi,%rsi
mov    0x2ece(%rip),%rdi
jmp    1030 <ASN1_item_dup@plt>

LLVM IR (-O0):
@DHparams_it = global i32 0
define i32* @DHparams_dup(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32* @ASN1_item_dup(i32* @DHparams_it, i32* %3)
ret i32* %4
}

LLVM IR (-O2):
@DHparams_it = global i32 0
define i32* @DHparams_dup(i32* %0) {
%2 = tail call i32* @ASN1_item_dup(i32* @DHparams_it, i32* %0)
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void raw_formula_free(void *p) {
  char **str = (char **)p;
  char *real_str = *str;
  if (real_str != NULL) {
    free(real_str);
  }
}


x86 assembly (clang, -O0):
<raw_formula_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1143 <raw_formula_free+0x33>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raw_formula_free>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <raw_formula_free+0xd>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @raw_formula_free(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @free(i8* %3)
br label %7
7: ; preds = %5, %1
ret void
}
int op_preced(const char c) {
  switch (c) {
  case '^':
    return 4;
  case '*':
  case '/':
  case '%':
    return 3;
  case '+':
  case '-':
    return 2;
  case '=':
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<op_preced>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffdb,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x39,%eax
ja     1164 <op_preced+0x64>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x4,-0x4(%rbp)
jmp    116b <op_preced+0x6b>
movl   $0x3,-0x4(%rbp)
jmp    116b <op_preced+0x6b>
movl   $0x2,-0x4(%rbp)
jmp    116b <op_preced+0x6b>
movl   $0x1,-0x4(%rbp)
jmp    116b <op_preced+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_preced>:
add    $0xffffffdb,%edi
cmp    $0x39,%edi
ja     1129 <op_preced+0x29>
mov    $0x4,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x3,%eax
ret
mov    $0x2,%eax
ret
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @op_preced(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %10 [
i32 94, label %6
i32 42, label %7
i32 47, label %7
i32 37, label %7
i32 43, label %8
i32 45, label %8
i32 61, label %9
]
6: ; preds = %1
store i32 4, i32* %2
br label %11
7: ; preds = %1, %1, %1
store i32 3, i32* %2
br label %11
8: ; preds = %1, %1
store i32 2, i32* %2
br label %11
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9, %8, %7, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @op_preced(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %6 [
i32 94, label %7
i32 42, label %3
i32 47, label %3
i32 37, label %3
i32 43, label %4
i32 45, label %4
i32 61, label %5
]
3: ; preds = %1, %1, %1
br label %7
4: ; preds = %1, %1
br label %7
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %6, %5, %4, %3
%8 = phi i32 [ 0, %6 ], [ 1, %5 ], [ 2, %4 ], [ 3, %3 ], [ 4, %1 ]
ret i32 %8
}
/* Type definitions */
struct addrinfo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ freeaddrinfo(struct addrinfo *);
void udp_ainfo_put(struct addrinfo *ainfo) { freeaddrinfo(ainfo); }


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

x86 assembly (clang, -O2):
<udp_ainfo_put>:
jmp    1030 <freeaddrinfo@plt>

LLVM IR (-O0):
%struct.addrinfo = type { i32 }
define void @udp_ainfo_put(%struct.addrinfo* %0) {
%2 = alloca %struct.addrinfo*
store %struct.addrinfo* %0, %struct.addrinfo** %2
%3 = load %struct.addrinfo*, %struct.addrinfo** %2
%4 = call i32 @freeaddrinfo(%struct.addrinfo* %3)
ret void
}

LLVM IR (-O2):
%struct.addrinfo = type { i32 }
define void @udp_ainfo_put(%struct.addrinfo* %0) {
%2 = tail call i32 @freeaddrinfo(%struct.addrinfo* %0)
ret void
}
void xor_swap(int *a, int *b) {
  *a = *a ^ *b;
  *b = *a ^ *b;
  *a = *a ^ *b;
  return;
}


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

x86 assembly (clang, -O2):
<xor_swap>:
mov    (%rsi),%eax
xor    (%rdi),%eax
mov    %eax,(%rdi)
xor    (%rsi),%eax
mov    %eax,(%rsi)
xor    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @xor_swap(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = xor i32 %6, %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = xor i32 %12, %14
%16 = load i32*, i32** %4
store i32 %15, i32* %16
%17 = load i32*, i32** %3
%18 = load i32, i32* %17
%19 = load i32*, i32** %4
%20 = load i32, i32* %19
%21 = xor i32 %18, %20
%22 = load i32*, i32** %3
store i32 %21, i32* %22
ret void
}

LLVM IR (-O2):
define void @xor_swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = xor i32 %4, %3
store i32 %5, i32* %0
%6 = load i32, i32* %1
%7 = xor i32 %6, %5
store i32 %7, i32* %1
%8 = load i32, i32* %0
%9 = xor i32 %8, %7
store i32 %9, i32* %0
ret void
}
unsigned xrop3_197_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = D ^ S;
  stk2 = T | stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_197_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_197_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%edx
shl    $0x8,%edx
or     %esi,%edx
mov    %ecx,%eax
xor    $0xff,%eax
or     %edx,%eax
xor    %ecx,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @xrop3_197_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = xor i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %7
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %6
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = xor i32 %32, -1
store i32 %33, i32* %8
%34 = load i32, i32* %8
ret i32 %34
}

LLVM IR (-O2):
define i32 @xrop3_197_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, 255
%8 = or i32 %6, %7
%9 = xor i32 %4, %8
%10 = xor i32 %9, -1
ret i32 %10
}
void main() {
  int a;
  pow_test();
  printf(a);
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <pow_test@plt>
movslq -0x4(%rbp),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <pow_test@plt>
xor    %edi,%edi
xor    %eax,%eax
pop    %rcx
jmp    1040 <printf@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = call i32 (...) @pow_test()
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
%6 = call i32 (i8*, ...) @printf(i8* %5)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @pow_test()
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) null)
ret void
}