xunge/DecIR huggingface dataset:
void map2check_binop_mul_uint(unsigned param1, unsigned param2, unsigned line,
                              unsigned scope, char *function_name) {}


x86 assembly (clang, -O0):
<map2check_binop_mul_uint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @map2check_binop_mul_uint(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
define void @map2check_binop_mul_uint(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture %4) {
ret void
}
int err_syntax18_lex(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @err_syntax18_lex() {
ret i32 -1
}
int main() {
  int a[] = {2, 7, 55, 33, 45};
  printf("a[3]=%d\n", a[3]);
  printf("a[a]=%d\n", 3 [a]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%esi
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"a[3]=%d\0A\00"
@.str.1 = [9 x i8] c"a[a]=%d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 33)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 33)
ret i32 0
}
void usb_putchar(char c) {}


x86 assembly (clang, -O0):
<usb_putchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @usb_putchar(i8 signext %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CalcMarsSatElem(double, int, double *);
void CalcAllMarsSatElem(double t, double elem[12], void *user) {
  CalcMarsSatElem(t, 0, elem + (0 * 6));
  CalcMarsSatElem(t, 1, elem + (1 * 6));
}


x86 assembly (clang, -O0):
<CalcAllMarsSatElem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rsi
xor    %edi,%edi
call   1030 <CalcMarsSatElem@plt>
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rsi
add    $0x30,%rsi
mov    $0x1,%edi
call   1030 <CalcMarsSatElem@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalcAllMarsSatElem>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movsd  %xmm0,0x8(%rsp)
xor    %edi,%edi
mov    %rbx,%rsi
call   1030 <CalcMarsSatElem@plt>
add    $0x30,%rbx
movsd  0x8(%rsp),%xmm0
mov    $0x1,%edi
mov    %rbx,%rsi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <CalcMarsSatElem@plt>

LLVM IR (-O0):
define void @CalcAllMarsSatElem(double %0, double* %1, i8* %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca i8*
store double %0, double* %4
store double* %1, double** %5
store i8* %2, i8** %6
%7 = load double, double* %4
%8 = load double*, double** %5
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = call i32 @CalcMarsSatElem(double %7, i32 0, double* %9)
%11 = load double, double* %4
%12 = load double*, double** %5
%13 = getelementptr inbounds double, double* %12, i64 6
%14 = call i32 @CalcMarsSatElem(double %11, i32 1, double* %13)
ret void
}

LLVM IR (-O2):
define void @CalcAllMarsSatElem(double %0, double* %1, i8* nocapture readnone %2) {
%4 = tail call i32 @CalcMarsSatElem(double %0, i32 0, double* %1)
%5 = getelementptr inbounds double, double* %1, i64 6
%6 = tail call i32 @CalcMarsSatElem(double %0, i32 1, double* %5)
ret void
}
void rop3_89_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~S;
  stk2 = T | stk3;
  stk1 = *D ^ stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_89_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_89_0_0>:
not    %sil
or     %dl,%sil
xor    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_89_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8, i8* %6
%15 = zext i8 %14 to i32
%16 = load i8, i8* %9
%17 = zext i8 %16 to i32
%18 = or i32 %15, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8*, i8** %4
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = xor i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = load i8*, i8** %4
store i8 %27, i8* %28
ret void
}

LLVM IR (-O2):
define void @rop3_89_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, -1
%5 = or i8 %4, %2
%6 = load i8, i8* %0
%7 = xor i8 %6, %5
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int f(int);
int /*<<< orphan*/ printf(char *, int);
int scanf(char *, int *);
int main() {
  int n;
  return scanf("%d", &n), printf("%d\n", f(n)), 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   1030 <f@plt>
mov    %eax,%esi
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <f@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\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 @f(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int LowerBound(int *, int, int);
int getEQTPos(int A[], int N, int K) {
  int pos = -1;
  if (A[N] >= K) {
    pos = LowerBound(A, N, K);
  }
  return pos;
}


x86 assembly (clang, -O0):
<getEQTPos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x10(%rbp),%eax
jl     114f <getEQTPos+0x3f>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <LowerBound@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getEQTPos>:
movslq %esi,%rax
cmp    %edx,(%rdi,%rax,4)
jge    111e <getEQTPos+0xe>
mov    $0xffffffff,%eax
ret
jmp    1030 <LowerBound@plt>

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

LLVM IR (-O2):
define i32 @getEQTPos(i32* %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = icmp slt i32 %6, %2
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = tail call i32 @LowerBound(i32* %0, i32 %1, i32 %2)
br label %10
10: ; preds = %8, %3
%11 = phi i32 [ %9, %8 ], [ -1, %3 ]
ret i32 %11
}
int walNextHash(int iPriorHash) { return (iPriorHash + 1) & ((4096 * 2) - 1); }


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

x86 assembly (clang, -O2):
<walNextHash>:
lea    0x1(%rdi),%eax
and    $0x1fff,%eax
ret

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

LLVM IR (-O2):
define i32 @walNextHash(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = and i32 %2, 8191
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ itoa(int, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  int n;
  char s[20];
  n = -2147483648;
  itoa(n, s);
  printf("%s\n", s);
  n = 2147483647;
  itoa(n, s);
  printf("%s\n", s);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsp,%rbx
mov    $0x80000000,%edi
mov    %rbx,%rsi
call   1040 <itoa@plt>
lea    0xec2(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x7fffffff,%edi
mov    %rbx,%rsi
call   1040 <itoa@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [20 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -2147483648, i32* %6
%8 = load i32, i32* %6
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%10 = call i32 @itoa(i32 %8, i8* %9)
%11 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
store i32 2147483647, i32* %6
%13 = load i32, i32* %6
%14 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%15 = call i32 @itoa(i32 %13, i8* %14)
%16 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [20 x i8]
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%5 = call i32 @itoa(i32 -2147483648, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%7 = call i32 @itoa(i32 2147483647, i8* %4)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int len(char const *);
int /*<<< orphan*/ write(int, char const *, int);
int errors(const char *errmsg, int exitval) {
  write(2, errmsg, len(errmsg));
  write(2, "\n", 1);
  exit(exitval);
}


x86 assembly (clang, -O0):
<errors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <len@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1040 <write@plt>
mov    $0x2,%edi
lea    0xe94(%rip),%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    -0xc(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<errors>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <len@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <write@plt>
lea    0xead(%rip),%rsi
mov    $0x2,%edi
mov    $0x1,%edx
call   1040 <write@plt>
mov    %ebp,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define i32 @errors(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 i8*, i8** %3
%7 = call i32 @len(i8* %6)
%8 = call i32 @write(i32 2, i8* %5, i32 %7)
%9 = call i32 @write(i32 2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%10 = load i32, i32* %4
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define i32 @errors(i8* %0, i32 %1) {
%3 = tail call i32 @len(i8* %0)
%4 = tail call i32 @write(i32 2, i8* %0, i32 %3)
%5 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%6 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int _finite(double);
int finite(double x) { return _finite(x); }


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

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

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

LLVM IR (-O2):
define i32 @finite(double %0) {
%2 = tail call i32 @_finite(double %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
__attribute__((__noreturn__)) void _Exit(int s) { _exit(s); }


x86 assembly (clang, -O0):
<_Exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<_Exit>:
push   %rax
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @_Exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_exit(i32 %3)
unreachable
}

LLVM IR (-O2):
define void @_Exit(i32 %0) {
%2 = tail call i32 @_exit(i32 %0)
unreachable
}
int test_fun(int x, int y, int z) {
  int c = 0;
  while (x > y + z) {
    y = y + 1;
    z = z + 1;
    c = c + 1;
  }
  return c;
}


x86 assembly (clang, -O0):
<test_fun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
cmp    %ecx,%eax
jle    1145 <test_fun+0x45>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1114 <test_fun+0x14>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fun>:
lea    (%rdx,%rsi,1),%ecx
xor    %eax,%eax
cmp    %edi,%ecx
jge    111e <test_fun+0x1e>
add    $0x2,%ecx
cmp    %ecx,%edi
cmovg  %edi,%ecx
not    %edx
add    %ecx,%edx
sub    %esi,%edx
shr    %edx
add    $0x1,%edx
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_fun(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %2, %1
%5 = icmp slt i32 %4, %0
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = add i32 %4, 2
%8 = call i32 @llvm.smax.i32(i32 %0, i32 %7)
%9 = xor i32 %2, -1
%10 = add i32 %8, %9
%11 = sub i32 %10, %1
%12 = lshr i32 %11, 1
%13 = add nuw i32 %12, 1
br label %14
14: ; preds = %6, %3
%15 = phi i32 [ 0, %3 ], [ %13, %6 ]
ret i32 %15
}
void lvmlockd_set_use(int use) {}


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

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

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

LLVM IR (-O2):
define void @lvmlockd_set_use(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *s) {
  fprintf(stderr, "usage: %s [-s <at port>] [-n net card device]\n", s);
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [47 x i8] c"usage: %s [-s <at port>] [-n net card device]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"usage: %s [-s <at port>] [-n net card device]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ test1(int, char **);
int main(int argc, char **argv) { test1(argc, argv); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @test1(i32 %0, i8** %1)
ret i32 0
}
void sdram_enable_refresh(void) {}


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

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

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

LLVM IR (-O2):
define void @sdram_enable_refresh() {
ret void
}
/* Type definitions */
struct cart {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _cartVarDbName(char *, char *);
int cartVarExists(struct cart *, int /*<<< orphan*/);
int cartVarExistsDb(struct cart *cart, char *db, char *var) {
  return cartVarExists(cart, _cartVarDbName(db, var));
}


x86 assembly (clang, -O0):
<cartVarExistsDb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <_cartVarDbName@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1030 <cartVarExists@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cartVarExistsDb>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1040 <_cartVarDbName@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <cartVarExists@plt>

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

LLVM IR (-O2):
%struct.cart = type { i32 }
define i32 @cartVarExistsDb(%struct.cart* %0, i8* %1, i8* %2) {
%4 = tail call i32 @_cartVarDbName(i8* %1, i8* %2)
%5 = tail call i32 @cartVarExists(%struct.cart* %0, i32 %4)
ret i32 %5
}
/* Variables and functions */
const char *ILLutil_strchr(const char *s, int c) {
  while (*s) {
    if (*s == c)
      return s;
    s++;
  }
  return (char *)NULL;
}


x86 assembly (clang, -O0):
<ILLutil_strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <ILLutil_strchr+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1135 <ILLutil_strchr+0x35>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <ILLutil_strchr+0x4e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <ILLutil_strchr+0xb>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ILLutil_strchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <ILLutil_strchr+0x23>
mov    %rdi,%rax
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %esi,%ecx
je     1125 <ILLutil_strchr+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <ILLutil_strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @ILLutil_strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = sext i8 %6 to i32
%9 = icmp eq i32 %8, %1
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %2
%15 = phi i8* [ null, %2 ], [ null, %10 ], [ %7, %5 ]
ret i8* %15
}
/* Variables and functions */
int sqrt(int);
int distance(int x1, int y1, int x2, int y2) {
  return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}


x86 assembly (clang, -O0):
<distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
sub    -0xc(%rbp),%edi
mov    -0x4(%rbp),%eax
sub    -0xc(%rbp),%eax
imul   %eax,%edi
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0x10(%rbp),%ecx
imul   %ecx,%eax
add    %eax,%edi
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance>:
sub    %edx,%edi
imul   %edi,%edi
sub    %ecx,%esi
imul   %esi,%esi
add    %esi,%edi
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define i32 @distance(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* %7
%11 = sub nsw i32 %9, %10
%12 = load i32, i32* %5
%13 = load i32, i32* %7
%14 = sub nsw i32 %12, %13
%15 = mul nsw i32 %11, %14
%16 = load i32, i32* %6
%17 = load i32, i32* %8
%18 = sub nsw i32 %16, %17
%19 = load i32, i32* %6
%20 = load i32, i32* %8
%21 = sub nsw i32 %19, %20
%22 = mul nsw i32 %18, %21
%23 = add nsw i32 %15, %22
%24 = call i32 @sqrt(i32 %23)
ret i32 %24
}

LLVM IR (-O2):
define i32 @distance(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %0, %2
%6 = mul nsw i32 %5, %5
%7 = sub nsw i32 %1, %3
%8 = mul nsw i32 %7, %7
%9 = add nuw nsw i32 %8, %6
%10 = tail call i32 @sqrt(i32 %9)
ret i32 %10
}
void handle_53(sig) int sig;
{}


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

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

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

LLVM IR (-O2):
define void @handle_53(i32 %0) {
ret void
}
void XResourceManagerString() {}


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

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

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

LLVM IR (-O2):
define void @XResourceManagerString() {
ret void
}
int assign_cell(int i, int j, int symi, int symj) {
  if (i > j)
    return 0;
  else if (symi >= 0) {
    if (symj >= 0)
      return 1;
    else
      return 2;
  } else if (symj >= 0)
    return 3;
  else
    return 0;
}


x86 assembly (clang, -O0):
<assign_cell>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1128 <assign_cell+0x28>
movl   $0x0,-0x4(%rbp)
jmp    1171 <assign_cell+0x71>
cmpl   $0x0,-0x10(%rbp)
jl     1154 <assign_cell+0x54>
cmpl   $0x0,-0x14(%rbp)
jl     1148 <assign_cell+0x48>
movl   $0x1,-0x4(%rbp)
jmp    1171 <assign_cell+0x71>
movl   $0x2,-0x4(%rbp)
jmp    1171 <assign_cell+0x71>
cmpl   $0x0,-0x14(%rbp)
jl     116a <assign_cell+0x6a>
movl   $0x3,-0x4(%rbp)
jmp    1171 <assign_cell+0x71>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<assign_cell>:
xor    %eax,%eax
cmp    %esi,%edi
jg     111b <assign_cell+0x1b>
test   %edx,%edx
js     1113 <assign_cell+0x13>
shr    $0x1f,%ecx
add    $0x1,%ecx
mov    %ecx,%eax
ret
not    %ecx
shr    $0x1f,%ecx
lea    (%rcx,%rcx,2),%eax
ret

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

LLVM IR (-O2):
define i32 @assign_cell(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %0, %1
br i1 %5, label %14, label %6
6: ; preds = %4
%7 = icmp sgt i32 %2, -1
br i1 %7, label %8, label %11
8: ; preds = %6
%9 = icmp sgt i32 %3, -1
%10 = select i1 %9, i32 1, i32 2
br label %14
11: ; preds = %6
%12 = icmp slt i32 %3, 0
%13 = select i1 %12, i32 0, i32 3
br label %14
14: ; preds = %11, %8, %4
%15 = phi i32 [ 0, %4 ], [ %10, %8 ], [ %13, %11 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ did_print_package(char *);
int /*<<< orphan*/ printed_package(char *);
int /*<<< orphan*/ printf(char *, char *);
int print_results_simple(void *db, int field_count, char **row, char **fields) {
  (void)db;
  (void)field_count;
  (void)fields;
  if (!did_print_package(row[0])) {
    printf("%s\n", row[0]);
    printed_package(row[0]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<print_results_simple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1050 <did_print_package@plt>
cmp    $0x0,%eax
jne    117b <print_results_simple+0x4b>
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1040 <printed_package@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_results_simple>:
push   %rbx
mov    %rdx,%rbx
mov    (%rdx),%rdi
call   1050 <did_print_package@plt>
test   %eax,%eax
jne    1157 <print_results_simple+0x27>
mov    (%rbx),%rsi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    (%rbx),%rdi
call   1040 <printed_package@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @print_results_simple(i8* %0, i32 %1, i8** %2, i8** %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8**
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i8** %3, i8*** %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i8**, i8*** %8
%12 = load i8**, i8*** %7
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i32 @did_print_package(i8* %14)
%16 = icmp ne i32 %15, 0
br i1 %16, label %26, label %17
17: ; preds = %4
%18 = load i8**, i8*** %7
%19 = getelementptr inbounds i8*, i8** %18, i64 0
%20 = load i8*, i8** %19
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %20)
%22 = load i8**, i8*** %7
%23 = getelementptr inbounds i8*, i8** %22, i64 0
%24 = load i8*, i8** %23
%25 = call i32 @printed_package(i8* %24)
br label %26
26: ; preds = %17, %4
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @print_results_simple(i8* nocapture readnone %0, i32 %1, i8** nocapture %2, i8** nocapture readnone %3) {
%5 = load i8*, i8** %2
%6 = tail call i32 @did_print_package(i8* %5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = load i8*, i8** %2
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %2
%12 = tail call i32 @printed_package(i8* %11)
br label %13
13: ; preds = %8, %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int printPassFail(const int result) {
  if (result)
    printf("Result:Passed\n\n");
  else
    printf("Result:Failed\n\n");
  return result;
}


x86 assembly (clang, -O0):
<printPassFail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1136 <printPassFail+0x26>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
jmp    1142 <printPassFail+0x32>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printPassFail>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
lea    0xee4(%rip),%rax
lea    0xeec(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [15 x i8] c"Result:Failed\0A\00"
@str.2 = [15 x i8] c"Result:Passed\0A\00"
define i32 @printPassFail(i32 returned %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @str.2, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret i32 %0
}
void psnip_cpu_getid(int func, int *data) {
  __asm__("cpuid"
          : "=a"(data[0]), "=b"(data[1]), "=c"(data[2]), "=d"(data[3])
          : "0"(func), "2"(0));
}


x86 assembly (clang, -O0):
<psnip_cpu_getid>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%r8
mov    -0x18(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
xor    %ecx,%ecx
cpuid
mov    %eax,%r9d
mov    -0x28(%rbp),%rax
mov    %ecx,%esi
mov    -0x20(%rbp),%rcx
mov    %r9d,(%r8)
mov    %ebx,0x4(%rdi)
mov    %esi,0x8(%rcx)
mov    %edx,0xc(%rax)
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<psnip_cpu_getid>:
push   %rbx
mov    %edi,%eax
xor    %ecx,%ecx
cpuid
mov    %eax,(%rsi)
mov    %ebx,0x4(%rsi)
mov    %ecx,0x8(%rsi)
mov    %edx,0xc(%rsi)
pop    %rbx
ret

LLVM IR (-O0):
define void @psnip_cpu_getid(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 2
%11 = load i32*, i32** %4
%12 = getelementptr inbounds i32, i32* %11, i64 3
%13 = load i32, i32* %3
%14 = call { i32, i32, i32, i32 } asm "cpuid", "={ax},={bx},={cx},={dx},0,2,~{dirflag},~{fpsr},~{flags}"(i32 %13, i32 0)
%15 = extractvalue { i32, i32, i32, i32 } %14, 0
%16 = extractvalue { i32, i32, i32, i32 } %14, 1
%17 = extractvalue { i32, i32, i32, i32 } %14, 2
%18 = extractvalue { i32, i32, i32, i32 } %14, 3
store i32 %15, i32* %6
store i32 %16, i32* %8
store i32 %17, i32* %10
store i32 %18, i32* %12
ret void
}

LLVM IR (-O2):
define void @psnip_cpu_getid(i32 %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i32, i32* %1, i64 1
%4 = getelementptr inbounds i32, i32* %1, i64 2
%5 = getelementptr inbounds i32, i32* %1, i64 3
%6 = tail call { i32, i32, i32, i32 } asm "cpuid", "={ax},={bx},={cx},={dx},0,2,~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 0)
%7 = extractvalue { i32, i32, i32, i32 } %6, 0
%8 = extractvalue { i32, i32, i32, i32 } %6, 1
%9 = extractvalue { i32, i32, i32, i32 } %6, 2
%10 = extractvalue { i32, i32, i32, i32 } %6, 3
store i32 %7, i32* %1
store i32 %8, i32* %3
store i32 %9, i32* %4
store i32 %10, i32* %5
ret void
}
/* Variables and functions */
int getcpu();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  printf("cpu count: %d\n", getcpu());
  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)
mov    $0x0,%al
call   1040 <getcpu@plt>
mov    %eax,%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"cpu count: %d\0A\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 i32 (...) @getcpu()
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"cpu count: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getcpu()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ handle_49(int /*<<< orphan*/);
int gen_49() { handle_49(0); }


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

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

LLVM IR (-O0):
define i32 @gen_49() {
%1 = alloca i32
%2 = call i32 @handle_49(i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @gen_49() {
%1 = tail call i32 @handle_49(i32 0)
ret i32 undef
}
void dfn_ac(char c) {}


x86 assembly (clang, -O0):
<dfn_ac>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @dfn_ac(i8 signext %0) {
ret void
}
void rop3_5_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = *D | T;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_5_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_5_1_0>:
mov    (%rdi),%al
or     %esi,%edx
or     %al,%dl
not    %dl
and    %al,%sil
or     %dl,%sil
mov    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_5_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = or i8 %5, %4
%7 = xor i8 %6, -1
%8 = and i8 %4, %1
%9 = or i8 %8, %7
store i8 %9, i8* %0
ret void
}
void sigpipe(int arg) {}


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

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

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

LLVM IR (-O2):
define void @sigpipe(i32 %0) {
ret void
}
int test_imm_7Dint16_mem(short *val) {
  return ((*val) & (-0x7D << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_7Dint16_mem>:
movzwl (%rdi),%eax
test   $0xff83,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_7Dint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -125
%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_7Dint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -125
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
extern void libvampsdk_v_2_7_present(void) {}


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

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

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

LLVM IR (-O2):
define void @libvampsdk_v_2_7_present() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void *strdup(void *);
uint32_t __attribute__((no)) vm_strdup(uint32_t a, void *mem) {
  void *r = strdup(mem + a);
  int ret = r ? r - mem : 0;
  return ret;
}


x86 assembly (clang, -O0):
<vm_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
movslq -0x4(%rbp),%rax
add    %rax,%rdi
call   1030 <strdup@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1152 <vm_strdup+0x42>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x28(%rbp)
jmp    115d <vm_strdup+0x4d>
xor    %eax,%eax
mov    %rax,-0x28(%rbp)
jmp    115d <vm_strdup+0x4d>
mov    -0x28(%rbp),%rax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vm_strdup>:
push   %rbx
mov    %rsi,%rbx
movslq %edi,%rdi
add    %rsi,%rdi
call   1030 <strdup@plt>
mov    %eax,%edx
sub    %ebx,%edx
xor    %ecx,%ecx
test   %rax,%rax
cmovne %edx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @vm_strdup(i32 %0, i8* %1) {
%3 = sext i32 %0 to i64
%4 = getelementptr i8, i8* %1, i64 %3
%5 = tail call i8* @strdup(i8* %4)
%6 = icmp eq i8* %5, null
%7 = ptrtoint i8* %5 to i64
%8 = ptrtoint i8* %1 to i64
%9 = sub i64 %7, %8
%10 = trunc i64 %9 to i32
%11 = select i1 %6, i32 0, i32 %10
ret i32 %11
}
/* Variables and functions */
size_t hash_map_hash_str(const void *key) {
  const char *str = (const char *)key;
  size_t hash = 5381;
  while (*str) {
    hash = ((hash << 5) + hash) + *str;
    ++str;
  }
  return hash;
}


x86 assembly (clang, -O0):
<hash_map_hash_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movq   $0x1505,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1151 <hash_map_hash_str+0x51>
mov    -0x18(%rbp),%rax
shl    $0x5,%rax
add    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbq (%rcx),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <hash_map_hash_str+0x18>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_map_hash_str>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <hash_map_hash_str+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_map_hash_str+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @hash_map_hash_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i64 [ %10, %4 ], [ 5381, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = mul i64 %6, 33
%9 = sext i8 %5 to i64
%10 = add i64 %8, %9
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %10, %4 ]
ret i64 %15
}