xunge/DecIR huggingface dataset:
long proc4(long p1, int p2, short p3, char p4) { return p1 + p2 + p3 * p4; }


x86 assembly (clang, -O0):
<proc4>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dx,%cx
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %cx,-0xe(%rbp)
mov    %al,-0xf(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
movswl -0xe(%rbp),%ecx
movsbl -0xf(%rbp),%edx
imul   %edx,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<proc4>:
movslq %esi,%rsi
add    %rdi,%rsi
movslq %edx,%rdx
movslq %ecx,%rax
imul   %rdx,%rax
add    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @proc4(i64 %0, i32 %1, i16 signext %2, i8 signext %3) {
%5 = alloca i64
%6 = alloca i32
%7 = alloca i16
%8 = alloca i8
store i64 %0, i64* %5
store i32 %1, i32* %6
store i16 %2, i16* %7
store i8 %3, i8* %8
%9 = load i64, i64* %5
%10 = load i32, i32* %6
%11 = sext i32 %10 to i64
%12 = add nsw i64 %9, %11
%13 = load i16, i16* %7
%14 = sext i16 %13 to i32
%15 = load i8, i8* %8
%16 = sext i8 %15 to i32
%17 = mul nsw i32 %14, %16
%18 = sext i32 %17 to i64
%19 = add nsw i64 %12, %18
ret i64 %19
}

LLVM IR (-O2):
define i64 @proc4(i64 %0, i32 %1, i16 signext %2, i8 signext %3) {
%5 = sext i32 %1 to i64
%6 = add nsw i64 %5, %0
%7 = sext i16 %2 to i64
%8 = sext i8 %3 to i64
%9 = mul nsw i64 %8, %7
%10 = add nsw i64 %6, %9
ret i64 %10
}
/* Variables and functions */
void *realloc(void *, size_t);
void *xrealloc(void *ptr, size_t sz) {
  void *new;
  new = realloc(ptr, sz);
  return new;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}
double QuarticEaseIn(double p) { return p * p * p * p; }


x86 assembly (clang, -O0):
<QuarticEaseIn>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<QuarticEaseIn>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @QuarticEaseIn(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = load double, double* %2
%7 = fmul double %5, %6
%8 = load double, double* %2
%9 = fmul double %7, %8
ret double %9
}

LLVM IR (-O2):
define double @QuarticEaseIn(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %2, %0
%4 = fmul double %3, %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalpha(int);
void t_isalpha_0x56() {
  Assert_real((isalpha(86)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              435, ("isalpha should be 1 for V"));
}


x86 assembly (clang, -O0):
<t_isalpha_0x56>:
push   %rbp
mov    %rsp,%rbp
mov    $0x56,%edi
call   1030 <isalpha@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1b3,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0x56>:
push   %rax
mov    $0x56,%edi
call   1030 <isalpha@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x1b3,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for V\00"
define void @t_isalpha_0x56() {
%1 = call i32 @isalpha(i32 86)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 435, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for V\00"
define void @t_isalpha_0x56() {
%1 = tail call i32 @isalpha(i32 86)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 435, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int printf(char *);
int printTheHello(void) { return printf("Hola, Mundo!\n"); }


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"Hola, Mundo!\0A\00"
define i32 @printTheHello() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int glipGetBytes(int type) {
  int bytes;
  switch (type) {
  case 5120:
  case 5121:
    bytes = 1;
    break;
  case 5122:
  case 5123:
    bytes = 2;
    break;
  case 5124:
  case 5125:
    bytes = 4;
    break;
  case 5126:
    bytes = 4;
    break;
  case 5127:
    bytes = 8;
    break;
  default:
    bytes = 0;
    break;
  }
  return bytes;
}


x86 assembly (clang, -O0):
<glipGetBytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffec00,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x7,%eax
ja     116e <glipGetBytes+0x6e>
mov    -0x10(%rbp),%rax
lea    0xed7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x8(%rbp)
jmp    1175 <glipGetBytes+0x75>
movl   $0x2,-0x8(%rbp)
jmp    1175 <glipGetBytes+0x75>
movl   $0x4,-0x8(%rbp)
jmp    1175 <glipGetBytes+0x75>
movl   $0x4,-0x8(%rbp)
jmp    1175 <glipGetBytes+0x75>
movl   $0x8,-0x8(%rbp)
jmp    1175 <glipGetBytes+0x75>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<glipGetBytes>:
add    $0xffffec00,%edi
xor    %eax,%eax
cmp    $0x7,%edi
ja     111a <glipGetBytes+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @glipGetBytes(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %10 [
i32 5120, label %5
i32 5121, label %5
i32 5122, label %6
i32 5123, label %6
i32 5124, label %7
i32 5125, label %7
i32 5126, label %8
i32 5127, label %9
]
5: ; preds = %1, %1
store i32 1, i32* %3
br label %11
6: ; preds = %1, %1
store i32 2, i32* %3
br label %11
7: ; preds = %1, %1
store i32 4, i32* %3
br label %11
8: ; preds = %1
store i32 4, i32* %3
br label %11
9: ; preds = %1
store i32 8, i32* %3
br label %11
10: ; preds = %1
store i32 0, i32* %3
br label %11
11: ; preds = %10, %9, %8, %7, %6, %5
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@switch.table.glipGetBytes = [8 x i32] [i32 1, i32 1, i32 2, i32 2, i32 4, i32 4, i32 4, i32 8]
define i32 @glipGetBytes(i32 %0) {
%2 = add i32 %0, -5120
%3 = icmp ult i32 %2, 8
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [8 x i32], [8 x i32]* @switch.table.glipGetBytes, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int wcscmp(int /*<<< orphan*/ const *, int /*<<< orphan*/ const *);
int wcscoll(const wchar_t *s1, const wchar_t *s2) { return wcscmp(s1, s2); }


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

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

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

LLVM IR (-O2):
define i32 @wcscoll(i32* %0, i32* %1) {
%3 = tail call i32 @wcscmp(i32* %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int randInt(int);
int getRandomFunction(int numFunctions) {
  if (numFunctions < 1) {
    printf("Error: cannot assign the function gene a value as the Function Set "
           "is empty.\nTerminating CGP-Library.\n");
    exit(0);
  }
  return randInt(numFunctions);
}


x86 assembly (clang, -O0):
<getRandomFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    1158 <getRandomFunction+0x28>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x4(%rbp),%edi
call   1040 <randInt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRandomFunction>:
test   %edi,%edi
jle    1139 <getRandomFunction+0x9>
jmp    1040 <randInt@plt>
push   %rax
lea    0xebf(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [103 x i8] c"Error: cannot assign the function gene a value as the Function Set is empty.\0ATerminating CGP-Library.\0A\00"
define i32 @getRandomFunction(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 0)
unreachable
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i32 @randInt(i32 %9)
ret i32 %10
}

LLVM IR (-O2):
@str = [102 x i8] c"Error: cannot assign the function gene a value as the Function Set is empty.\0ATerminating CGP-Library.\00"
define i32 @getRandomFunction(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([102 x i8], [102 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %1
%7 = tail call i32 @randInt(i32 %0)
ret i32 %7
}
void f140(void) {
a:
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
  ({
    ({ 0; });
    ({
      goto a;
      0;
    });
    0;
  });
  0;
}


x86 assembly (clang, -O0):
<f140>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
jmp    1104 <f140+0x4>

x86 assembly (clang, -O2):
<f140>:
jmp    1100 <f140>

LLVM IR (-O0):
define void @f140() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %7, %0
store i32 0, i32* %1
%8 = load i32, i32* %1
store i32 0, i32* %2
%9 = load i32, i32* %2
store i32 0, i32* %3
%10 = load i32, i32* %3
store i32 0, i32* %4
%11 = load i32, i32* %4
br label %7
}

LLVM IR (-O2):
define void @f140() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x35() {
  Assert_real((isspace(53) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              270, ("isspace should be 0 for 5"));
}


x86 assembly (clang, -O0):
<t_isspace_0x35>:
push   %rbp
mov    %rsp,%rbp
mov    $0x35,%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x10e,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isspace_0x35>:
push   %rax
mov    $0x35,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x10e,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for 5\00"
define void @t_isspace_0x35() {
%1 = call i64 @isspace(i32 53)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 270, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for 5\00"
define void @t_isspace_0x35() {
%1 = tail call i64 @isspace(i32 53)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 270, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, short, short, short, short);
void coordinates_to_sexigesimal_str(short hour, short min, short sec,
                                    short msec, char *dst) {
  snprintf(dst, 14, "%i:%i:%i.%i", hour, min, sec, msec);
}


x86 assembly (clang, -O0):
<coordinates_to_sexigesimal_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cx,%ax
mov    %dx,%cx
mov    %si,%dx
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %dx,-0x4(%rbp)
mov    %cx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %r8,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x2(%rbp),%cx
mov    -0x4(%rbp),%r8w
mov    -0x6(%rbp),%ax
mov    $0xe,%esi
lea    0xeab(%rip),%rdx
movswl %cx,%ecx
movswl %r8w,%r8d
movswl %ax,%r9d
movswl -0x8(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coordinates_to_sexigesimal_str>:
push   %rax
mov    %edx,%r9d
mov    %esi,%r10d
mov    %edi,%eax
mov    %ecx,(%rsp)
lea    0xedd(%rip),%rdx
mov    %r8,%rdi
mov    $0xe,%esi
mov    %eax,%ecx
mov    %r10d,%r8d
call   1030 <snprintf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%i:%i:%i.%i\00"
define void @coordinates_to_sexigesimal_str(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3, i8* %4) {
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16
%9 = alloca i16
%10 = alloca i8*
store i16 %0, i16* %6
store i16 %1, i16* %7
store i16 %2, i16* %8
store i16 %3, i16* %9
store i8* %4, i8** %10
%11 = load i8*, i8** %10
%12 = load i16, i16* %6
%13 = load i16, i16* %7
%14 = load i16, i16* %8
%15 = load i16, i16* %9
%16 = call i32 @snprintf(i8* %11, i32 14, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i16 signext %12, i16 signext %13, i16 signext %14, i16 signext %15)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%i:%i:%i.%i\00"
define void @coordinates_to_sexigesimal_str(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3, i8* %4) {
%6 = tail call i32 @snprintf(i8* %4, i32 14, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3)
ret void
}
void gtk_im_preedit_style_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_im_preedit_style_get_type() {
ret void
}
/* Variables and functions */
scalar_t__ undo();
int reset() {
  while (undo())
    ;
}


x86 assembly (clang, -O0):
<reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <undo@plt>
cmp    $0x0,%rax
je     112e <reset+0x1e>
jmp    1118 <reset+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <undo@plt>
test   %rax,%rax
jne    1120 <reset+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @reset() {
%1 = alloca i32
br label %2
2: ; preds = %5, %0
%3 = call i64 (...) @undo()
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %2
br label %2
6: ; preds = %2
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @reset() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @undo()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
void tar_fill_ustar_magic(char b[512]) {
  strcpy(b + 257, "ustar");
  memcpy(b + 263, "00", 2);
}


x86 assembly (clang, -O0):
<tar_fill_ustar_magic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x101,%rdi
lea    0xec2(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
add    $0x107,%rdi
lea    0xeb1(%rip),%rsi
mov    $0x2,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tar_fill_ustar_magic>:
push   %rbx
mov    %rdi,%rbx
add    $0x101,%rdi
lea    0xece(%rip),%rsi
call   1030 <strcpy@plt>
add    $0x107,%rbx
lea    0xec1(%rip),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
pop    %rbx
jmp    1040 <memcpy@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"ustar\00"
@.str.1 = [3 x i8] c"00\00"
define void @tar_fill_ustar_magic(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 257
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 263
%8 = call i32 @memcpy(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"ustar\00"
@.str.1 = [3 x i8] c"00\00"
define void @tar_fill_ustar_magic(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 257
%3 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds i8, i8* %0, i64 263
%5 = tail call i32 @memcpy(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
ret void
}
/* Variables and functions */
int f452(int *);
int f453(int *p) { return f452(p); }


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

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

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

LLVM IR (-O2):
define i32 @f453(i32* %0) {
%2 = tail call i32 @f452(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ quickSort(int *, int /*<<< orphan*/, int);
void sortData(int *pData, int count) { quickSort(pData, 0, count - 1); }


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

x86 assembly (clang, -O2):
<sortData>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <quickSort@plt>

LLVM IR (-O0):
define void @sortData(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
%8 = call i32 @quickSort(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @sortData(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @quickSort(i32* %0, i32 0, i32 %3)
ret void
}
void lcm_resume(void) {
  printk("kernel %s\n", __func__);
  lcm_init();
}


x86 assembly (clang, -O0):
<lcm_resume>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed9(%rip),%rsi
mov    $0x0,%al
call   1030 <printk@plt>
mov    $0x0,%al
call   1040 <lcm_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm_resume>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1030 <printk@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <lcm_init@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"kernel %s\0A\00"
@__func__.lcm_resume = [11 x i8] c"lcm_resume\00"
define void @lcm_resume() {
%1 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.lcm_resume, i64 0, i64 0))
%2 = call i32 (...) @lcm_init()
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"kernel %s\0A\00"
@__func__.lcm_resume = [11 x i8] c"lcm_resume\00"
define void @lcm_resume() {
%1 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.lcm_resume, i64 0, i64 0))
%2 = tail call i32 (...) @lcm_init()
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solcon_length_solution_diagnostics(int k, int *n) {
  int fail;
  double *c;
  fail = _ada_use_c2phc4c(206, &k, n, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_length_solution_diagnostics>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xce,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_length_solution_diagnostics>:
push   %rax
mov    %rsi,%rdx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0xce,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @solcon_length_solution_diagnostics(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %3
store i32* %1, i32** %4
%7 = load i32*, i32** %4
%8 = load double*, double** %6
%9 = call i32 @_ada_use_c2phc4c(i32 206, i32* %3, i32* %7, double* %8, i32 0)
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @solcon_length_solution_diagnostics(i32 %0, i32* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @_ada_use_c2phc4c(i32 206, i32* %3, i32* %1, double* undef, i32 0)
ret i32 %4
}
int main() {
  if (0)
    return 4;
  return 5;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 5
}

LLVM IR (-O2):
define i32 @main() {
ret i32 5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void modifyArrayElement(int e) { printf("%d\n", e *= 2); }


x86 assembly (clang, -O0):
<modifyArrayElement>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
shl    $0x1,%esi
mov    %esi,-0x4(%rbp)
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modifyArrayElement>:
lea    (%rdi,%rdi,1),%esi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @modifyArrayElement(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
int rl_yank_nth_arg(count, ignore)
int count, ignore;
{ return (rl_yank_nth_arg_internal(count, ignore, 0)); }


x86 assembly (clang, -O0):
<rl_yank_nth_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <rl_yank_nth_arg_internal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rl_yank_nth_arg>:
xor    %edx,%edx
xor    %eax,%eax
jmp    1030 <rl_yank_nth_arg_internal@plt>

LLVM IR (-O0):
define i32 @rl_yank_nth_arg(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 (i32, i32, i32, ...) bitcast (i32 (...)* @rl_yank_nth_arg_internal to i32 (i32, i32, i32, ...)*)(i32 %5, i32 %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @rl_yank_nth_arg(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @rl_yank_nth_arg_internal to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 0)
ret i32 %3
}
void invoke_shutdown_call(void *fn) {
  void (*call)() = fn;
  (*call)();
}


x86 assembly (clang, -O0):
<invoke_shutdown_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   *-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invoke_shutdown_call>:
xor    %eax,%eax
jmp    *%rdi

LLVM IR (-O0):
define void @invoke_shutdown_call(i8* %0) {
%2 = alloca i8*
%3 = alloca void (...)*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to void (...)*
store void (...)* %5, void (...)** %3
%6 = load void (...)*, void (...)** %3
ret void
}

LLVM IR (-O2):
define void @invoke_shutdown_call(i8* nocapture %0) {
%2 = bitcast i8* %0 to void (...)*
tail call void (...) %2()
ret void
}
/* Variables and functions */
int errno;
int dag_get_last_error() { return errno; }


x86 assembly (clang, -O0):
<dag_get_last_error>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dag_get_last_error>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @dag_get_last_error() {
%1 = load i32, i32* @errno
ret i32 %1
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @dag_get_last_error() {
%1 = load i32, i32* @errno
ret i32 %1
}
/* Variables and functions */
double __nv_y0(double);
double y0(double __a) { return __nv_y0(__a); }


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

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

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

LLVM IR (-O2):
define double @y0(double %0) {
%2 = tail call double @__nv_y0(double %0)
ret double %2
}
/* Type definitions */
struct dirent {
  int dummy;
};
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
struct dirent *readdir(int /*<<< orphan*/ *);
int __readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result) {
  entry = readdir(dirp);
  *result = entry;
  if (entry == NULL)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<__readdir_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <readdir@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <__readdir_r+0x43>
movl   $0xffffffff,-0x4(%rbp)
jmp    115a <__readdir_r+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__readdir_r>:
push   %rbx
mov    %rdx,%rbx
call   1030 <readdir@plt>
mov    %rax,(%rbx)
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.dirent = type { i32 }
define i32 @__readdir_r(i32* %0, %struct.dirent* %1, %struct.dirent** %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca %struct.dirent*
%7 = alloca %struct.dirent**
store i32* %0, i32** %5
store %struct.dirent* %1, %struct.dirent** %6
store %struct.dirent** %2, %struct.dirent*** %7
%8 = load i32*, i32** %5
%9 = call %struct.dirent* @readdir(i32* %8)
store %struct.dirent* %9, %struct.dirent** %6
%10 = load %struct.dirent*, %struct.dirent** %6
%11 = load %struct.dirent**, %struct.dirent*** %7
store %struct.dirent* %10, %struct.dirent** %11
%12 = load %struct.dirent*, %struct.dirent** %6
%13 = icmp eq %struct.dirent* %12, null
br i1 %13, label %14, label %15
14: ; preds = %3
store i32 -1, i32* %4
br label %16
15: ; preds = %3
store i32 0, i32* %4
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
define i32 @__readdir_r(i32* %0, %struct.dirent* nocapture readnone %1, %struct.dirent** nocapture writeonly %2) {
%4 = tail call %struct.dirent* @readdir(i32* %0)
store %struct.dirent* %4, %struct.dirent** %2
%5 = icmp eq %struct.dirent* %4, null
%6 = sext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ _string_append_with_format_list(char const *, char **,
                                                   int /*<<< orphan*/);
char *string_new();
char *string_from_vformat(const char *format, va_list arguments) {
  char *nuevo = string_new();
  _string_append_with_format_list(format, &nuevo, arguments);
  return nuevo;
}


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

x86 assembly (clang, -O2):
<string_from_vformat>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <string_new@plt>
mov    %rax,(%rsp)
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
call   1040 <_string_append_with_format_list@plt>
mov    (%rsp),%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @string_from_vformat(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i8* (...) @string_new()
store i8* %6, i8** %5
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @_string_append_with_format_list(i8* %7, i8** %5, i32 %8)
%10 = load i8*, i8** %5
ret i8* %10
}

LLVM IR (-O2):
define i8* @string_from_vformat(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = tail call i8* (...) @string_new()
store i8* %5, i8** %3
%6 = call i32 @_string_append_with_format_list(i8* %0, i8** %3, i32 %1)
%7 = load i8*, i8** %3
ret i8* %7
}
int sv_isflags(int flags, int value) { return (flags & value) > 0; }


x86 assembly (clang, -O0):
<sv_isflags>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
cmp    $0x0,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sv_isflags>:
xor    %eax,%eax
test   %edi,%esi
setg   %al
ret

LLVM IR (-O0):
define i32 @sv_isflags(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 = and i32 %5, %6
%8 = icmp sgt i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @sv_isflags(i32 %0, i32 %1) {
%3 = and i32 %1, %0
%4 = icmp sgt i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int encFixed(char **buf, int sz, char *r) {
  memcpy(*buf, r, sz);
  *buf += sz;
  return 0;
}


x86 assembly (clang, -O0):
<encFixed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
movslq %edx,%rdx
add    %rdx,%rcx
mov    %rcx,(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encFixed>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    (%rdi),%rdi
mov    %rdx,%rsi
mov    %ebx,%edx
call   1030 <memcpy@plt>
movslq %ebx,%rax
add    %rax,(%r14)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @encFixed(i8** nocapture %0, i32 %1, i8* %2) {
%4 = load i8*, i8** %0
%5 = tail call i32 @memcpy(i8* %4, i8* %2, i32 %1)
%6 = load i8*, i8** %0
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i8, i8* %6, i64 %7
store i8* %8, i8** %0
ret i32 0
}
int test_imm_CDint32_mem(int *val) {
  return ((*val) & (0xCD << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_CDint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 205
%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_CDint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 205
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct drm_device {
  int dummy;
};

/* Variables and functions */
int radeon_driver_vblank_do_wait(struct drm_device *, unsigned int *, int);
int radeon_driver_vblank_wait2(struct drm_device *dev, unsigned int *sequence) {
  return radeon_driver_vblank_do_wait(dev, sequence, 2);
}


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

x86 assembly (clang, -O2):
<radeon_driver_vblank_wait2>:
mov    $0x2,%edx
jmp    1030 <radeon_driver_vblank_do_wait@plt>

LLVM IR (-O0):
%struct.drm_device = type { i32 }
define i32 @radeon_driver_vblank_wait2(%struct.drm_device* %0, i32* %1) {
%3 = alloca %struct.drm_device*
%4 = alloca i32*
store %struct.drm_device* %0, %struct.drm_device** %3
store i32* %1, i32** %4
%5 = load %struct.drm_device*, %struct.drm_device** %3
%6 = load i32*, i32** %4
%7 = call i32 @radeon_driver_vblank_do_wait(%struct.drm_device* %5, i32* %6, i32 2)
ret i32 %7
}

LLVM IR (-O2):
%struct.drm_device = type { i32 }
define i32 @radeon_driver_vblank_wait2(%struct.drm_device* %0, i32* %1) {
%3 = tail call i32 @radeon_driver_vblank_do_wait(%struct.drm_device* %0, i32* %1, i32 2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ AF_UNIX;
int /*<<< orphan*/ SOCK_SEQPACKET;
int /*<<< orphan*/ check(int /*<<< orphan*/, char *);
int /*<<< orphan*/ make_cloexec(int);
int /*<<< orphan*/ socketpair(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/, int *);
void get_socketpair(int sv[]) {
  check(socketpair(AF_UNIX, SOCK_SEQPACKET, 0, sv), "socketpair");
  make_cloexec(sv[0]);
  make_cloexec(sv[1]);
}


x86 assembly (clang, -O0):
<get_socketpair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    0x2e8c(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rcx
xor    %edx,%edx
call   1030 <socketpair@plt>
mov    %eax,%edi
lea    0xe9e(%rip),%rsi
call   1040 <check@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1050 <make_cloexec@plt>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
call   1050 <make_cloexec@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_socketpair>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    0x2e94(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
mov    %rbx,%rcx
call   1030 <socketpair@plt>
lea    0xea9(%rip),%rsi
mov    %eax,%edi
call   1040 <check@plt>
mov    (%rbx),%edi
call   1050 <make_cloexec@plt>
mov    0x4(%rbx),%edi
pop    %rbx
jmp    1050 <make_cloexec@plt>

LLVM IR (-O0):
@AF_UNIX = global i32 0
@SOCK_SEQPACKET = global i32 0
@.str = [11 x i8] c"socketpair\00"
define void @get_socketpair(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @AF_UNIX
%4 = load i32, i32* @SOCK_SEQPACKET
%5 = load i32*, i32** %2
%6 = call i32 @socketpair(i32 %3, i32 %4, i32 0, i32* %5)
%7 = call i32 @check(i32 %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = call i32 @make_cloexec(i32 %10)
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32, i32* %13
%15 = call i32 @make_cloexec(i32 %14)
ret void
}

LLVM IR (-O2):
@AF_UNIX = global i32 0
@SOCK_SEQPACKET = global i32 0
@.str = [11 x i8] c"socketpair\00"
define void @get_socketpair(i32* %0) {
%2 = load i32, i32* @AF_UNIX
%3 = load i32, i32* @SOCK_SEQPACKET
%4 = tail call i32 @socketpair(i32 %2, i32 %3, i32 0, i32* %0)
%5 = tail call i32 @check(i32 %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %0
%7 = tail call i32 @make_cloexec(i32 %6)
%8 = getelementptr inbounds i32, i32* %0, i64 1
%9 = load i32, i32* %8
%10 = tail call i32 @make_cloexec(i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void m_free(void *ptr) {
  if (ptr != NULL) {
    free(ptr);
  }
}


x86 assembly (clang, -O0):
<m_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <m_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_free>:
test   %rdi,%rdi
je     111a <m_free+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @m_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *GetEnvVar(char const *);
int HasEnvVar(const char *name) { return GetEnvVar(name) != NULL; }


x86 assembly (clang, -O0):
<HasEnvVar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <GetEnvVar@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HasEnvVar>:
push   %rax
call   1030 <GetEnvVar@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @HasEnvVar(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32* @GetEnvVar(i8* %3)
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @HasEnvVar(i8* %0) {
%2 = tail call i32* @GetEnvVar(i8* %0)
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void *malloc(size_t);
void *safe_malloc(size_t nbytes) {
  void *buf;
  if ((buf = malloc(nbytes)) == NULL)
    fatal("Out of memory");
  return buf;
}


x86 assembly (clang, -O0):
<safe_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    114f <safe_malloc+0x2f>
lea    0xeb6(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_malloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <safe_malloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
define noalias i8* @safe_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ hash_keccak(int, int /*<<< orphan*/ const *,
                               int /*<<< orphan*/, int, int /*<<< orphan*/ *,
                               int, int);
int hash_sha3_256(uint8_t *h, const uint8_t *m, uint64_t n) {
  hash_keccak(17 * 8, m, n, 0x06, h, 32, 32);
  return 1;
}


x86 assembly (clang, -O0):
<hash_sha3_256>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%r8
mov    $0x88,%edi
mov    $0x6,%ecx
mov    $0x20,%r9d
movl   $0x20,(%rsp)
call   1030 <hash_keccak@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_sha3_256>:
push   %rax
mov    %rdi,%r8
movl   $0x20,(%rsp)
mov    $0x88,%edi
mov    $0x6,%ecx
mov    $0x20,%r9d
call   1030 <hash_keccak@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @hash_sha3_256(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %5
%8 = load i32, i32* %6
%9 = load i32*, i32** %4
%10 = call i32 @hash_keccak(i32 136, i32* %7, i32 %8, i32 6, i32* %9, i32 32, i32 32)
ret i32 1
}

LLVM IR (-O2):
define i32 @hash_sha3_256(i32* %0, i32* %1, i32 %2) {
%4 = tail call i32 @hash_keccak(i32 136, i32* %1, i32 %2, i32 6, i32* %0, i32 32, i32 32)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int /*<<< orphan*/ __VERIFIER_assume(int);
int __VERIFIER_nondet_int();
void main() {
  int i, n = __VERIFIER_nondet_int();
  __VERIFIER_assume(n >= 2);
  for (i = 2; i % n != 0; i++)
    ;
  __VERIFIER_assert(i <= n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <__VERIFIER_assume@plt>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
je     117d <main+0x4d>
jmp    116f <main+0x3f>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    115a <main+0x2a>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %edi,%edi
cmp    $0x2,%eax
setge  %dil
call   1050 <__VERIFIER_assume@plt>
mov    $0x1,%ecx
nopl   (%rax)
add    $0x1,%ecx
mov    %ecx,%eax
cltd
idiv   %ebx
test   %edx,%edx
jne    1150 <main+0x20>
xor    %edi,%edi
cmp    %ebx,%ecx
setle  %dil
pop    %rbx
jmp    1040 <__VERIFIER_assert@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 2
%6 = zext i1 %5 to i32
%7 = call i32 @__VERIFIER_assume(i32 %6)
store i32 2, i32* %1
br label %8
8: ; preds = %14, %0
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = srem i32 %9, %10
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %8
br label %14
14: ; preds = %13
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 1
store i32 %16, i32* %1
br label %8
17: ; preds = %8
%18 = load i32, i32* %1
%19 = load i32, i32* %2
%20 = icmp sle i32 %18, %19
%21 = zext i1 %20 to i32
%22 = call i32 @__VERIFIER_assert(i32 %21)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp sgt i32 %1, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @__VERIFIER_assume(i32 %3)
br label %5
5: ; preds = %5, %0
%6 = phi i32 [ 2, %0 ], [ %9, %5 ]
%7 = srem i32 %6, %1
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %5
10: ; preds = %5
%11 = icmp sle i32 %6, %1
%12 = zext i1 %11 to i32
%13 = tail call i32 @__VERIFIER_assert(i32 %12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ refresh();
void console_refresh(void) { refresh(); }


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

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

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

LLVM IR (-O2):
define void @console_refresh() {
%1 = tail call i32 (...) @refresh()
ret void
}