xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ pthread_key_t;

/* Variables and functions */
int /*<<< orphan*/ free(void *);
int pthread_key_delete(pthread_key_t __key) {
  free((void *)__key);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @pthread_key_delete(i64 %0) {
%2 = inttoptr i64 %0 to i8*
%3 = tail call i32 @free(i8* %2)
ret i32 0
}
signed long long signedlonglong_ignoring_unsignedshort(signed long long x,
                                                       unsigned short y) {
  return x;
}


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

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

LLVM IR (-O0):
define i64 @signedlonglong_ignoring_unsignedshort(i64 %0, i16 zeroext %1) {
%3 = alloca i64
%4 = alloca i16
store i64 %0, i64* %3
store i16 %1, i16* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @signedlonglong_ignoring_unsignedshort(i64 returned %0, i16 zeroext %1) {
ret i64 %0
}
int foo(int k) { return k + 1; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
unsigned short item_num(int production, int index) {
  return production | ((31 - index) << 11);
}


x86 assembly (clang, -O0):
<item_num>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x1f,%ecx
sub    -0x8(%rbp),%ecx
shl    $0xb,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<item_num>:
shl    $0xb,%esi
mov    $0xf800,%eax
sub    %esi,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @item_num(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 31, %6
%8 = shl i32 %7, 11
%9 = or i32 %5, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}

LLVM IR (-O2):
define zeroext i16 @item_num(i32 %0, i32 %1) {
%3 = mul i32 %1, -2048
%4 = add i32 %3, 63488
%5 = or i32 %4, %0
%6 = trunc i32 %5 to i16
ret i16 %6
}
void do_div(_Complex double *a, _Complex double *b) { *a = *b / (4.0 - 5.0fi); }


x86 assembly (clang, -O0):
<do_div>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0x8(%rax),%xmm1
movsd  0xedb(%rip),%xmm2
movsd  0xedb(%rip),%xmm3
call   1150 <__divdc3>
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  %xmm1,0x8(%rax)
add    $0x10,%rsp
pop    %rbp
ret
cs nopw 0x0(%rax,%rax,1)
nop

x86 assembly (clang, -O2):
<do_div>:
push   %rbx
mov    %rdi,%rbx
movsd  (%rsi),%xmm0
movsd  0x8(%rsi),%xmm1
movsd  0xeeb(%rip),%xmm2
movsd  0xeeb(%rip),%xmm3
call   1130 <__divdc3>
movsd  %xmm0,(%rbx)
movsd  %xmm1,0x8(%rbx)
pop    %rbx
ret
nopl   (%rax)

LLVM IR (-O0):
define void @do_div({ double, double }* %0, { double, double }* %1) {
%3 = alloca { double, double }*
%4 = alloca { double, double }*
store { double, double }* %0, { double, double }** %3
store { double, double }* %1, { double, double }** %4
%5 = load { double, double }*, { double, double }** %4
%6 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
%7 = load double, double* %6
%8 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
%9 = load double, double* %8
%10 = call { double, double } @__divdc3(double %7, double %9, double 4.000000e+00, double -5.000000e+00)
%11 = extractvalue { double, double } %10, 0
%12 = extractvalue { double, double } %10, 1
%13 = load { double, double }*, { double, double }** %3
%14 = getelementptr inbounds { double, double }, { double, double }* %13, i32 0, i32 0
%15 = getelementptr inbounds { double, double }, { double, double }* %13, i32 0, i32 1
store double %11, double* %14
store double %12, double* %15
ret void
}

LLVM IR (-O2):
define void @do_div({ double, double }* nocapture writeonly %0, { double, double }* nocapture %1) {
%3 = getelementptr inbounds { double, double }, { double, double }* %1, i64 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds { double, double }, { double, double }* %1, i64 0, i32 1
%6 = load double, double* %5
%7 = tail call { double, double } @__divdc3(double %4, double %6, double 4.000000e+00, double -5.000000e+00)
%8 = extractvalue { double, double } %7, 0
%9 = extractvalue { double, double } %7, 1
%10 = getelementptr inbounds { double, double }, { double, double }* %0, i64 0, i32 0
%11 = getelementptr inbounds { double, double }, { double, double }* %0, i64 0, i32 1
store double %8, double* %10
store double %9, double* %11
ret void
}
/* Type definitions */
struct memorycontainer {
  int dummy;
};

/* Variables and functions */
struct memorycontainer *createExpression(int, struct memorycontainer *,
                                         struct memorycontainer *);
struct memorycontainer *
createLeqExpression(struct memorycontainer *expression1,
                    struct memorycontainer *expression2) {
  return createExpression(0x0009, expression1, expression2);
}


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

x86 assembly (clang, -O2):
<createLeqExpression>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x9,%edi
jmp    1030 <createExpression@plt>

LLVM IR (-O0):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createLeqExpression(%struct.memorycontainer* %0, %struct.memorycontainer* %1) {
%3 = alloca %struct.memorycontainer*
%4 = alloca %struct.memorycontainer*
store %struct.memorycontainer* %0, %struct.memorycontainer** %3
store %struct.memorycontainer* %1, %struct.memorycontainer** %4
%5 = load %struct.memorycontainer*, %struct.memorycontainer** %3
%6 = load %struct.memorycontainer*, %struct.memorycontainer** %4
%7 = call %struct.memorycontainer* @createExpression(i32 9, %struct.memorycontainer* %5, %struct.memorycontainer* %6)
ret %struct.memorycontainer* %7
}

LLVM IR (-O2):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createLeqExpression(%struct.memorycontainer* %0, %struct.memorycontainer* %1) {
%3 = tail call %struct.memorycontainer* @createExpression(i32 9, %struct.memorycontainer* %0, %struct.memorycontainer* %1)
ret %struct.memorycontainer* %3
}
int test_logicalShift(int x, int n) {
  unsigned u = (unsigned)x;
  unsigned shifted = u >> n;
  return (int)shifted;
}


x86 assembly (clang, -O0):
<test_logicalShift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_logicalShift(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = lshr i32 %8, %9
store i32 %10, i32* %6
%11 = load i32, i32* %6
ret i32 %11
}

LLVM IR (-O2):
define i32 @test_logicalShift(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
ret i32 %3
}
/* Type definitions */
struct timezone {
  scalar_t__ tz_dsttime;
  scalar_t__ tz_minuteswest;
};
struct timeval {
  int tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ bail(char *);
scalar_t__ gettimeofday(struct timeval *, struct timezone *);
int now() {
  struct timeval tp;
  struct timezone tz;
  tz.tz_minuteswest = 0;
  tz.tz_dsttime = 0;
  if (gettimeofday(&tp, &tz))
    bail("Could not get time of day");
  return tp.tv_sec;
}


x86 assembly (clang, -O0):
<now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <gettimeofday@plt>
cmp    $0x0,%rax
je     115b <now+0x3b>
lea    0xeaa(%rip),%rdi
call   1040 <bail@plt>
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<now>:
sub    $0x28,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <gettimeofday@plt>
test   %rax,%rax
je     114c <now+0x2c>
lea    0xeb9(%rip),%rdi
call   1040 <bail@plt>
mov    0x8(%rsp),%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
%struct.timezone = type { i64, i64 }
@.str = [26 x i8] c"Could not get time of day\00"
define i32 @now() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = getelementptr inbounds %struct.timezone, %struct.timezone* %2, i32 0, i32 1
store i64 0, i64* %3
%4 = getelementptr inbounds %struct.timezone, %struct.timezone* %2, i32 0, i32 0
store i64 0, i64* %4
%5 = call i64 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @bail(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %0
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%11 = load i32, i32* %10
ret i32 %11
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
%struct.timezone = type { i64, i64 }
@.str = [26 x i8] c"Could not get time of day\00"
define i32 @now() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = bitcast %struct.timeval* %1 to i8*
%4 = bitcast %struct.timezone* %2 to i8*
%5 = bitcast %struct.timezone* %2 to i8*
%6 = call i64 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %0
%9 = tail call i32 @bail(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %0
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%12 = load i32, i32* %11
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ msg;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printStr(char msg[]) {
  printf("Message read: %s\n", msg);
  printf("Message occupies %i bytes\n", sizeof(msg));
}


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

x86 assembly (clang, -O2):
<printStr>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Message read: %s\0A\00"
@.str.1 = [27 x i8] c"Message occupies %i bytes\0A\00"
define void @printStr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i64 8)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Message read: %s\0A\00"
@.str.1 = [27 x i8] c"Message occupies %i bytes\0A\00"
define void @printStr(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i64 8)
ret void
}
/* Variables and functions */
char *five_irish();
scalar_t__ strcmp(char const *, char *);
char *test_five_irish() {
  const char *out = five_irish();
  do {
    if (strcmp(out, "cúig"))
      return "error, five_irish != cúig";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<test_five_irish>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <five_irish@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed7(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     115d <test_five_irish+0x3d>
lea    0xeac(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    116a <test_five_irish+0x4a>
jmp    1162 <test_five_irish+0x42>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_five_irish>:
push   %rax
xor    %eax,%eax
call   1040 <five_irish@plt>
lea    0xee6(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
lea    0xebf(%rip),%rcx
cmovne %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"c\C3\BAig\00"
@.str.1 = [27 x i8] c"error, five_irish != c\C3\BAig\00"
define i8* @test_five_irish() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* (...) @five_irish()
store i8* %3, i8** %2
br label %4
4: ; preds = %0
%5 = load i8*, i8** %2
%6 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %4
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %11
9: ; preds = %4
br label %10
10: ; preds = %9
store i8* null, i8** %1
br label %11
11: ; preds = %10, %8
%12 = load i8*, i8** %1
ret i8* %12
}

LLVM IR (-O2):
@.str = [6 x i8] c"c\C3\BAig\00"
@.str.1 = [27 x i8] c"error, five_irish != c\C3\BAig\00"
define i8* @test_five_irish() {
%1 = tail call i8* (...) @five_irish()
%2 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* null, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void vzeroall() {
  db(0xC5);
  db(0xFC);
  db(0x77);
}


x86 assembly (clang, -O0):
<vzeroall>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc5,%edi
call   1030 <db@plt>
mov    $0xfc,%edi
call   1030 <db@plt>
mov    $0x77,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vzeroall>:
push   %rax
mov    $0xc5,%edi
call   1030 <db@plt>
mov    $0xfc,%edi
call   1030 <db@plt>
mov    $0x77,%edi
pop    %rax
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @vzeroall() {
%1 = call i32 @db(i32 197)
%2 = call i32 @db(i32 252)
%3 = call i32 @db(i32 119)
ret void
}

LLVM IR (-O2):
define void @vzeroall() {
%1 = tail call i32 @db(i32 197)
%2 = tail call i32 @db(i32 252)
%3 = tail call i32 @db(i32 119)
ret void
}
/* Variables and functions */
int isdigit(int);
int ismydigit(int c) { return isdigit(c); }


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

x86 assembly (clang, -O2):
<ismydigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @ismydigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
void g_node_prepend() {}


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

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

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

LLVM IR (-O2):
define void @g_node_prepend() {
ret void
}
int calc_blsmsk_u32(int src1, int src2) { return (src1 - 1) ^ (src2); }


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

x86 assembly (clang, -O2):
<calc_blsmsk_u32>:
lea    -0x1(%rdi),%eax
xor    %esi,%eax
ret

LLVM IR (-O0):
define i32 @calc_blsmsk_u32(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 = sub nsw i32 %5, 1
%7 = load i32, i32* %4
%8 = xor i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @calc_blsmsk_u32(i32 %0, i32 %1) {
%3 = add nsw i32 %0, -1
%4 = xor i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void Usage(char *nomeProg) {
  printf("Usage: %s <filename> <INICIO|FIM>\n", nomeProg);
  exit(1);
}


x86 assembly (clang, -O0):
<Usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"Usage: %s <filename> <INICIO|FIM>\0A\00"
define void @Usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [35 x i8] c"Usage: %s <filename> <INICIO|FIM>\0A\00"
define void @Usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void sigquit_handler(int sig) {
  printf("Terminating after receipt of SIGQUIT signal\n");
  fflush(stdout);
  exit(1);
}


x86 assembly (clang, -O0):
<sigquit_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<sigquit_handler>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"Terminating after receipt of SIGQUIT signal\0A\00"
@stdout = global i32 0
define void @sigquit_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = call i32 @fflush(i32 %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [44 x i8] c"Terminating after receipt of SIGQUIT signal\00"
define void @sigquit_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
%5 = tail call i32 @exit(i32 1)
unreachable
}
void *align_to_page(void *mem) {
  return (void *)((((unsigned long)mem) + 7) & ~7);
}


x86 assembly (clang, -O0):
<align_to_page>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x7,%rax
and    $0xfffffffffffffff8,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align_to_page>:
lea    0x7(%rdi),%rax
and    $0xfffffffffffffff8,%rax
ret

LLVM IR (-O0):
define i8* @align_to_page(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = add i64 %4, 7
%6 = and i64 %5, -8
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @align_to_page(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = add i64 %2, 7
%4 = and i64 %3, -8
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
int isPowerOfTwo(int x) { return ((x != 0) && !(x & (x - 1))); }


x86 assembly (clang, -O0):
<isPowerOfTwo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112c <isPowerOfTwo+0x2c>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPowerOfTwo>:
test   %edi,%edi
je     110f <isPowerOfTwo+0xf>
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isPowerOfTwo(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 %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
%9 = and i32 %6, %8
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br label %12
12: ; preds = %5, %1
%13 = phi i1 [ false, %1 ], [ %11, %5 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @isPowerOfTwo(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.ctpop.i32(i32 %0)
%5 = icmp ult i32 %4, 2
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
unsigned int *malloc(int);
scalar_t__ rand();
unsigned int *readnum() {
  unsigned int *res = malloc(sizeof(unsigned int));
  *res = ((unsigned int)rand()) % 4096;
  return res;
}


x86 assembly (clang, -O0):
<readnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,%ecx
and    $0xfff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readnum>:
push   %rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <rand@plt>
and    $0xfff,%eax
mov    %eax,(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @readnum() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 4)
store i32* %2, i32** %1
%3 = call i64 (...) @rand()
%4 = trunc i64 %3 to i32
%5 = urem i32 %4, 4096
%6 = load i32*, i32** %1
store i32 %5, i32* %6
%7 = load i32*, i32** %1
ret i32* %7
}

LLVM IR (-O2):
define noalias i32* @readnum() {
%1 = tail call i32* @malloc(i32 4)
%2 = tail call i64 (...) @rand()
%3 = trunc i64 %2 to i32
%4 = and i32 %3, 4095
store i32 %4, i32* %1
ret i32* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Root6(int n, double X) {
  printf("Root6 not implemented yet\n");
  return;
}


x86 assembly (clang, -O0):
<Root6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [27 x i8] c"Root6 not implemented yet\0A\00"
define void @Root6(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [26 x i8] c"Root6 not implemented yet\00"
define void @Root6(i32 %0, double %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret void
}
int multi_line_foo(int i) { return i; }


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

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

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

LLVM IR (-O2):
define i32 @multi_line_foo(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void exit_handler() { printf("this is exit_handler\n"); }


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

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

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

LLVM IR (-O2):
@str = [21 x i8] c"this is exit_handler\00"
define void @exit_handler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
void EVP_PKEY_get1_EC_KEY(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_PKEY_get1_EC_KEY() {
ret void
}
void foo126(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo126(i32 %0) {
ret void
}
volatile void efaterror(n) const char *n;
{
  fatsay();
  perror(n);
  fatcleanup(1);
}


x86 assembly (clang, -O0):
<efaterror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <fatsay@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1050 <perror@plt>
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <fatcleanup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<efaterror>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <fatsay@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <perror@plt>
mov    $0x1,%edi
xor    %eax,%eax
pop    %rbx
jmp    1040 <fatcleanup@plt>

LLVM IR (-O0):
define void @efaterror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @fatsay()
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @perror to i32 (i8*, ...)*)(i8* %4)
%6 = call i32 (i32, ...) bitcast (i32 (...)* @fatcleanup to i32 (i32, ...)*)(i32 1)
ret void
}

LLVM IR (-O2):
define void @efaterror(i8* %0) {
%2 = tail call i32 (...) @fatsay()
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @perror to i32 (i8*, ...)*)(i8* %0)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @fatcleanup to i32 (i32, ...)*)(i32 1)
ret void
}
int _kill(__attribute__((unused)) int pid, __attribute__((unused)) int sig) {
  return -1;
}


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

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

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

LLVM IR (-O2):
define i32 @_kill(i32 %0, i32 %1) {
ret i32 -1
}
int is_legal_lfnchar(char ch) {
  static const char *legals = " \tABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrs"
                              "tuvwxyz0123456789~!@#$%^&*()-{}'`,.";
  const char *i;
  for (i = legals; i; i++)
    if (*i == ch)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_legal_lfnchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    0x2f0f(%rip),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1155 <is_legal_lfnchar+0x55>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    113f <is_legal_lfnchar+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    115c <is_legal_lfnchar+0x5c>
jmp    1144 <is_legal_lfnchar+0x44>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1115 <is_legal_lfnchar+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@is_legal_lfnchar.legals = internal global i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i32 0, i32 0)
@.str = [83 x i8] c" \09ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789~!@#$%^&*()-{}'`,.\00"
define i32 @is_legal_lfnchar(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8*
store i8 %0, i8* %3
%5 = load i8*, i8** @is_legal_lfnchar.legals
store i8* %5, i8** %4
br label %6
6: ; preds = %18, %1
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %21
9: ; preds = %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %12, %14
br i1 %15, label %16, label %17
16: ; preds = %9
store i32 1, i32* %2
br label %22
17: ; preds = %9
br label %18
18: ; preds = %17
%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 i32 0, i32* %2
br label %22
22: ; preds = %21, %16
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @is_legal_lfnchar(i8 signext %0) {
ret i32 1
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int IoDeleteSymbolicLink(int SymbolicLinkName) {
  {
    int tmp_ndt_6;
    tmp_ndt_6 = __VERIFIER_nondet_int();
    if (tmp_ndt_6 == 0) {
      goto switch_4_0;
    } else {
      goto switch_4_default;
      if (0) {
      switch_4_0:
        return (0);
      switch_4_default:;
        return (-1073741823);
      } else {
      }
    }
  }
}


x86 assembly (clang, -O0):
<IoDeleteSymbolicLink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1134 <IoDeleteSymbolicLink+0x24>
jmp    1139 <IoDeleteSymbolicLink+0x29>
jmp    1145 <IoDeleteSymbolicLink+0x35>
movl   $0x0,-0x4(%rbp)
jmp    114c <IoDeleteSymbolicLink+0x3c>
movl   $0xc0000001,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IoDeleteSymbolicLink>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
mov    $0xc0000001,%ecx
cmovne %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @IoDeleteSymbolicLink(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %4
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
br label %12
9: ; preds = %1
br label %13
10: ; No predecessors!
br i1 false, label %11, label %14
11: ; preds = %10
br label %12
12: ; preds = %11, %8
store i32 0, i32* %2
br label %16
13: ; preds = %9
store i32 -1073741823, i32* %2
br label %16
14: ; preds = %10
br label %15
15: ; preds = %14
br label %16
16: ; preds = %12, %13, %15
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @IoDeleteSymbolicLink(i32 %0) {
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 0, i32 -1073741823
ret i32 %4
}
/* Variables and functions */
char const *weak_s2();
const char *__attribute__((section(".test.b"))) sibcall_weak_s2(void) {
  return weak_s2();
}


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

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

LLVM IR (-O0):
define i8* @sibcall_weak_s2() section ".test.b" {
%1 = call i8* (...) @weak_s2()
ret i8* %1
}

LLVM IR (-O2):
define i8* @sibcall_weak_s2() section ".test.b" {
%1 = tail call i8* (...) @weak_s2()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ writec(int /*<<< orphan*/);
void writeb(const char *b, size_t n) {
  for (; n; n--)
    writec(*b++);
}


x86 assembly (clang, -O0):
<writeb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1153 <writeb+0x43>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <writec@plt>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <writeb+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeb>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1143 <writeb+0x33>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1030 <writec@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <writeb+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @writeb(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %11, %4 ], [ %1, %2 ]
%6 = phi i8* [ %7, %4 ], [ %0, %2 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
%10 = tail call i32 @writec(i32 %9)
%11 = add i64 %5, -1
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void hook(const char *str) { printf(">>> %s\n", str); }


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

x86 assembly (clang, -O2):
<hook>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c">>> %s\0A\00"
define void @hook(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_strbuf_tostring_free() {
  printf("NOT IMPLEMENTED:"
         "pa_strbuf_tostring_free"
         "\n");
}


x86 assembly (clang, -O0):
<pa_strbuf_tostring_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [41 x i8] c"NOT IMPLEMENTED:pa_strbuf_tostring_free\0A\00"
define i32 @pa_strbuf_tostring_free() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [40 x i8] c"NOT IMPLEMENTED:pa_strbuf_tostring_free\00"
define i32 @pa_strbuf_tostring_free() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ invalid_phase(char *);
void phase_5(char *input) { invalid_phase("5b"); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"5b\00"
define void @phase_5(i8* nocapture readnone %0) {
%2 = tail call i32 @invalid_phase(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int logmsg_t(char *, char *, int /*<<< orphan*/ *, unsigned int, int);
int eslib_logerror_t(char *name, char *msg, time_t *timer,
                     unsigned int seconds) {
  return logmsg_t(name, msg, timer, seconds, 2);
}


x86 assembly (clang, -O0):
<eslib_logerror_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x2,%r8d
call   1030 <logmsg_t@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eslib_logerror_t>:
mov    $0x2,%r8d
jmp    1030 <logmsg_t@plt>

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

LLVM IR (-O2):
define i32 @eslib_logerror_t(i8* %0, i8* %1, i32* %2, i32 %3) {
%5 = tail call i32 @logmsg_t(i8* %0, i8* %1, i32* %2, i32 %3, i32 2)
ret i32 %5
}
void ao() {}


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

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

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

LLVM IR (-O2):
define void @ao() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, char *);
char *dconfig(char *buf, char *parameter, int n) {
  sprintf(buf, "D%i.%s", n, parameter);
  return buf;
}


x86 assembly (clang, -O0):
<dconfig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xecb(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dconfig>:
push   %rbx
mov    %rsi,%rcx
mov    %rdi,%rbx
lea    0xee2(%rip),%rsi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"D%i.%s\00"
define i8* @dconfig(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %6
%9 = load i8*, i8** %5
%10 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %8, i8* %9)
%11 = load i8*, i8** %4
ret i8* %11
}

LLVM IR (-O2):
@.str = [7 x i8] c"D%i.%s\00"
define i8* @dconfig(i8* returned writeonly %0, i8* %1, i32 %2) {
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2, i8* %1)
ret i8* %0
}
/* Type definitions */
struct addrinfo {
  int /*<<< orphan*/ ai_addrlen;
  int /*<<< orphan*/ ai_addr;
};

/* Variables and functions */
int sendto(int, char const *, int const, int /*<<< orphan*/, int /*<<< orphan*/,
           int /*<<< orphan*/);
int usend(int sockfd, struct addrinfo *targetinfo, const char *data,
          const int DATA_SIZE) {
  return sendto(sockfd, data, DATA_SIZE, 0, targetinfo->ai_addr,
                targetinfo->ai_addrlen);
}


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

x86 assembly (clang, -O2):
<usend>:
mov    (%rsi),%r9d
mov    0x4(%rsi),%r8d
mov    %rdx,%rsi
mov    %ecx,%edx
xor    %ecx,%ecx
jmp    1030 <sendto@plt>

LLVM IR (-O0):
%struct.addrinfo = type { i32, i32 }
define i32 @usend(i32 %0, %struct.addrinfo* %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca %struct.addrinfo*
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store %struct.addrinfo* %1, %struct.addrinfo** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %7
%11 = load i32, i32* %8
%12 = load %struct.addrinfo*, %struct.addrinfo** %6
%13 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %12, i32 0, i32 1
%14 = load i32, i32* %13
%15 = load %struct.addrinfo*, %struct.addrinfo** %6
%16 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %15, i32 0, i32 0
%17 = load i32, i32* %16
%18 = call i32 @sendto(i32 %9, i8* %10, i32 %11, i32 0, i32 %14, i32 %17)
ret i32 %18
}

LLVM IR (-O2):
%struct.addrinfo = type { i32, i32 }
define i32 @usend(i32 %0, %struct.addrinfo* nocapture %1, i8* %2, i32 %3) {
%5 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %1, i64 0, i32 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %1, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @sendto(i32 %0, i8* %2, i32 %3, i32 0, i32 %6, i32 %8)
ret i32 %9
}
__attribute__((no, noclone)) unsigned __int128 t143_2sub(unsigned __int128 y) {
  signed __int128 x = (-1);
  unsigned __int128 r;
  if (__builtin_sub_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t143_2sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
movq   $0xffffffffffffffff,-0x38(%rbp)
ff
movq   $0xffffffffffffffff,-0x40(%rbp)
ff
mov    -0x40(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    %rcx,%r9
sar    $0x3f,%r9
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rax
sub    %rsi,%rdx
sbb    %rax,%rcx
mov    %r9,%r8
sbb    $0x0,%r8
sbb    $0x0,%r9
mov    %r8d,%eax
and    $0x1,%eax
mov    %eax,%esi
mov    %rsi,%rax
neg    %rax
mov    %rax,%rdi
xor    %r9,%rdi
xor    %r8,%rax
or     %rdi,%rax
or     %rsi,%rax
setne  %al
mov    %rdx,-0x50(%rbp)
mov    %rcx,-0x48(%rbp)
test   $0x1,%al
jne    119d <t143_2sub+0x8d>
jmp    11a4 <t143_2sub+0x94>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x50(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t143_2sub>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
not    %rbx
not    %r14
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t143_2sub(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = alloca i128
%8 = bitcast i128* %4 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %0, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
%11 = load i128, i128* %4
store i128 %11, i128* %5
store i128 -1, i128* %6
%12 = load i128, i128* %6
%13 = load i128, i128* %5
%14 = sext i128 %12 to i129
%15 = zext i128 %13 to i129
%16 = call { i129, i1 } @llvm.ssub.with.overflow.i129(i129 %14, i129 %15)
%17 = extractvalue { i129, i1 } %16, 1
%18 = extractvalue { i129, i1 } %16, 0
%19 = trunc i129 %18 to i128
%20 = zext i128 %19 to i129
%21 = icmp ne i129 %18, %20
%22 = or i1 %17, %21
store i128 %19, i128* %7
br i1 %22, label %23, label %25
23: ; preds = %2
%24 = call i32 (...) @bar()
br label %25
25: ; preds = %23, %2
%26 = load i128, i128* %7
store i128 %26, i128* %3
%27 = bitcast i128* %3 to { i64, i64 }*
%28 = load { i64, i64 }, { i64, i64 }* %27
ret { i64, i64 } %28
}

LLVM IR (-O2):
define { i64, i64 } @t143_2sub(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = xor i128 %6, -1
%8 = tail call i32 (...) @bar()
%9 = trunc i128 %7 to i64
%10 = lshr i128 %7, 64
%11 = trunc i128 %10 to i64
%12 = insertvalue { i64, i64 } poison, i64 %9, 0
%13 = insertvalue { i64, i64 } %12, i64 %11, 1
ret { i64, i64 } %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, char const *);
void emit(const char *fn, int n) {
  printf(" if (luaL_loadbuffer(L,(const char*)B%d,sizeof(B%d),\"%s\")==0) "
         "lua_pcall(L, 0, 0, 0);\n",
         n, n, fn);
}


x86 assembly (clang, -O0):
<emit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    %esi,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [86 x i8] c" if (luaL_loadbuffer(L,(const char*)B%d,sizeof(B%d),\22%s\22)==0) lua_pcall(L, 0, 0, 0);\0A\00"
define void @emit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %4
%7 = load i8*, i8** %3
%8 = call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6, i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [86 x i8] c" if (luaL_loadbuffer(L,(const char*)B%d,sizeof(B%d),\22%s\22)==0) lua_pcall(L, 0, 0, 0);\0A\00"
define void @emit(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %1, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ shutdown_server(int);
void catch_ctrlc(int sig) {
  printf("--- Caught ctrl c ---\n");
  shutdown_server(5);
}


x86 assembly (clang, -O0):
<catch_ctrlc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
mov    $0x5,%edi
call   1030 <shutdown_server@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<catch_ctrlc>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
mov    $0x5,%edi
pop    %rax
jmp    1030 <shutdown_server@plt>

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

LLVM IR (-O2):
@str = [22 x i8] c"--- Caught ctrl c ---\00"
define void @catch_ctrlc(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @shutdown_server(i32 5)
ret void
}