xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ standard_command(int, int /*<<< orphan*/, int, char **);
void one_argument_command(int opcode_byte, char **arguments) {
  standard_command(opcode_byte, 0, 1, arguments);
}


x86 assembly (clang, -O0):
<one_argument_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rcx
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <standard_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<one_argument_command>:
mov    %rsi,%rcx
xor    %esi,%esi
mov    $0x1,%edx
jmp    1030 <standard_command@plt>

LLVM IR (-O0):
define void @one_argument_command(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 @standard_command(i32 %5, i32 0, i32 1, i8** %6)
ret void
}

LLVM IR (-O2):
define void @one_argument_command(i32 %0, i8** %1) {
%3 = tail call i32 @standard_command(i32 %0, i32 0, i32 1, i8** %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main(void) {
  int toes;
  toes = 10;
  printf("toes is %d, twice toes is %d, toes squared is %d.\n", toes, toes * 2,
         toes * toes);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xa,%esi
mov    $0x14,%edx
mov    $0x64,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [51 x i8] c"toes is %d, twice toes is %d, toes squared is %d.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 10, i32 20, i32 100)
ret i32 0
}
int hskip_lws(const char *hdr) {
  int i;
  for (i = 0; *hdr == ' ' || *hdr == '\t' || *hdr == '\r' || *hdr == '\n';
       ++hdr)
    ++i;
  return i;
}


x86 assembly (clang, -O0):
<hskip_lws>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0xd(%rbp)
je     115e <hskip_lws+0x5e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0xd(%rbp)
je     115e <hskip_lws+0x5e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0xd(%rbp)
je     115e <hskip_lws+0x5e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    116e <hskip_lws+0x6e>
jmp    1188 <hskip_lws+0x88>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hskip_lws+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hskip_lws>:
xor    %eax,%eax
movabs $0x100002600,%rcx
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%edx
cmp    $0x20,%rdx
ja     1126 <hskip_lws+0x26>
bt     %rdx,%rcx
jae    1126 <hskip_lws+0x26>
add    $0x1,%rax
jmp    1110 <hskip_lws+0x10>
ret

LLVM IR (-O0):
define i32 @hskip_lws(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %29, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 32
br i1 %8, label %24, label %9
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 9
br i1 %13, label %24, label %14
14: ; preds = %9
%15 = load i8*, i8** %2
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 13
br i1 %18, label %24, label %19
19: ; preds = %14
%20 = load i8*, i8** %2
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 10
br label %24
24: ; preds = %19, %14, %9, %4
%25 = phi i1 [ true, %14 ], [ true, %9 ], [ true, %4 ], [ %23, %19 ]
br i1 %25, label %26, label %32
26: ; preds = %24
%27 = load i32, i32* %3
%28 = add nsw i32 %27, 1
store i32 %28, i32* %3
br label %29
29: ; preds = %26
%30 = load i8*, i8** %2
%31 = getelementptr inbounds i8, i8* %30, i32 1
store i8* %31, i8** %2
br label %4
32: ; preds = %24
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
define i32 @hskip_lws(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %8, %6 ]
%4 = phi i32 [ 0, %1 ], [ %7, %6 ]
%5 = load i8, i8* %3
switch i8 %5, label %9 [
i8 32, label %6
i8 9, label %6
i8 13, label %6
i8 10, label %6
]
6: ; preds = %2, %2, %2, %2
%7 = add nuw nsw i32 %4, 1
%8 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
9: ; preds = %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int usage() {
  fprintf(stderr, "usage: line_endings unix|dos FILES\n"
                  "\n"
                  "Convert FILES to either unix or dos line endings.\n");
  return 1;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [87 x i8] c"usage: line_endings unix|dos FILES\0A\0AConvert FILES to either unix or dos line endings.\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [87 x i8] c"usage: line_endings unix|dos FILES\0A\0AConvert FILES to either unix or dos line endings.\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, ...);
int make_fd_nonblock(int fd) {
  int flag;
  flag = fcntl(fd, F_GETFL);
  if (flag == -1)
    return -1;
  flag = fcntl(fd, F_SETFL, flag | O_NONBLOCK);
  return flag;
}


x86 assembly (clang, -O0):
<make_fd_nonblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1147 <make_fd_nonblock+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    116f <make_fd_nonblock+0x5f>
mov    -0x8(%rbp),%edi
mov    0x2e87(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
mov    0x2e8b(%rip),%rax
or     (%rax),%edx
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_fd_nonblock>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1030 <fcntl@plt>
cmp    $0xffffffff,%eax
je     1146 <make_fd_nonblock+0x36>
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%esi
mov    0x2eb0(%rip),%rcx
or     (%rcx),%eax
mov    %ebx,%edi
mov    %eax,%edx
xor    %eax,%eax
pop    %rbx
jmp    1030 <fcntl@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @make_fd_nonblock(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = load i32, i32* @F_SETFL
%7 = load i32, i32* @O_NONBLOCK
%8 = or i32 %7, %3
%9 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %6, i32 %8)
br label %10
10: ; preds = %1, %5
%11 = phi i32 [ %9, %5 ], [ -1, %1 ]
ret i32 %11
}
void sigpipeHandler(int signo) { return; }


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

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

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

LLVM IR (-O2):
define void @sigpipeHandler(i32 %0) {
ret void
}
int *fx(int *b, int *e) { return b + (e - b); }


x86 assembly (clang, -O0):
<fx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rdx
sub    %rdx,%rcx
sar    $0x2,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fx>:
mov    %rsi,%rax
ret

LLVM IR (-O0):
define i32* @fx(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 = load i32*, i32** %3
%8 = ptrtoint i32* %6 to i64
%9 = ptrtoint i32* %7 to i64
%10 = sub i64 %8, %9
%11 = sdiv exact i64 %10, 4
%12 = getelementptr inbounds i32, i32* %5, i64 %11
ret i32* %12
}

LLVM IR (-O2):
define i32* @fx(i32* %0, i32* %1) {
%3 = ptrtoint i32* %1 to i64
%4 = ptrtoint i32* %0 to i64
%5 = sub i64 %3, %4
%6 = ashr exact i64 %5, 2
%7 = getelementptr inbounds i32, i32* %0, i64 %6
ret i32* %7
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void *funcA(void *param) { assert(0); }


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

x86 assembly (clang, -O2):
<funcA>:
xor    %edi,%edi
jmp    1030 <assert@plt>

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

LLVM IR (-O2):
define noalias i8* @funcA(i8* nocapture readnone %0) {
%2 = tail call i32 @assert(i32 0)
ret i8* undef
}
int esConstante(char c) {
  if (c >= 'A' && c <= 'Z')
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<esConstante>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1130 <esConstante+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1130 <esConstante+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <esConstante+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<esConstante>:
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @esConstante(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
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %13
12: ; preds = %7, %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @esConstante(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
double sqrt(double);
double hl_math_sqrt(double a) { return sqrt(a); }


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

x86 assembly (clang, -O2):
<hl_math_sqrt>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     111f <hl_math_sqrt+0xf>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @hl_math_sqrt(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @sqrt(double %3)
ret double %4
}

LLVM IR (-O2):
define double @hl_math_sqrt(double %0) {
%2 = tail call double @sqrt(double %0)
ret double %2
}
short int kernel__Float___60d(double self, double p0) {
  short int var;
  short int var1;
  var1 = self < p0;
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


x86 assembly (clang, -O0):
<kernel__Float___60d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %ax,-0x14(%rbp)
mov    -0x14(%rbp),%ax
mov    %ax,-0x12(%rbp)
movswl -0x12(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel__Float___60d>:
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define signext i16 @kernel__Float___60d(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i16
%6 = alloca i16
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fcmp olt double %7, %8
%10 = zext i1 %9 to i32
%11 = trunc i32 %10 to i16
store i16 %11, i16* %6
%12 = load i16, i16* %6
store i16 %12, i16* %5
br label %13
13: ; preds = %2
%14 = load i16, i16* %5
ret i16 %14
}

LLVM IR (-O2):
define signext i16 @kernel__Float___60d(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = zext i1 %3 to i16
ret i16 %4
}
/* Type definitions */
struct darr {
  int dummy;
};

/* Variables and functions */
int darr_resize(struct darr *, scalar_t__);
scalar_t__ darr_size(struct darr *);
int darr_grow(struct darr *d, size_t size) {
  return darr_resize(d, darr_size(d) + size);
}


x86 assembly (clang, -O0):
<darr_grow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <darr_size@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rsi
add    -0x10(%rbp),%rsi
call   1040 <darr_resize@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<darr_grow>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <darr_size@plt>
add    %rax,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <darr_resize@plt>

LLVM IR (-O0):
%struct.darr = type { i32 }
define i32 @darr_grow(%struct.darr* %0, i64 %1) {
%3 = alloca %struct.darr*
%4 = alloca i64
store %struct.darr* %0, %struct.darr** %3
store i64 %1, i64* %4
%5 = load %struct.darr*, %struct.darr** %3
%6 = load %struct.darr*, %struct.darr** %3
%7 = call i64 @darr_size(%struct.darr* %6)
%8 = load i64, i64* %4
%9 = add i64 %7, %8
%10 = call i32 @darr_resize(%struct.darr* %5, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.darr = type { i32 }
define i32 @darr_grow(%struct.darr* %0, i64 %1) {
%3 = tail call i64 @darr_size(%struct.darr* %0)
%4 = add i64 %3, %1
%5 = tail call i32 @darr_resize(%struct.darr* %0, i64 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar_fd(char const, int);
void ft_putstr_fd(const char *s, int fd) {
  int i;
  i = 0;
  while (s[i] != '\0') {
    ft_putchar_fd(s[i], fd);
    i++;
  }
}


x86 assembly (clang, -O0):
<ft_putstr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115f <ft_putstr_fd+0x4f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0xc(%rbp),%esi
movsbl %al,%edi
call   1030 <ft_putchar_fd@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <ft_putstr_fd+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr_fd>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1145 <ft_putstr_fd+0x35>
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
mov    %ebp,%esi
call   1030 <ft_putchar_fd@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <ft_putstr_fd+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @ft_putstr_fd(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = tail call i32 @ft_putchar_fd(i8 signext %7, i32 %1)
%9 = add nuw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foobar(char *);
void __attribute__((no_instrument_function)) func(void) {
  foobar("Hello world\n");
}


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"Hello world\0A\00"
define void @func() {
%1 = tail call i32 @foobar(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ strtol(char const *, char **, int);
int parse_num(const char *in) {
  char *stopped;
  int x = (int)strtol(in, &stopped, 10);
  if (*stopped || (x < 0))
    return -1;
  return x;
}


x86 assembly (clang, -O0):
<parse_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    114b <parse_num+0x3b>
cmpl   $0x0,-0x1c(%rbp)
jge    1157 <parse_num+0x47>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <parse_num+0x4d>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_num>:
push   %rax
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
test   %eax,%eax
mov    $0xffffffff,%ecx
cmovs  %ecx,%eax
mov    (%rsp),%rcx
xor    %edx,%edx
cmp    (%rcx),%dl
sbb    %ecx,%ecx
or     %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @parse_num(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i64 @strtol(i8* %0, i8** %2, i32 10)
%5 = trunc i64 %4 to i32
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
%9 = icmp slt i32 %5, 0
%10 = select i1 %8, i1 true, i1 %9
%11 = select i1 %10, i32 -1, i32 %5
ret i32 %11
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t f32i(int32_t x) { return x ^ 1; }


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

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

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

LLVM IR (-O2):
define i32 @f32i(i32 %0) {
%2 = xor i32 %0, 1
ret i32 %2
}
int of_modalias_node(struct device_node *node, char *modalias, int len) {
  return -38;
}


x86 assembly (clang, -O0):
<of_modalias_node>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0xffffffda,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.device_node = type opaque
define i32 @of_modalias_node(%struct.device_node* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 -38
}
/* Type definitions */
struct sk_buff {
  int dummy;
};
struct llc_pdu_un {
  int dummy;
};

/* Variables and functions */
scalar_t__ skb_network_header(struct sk_buff *);
struct llc_pdu_un *llc_pdu_un_hdr(struct sk_buff *skb) {
  return (struct llc_pdu_un *)skb_network_header(skb);
}


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

x86 assembly (clang, -O2):
<llc_pdu_un_hdr>:
jmp    1030 <skb_network_header@plt>

LLVM IR (-O0):
%struct.llc_pdu_un = type { i32 }
%struct.sk_buff = type { i32 }
define %struct.llc_pdu_un* @llc_pdu_un_hdr(%struct.sk_buff* %0) {
%2 = alloca %struct.sk_buff*
store %struct.sk_buff* %0, %struct.sk_buff** %2
%3 = load %struct.sk_buff*, %struct.sk_buff** %2
%4 = call i64 @skb_network_header(%struct.sk_buff* %3)
%5 = inttoptr i64 %4 to %struct.llc_pdu_un*
ret %struct.llc_pdu_un* %5
}

LLVM IR (-O2):
%struct.llc_pdu_un = type { i32 }
%struct.sk_buff = type { i32 }
define %struct.llc_pdu_un* @llc_pdu_un_hdr(%struct.sk_buff* %0) {
%2 = tail call i64 @skb_network_header(%struct.sk_buff* %0)
%3 = inttoptr i64 %2 to %struct.llc_pdu_un*
ret %struct.llc_pdu_un* %3
}
int add(a, b)
int a, b;
{ return (a + b); }


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

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

LLVM IR (-O0):
define i32 @add(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int uint64_t;
typedef int int64_t;

/* Variables and functions */
uint64_t zigzag64(int64_t v) {
  if (v < 0)
    return ((uint64_t)(-v)) * 2 - 1;
  else
    return v * 2;
}


x86 assembly (clang, -O0):
<zigzag64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1124 <zigzag64+0x24>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112d <zigzag64+0x2d>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zigzag64>:
lea    (%rdi,%rdi,1),%ecx
test   %edi,%edi
mov    %ecx,%eax
not    %eax
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @zigzag64(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = mul i32 %0, -2
%4 = add nsw i32 %3, -1
%5 = shl nsw i32 %0, 1
%6 = select i1 %2, i32 %4, i32 %5
ret i32 %6
}
/* Variables and functions */
size_t high_size_bit(int);
size_t splitvdirect_bit_LaceKVE_size() { return high_size_bit(2); }


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

x86 assembly (clang, -O2):
<splitvdirect_bit_LaceKVE_size>:
mov    $0x2,%edi
jmp    1030 <high_size_bit@plt>

LLVM IR (-O0):
define i64 @splitvdirect_bit_LaceKVE_size() {
%1 = call i64 @high_size_bit(i32 2)
ret i64 %1
}

LLVM IR (-O2):
define i64 @splitvdirect_bit_LaceKVE_size() {
%1 = tail call i64 @high_size_bit(i32 2)
ret i64 %1
}
int test_imm_0Eint8_reg(signed char val) {
  return ((val) & (0x0E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_0Eint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xe,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_0Eint8_reg>:
test   $0xe,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_0Eint8_reg(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, 14
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_0Eint8_reg(i8 signext %0) {
%2 = and i8 %0, 14
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int are_equal(int a[], int b[], int size) {
  for (int i = 0; i < size; i++) {
    if (a[i] != b[i])
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<are_equal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    115d <are_equal+0x5d>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x18(%rbp),%rcx
movslq -0x20(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
je     114a <are_equal+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1164 <are_equal+0x64>
jmp    114f <are_equal+0x4f>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1116 <are_equal+0x16>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<are_equal>:
test   %edx,%edx
jle    113d <are_equal+0x3d>
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
jne    113c <are_equal+0x3c>
mov    %edx,%r8d
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rax,%rdx
cmp    %rax,%r8
je     1134 <are_equal+0x34>
mov    (%rdi,%rdx,4),%ecx
lea    0x1(%rdx),%rax
cmp    (%rsi,%rdx,4),%ecx
je     1120 <are_equal+0x20>
xor    %eax,%eax
cmp    %r8,%rdx
setae  %al
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @are_equal(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 0, i32* %8
br label %9
9: ; preds = %27, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %7
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %30
13: ; preds = %9
%14 = load i32*, i32** %5
%15 = load i32, i32* %8
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = load i32*, i32** %6
%20 = load i32, i32* %8
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = load i32, i32* %22
%24 = icmp ne i32 %18, %23
br i1 %24, label %25, label %26
25: ; preds = %13
store i32 0, i32* %4
br label %31
26: ; preds = %13
br label %27
27: ; preds = %26
%28 = load i32, i32* %8
%29 = add nsw i32 %28, 1
store i32 %29, i32* %8
br label %9
30: ; preds = %9
store i32 1, i32* %4
br label %31
31: ; preds = %30, %25
%32 = load i32, i32* %4
ret i32 %32
}

LLVM IR (-O2):
define i32 @are_equal(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %24
5: ; preds = %3
%6 = zext i32 %2 to i64
%7 = zext i32 %2 to i64
%8 = load i32, i32* %0
%9 = load i32, i32* %1
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %5, %14
%12 = phi i64 [ %20, %14 ], [ 1, %5 ]
%13 = icmp eq i64 %12, %7
br i1 %13, label %21, label %14
14: ; preds = %11
%15 = getelementptr inbounds i32, i32* %0, i64 %12
%16 = load i32, i32* %15
%17 = getelementptr inbounds i32, i32* %1, i64 %12
%18 = load i32, i32* %17
%19 = icmp eq i32 %16, %18
%20 = add nuw nsw i64 %12, 1
br i1 %19, label %11, label %21
21: ; preds = %11, %14
%22 = icmp uge i64 %12, %6
%23 = zext i1 %22 to i32
br label %24
24: ; preds = %21, %5, %3
%25 = phi i32 [ 1, %3 ], [ 0, %5 ], [ %23, %21 ]
ret i32 %25
}
void X509_EXTENSION_get_critical(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_EXTENSION_get_critical() {
ret void
}
/* Variables and functions */
int get_word(int);
unsigned long get_long(int offset) {
  return (get_word(offset) << 16) | get_word(offset + 2);
}


x86 assembly (clang, -O0):
<get_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <get_word@plt>
shl    $0x10,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
add    $0x2,%edi
call   1030 <get_word@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
or     %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_long>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <get_word@plt>
mov    %eax,%ebp
shl    $0x10,%ebp
add    $0x2,%ebx
mov    %ebx,%edi
call   1030 <get_word@plt>
or     %ebp,%eax
cltq
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i64 @get_long(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @get_word(i32 %3)
%5 = shl i32 %4, 16
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 2
%8 = call i32 @get_word(i32 %7)
%9 = or i32 %5, %8
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
define i64 @get_long(i32 %0) {
%2 = tail call i32 @get_word(i32 %0)
%3 = shl i32 %2, 16
%4 = add nsw i32 %0, 2
%5 = tail call i32 @get_word(i32 %4)
%6 = or i32 %3, %5
%7 = sext i32 %6 to i64
ret i64 %7
}
int test_imm_2Eint16_reg(short val) {
  return ((val) & (-0x2E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Eint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%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_reg>:
test   $0xffd2,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_2Eint16_reg(i16 signext %0) {
%2 = and i16 %0, -46
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
adrx0adrreg1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((((double *)10000000)[x0]) <= (p1[1111111 / 4]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrx0adrreg1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
movslq -0x1c(%rbp),%rcx
mov    $0x989680,%eax
movsd  (%rax,%rcx,8),%xmm1
mov    -0x30(%rbp),%rax
movsd  0x21e888(%rax),%xmm0
ucomisd %xmm1,%xmm0
jb     114c <adrx0adrreg1+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1153 <adrx0adrreg1+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0adrreg1>:
movslq %edi,%rdx
movsd  0x21e888(%rcx),%xmm0
xor    %eax,%eax
ucomisd 0x989680(,%rdx,8),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @adrx0adrreg1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load i32, i32* %10
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds double, double* inttoptr (i64 10000000 to double*), i64 %15
%17 = load double, double* %16
%18 = load double*, double** %13
%19 = getelementptr inbounds double, double* %18, i64 277777
%20 = load double, double* %19
%21 = fcmp ole double %17, %20
br i1 %21, label %22, label %23
22: ; preds = %6
store i32 1, i32* %7
br label %24
23: ; preds = %6
store i32 0, i32* %7
br label %24
24: ; preds = %23, %22
%25 = load i32, i32* %7
ret i32 %25
}

LLVM IR (-O2):
define i32 @adrx0adrreg1(double %0, double %1, i32 %2, i32 %3, double* nocapture readnone %4, double* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds double, double* inttoptr (i64 10000000 to double*), i64 %7
%9 = load double, double* %8
%10 = getelementptr inbounds double, double* %5, i64 277777
%11 = load double, double* %10
%12 = fcmp ole double %9, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() {
  system("pid -o pid,ppid");
  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 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"pid -o pid,ppid\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @system(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"pid -o pid,ppid\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void sim_set_ring(struct lm_interface_state *s, int v) {}


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

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

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

LLVM IR (-O2):
%struct.lm_interface_state = type opaque
define void @sim_set_ring(%struct.lm_interface_state* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ run2();
int main() {
  run2();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <run2@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <run2@plt>
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @run2()
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @run2()
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  long long quot;
  scalar_t__ rem;
};
typedef TYPE_1__ lldiv_t;

/* Variables and functions */
TYPE_1__ lldiv(long long, unsigned long long);
long long sum_of_digits(long long n) {
  long long sum = 0;
  while (n) {
    lldiv_t d = lldiv(n, 10ull);
    sum += d.rem;
    n = d.quot;
  }
  return sum;
}


x86 assembly (clang, -O0):
<sum_of_digits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115e <sum_of_digits+0x4e>
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <lldiv@plt>
mov    %rax,-0x20(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1124 <sum_of_digits+0x14>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_of_digits>:
push   %rbx
test   %rdi,%rdi
je     1137 <sum_of_digits+0x27>
mov    %rdi,%rax
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0xa,%esi
mov    %rax,%rdi
call   1030 <lldiv@plt>
add    %rdx,%rbx
test   %rax,%rax
jne    1120 <sum_of_digits+0x10>
jmp    1139 <sum_of_digits+0x29>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64, i64 }
define i64 @sum_of_digits(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca %struct.TYPE_3__
store i64 %0, i64* %2
store i64 0, i64* %3
br label %5
5: ; preds = %8, %1
%6 = load i64, i64* %2
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %22
8: ; preds = %5
%9 = load i64, i64* %2
%10 = call { i64, i64 } @lldiv(i64 %9, i64 10)
%11 = bitcast %struct.TYPE_3__* %4 to { i64, i64 }*
%12 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %11, i32 0, i32 0
%13 = extractvalue { i64, i64 } %10, 0
store i64 %13, i64* %12
%14 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %11, i32 0, i32 1
%15 = extractvalue { i64, i64 } %10, 1
store i64 %15, i64* %14
%16 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %4, i32 0, i32 1
%17 = load i64, i64* %16
%18 = load i64, i64* %3
%19 = add nsw i64 %18, %17
store i64 %19, i64* %3
%20 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %4, i32 0, i32 0
%21 = load i64, i64* %20
store i64 %21, i64* %2
br label %5
22: ; preds = %5
%23 = load i64, i64* %3
ret i64 %23
}

LLVM IR (-O2):
define i64 @sum_of_digits(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %7, %3 ], [ %0, %1 ]
%5 = phi i64 [ %9, %3 ], [ 0, %1 ]
%6 = tail call { i64, i64 } @lldiv(i64 %4, i64 10)
%7 = extractvalue { i64, i64 } %6, 0
%8 = extractvalue { i64, i64 } %6, 1
%9 = add nsw i64 %8, %5
%10 = icmp eq i64 %7, 0
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i64 [ 0, %1 ], [ %9, %3 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ inprec_ru8(char const);
void inprec_rstr(const char *s) {
  while (*s) {
    inprec_ru8(*s);
    s++;
  }
  inprec_ru8(0);
}


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

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

LLVM IR (-O0):
define void @inprec_rstr(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 = load i8, i8* %8
%10 = call i32 @inprec_ru8(i8 signext %9)
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
br label %3
13: ; preds = %3
%14 = call i32 @inprec_ru8(i8 signext 0)
ret void
}

LLVM IR (-O2):
define void @inprec_rstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @inprec_ru8(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = tail call i32 @inprec_ru8(i8 signext 0)
ret void
}
/* Variables and functions */
char *strrchr(char *, char);
char *leaf_of(char *path) {
  char *leaf = strrchr(path, '/');
  if (leaf != 0)
    leaf++;
  else
    leaf = path;
  return leaf;
}


x86 assembly (clang, -O0):
<leaf_of>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <leaf_of+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1152 <leaf_of+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leaf_of>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @leaf_of(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ cpu_set_stack_value(unsigned int, unsigned int);
void write_5200_stack(unsigned int addr, unsigned int value) {
  cpu_set_stack_value(addr & 0xff, value);
}


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

x86 assembly (clang, -O2):
movzbl %dil,%edi
jmp    1030 <cpu_set_stack_value@plt>

LLVM IR (-O0):
define void @write_5200_stack(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 = and i32 %5, 255
%7 = load i32, i32* %4
%8 = call i32 @cpu_set_stack_value(i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @write_5200_stack(i32 %0, i32 %1) {
%3 = and i32 %0, 255
%4 = tail call i32 @cpu_set_stack_value(i32 %3, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  char *c = NULL;
  if (!c)
    printf("NULL");
  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)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1145 <main+0x35>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"NULL\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Init();
void ProfileReset(void) { Init(); }


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

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

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

LLVM IR (-O2):
define void @ProfileReset() {
%1 = tail call i32 (...) @Init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ltrim(char *);
int /*<<< orphan*/ rtrim(char *);
void trim(char *str) {
  rtrim(str);
  ltrim(str);
}


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

x86 assembly (clang, -O2):
<trim>:
push   %rbx
mov    %rdi,%rbx
call   1030 <rtrim@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <ltrim@plt>

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

LLVM IR (-O2):
define void @trim(i8* %0) {
%2 = tail call i32 @rtrim(i8* %0)
%3 = tail call i32 @ltrim(i8* %0)
ret void
}