xunge/DecIR huggingface dataset:
char *leftShift(char *str) {
  char *s = str;
  while (*s) {
    *s = *(s + 1);
    s++;
  }
  *(s - 1) = '\0';
  return str;
}


x86 assembly (clang, -O0):
<leftShift>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     113b <leftShift+0x3b>
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <leftShift+0x10>
mov    -0x10(%rbp),%rax
movb   $0x0,-0x1(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leftShift>:
mov    %rdi,%rax
cmpb   $0x0,(%rdi)
mov    %rdi,%rcx
je     1123 <leftShift+0x23>
mov    %rax,%rdx
xchg   %ax,%ax
lea    0x1(%rdx),%rcx
movzbl 0x1(%rdx),%esi
mov    %sil,(%rdx)
mov    %rcx,%rdx
test   %sil,%sil
jne    1110 <leftShift+0x10>
movb   $0x0,-0x1(%rcx)
ret

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

LLVM IR (-O2):
define i8* @leftShift(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %6, %4 ], [ %0, %1 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %1
%10 = phi i8* [ %0, %1 ], [ %6, %4 ]
%11 = getelementptr inbounds i8, i8* %10, i64 -1
store i8 0, i8* %11
ret i8* %0
}
/* Variables and functions */
double ltr_int_vec_size(double *);
void ltr_int_normalize_vec(double vec[3]) {
  double a = ltr_int_vec_size(vec);
  vec[0] /= a;
  vec[1] /= a;
  vec[2] /= a;
}


x86 assembly (clang, -O0):
<ltr_int_normalize_vec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ltr_int_vec_size@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rax)
movsd  -0x10(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltr_int_normalize_vec>:
push   %rbx
mov    %rdi,%rbx
call   1030 <ltr_int_vec_size@plt>
movupd (%rbx),%xmm1
movapd %xmm0,%xmm2
unpcklpd %xmm0,%xmm2
divpd  %xmm2,%xmm1
movupd %xmm1,(%rbx)
movsd  0x10(%rbx),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ltr_int_normalize_vec(double* %0) {
%2 = tail call double @ltr_int_vec_size(double* %0)
%3 = bitcast double* %0 to <2 x double>*
%4 = load <2 x double>, <2 x double>* %3
%5 = insertelement <2 x double> poison, double %2, i64 0
%6 = shufflevector <2 x double> %5, <2 x double> poison, <2 x i32> zeroinitializer
%7 = fdiv <2 x double> %4, %6
%8 = bitcast double* %0 to <2 x double>*
store <2 x double> %7, <2 x double>* %8
%9 = getelementptr inbounds double, double* %0, i64 2
%10 = load double, double* %9
%11 = fdiv double %10, %2
store double %11, double* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test1() { printf("hello from test1 !\n"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"hello from test1 !\0A\00"
define void @test1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"hello from test1 !\00"
define void @test1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
unsigned int rdtsc_l(void) {
  unsigned int u, l;
  asm volatile("rdtsc" : "=a"(l), "=d"(u));
  return l;
}


x86 assembly (clang, -O0):
<rdtsc_l>:
push   %rbp
mov    %rsp,%rbp
rdtsc
mov    %eax,-0x8(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @rdtsc_l() {
%1 = alloca i32
%2 = alloca i32
%3 = call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%4 = extractvalue { i32, i32 } %3, 0
%5 = extractvalue { i32, i32 } %3, 1
store i32 %4, i32* %2
store i32 %5, i32* %1
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @rdtsc_l() {
%1 = tail call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i32, i32 } %1, 0
ret i32 %2
}
short decodeX(int value) { return value >> 8; }


x86 assembly (clang, -O0):
<decodeX>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<decodeX>:
mov    %edi,%eax
shr    $0x8,%eax
ret

LLVM IR (-O0):
define signext i16 @decodeX(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = trunc i32 %4 to i16
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @decodeX(i32 %0) {
%2 = lshr i32 %0, 8
%3 = trunc i32 %2 to i16
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ helper(int *, char *);
scalar_t__ malloc(int);
char *numberToWords(int num) {
  if (!num)
    return "Zero";
  char *s = (char *)malloc(sizeof(char) * 100);
  *s = '\0';
  helper(&num, s);
  return s;
}


x86 assembly (clang, -O0):
<numberToWords>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1145 <numberToWords+0x25>
lea    0xec4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    116f <numberToWords+0x4f>
mov    $0x64,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rsi
lea    -0xc(%rbp),%rdi
call   1040 <helper@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numberToWords>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0xc(%rsp)
test   %edi,%edi
je     114c <numberToWords+0x2c>
mov    $0x64,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
movb   $0x0,(%rax)
lea    0xc(%rsp),%rdi
mov    %rax,%rsi
call   1040 <helper@plt>
jmp    1153 <numberToWords+0x33>
lea    0xead(%rip),%rbx
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"Zero\00"
define i8* @numberToWords(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = icmp eq i32 %0, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @malloc(i32 100)
%6 = inttoptr i64 %5 to i8*
store i8 0, i8* %6
%7 = call i32 @helper(i32* %2, i8* %6)
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %6, %4 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %9
}
int sub(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sub() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ sleep(int);
void foo() {
  sleep(1);
  bar();
  sleep(1);
}


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

x86 assembly (clang, -O2):
<foo>:
push   %rax
mov    $0x1,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
call   1030 <bar@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <sleep@plt>

LLVM IR (-O0):
define void @foo() {
%1 = call i32 @sleep(i32 1)
%2 = call i32 (...) @bar()
%3 = call i32 @sleep(i32 1)
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 @sleep(i32 1)
%2 = tail call i32 (...) @bar()
%3 = tail call i32 @sleep(i32 1)
ret void
}
void INT_Excep_PERIB_INTB157(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB157() {
ret void
}
/* Variables and functions */
int _write_r(void *, char *, int);
int devo_fputc(int c, void *stream) {
  char ch = c;
  return (_write_r(stream, &ch, 1) == -1) ? -1 : c;
}


x86 assembly (clang, -O0):
<devo_fputc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x11(%rbp),%rsi
mov    $0x1,%edx
call   1030 <_write_r@plt>
cmp    $0xffffffff,%eax
jne    114d <devo_fputc+0x3d>
mov    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    1153 <devo_fputc+0x43>
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<devo_fputc>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rax
mov    %edi,%ebx
mov    %bl,0xf(%rsp)
lea    0xf(%rsp),%rsi
mov    %rax,%rdi
mov    $0x1,%edx
call   1030 <_write_r@plt>
cmp    $0xffffffff,%eax
cmovne %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @devo_fputc(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = trunc i32 %6 to i8
store i8 %7, i8* %5
%8 = load i8*, i8** %4
%9 = call i32 @_write_r(i8* %8, i8* %5, i32 1)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %12
11: ; preds = %2
br label %14
12: ; preds = %2
%13 = load i32, i32* %3
br label %14
14: ; preds = %12, %11
%15 = phi i32 [ -1, %11 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @devo_fputc(i32 %0, i8* %1) {
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = call i32 @_write_r(i8* %1, i8* %3, i32 1)
%6 = icmp eq i32 %5, -1
%7 = select i1 %6, i32 -1, i32 %0
ret i32 %7
}
/* Type definitions */
struct cpu {
  int dummy;
};

/* Variables and functions */
unsigned char cpu_get_d(struct cpu *);
unsigned char cpu_get_e(struct cpu *);
unsigned short cpu_get_de(struct cpu *cpu) {
  unsigned char d = cpu_get_d(cpu);
  unsigned char e = cpu_get_e(cpu);
  return (((unsigned short)((unsigned char)(e))) |
          (((unsigned short)((unsigned char)(d))) << 8));
}


x86 assembly (clang, -O0):
<cpu_get_de>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <cpu_get_d@plt>
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <cpu_get_e@plt>
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzwl %ax,%eax
movzbl -0x9(%rbp),%ecx
movzwl %cx,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_get_de>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <cpu_get_d@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <cpu_get_e@plt>
movzbl %al,%ecx
movzbl %bpl,%eax
shl    $0x8,%eax
or     %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.cpu = type { i32 }
define zeroext i16 @cpu_get_de(%struct.cpu* %0) {
%2 = alloca %struct.cpu*
%3 = alloca i8
%4 = alloca i8
store %struct.cpu* %0, %struct.cpu** %2
%5 = load %struct.cpu*, %struct.cpu** %2
%6 = call zeroext i8 @cpu_get_d(%struct.cpu* %5)
store i8 %6, i8* %3
%7 = load %struct.cpu*, %struct.cpu** %2
%8 = call zeroext i8 @cpu_get_e(%struct.cpu* %7)
store i8 %8, i8* %4
%9 = load i8, i8* %4
%10 = zext i8 %9 to i16
%11 = zext i16 %10 to i32
%12 = load i8, i8* %3
%13 = zext i8 %12 to i16
%14 = zext i16 %13 to i32
%15 = shl i32 %14, 8
%16 = or i32 %11, %15
%17 = trunc i32 %16 to i16
ret i16 %17
}

LLVM IR (-O2):
%struct.cpu = type { i32 }
define zeroext i16 @cpu_get_de(%struct.cpu* %0) {
%2 = tail call zeroext i8 @cpu_get_d(%struct.cpu* %0)
%3 = tail call zeroext i8 @cpu_get_e(%struct.cpu* %0)
%4 = zext i8 %3 to i16
%5 = zext i8 %2 to i16
%6 = shl nuw i16 %5, 8
%7 = or i16 %6, %4
ret i16 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int outit(int *data, int len) {
  int i;
  for (i = 0; i < len; i++)
    printf("%d ", data[i]);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<outit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <outit+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <outit+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outit>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <outit+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <outit+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @outit(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @outit(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
size_t libretro_dummy_retro_serialize_size(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @libretro_dummy_retro_serialize_size() {
ret i64 0
}

LLVM IR (-O2):
define i64 @libretro_dummy_retro_serialize_size() {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ change(int **);
int /*<<< orphan*/ derefI(int *);
void checkForCallee5(int *x) {
  if (x) {
    derefI(x);
    change(&x);
  }
}


x86 assembly (clang, -O0):
<checkForCallee5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1149 <checkForCallee5+0x29>
mov    -0x8(%rbp),%rdi
call   1040 <derefI@plt>
lea    -0x8(%rbp),%rdi
call   1030 <change@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkForCallee5>:
push   %rax
mov    %rdi,(%rsp)
test   %rdi,%rdi
je     1137 <checkForCallee5+0x17>
call   1040 <derefI@plt>
mov    %rsp,%rdi
call   1030 <change@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @checkForCallee5(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32*, i32** %2
%7 = call i32 @derefI(i32* %6)
%8 = call i32 @change(i32** %2)
br label %9
9: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @checkForCallee5(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = icmp eq i32* %0, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @derefI(i32* %0)
%6 = call i32 @change(i32** %2)
br label %7
7: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ chr1setBank7(int);
void m33setParamsAXX3(uint16_t addr, uint8_t val) {
  (void)addr;
  chr1setBank7(val << 10);
}


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

x86 assembly (clang, -O2):
<m33setParamsAXX3>:
mov    %esi,%edi
shl    $0xa,%edi
jmp    1030 <chr1setBank7@plt>

LLVM IR (-O0):
define void @m33setParamsAXX3(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 = shl i32 %6, 10
%8 = call i32 @chr1setBank7(i32 %7)
ret void
}

LLVM IR (-O2):
define void @m33setParamsAXX3(i32 %0, i32 %1) {
%3 = shl i32 %1, 10
%4 = tail call i32 @chr1setBank7(i32 %3)
ret void
}
int on_ac(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @on_ac() {
ret i32 1
}
/* Type definitions */
struct szl_obj {
  int dummy;
};
struct szl_interp {
  int dummy;
};

/* Variables and functions */
scalar_t__ szl_str_to_code(struct szl_interp *, struct szl_obj *);
scalar_t__ szl_wstr_to_str(struct szl_interp *, struct szl_obj *);
int szl_wstr_to_code(struct szl_interp *interp, struct szl_obj *obj) {
  return szl_wstr_to_str(interp, obj) && szl_str_to_code(interp, obj);
}


x86 assembly (clang, -O0):
<szl_wstr_to_code>:
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   1040 <szl_wstr_to_str@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     1166 <szl_wstr_to_code+0x46>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <szl_str_to_code@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<szl_wstr_to_code>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <szl_wstr_to_str@plt>
test   %rax,%rax
je     114c <szl_wstr_to_code+0x2c>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <szl_str_to_code@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
jmp    114e <szl_wstr_to_code+0x2e>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.szl_interp = type { i32 }
%struct.szl_obj = type { i32 }
define i32 @szl_wstr_to_code(%struct.szl_interp* %0, %struct.szl_obj* %1) {
%3 = alloca %struct.szl_interp*
%4 = alloca %struct.szl_obj*
store %struct.szl_interp* %0, %struct.szl_interp** %3
store %struct.szl_obj* %1, %struct.szl_obj** %4
%5 = load %struct.szl_interp*, %struct.szl_interp** %3
%6 = load %struct.szl_obj*, %struct.szl_obj** %4
%7 = call i64 @szl_wstr_to_str(%struct.szl_interp* %5, %struct.szl_obj* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load %struct.szl_interp*, %struct.szl_interp** %3
%11 = load %struct.szl_obj*, %struct.szl_obj** %4
%12 = call i64 @szl_str_to_code(%struct.szl_interp* %10, %struct.szl_obj* %11)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %9, %2
%15 = phi i1 [ false, %2 ], [ %13, %9 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
%struct.szl_interp = type { i32 }
%struct.szl_obj = type { i32 }
define i32 @szl_wstr_to_code(%struct.szl_interp* %0, %struct.szl_obj* %1) {
%3 = tail call i64 @szl_wstr_to_str(%struct.szl_interp* %0, %struct.szl_obj* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @szl_str_to_code(%struct.szl_interp* %0, %struct.szl_obj* %1)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Type definitions */
struct gengetopt_args_info {
  int dummy;
};

/* Variables and functions */
int options2(int, char **, struct gengetopt_args_info *, int /*<<< orphan*/,
             int, int);
int options(int argc, char **argv, struct gengetopt_args_info *args_info) {
  return options2(argc, argv, args_info, 0, 1, 1);
}


x86 assembly (clang, -O0):
<options>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
mov    $0x1,%r9d
mov    %r9d,%r8d
call   1030 <options2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<options>:
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
jmp    1030 <options2@plt>

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

LLVM IR (-O2):
%struct.gengetopt_args_info = type { i32 }
define i32 @options(i32 %0, i8** %1, %struct.gengetopt_args_info* %2) {
%4 = tail call i32 @options2(i32 %0, i8** %1, %struct.gengetopt_args_info* %2, i32 0, i32 1, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ bomb(char *);
extern void Perl_dump_mstats(char *s) { bomb("Perl_dump_mstats"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Perl_dump_mstats\00"
define void @Perl_dump_mstats(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @bomb(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Perl_dump_mstats\00"
define void @Perl_dump_mstats(i8* nocapture readnone %0) {
%2 = tail call i32 @bomb(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
int test00(const char *s1, const char *s2) { return __builtin_strcmp(s1, s2); }


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

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

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

LLVM IR (-O2):
define i32 @test00(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
int mtd_write_firmware(char *filename, int offset, int len) { return 0; }


x86 assembly (clang, -O0):
<mtd_write_firmware>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @mtd_write_firmware(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int isst_send_msr_command(int, int, int /*<<< orphan*/, unsigned long long *);
int isst_get_trl(int cpu, unsigned long long *trl) {
  int ret;
  ret = isst_send_msr_command(cpu, 0x1AD, 0, trl);
  if (ret)
    return ret;
  return 0;
}


x86 assembly (clang, -O0):
<isst_get_trl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rcx
mov    $0x1ad,%esi
xor    %edx,%edx
call   1030 <isst_send_msr_command@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     114a <isst_get_trl+0x3a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1151 <isst_get_trl+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @isst_get_trl(i32 %0, i64* %1) {
%3 = tail call i32 @isst_send_msr_command(i32 %0, i32 429, i32 0, i64* %1)
ret i32 %3
}
int mDB_last(fn, idx, rows, dst) {
  return mDBi_msg('l', fn, idx, rows, 0, 0, 0, dst);
}


x86 assembly (clang, -O0):
<mDB_last>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%eax
mov    $0x6c,%edi
xor    %r9d,%r9d
mov    %r9d,%r8d
movl   $0x0,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1030 <mDBi_msg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mDB_last>:
push   %rax
mov    %ecx,%r10d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    $0x6c,%edi
xor    %r8d,%r8d
xor    %r9d,%r9d
xor    %eax,%eax
push   %r10
push   $0x0
call   1030 <mDBi_msg@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mDB_last(i32 %0, i32 %1, i32 %2, i32 %3) {
%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 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @mDBi_msg to i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...)*)(i32 108, i32 %9, i32 %10, i32 %11, i32 0, i32 0, i32 0, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @mDB_last(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @mDBi_msg to i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...)*)(i32 108, i32 %0, i32 %1, i32 %2, i32 0, i32 0, i32 0, i32 %3)
ret i32 %5
}
void g_hook_list_init() {}


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

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

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

LLVM IR (-O2):
define void @g_hook_list_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
scalar_t__ rename(char *, char *);
int main(int argc, char **argv) {
  if (rename("./test.data", "..//test.txt") != 0) {
    perror("rename error");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    0xec8(%rip),%rsi
call   1040 <rename@plt>
cmp    $0x0,%rax
je     115f <main+0x3f>
lea    0xebf(%rip),%rdi
call   1030 <perror@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedd(%rip),%rsi
call   1040 <rename@plt>
test   %rax,%rax
jne    113d <main+0x1d>
xor    %eax,%eax
pop    %rcx
ret
lea    0xed5(%rip),%rdi
call   1030 <perror@plt>
jmp    1139 <main+0x19>

LLVM IR (-O0):
@.str = [12 x i8] c"./test.data\00"
@.str.1 = [13 x i8] c"..//test.txt\00"
@.str.2 = [13 x i8] c"rename error\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i64 @rename(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"./test.data\00"
@.str.1 = [13 x i8] c"..//test.txt\00"
@.str.2 = [13 x i8] c"rename error\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @rename(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i32 0
}
int neq(long a, long b) { return a != b; }


x86 assembly (clang, -O0):
<neq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<neq>:
xor    %eax,%eax
cmp    %rsi,%rdi
setne  %al
ret

LLVM IR (-O0):
define i32 @neq(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ne i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @neq(i64 %0, i64 %1) {
%3 = icmp ne i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int foo(char *p) { return p + 1000 < p; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x3e8,%rax
cmp    -0x8(%rbp),%rax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1000
%5 = load i8*, i8** %2
%6 = icmp ult i8* %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @foo(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ x;

/* Variables and functions */
int INT_MAX;
__attribute__((const)) int add_saturated(int x, int y) {
  int sum = x + y;
  int overflow = (x ^ sum) & (y ^ sum);
  int inf = (x >> (sizeof(x) * 8 - 1)) ^ INT_MAX;
  return overflow < 0 ? inf : sum;
}


x86 assembly (clang, -O0):
<add_saturated>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
xor    -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
mov    0x2eb7(%rip),%rcx
xor    (%rcx),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    114b <add_saturated+0x4b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1151 <add_saturated+0x51>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_saturated>:
lea    (%rsi,%rdi,1),%eax
mov    %eax,%ecx
xor    %edi,%ecx
sar    $0x1f,%edi
mov    0x2ed7(%rip),%rdx
xor    (%rdx),%edi
xor    %eax,%esi
test   %esi,%ecx
cmovs  %edi,%eax
ret

LLVM IR (-O0):
@INT_MAX = global i32 0
define i32 @add_saturated(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = add nsw i32 %8, %9
store i32 %10, i32* %5
%11 = load i32, i32* %3
%12 = load i32, i32* %5
%13 = xor i32 %11, %12
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = xor i32 %14, %15
%17 = and i32 %13, %16
store i32 %17, i32* %6
%18 = load i32, i32* %3
%19 = ashr i32 %18, 31
%20 = load i32, i32* @INT_MAX
%21 = xor i32 %19, %20
store i32 %21, i32* %7
%22 = load i32, i32* %6
%23 = icmp slt i32 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %2
%25 = load i32, i32* %7
br label %28
26: ; preds = %2
%27 = load i32, i32* %5
br label %28
28: ; preds = %26, %24
%29 = phi i32 [ %25, %24 ], [ %27, %26 ]
ret i32 %29
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @add_saturated(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = xor i32 %3, %0
%5 = xor i32 %3, %1
%6 = and i32 %4, %5
%7 = ashr i32 %0, 31
%8 = load i32, i32* @INT_MAX
%9 = xor i32 %8, %7
%10 = icmp slt i32 %6, 0
%11 = select i1 %10, i32 %9, i32 %3
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int ir_hash_add(unsigned char *, int);
int ir_register_command(unsigned char *code, int command) {
  if (command <= 0) {
    errno = EINVAL;
    return -1;
  }
  return ir_hash_add(code, command);
}


x86 assembly (clang, -O0):
<ir_register_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     1147 <ir_register_command+0x37>
mov    0x2ea8(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea7(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1156 <ir_register_command+0x46>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <ir_hash_add@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ir_register_command>:
test   %esi,%esi
jle    1119 <ir_register_command+0x9>
jmp    1030 <ir_hash_add@plt>
mov    0x2eb8(%rip),%rax
mov    (%rax),%eax
mov    0x2eb7(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @ir_register_command(i8* %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = load i32, i32* @EINVAL
store i32 %5, i32* @errno
br label %8
6: ; preds = %2
%7 = tail call i32 @ir_hash_add(i8* %0, i32 %1)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ -1, %4 ], [ %7, %6 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(char *, int, int /*<<< orphan*/,
                          int /*<<< orphan*/ *);
int /*<<< orphan*/ strlen(char *);
void write_header(FILE *fstream) {
  fwrite("#OPL_II#", 1, strlen("#OPL_II#"), fstream);
}


x86 assembly (clang, -O0):
<write_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rcx
lea    0xebb(%rip),%rdi
mov    $0x1,%esi
call   1040 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_header>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    %eax,%edx
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"#OPL_II#\00"
define void @write_header(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @strlen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = load i32*, i32** %2
%5 = call i32 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 %3, i32* %4)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"#OPL_II#\00"
define void @write_header(i32* nocapture %0) {
%2 = tail call i32 @strlen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 %2, i32* %0)
ret void
}
/* Variables and functions */
int o_listen(int, int);
int f_listen(int fd, int backlog) { return o_listen(fd, backlog); }


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

x86 assembly (clang, -O2):
<f_listen>:
jmp    1030 <o_listen@plt>

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

LLVM IR (-O2):
define i32 @f_listen(i32 %0, i32 %1) {
%3 = tail call i32 @o_listen(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ *get_test_arena(unsigned int);
int PHS_initialize_arena(unsigned int m_cost) {
  if (get_test_arena(m_cost) == NULL)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<PHS_initialize_arena>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <get_test_arena@plt>
cmp    $0x0,%rax
jne    1139 <PHS_initialize_arena+0x29>
movl   $0xffffffff,-0x4(%rbp)
jmp    1140 <PHS_initialize_arena+0x30>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PHS_initialize_arena>:
push   %rax
call   1030 <get_test_arena@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @PHS_initialize_arena(i32 %0) {
%2 = tail call i32* @get_test_arena(i32 %0)
%3 = icmp eq i32* %2, null
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int strlen(char *);
char tolower(char);
void str_tolower(char s[]) {
  int i;
  for (i = 0; i < strlen(s); ++i)
    s[i] = tolower(s[i]);
}


x86 assembly (clang, -O0):
<str_tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    117b <str_tolower+0x5b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <str_tolower+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_tolower>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    1161 <str_tolower+0x41>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1040 <tolower@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <str_tolower+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @str_tolower(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call signext i8 @tolower(i8 signext %7)
store i8 %8, i8* %6
%9 = add nuw nsw i64 %5, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %9, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
ret void
}
char file_NativeSlash() { return '/'; }


x86 assembly (clang, -O0):
<file_NativeSlash>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2f,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_NativeSlash>:
mov    $0x2f,%al
ret

LLVM IR (-O0):
define signext i8 @file_NativeSlash() {
ret i8 47
}

LLVM IR (-O2):
define signext i8 @file_NativeSlash() {
ret i8 47
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ display;
};
typedef TYPE_1__ Screen;

/* Variables and functions */
void *get_Screen_display(void *_p) { return (void *)((Screen *)_p)->display; }


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

x86 assembly (clang, -O2):
<get_Screen_display>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i8* @get_Screen_display(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @get_Screen_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
char *strdup(char *);
int main(int argc, char *argv[]) {
  {
    char *str = strdup("hello");
    str[0] = 'H';
    printf("%s\n", str);
  }
  exit(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)
lea    0xeb3(%rip),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x48,(%rax)
mov    -0x18(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <strdup@plt>
movb   $0x48,(%rax)
lea    0xebf(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
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
%7 = call i8* @strdup(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i8* %7, i8** %6
%8 = load i8*, i8** %6
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 72, i8* %9
%10 = load i8*, i8** %6
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = load i32, i32* @EXIT_SUCCESS
%13 = call i32 @exit(i32 %12)
unreachable
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(6) i8* @strdup(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i8 72, i8* %3
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_SUCCESS
%6 = tail call i32 @exit(i32 %5)
unreachable
}