xunge/DecIR huggingface dataset:
/* Variables and functions */
int exact_square(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, c;
  scanf("%d", &n);
  c = exact_square(n);
  printf("%d", c);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1040 <exact_square@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @exact_square(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
double chia(int s1, int s2) {
  if (s2 == 0) {
    printf("khong the chia cho so 0");
    return 0;
  } else {
    return s1 / s2;
  }
}


x86 assembly (clang, -O0):
<chia>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1141 <chia+0x31>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1151 <chia+0x41>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chia>:
test   %esi,%esi
je     111e <chia+0xe>
mov    %edi,%eax
cltd
idiv   %esi
cvtsi2sd %eax,%xmm0
ret
push   %rax
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"khong the chia cho so 0\00"
define double @chia(i32 %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
store double 0.000000e+00, double* %3
br label %15
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = sdiv i32 %11, %12
%14 = sitofp i32 %13 to double
store double %14, double* %3
br label %15
15: ; preds = %10, %8
%16 = load double, double* %3
ret double %16
}

LLVM IR (-O2):
@.str = [24 x i8] c"khong the chia cho so 0\00"
define double @chia(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %9
6: ; preds = %2
%7 = sdiv i32 %0, %1
%8 = sitofp i32 %7 to double
br label %9
9: ; preds = %6, %4
%10 = phi double [ 0.000000e+00, %4 ], [ %8, %6 ]
ret double %10
}
/* Type definitions */
struct const_Matrix_T {
  int dummy;
};
struct Matrix_T {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ print_to_file_const_Matrix_T(int /*<<< orphan*/ *const,
                                                struct const_Matrix_T *);
void print_to_file_Matrix_T(FILE *const file, const struct Matrix_T *const a) {
  print_to_file_const_Matrix_T(file, (struct const_Matrix_T *)a);
}


x86 assembly (clang, -O0):
<print_to_file_Matrix_T>:
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 <print_to_file_const_Matrix_T@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.Matrix_T = type { i32 }
%struct.const_Matrix_T = type { i32 }
define void @print_to_file_Matrix_T(i32* %0, %struct.Matrix_T* %1) {
%3 = alloca i32*
%4 = alloca %struct.Matrix_T*
store i32* %0, i32** %3
store %struct.Matrix_T* %1, %struct.Matrix_T** %4
%5 = load i32*, i32** %3
%6 = load %struct.Matrix_T*, %struct.Matrix_T** %4
%7 = bitcast %struct.Matrix_T* %6 to %struct.const_Matrix_T*
%8 = call i32 @print_to_file_const_Matrix_T(i32* %5, %struct.const_Matrix_T* %7)
ret void
}

LLVM IR (-O2):
%struct.Matrix_T = type { i32 }
%struct.const_Matrix_T = type { i32 }
define void @print_to_file_Matrix_T(i32* %0, %struct.Matrix_T* %1) {
%3 = bitcast %struct.Matrix_T* %1 to %struct.const_Matrix_T*
%4 = tail call i32 @print_to_file_const_Matrix_T(i32* %0, %struct.const_Matrix_T* %3)
ret void
}
int f17(int g, long *h) { return g + h[0]; }


x86 assembly (clang, -O0):
<f17>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movslq -0x4(%rbp),%rax
mov    -0x10(%rbp),%rcx
add    (%rcx),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f17(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = load i64*, i64** %4
%8 = getelementptr inbounds i64, i64* %7, i64 0
%9 = load i64, i64* %8
%10 = add nsw i64 %6, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @f17(i32 %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = trunc i64 %3 to i32
%5 = add i32 %4, %0
ret i32 %5
}
int finished(struct list *list, struct list *p) { return p == list; }


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

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

LLVM IR (-O0):
%struct.list = type opaque
define i32 @finished(%struct.list* %0, %struct.list* %1) {
%3 = alloca %struct.list*
%4 = alloca %struct.list*
store %struct.list* %0, %struct.list** %3
store %struct.list* %1, %struct.list** %4
%5 = load %struct.list*, %struct.list** %4
%6 = load %struct.list*, %struct.list** %3
%7 = icmp eq %struct.list* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
%struct.list = type opaque
define i32 @finished(%struct.list* readnone %0, %struct.list* readnone %1) {
%3 = icmp eq %struct.list* %1, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ vasprintf(char **, char const *, int /*<<< orphan*/);
char *g_strdup_vprintf(const char *format, va_list ap) {
  char *str_res = NULL;
  vasprintf(&str_res, format, ap);
  return str_res;
}


x86 assembly (clang, -O0):
<g_strdup_vprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    -0x18(%rbp),%rdi
call   1030 <vasprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_strdup_vprintf>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
movq   $0x0,(%rsp)
mov    %rsp,%rdi
call   1030 <vasprintf@plt>
mov    (%rsp),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @g_strdup_vprintf(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%5 = call i32 @vasprintf(i8** %3, i8* %0, i32 %1)
%6 = load i8*, i8** %3
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void imprimir_vetor(int vetor[], int tamanho) {
  int i;
  for (i = 0; i < tamanho; i++)
    printf("%d\t", vetor[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<imprimir_vetor>:
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 <imprimir_vetor+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 <imprimir_vetor+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimir_vetor>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <imprimir_vetor+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 <imprimir_vetor+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\09\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @imprimir_vetor(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 void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\09\00"
define void @imprimir_vetor(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 void
}
char *strchr(const char *s, int c) {
  while (*s != (char)c)
    if (!*s++)
      return 0;
  return (char *)s;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x14(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
je     114a <strchr+0x4a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
jne    1145 <strchr+0x45>
movq   $0x0,-0x8(%rbp)
jmp    1152 <strchr+0x52>
jmp    110b <strchr+0xb>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
movsbl %sil,%ecx
nopw   0x0(%rax,%rax,1)
movsbl (%rax),%edx
cmp    %edx,%ecx
je     1121 <strchr+0x21>
add    $0x1,%rax
test   %dl,%dl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
br label %5
5: ; preds = %10, %2
%6 = phi i8* [ %0, %2 ], [ %11, %10 ]
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %4, %8
br i1 %9, label %13, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = icmp eq i8 %7, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %10
%14 = phi i8* [ null, %10 ], [ %6, %5 ]
ret i8* %14
}
mod4(signed short x, signed short y) { return x % y; }


x86 assembly (clang, -O0):
<mod4>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod4>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @mod4(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = load i16, i16* %4
%8 = sext i16 %7 to i32
%9 = srem i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @mod4(i16 signext %0, i16 signext %1) {
%3 = sext i16 %0 to i32
%4 = sext i16 %1 to i32
%5 = srem i32 %3, %4
ret i32 %5
}
unsigned int f1(unsigned int x, unsigned int y) {
  return (x << y) | (x >> ((-y) & (8 * 4 - 1)));
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    $0x1f,%ecx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%eax
ret

LLVM IR (-O0):
define i32 @f1(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 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 0, %9
%11 = and i32 %10, 31
%12 = lshr i32 %8, %11
%13 = or i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @f1(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub i32 0, %1
%5 = and i32 %4, 31
%6 = lshr i32 %0, %5
%7 = or i32 %6, %3
ret i32 %7
}
int __mp_startleaktable(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__mp_startleaktable() {
ret i32 0
}
void check_integer_overflows_in_array_size() { int arr[4608 * 1024 * 1024]; }


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

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

LLVM IR (-O0):
define void @check_integer_overflows_in_array_size() {
%1 = alloca [536870912 x i32]
ret void
}

LLVM IR (-O2):
define void @check_integer_overflows_in_array_size() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ enqueue_1(int *, int);
void push(int *a, int val) { enqueue_1(a, val); }


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

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

LLVM IR (-O0):
define void @push(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 @enqueue_1(i32* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @push(i32* %0, i32 %1) {
%3 = tail call i32 @enqueue_1(i32* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void *realloc(void *, size_t);
void *safe_realloc(void *buf, size_t size) {
  void *result = realloc(buf, size);
  assert(size == 0 || result != NULL);
  return result;
}


x86 assembly (clang, -O0):
<safe_realloc>:
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 <realloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x19(%rbp)
je     115c <safe_realloc+0x3c>
cmpq   $0x0,-0x18(%rbp)
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_realloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <realloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
sete   %al
test   %r14,%r14
setne  %cl
or     %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @safe_realloc(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 i64, i64* %4
%10 = icmp eq i64 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = load i8*, i8** %5
%13 = icmp ne i8* %12, null
br label %14
14: ; preds = %11, %2
%15 = phi i1 [ true, %2 ], [ %13, %11 ]
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
define noalias i8* @safe_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i64 %1, 0
%5 = icmp ne i8* %3, null
%6 = or i1 %4, %5
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
ret i8* %3
}
/* Type definitions */
struct rw_semaphore {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __up_write(struct rw_semaphore *);
void up_write(struct rw_semaphore *sem) {
  ;
  __up_write(sem);
  ;
}


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

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

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

LLVM IR (-O2):
%struct.rw_semaphore = type { i32 }
define void @up_write(%struct.rw_semaphore* %0) {
%2 = tail call i32 @__up_write(%struct.rw_semaphore* %0)
ret void
}
int test_imm_15int8_reg(signed char val) {
  return ((val) & (-0x15 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_15int8_reg(i8 signext %0) {
%2 = and i8 %0, -21
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test_imm_EDint8_mem(signed char *val) {
  return ((*val) & (0xED << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_EDint8_mem>:
testb  $0xed,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_EDint8_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, 237
%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_EDint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -19
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ isspace(unsigned char);
char *lskip(char *s) {
  while (*s && isspace((unsigned char)(*s)))
    s++;
  return (char *)s;
}


x86 assembly (clang, -O0):
<lskip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1147 <lskip+0x37>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1157 <lskip+0x47>
jmp    1168 <lskip+0x58>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <lskip+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lskip>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <lskip+0x29>
nopw   0x0(%rax,%rax,1)
movzbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <lskip+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <lskip+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @lskip(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i64 @isspace(i8 zeroext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
void test_three(int x, int y) {
#pragma omp target
#pragma omp teams distribute simd collapse(1)
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      ;
}


x86 assembly (clang, -O0):
<test_three>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1156 <test_three+0x56>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1143 <test_three+0x43>
jmp    1135 <test_three+0x35>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1124 <test_three+0x24>
jmp    1148 <test_three+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_three+0x11>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_three(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PTRACE_TRACEME;
int /*<<< orphan*/ SIGSTOP;
int /*<<< orphan*/ err(int, char *);
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
int ptrace(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *);
int debuggee(void *arg_) {
  if (ptrace(PTRACE_TRACEME, 0, NULL, NULL) == -1) {
    err(1, "ptrace(PTRACE_TRACEME)");
  }
  kill(getpid(), SIGSTOP);
  return 0;
}


x86 assembly (clang, -O0):
<debuggee>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1060 <ptrace@plt>
cmp    $0xffffffff,%eax
jne    117d <debuggee+0x3d>
mov    $0x1,%edi
lea    0xe88(%rip),%rsi
call   1050 <err@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    0x2e4b(%rip),%rax
mov    (%rax),%esi
call   1040 <kill@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debuggee>:
push   %rax
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1060 <ptrace@plt>
cmp    $0xffffffff,%eax
jne    116b <debuggee+0x2b>
lea    0xe9f(%rip),%rsi
mov    $0x1,%edi
call   1050 <err@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
mov    0x2e5f(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1040 <kill@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@PTRACE_TRACEME = global i32 0
@.str = [23 x i8] c"ptrace(PTRACE_TRACEME)\00"
@SIGSTOP = global i32 0
define i32 @debuggee(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @PTRACE_TRACEME
%4 = call i32 @ptrace(i32 %3, i32 0, i32* null, i32* null)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @err(i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = call i32 (...) @getpid()
%10 = load i32, i32* @SIGSTOP
%11 = call i32 @kill(i32 %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@PTRACE_TRACEME = global i32 0
@.str = [23 x i8] c"ptrace(PTRACE_TRACEME)\00"
@SIGSTOP = global i32 0
define i32 @debuggee(i8* nocapture readnone %0) {
%2 = load i32, i32* @PTRACE_TRACEME
%3 = tail call i32 @ptrace(i32 %2, i32 0, i32* null, i32* null)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = tail call i32 (...) @getpid()
%9 = load i32, i32* @SIGSTOP
%10 = tail call i32 @kill(i32 %8, i32 %9)
ret i32 0
}
int ft_isblank(int c) {
  if (c == ' ' || c == '\n' || c == '\t')
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<ft_isblank>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
je     1125 <ft_isblank+0x25>
cmpl   $0xa,-0x8(%rbp)
je     1125 <ft_isblank+0x25>
cmpl   $0x9,-0x8(%rbp)
jne    1131 <ft_isblank+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1138 <ft_isblank+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isblank>:
cmp    $0x20,%edi
ja     111d <ft_isblank+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100000600,%rdx
bt     %rcx,%rdx
jae    111d <ft_isblank+0x1d>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_isblank(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %3
i32 10, label %3
i32 9, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ lcd_byte(int, int /*<<< orphan*/);
void lcd_empty() { lcd_byte(0x01, 0); }


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

x86 assembly (clang, -O2):
<lcd_empty>:
mov    $0x1,%edi
xor    %esi,%esi
jmp    1030 <lcd_byte@plt>

LLVM IR (-O0):
define void @lcd_empty() {
%1 = call i32 @lcd_byte(i32 1, i32 0)
ret void
}

LLVM IR (-O2):
define void @lcd_empty() {
%1 = tail call i32 @lcd_byte(i32 1, i32 0)
ret void
}
void MHal_PNL_Switch_LPLL_SubBank(unsigned short u16Bank) {
  (u16Bank = u16Bank);
}


x86 assembly (clang, -O0):
<MHal_PNL_Switch_LPLL_SubBank>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
mov    %ax,-0x2(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @MHal_PNL_Switch_LPLL_SubBank(i16 zeroext %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ compute_pos();
int /*<<< orphan*/ compute_velocities();
int /*<<< orphan*/ tersoff2_energy();
int /*<<< orphan*/ tersoff2_forces();
void integrate() {
  compute_pos();
  tersoff2_forces();
  tersoff2_energy();
  compute_velocities();
}


x86 assembly (clang, -O0):
<integrate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <compute_pos@plt>
mov    $0x0,%al
call   1030 <tersoff2_forces@plt>
mov    $0x0,%al
call   1040 <tersoff2_energy@plt>
mov    $0x0,%al
call   1050 <compute_velocities@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<integrate>:
push   %rax
xor    %eax,%eax
call   1060 <compute_pos@plt>
xor    %eax,%eax
call   1030 <tersoff2_forces@plt>
xor    %eax,%eax
call   1040 <tersoff2_energy@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <compute_velocities@plt>

LLVM IR (-O0):
define void @integrate() {
%1 = call i32 (...) @compute_pos()
%2 = call i32 (...) @tersoff2_forces()
%3 = call i32 (...) @tersoff2_energy()
%4 = call i32 (...) @compute_velocities()
ret void
}

LLVM IR (-O2):
define void @integrate() {
%1 = tail call i32 (...) @compute_pos()
%2 = tail call i32 (...) @tersoff2_forces()
%3 = tail call i32 (...) @tersoff2_energy()
%4 = tail call i32 (...) @compute_velocities()
ret void
}
int int_cube(int x) { return (x * x * x); }


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

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

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

LLVM IR (-O2):
define i32 @int_cube(i32 %0) {
%2 = mul nsw i32 %0, %0
%3 = mul nsw i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(int);
long strtol(char const *, char **, int);
long parse_long(const char *s, char **tail) {
  if (!isdigit((int)(unsigned char)*s)) {
    *tail = (char *)s;
    return 0;
  }
  return strtol(s, (char **)tail, 10);
}


x86 assembly (clang, -O0):
<parse_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    115d <parse_long+0x3d>
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movq   $0x0,-0x8(%rbp)
jmp    1173 <parse_long+0x53>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_long>:
movzbl (%rdi),%eax
add    $0xffffffd0,%eax
cmp    $0xa,%eax
jae    1125 <parse_long+0x15>
mov    $0xa,%edx
jmp    1030 <strtol@plt>
mov    %rdi,(%rsi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @parse_long(i8* %0, i8** nocapture %1) {
%3 = load i8, i8* %0
%4 = zext i8 %3 to i32
%5 = add nsw i32 %4, -48
%6 = icmp ult i32 %5, 10
br i1 %6, label %8, label %7
7: ; preds = %2
store i8* %0, i8** %1
br label %10
8: ; preds = %2
%9 = tail call i64 @strtol(i8* %0, i8** %1, i32 10)
br label %10
10: ; preds = %8, %7
%11 = phi i64 [ %9, %8 ], [ 0, %7 ]
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ test1();
int /*<<< orphan*/ test2();
int /*<<< orphan*/ test3();
int main() {
  test1();
  test2();
  test2();
  test2();
  test2();
  puts("");
  test3();
  test3();
  test3();
  test3();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <test1@plt>
mov    $0x0,%al
call   1060 <test2@plt>
mov    $0x0,%al
call   1060 <test2@plt>
mov    $0x0,%al
call   1060 <test2@plt>
mov    $0x0,%al
call   1060 <test2@plt>
lea    0xe87(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <test3@plt>
mov    $0x0,%al
call   1040 <test3@plt>
mov    $0x0,%al
call   1040 <test3@plt>
mov    $0x0,%al
call   1040 <test3@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <test1@plt>
xor    %eax,%eax
call   1060 <test2@plt>
xor    %eax,%eax
call   1060 <test2@plt>
xor    %eax,%eax
call   1060 <test2@plt>
xor    %eax,%eax
call   1060 <test2@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <test3@plt>
xor    %eax,%eax
call   1040 <test3@plt>
xor    %eax,%eax
call   1040 <test3@plt>
xor    %eax,%eax
call   1040 <test3@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test1()
%3 = call i32 (...) @test2()
%4 = call i32 (...) @test2()
%5 = call i32 (...) @test2()
%6 = call i32 (...) @test2()
%7 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @test3()
%9 = call i32 (...) @test3()
%10 = call i32 (...) @test3()
%11 = call i32 (...) @test3()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test1()
%2 = tail call i32 (...) @test2()
%3 = tail call i32 (...) @test2()
%4 = tail call i32 (...) @test2()
%5 = tail call i32 (...) @test2()
%6 = tail call i32 @putchar(i32 10)
%7 = tail call i32 (...) @test3()
%8 = tail call i32 (...) @test3()
%9 = tail call i32 (...) @test3()
%10 = tail call i32 (...) @test3()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR57_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

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

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

LLVM IR (-O2):
define void @U_WMR57_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
void signed_char_and_signed_char(signed char *LHS, signed char RHS) {
  (*LHS) &= RHS;
}


x86 assembly (clang, -O0):
<signed_char_and_signed_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%edx
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
and    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<signed_char_and_signed_char>:
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @signed_char_and_signed_char(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = and i32 %9, %6
%11 = trunc i32 %10 to i8
store i8 %11, i8* %7
ret void
}

LLVM IR (-O2):
define void @signed_char_and_signed_char(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = and i8 %3, %1
store i8 %4, i8* %0
ret void
}
unsigned xrop3_115_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~T;
  stk2 = D | stk3;
  stk1 = S & stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


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

x86 assembly (clang, -O2):
<xrop3_115_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
not    %eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_115_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = xor i32 %4, -1
ret i32 %5
}
void PGMR3QueryMemoryStats(void) {}


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

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

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

LLVM IR (-O2):
define void @PGMR3QueryMemoryStats() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ argp_parse(int /*<<< orphan*/, int, char **,
                              int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, char **argv) {
  argp_parse(0, argc, argv, 0, 0, 0);
  exit(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)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
xor    %r9d,%r9d
mov    %r9d,%edi
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <argp_parse@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsi,%rdx
mov    %edi,%esi
xor    %edi,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <argp_parse@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @argp_parse(i32 0, i32 %6, i8** %7, i32 0, i32 0, i32 0)
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @argp_parse(i32 0, i32 %0, i8** %1, i32 0, i32 0, i32 0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
int free3dArray_d(double ***x3d) {
  free(&x3d[0][0][0]);
  free(&x3d[0][0]);
  free(&x3d[0]);
  return 0;
}


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

x86 assembly (clang, -O2):
<free3dArray_d>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    (%rbx),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @free3dArray_d(double*** nocapture %0) {
%2 = bitcast double*** %0 to i8***
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
tail call void @free(i8* %4)
%5 = bitcast double*** %0 to i8**
%6 = load i8*, i8** %5
tail call void @free(i8* %6)
%7 = bitcast double*** %0 to i8*
tail call void @free(i8* %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ local_bh_enable();
__attribute__((always_)) void __rcu_read_unlock_bh(void) { local_bh_enable(); }


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

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

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

LLVM IR (-O2):
define void @__rcu_read_unlock_bh() {
%1 = tail call i32 (...) @local_bh_enable()
ret void
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int tcgetattr(int, struct termios *);
int isatty(int fd) {
  int retval;
  struct termios t;
  retval = (tcgetattr(fd, &t) != -1);
  return (retval);
}


x86 assembly (clang, -O0):
<isatty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1030 <tcgetattr@plt>
cmp    $0xffffffff,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isatty>:
push   %rax
mov    %rsp,%rsi
call   1030 <tcgetattr@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.termios = type { i32 }
define i32 @isatty(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.termios
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @tcgetattr(i32 %5, %struct.termios* %4)
%7 = icmp ne i32 %6, -1
%8 = zext i1 %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
%struct.termios = type { i32 }
define i32 @isatty(i32 %0) {
%2 = alloca %struct.termios
%3 = bitcast %struct.termios* %2 to i8*
%4 = call i32 @tcgetattr(i32 %0, %struct.termios* %2)
%5 = icmp ne i32 %4, -1
%6 = zext i1 %5 to i32
ret i32 %6
}
void foo253() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @push() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
double stdlib_strided_dnanstdevpn(int /*<<< orphan*/ const, double const,
                                  double const *, int /*<<< orphan*/ const);
double stdlib_strided_dnanstdev(const int64_t N, const double correction,
                                const double *X, const int64_t stride) {
  return stdlib_strided_dnanstdevpn(N, correction, X, stride);
}


x86 assembly (clang, -O0):
<stdlib_strided_dnanstdev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <stdlib_strided_dnanstdevpn@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @stdlib_strided_dnanstdev(i32 %0, double %1, double* %2, i32 %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca double*
%8 = alloca i32
store i32 %0, i32* %5
store double %1, double* %6
store double* %2, double** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load double, double* %6
%11 = load double*, double** %7
%12 = load i32, i32* %8
%13 = call double @stdlib_strided_dnanstdevpn(i32 %9, double %10, double* %11, i32 %12)
ret double %13
}

LLVM IR (-O2):
define double @stdlib_strided_dnanstdev(i32 %0, double %1, double* %2, i32 %3) {
%5 = tail call double @stdlib_strided_dnanstdevpn(i32 %0, double %1, double* %2, i32 %3)
ret double %5
}