xunge/DecIR huggingface dataset:
int c_label(const char **wp) { return (wp[0][0] == 'f' ? 1 : 0); }


x86 assembly (clang, -O0):
<c_label>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x66,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_label>:
mov    (%rdi),%rcx
xor    %eax,%eax
cmpb   $0x66,(%rcx)
sete   %al
ret

LLVM IR (-O0):
define i32 @c_label(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 102
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @c_label(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 102
%5 = zext i1 %4 to i32
ret i32 %5
}
void WriteInventory(const char *dest) {}


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

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

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

LLVM IR (-O2):
define void @WriteInventory(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void MMX_PSRLD_imm(int dst_reg, int amount) {
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0x72);
  addbyte(0xc0 | dst_reg | 0x10);
  addbyte(amount);
}


x86 assembly (clang, -O0):
<MMX_PSRLD_imm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0x72,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
or     $0xc0,%edi
or     $0x10,%edi
call   1030 <addbyte@plt>
mov    -0x8(%rbp),%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MMX_PSRLD_imm>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0x72,%edi
call   1030 <addbyte@plt>
or     $0xd0,%ebp
mov    %ebp,%edi
call   1030 <addbyte@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @MMX_PSRLD_imm(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @addbyte(i32 102)
%6 = call i32 @addbyte(i32 15)
%7 = call i32 @addbyte(i32 114)
%8 = load i32, i32* %3
%9 = or i32 192, %8
%10 = or i32 %9, 16
%11 = call i32 @addbyte(i32 %10)
%12 = load i32, i32* %4
%13 = call i32 @addbyte(i32 %12)
ret void
}

LLVM IR (-O2):
define void @MMX_PSRLD_imm(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 102)
%4 = tail call i32 @addbyte(i32 15)
%5 = tail call i32 @addbyte(i32 114)
%6 = or i32 %0, 208
%7 = tail call i32 @addbyte(i32 %6)
%8 = tail call i32 @addbyte(i32 %1)
ret void
}
int sum1(int i1) { return i1; }


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

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

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

LLVM IR (-O2):
define i32 @sum1(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
double fabs(double);
int areEqual(double v1, double v2) {
  if (fabs(v1 - v2) < 0.001)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<areEqual>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
movaps 0xef1(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xed5(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1141 <areEqual+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1148 <areEqual+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<areEqual>:
subsd  %xmm1,%xmm0
andpd  0xef4(%rip),%xmm0
movsd  0xefc(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @areEqual(double %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fsub double %6, %7
%9 = call double @llvm.fabs.f64(double %8)
%10 = fcmp olt double %9, 1.000000e-03
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 1, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @areEqual(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call double @llvm.fabs.f64(double %3)
%5 = fcmp olt double %4, 1.000000e-03
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
float _random(void) { return (float)rand() / (float)RAND_MAX; }


x86 assembly (clang, -O0):
<_random>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2ec1(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_random>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2ec4(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define float @_random() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to float
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to float
%5 = fdiv float %2, %4
ret float %5
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define float @_random() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to float
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to float
%5 = fdiv float %2, %4
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ say(char *, int);
void hit(void) { say("Die stupid drinks!", 1); }


x86 assembly (clang, -O0):
<hit>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
call   1030 <say@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hit>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <say@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Die stupid drinks!\00"
define void @hit() {
%1 = call i32 @say(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Die stupid drinks!\00"
define void @hit() {
%1 = tail call i32 @say(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int foo(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int iRet = 0;
  iRet = foo(1);
  printf("iRet = %d\n", iRet);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x1,%edi
call   1040 <foo@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"iRet = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = call i32 @foo(i32 1)
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"iRet = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @foo(i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printversion(char *prog) {
  printf("%s v0.1\n\n", prog);
  printf("Copyright (C) 1999, 2006, 2012 Robin Gareus\n"
         "This is free software; see the source for copying conditions.  There "
         "is NO\n"
         "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR "
         "PURPOSE.\n"
         "\n");
}


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

x86 assembly (clang, -O2):
<printversion>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%s v0.1\0A\0A\00"
@.str.1 = [197 x i8] c"Copyright (C) 1999, 2006, 2012 Robin Gareus\0AThis is free software; see the source for copying conditions. There is NO\0Awarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\0A\0A\00"
define void @printversion(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([197 x i8], [197 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s v0.1\0A\0A\00"
@str = [196 x i8] c"Copyright (C) 1999, 2006, 2012 Robin Gareus\0AThis is free software; see the source for copying conditions. There is NO\0Awarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\0A\00"
define void @printversion(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([196 x i8], [196 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ UINT8_MAX;
int /*<<< orphan*/ xsd_integer_value(char const *, int /*<<< orphan*/,
                                     int /*<<< orphan*/);
uint8_t xsd_uint8_value(const char *literal) {
  return (uint8_t)xsd_integer_value(literal, 0, UINT8_MAX);
}


x86 assembly (clang, -O0):
<xsd_uint8_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <xsd_integer_value@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xsd_uint8_value>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
jmp    1030 <xsd_integer_value@plt>

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

LLVM IR (-O2):
@UINT8_MAX = global i32 0
define i32 @xsd_uint8_value(i8* %0) {
%2 = load i32, i32* @UINT8_MAX
%3 = tail call i32 @xsd_integer_value(i8* %0, i32 0, i32 %2)
ret i32 %3
}
/* Type definitions */
struct conf_sec {
  int dummy;
};

/* Variables and functions */
size_t fetch_section_count(struct conf_sec **s) {
  size_t ret;
  for (ret = 0; s[ret]; ret++)
    ;
  return ret;
}


x86 assembly (clang, -O0):
<fetch_section_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1139 <fetch_section_count+0x39>
jmp    1128 <fetch_section_count+0x28>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <fetch_section_count+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fetch_section_count>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpq   $0x0,0x8(%rdi,%rax,8)
lea    0x1(%rax),%rax
jne    1110 <fetch_section_count+0x10>
ret

LLVM IR (-O0):
%struct.conf_sec = type { i32 }
define i64 @fetch_section_count(%struct.conf_sec** %0) {
%2 = alloca %struct.conf_sec**
%3 = alloca i64
store %struct.conf_sec** %0, %struct.conf_sec*** %2
store i64 0, i64* %3
br label %4
4: ; preds = %11, %1
%5 = load %struct.conf_sec**, %struct.conf_sec*** %2
%6 = load i64, i64* %3
%7 = getelementptr inbounds %struct.conf_sec*, %struct.conf_sec** %5, i64 %6
%8 = load %struct.conf_sec*, %struct.conf_sec** %7
%9 = icmp ne %struct.conf_sec* %8, null
br i1 %9, label %10, label %14
10: ; preds = %4
br label %11
11: ; preds = %10
%12 = load i64, i64* %3
%13 = add i64 %12, 1
store i64 %13, i64* %3
br label %4
14: ; preds = %4
%15 = load i64, i64* %3
ret i64 %15
}

LLVM IR (-O2):
%struct.conf_sec = type { i32 }
define i64 @fetch_section_count(%struct.conf_sec** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds %struct.conf_sec*, %struct.conf_sec** %0, i64 %3
%5 = load %struct.conf_sec*, %struct.conf_sec** %4
%6 = icmp eq %struct.conf_sec* %5, null
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ runtimeError(char *);
unsigned char *cvector(long nl, long nh) {
  unsigned char *v;
  v = (unsigned char *)malloc(
      (size_t)((nh - nl + 1 + 1) * sizeof(unsigned char)));
  if (!v)
    runtimeError("allocation failure in cvector()");
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<cvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x1,%rdi
shl    $0x0,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1164 <cvector+0x44>
lea    0xea1(%rip),%rdi
call   1040 <runtimeError@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
add    %rcx,%rax
add    $0x1,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %rdi,%rsi
lea    0x2(%rsi),%rdi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1147 <cvector+0x27>
lea    0xebe(%rip),%rdi
call   1040 <runtimeError@plt>
sub    %r14,%rbx
add    $0x1,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [32 x i8] c"allocation failure in cvector()\00"
define i8* @cvector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 1
%11 = mul i64 %10, 1
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %5
%14 = load i8*, i8** %5
%15 = icmp ne i8* %14, null
br i1 %15, label %18, label %16
16: ; preds = %2
%17 = call i32 @runtimeError(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %2
%19 = load i8*, i8** %5
%20 = load i64, i64* %3
%21 = sub i64 0, %20
%22 = getelementptr inbounds i8, i8* %19, i64 %21
%23 = getelementptr inbounds i8, i8* %22, i64 1
ret i8* %23
}

LLVM IR (-O2):
@.str = [32 x i8] c"allocation failure in cvector()\00"
define i8* @cvector(i64 %0, i64 %1) {
%3 = sub i64 2, %0
%4 = add i64 %3, %1
%5 = tail call i64 @malloc(i64 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @runtimeError(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
%10 = sub i64 0, %0
%11 = inttoptr i64 %5 to i8*
%12 = getelementptr inbounds i8, i8* %11, i64 %10
%13 = getelementptr inbounds i8, i8* %12, i64 1
ret i8* %13
}
void putbus(char instr, char data) {
  (*(volatile unsigned char *)0x400001) = instr;
  (*(volatile unsigned char *)0x400000) = data;
}


x86 assembly (clang, -O0):
<putbus>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%cl
mov    $0x400001,%eax
mov    %cl,(%rax)
mov    -0x2(%rbp),%cl
mov    $0x400000,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<putbus>:
mov    %dil,0x400001
mov    %sil,0x400000
ret

LLVM IR (-O0):
define void @putbus(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
store volatile i8 %5, i8* inttoptr (i64 4194305 to i8*)
%6 = load i8, i8* %4
store volatile i8 %6, i8* inttoptr (i64 4194304 to i8*)
ret void
}

LLVM IR (-O2):
define void @putbus(i8 signext %0, i8 signext %1) {
store volatile i8 %0, i8* inttoptr (i64 4194305 to i8*)
store volatile i8 %1, i8* inttoptr (i64 4194304 to i8*)
ret void
}
void endutent(void) {}


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

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

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

LLVM IR (-O2):
define void @endutent() {
ret void
}
int test_imm_C0int8_mem(signed char *val) {
  return ((*val) & (-0xC0 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_C0int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff40,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C0int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -192
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Type definitions */
typedef double time_t;

/* Variables and functions */
double difftime(time_t t1, time_t t0) { return t1 - t0; }


x86 assembly (clang, -O0):
<difftime>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<difftime>:
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @difftime(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fsub double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @difftime(double %0, double %1) {
%3 = fsub double %0, %1
ret double %3
}
/* Variables and functions */
scalar_t__ isspace(char);
void eat_space(char **s) {
  while (**s && isspace(**s)) {
    (*s)++;
  }
}


x86 assembly (clang, -O0):
<eat_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     114d <eat_space+0x3d>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    115d <eat_space+0x4d>
jmp    1170 <eat_space+0x60>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    111c <eat_space+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eat_space>:
push   %rbx
mov    (%rdi),%rax
mov    (%rax),%al
test   %al,%al
je     113f <eat_space+0x2f>
mov    %rdi,%rbx
nopl   (%rax)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     113f <eat_space+0x2f>
mov    (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
movzbl 0x1(%rax),%eax
test   %al,%al
jne    1120 <eat_space+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @eat_space(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %1, %9
%6 = phi i8 [ %12, %9 ], [ %3, %1 ]
%7 = tail call i64 @isspace(i8 signext %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = load i8*, i8** %0
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8* %11, i8** %0
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %9, %1
ret void
}
int __get_right_child_index(int index) { return index * 2 + 2; }


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

x86 assembly (clang, -O2):
<__get_right_child_index>:
lea    (%rdi,%rdi,1),%eax
add    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @__get_right_child_index(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 2
%5 = add nsw i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @__get_right_child_index(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = add nsw i32 %2, 2
ret i32 %3
}
void copia(void) {
  int i;
  extern char linea[], linea_max[];
  i = 0;
  while (linea[i] != '\0') {
    linea_max[i] = linea[i];
    i++;
  }
}


x86 assembly (clang, -O0):
<copia>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
mov    0x2eda(%rip),%rax
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114d <copia+0x4d>
movslq -0x4(%rbp),%rcx
mov    0x2ec2(%rip),%rax
mov    (%rax,%rcx,1),%dl
movslq -0x4(%rbp),%rcx
mov    0x2e9c(%rip),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <copia+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copia>:
mov    0x2ee9(%rip),%rax
mov    (%rax),%cl
test   %cl,%cl
je     1130 <copia+0x30>
xor    %edx,%edx
mov    0x2ec2(%rip),%rsi
cs nopw 0x0(%rax,%rax,1)
mov    %cl,(%rsi,%rdx,1)
movzbl 0x1(%rax,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1120 <copia+0x20>
ret

LLVM IR (-O0):
@linea = external global [0 x i8]
@linea_max = external global [0 x i8]
define void @copia() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %9, %0
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [0 x i8], [0 x i8]* @linea, i64 0, i64 %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %19
9: ; preds = %2
%10 = load i32, i32* %1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [0 x i8], [0 x i8]* @linea, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = load i32, i32* %1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [0 x i8], [0 x i8]* @linea_max, i64 0, i64 %15
store i8 %13, i8* %16
%17 = load i32, i32* %1
%18 = add nsw i32 %17, 1
store i32 %18, i32* %1
br label %2
19: ; preds = %2
ret void
}

LLVM IR (-O2):
@linea = external global [0 x i8]
@linea_max = external global [0 x i8]
define void @copia() {
%1 = load i8, i8* getelementptr inbounds ([0 x i8], [0 x i8]* @linea, i64 0, i64 0)
%2 = icmp eq i8 %1, 0
br i1 %2, label %11, label %3
3: ; preds = %0, %3
%4 = phi i64 [ %7, %3 ], [ 0, %0 ]
%5 = phi i8 [ %9, %3 ], [ %1, %0 ]
%6 = getelementptr inbounds [0 x i8], [0 x i8]* @linea_max, i64 0, i64 %4
store i8 %5, i8* %6
%7 = add nuw nsw i64 %4, 1
%8 = getelementptr inbounds [0 x i8], [0 x i8]* @linea, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void st_free(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @st_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int c = __VERIFIER_nondet_int();
  int x = __VERIFIER_nondet_int();
  while (x >= 0) {
    x += c;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     114b <main+0x3b>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <main+0x23>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int test_rr(int, int, int);
int test_rr_7_1_30(int argc, const char **argv) { return test_rr(7, 1, 30); }


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

x86 assembly (clang, -O2):
<test_rr_7_1_30>:
mov    $0x7,%edi
mov    $0x1,%esi
mov    $0x1e,%edx
jmp    1030 <test_rr@plt>

LLVM IR (-O0):
define i32 @test_rr_7_1_30(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @test_rr(i32 7, i32 1, i32 30)
ret i32 %5
}

LLVM IR (-O2):
define i32 @test_rr_7_1_30(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @test_rr(i32 7, i32 1, i32 30)
ret i32 %3
}
void f3(void) {
#pragma omp task depend(iterator(i = 0 : 1), iterator(j = 0 : 1), in : a)
  ;
}


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

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

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

LLVM IR (-O2):
define void @f3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void MySleep() { sleep(1); }


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

x86 assembly (clang, -O2):
<MySleep>:
mov    $0x1,%edi
jmp    1030 <sleep@plt>

LLVM IR (-O0):
define void @MySleep() {
%1 = call i32 @sleep(i32 1)
ret void
}

LLVM IR (-O2):
define void @MySleep() {
%1 = tail call i32 @sleep(i32 1)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t TS_DIFF(const uint32_t x, const uint32_t y) {
  return (x - y) & ((1 << 24) - 1);
}


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

x86 assembly (clang, -O2):
<TS_DIFF>:
mov    %edi,%eax
sub    %esi,%eax
and    $0xffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @TS_DIFF(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
%4 = and i32 %3, 16777215
ret i32 %4
}
int label_fifofile_set(const char *path) {
  int r = 0;
  return r;
}


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

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

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

LLVM IR (-O2):
define i32 @label_fifofile_set(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ one();
int /*<<< orphan*/ two();
int f(int x) {
  one();
  if (x) {
    two();
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <one@plt>
cmpl   $0x0,-0x8(%rbp)
je     1143 <f+0x23>
mov    $0x0,%al
call   1030 <two@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <one@plt>
test   %ebx,%ebx
je     1135 <f+0x15>
xor    %eax,%eax
call   1030 <two@plt>
pop    %rbx
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (...) @one()
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @two()
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = tail call i32 (...) @one()
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @two()
br label %6
6: ; preds = %4, %1
ret i32 undef
}
void NullProc(void) {}


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

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

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

LLVM IR (-O2):
define void @NullProc() {
ret void
}
void flushCache() { asm volatile("wbinvd" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @flushCache() {
tail call void asm sideeffect "wbinvd", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void CC_PalLogMaskSet(uint32_t setMask) { ((void)setMask); }


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

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

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

LLVM IR (-O2):
define void @CC_PalLogMaskSet(i64 %0) {
ret void
}
/* Variables and functions */
size_t strapp(char *target, const char *app) {
  size_t delta = 0;
  while (*app != '\0') {
    target[delta] = *app;
    delta++;
    app++;
  }
  return delta;
}


x86 assembly (clang, -O0):
<strapp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1152 <strapp+0x52>
mov    -0x10(%rbp),%rax
mov    (%rax),%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1114 <strapp+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strapp>:
mov    (%rsi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1120 <strapp+0x20>
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rdi,%rax,1)
movzbl 0x1(%rsi,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strapp+0x10>
ret

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

LLVM IR (-O2):
define i64 @strapp(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %12, %5 ], [ %3, %2 ]
%7 = phi i64 [ %10, %5 ], [ 0, %2 ]
%8 = phi i8* [ %11, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %6, i8* %9
%10 = add i64 %7, 1
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %2
%15 = phi i64 [ 0, %2 ], [ %10, %5 ]
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ outbyte1(char);
comma1() { outbyte1(','); }


x86 assembly (clang, -O0):
<comma1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2c,%edi
call   1030 <outbyte1@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comma1>:
mov    $0x2c,%edi
jmp    1030 <outbyte1@plt>

LLVM IR (-O0):
define i32 @comma1() {
%1 = alloca i32
%2 = call i32 @outbyte1(i8 signext 44)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @comma1() {
%1 = tail call i32 @outbyte1(i8 signext 44)
ret i32 undef
}
/* Variables and functions */
size_t next_segment(char **segment) {
  size_t used = 0;
  while (**segment != '\0') {
    ++*segment, ++used;
  }
  ++*segment, ++used;
  return (used);
}


x86 assembly (clang, -O0):
<next_segment>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1142 <next_segment+0x42>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <next_segment+0x10>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_segment>:
mov    (%rdi),%rcx
cmpb   $0x0,(%rcx)
je     1136 <next_segment+0x36>
add    $0x1,%rcx
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rcx,(%rdi)
add    $0x1,%rax
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1120 <next_segment+0x20>
add    $0xffffffffffffffff,%rcx
jmp    113b <next_segment+0x3b>
mov    $0x1,%eax
add    $0x1,%rcx
mov    %rcx,(%rdi)
ret

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

LLVM IR (-O2):
define i64 @next_segment(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %1, %5
%6 = phi i8* [ %8, %5 ], [ %2, %1 ]
%7 = phi i64 [ %9, %5 ], [ 1, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
store i8* %8, i8** %0
%9 = add i64 %7, 1
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %1
%13 = phi i64 [ 1, %1 ], [ %9, %5 ]
%14 = phi i8* [ %2, %1 ], [ %8, %5 ]
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8* %15, i8** %0
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error(int /*<<< orphan*/, int /*<<< orphan*/, char *);
void *realloc(void *, size_t);
void *xrealloc(void *ptr, size_t size) {
  void *res = realloc(ptr, size);
  if (!res)
    error(EXIT_FAILURE, errno, "realloc");
  return res;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116a <xrealloc+0x4a>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    0x2e84(%rip),%rax
mov    (%rax),%esi
lea    0xe9b(%rip),%rdx
call   1040 <error@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114c <xrealloc+0x2c>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
lea    0xeb9(%rip),%rdx
call   1040 <error@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@errno = global i32 0
@.str = [8 x i8] c"realloc\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @EXIT_FAILURE
%7 = load i32, i32* @errno
%8 = tail call i32 @error(i32 %6, i32 %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int run_command(int, char const **);
int main(int argc, const char *argv[]) {
  int rc = run_command(argc, argv);
  exit((rc < 0) ? EXIT_FAILURE : EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <run_command@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1160 <main+0x40>
mov    0x2e8a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
jmp    116c <main+0x4c>
mov    0x2e71(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <run_command@plt>
test   %eax,%eax
jns    1138 <main+0x18>
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 @run_command(i32 %7, i8** %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = load i32, i32* @EXIT_FAILURE
br label %16
14: ; preds = %2
%15 = load i32, i32* @EXIT_SUCCESS
br label %16
16: ; preds = %14, %12
%17 = phi i32 [ %13, %12 ], [ %15, %14 ]
%18 = call i32 @exit(i32 %17)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @run_command(i32 %0, i8** %1)
%4 = icmp slt i32 %3, 0
%5 = load i32, i32* @EXIT_FAILURE
%6 = load i32, i32* @EXIT_SUCCESS
%7 = select i1 %4, i32 %5, i32 %6
%8 = tail call i32 @exit(i32 %7)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ myFunc(int, int);
int main() {
  myFunc(75, 41);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4b,%edi
mov    $0x29,%esi
call   1030 <myFunc@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4b,%edi
mov    $0x29,%esi
call   1030 <myFunc@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @myFunc(i32 75, i32 41)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @myFunc(i32 75, i32 41)
ret i32 0
}
void foo610(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo610(i32 %0) {
ret void
}
int foo(int a) { return a + 4096; }


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

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

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 4096
ret i32 %4
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = add nsw i32 %0, 4096
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void toxic() {
  system("/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome "
         "--app https://github.com/illacceptanything/illacceptanything");
}


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

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

LLVM IR (-O0):
@.str = [124 x i8] c"/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome --app https://github.com/illacceptanything/illacceptanything\00"
define void @toxic() {
%1 = call i32 @system(i8* getelementptr inbounds ([124 x i8], [124 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [124 x i8] c"/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome --app https://github.com/illacceptanything/illacceptanything\00"
define void @toxic() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([124 x i8], [124 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ strlen(char const *);
int CStrings__strlen_unbounded(const char *p) { return (int)strlen(p); }


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

x86 assembly (clang, -O2):
<CStrings__strlen_unbounded>:
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i32 @CStrings__strlen_unbounded(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @CStrings__strlen_unbounded(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ft_strcpy(char *, char const *);
int ft_strlen(char const *);
scalar_t__ malloc(int);
char *ft_strdup(const char *s1) {
  size_t len;
  char *s2;
  len = ft_strlen(s1) + 1;
  s2 = (char *)malloc(sizeof(char) * len);
  if (s2 == NULL)
    return (NULL);
  ft_strcpy(s2, s1);
  return (s2);
}


x86 assembly (clang, -O0):
<ft_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <ft_strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1179 <ft_strdup+0x49>
movq   $0x0,-0x8(%rbp)
jmp    118e <ft_strdup+0x5e>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <ft_strcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <ft_strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
test   %rax,%rax
je     1159 <ft_strdup+0x29>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <ft_strcpy@plt>
jmp    115b <ft_strdup+0x2b>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @ft_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @ft_strlen(i8* %6)
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
store i64 %9, i64* %4
%10 = load i64, i64* %4
%11 = mul i64 1, %10
%12 = trunc i64 %11 to i32
%13 = call i64 @malloc(i32 %12)
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = icmp eq i8* %15, null
br i1 %16, label %17, label %18
17: ; preds = %1
store i8* null, i8** %2
br label %23
18: ; preds = %1
%19 = load i8*, i8** %5
%20 = load i8*, i8** %3
%21 = call i32 @ft_strcpy(i8* %19, i8* %20)
%22 = load i8*, i8** %5
store i8* %22, i8** %2
br label %23
23: ; preds = %18, %17
%24 = load i8*, i8** %2
ret i8* %24
}

LLVM IR (-O2):
define i8* @ft_strdup(i8* %0) {
%2 = tail call i32 @ft_strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @ft_strcpy(i8* %5, i8* %0)
br label %9
9: ; preds = %1, %7
%10 = phi i8* [ %5, %7 ], [ null, %1 ]
ret i8* %10
}