xunge/DecIR huggingface dataset:
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, char *);
char *sort(char *);
int main(int argc, char **argv) {
  if (argc != 2)
    printf("%s\n", "");
  else
    printf("%s\n", sort(argv[1]));
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1158 <main+0x38>
lea    0xeb9(%rip),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <printf@plt>
jmp    1174 <main+0x54>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <sort@plt>
mov    %rax,%rsi
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1134 <main+0x14>
mov    0x8(%rsi),%rdi
call   1040 <sort@plt>
mov    %rax,%rsi
jmp    113b <main+0x1b>
lea    0xec8(%rip),%rsi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %16
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i8* @sort(i8* %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %10, %8
%17 = load i32, i32* @EXIT_SUCCESS
ret i32 %17
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i8* @sort(i8* %6)
br label %8
8: ; preds = %2, %4
%9 = phi i8* [ %7, %4 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %2 ]
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ _Error(long, char *);
void Error_ExpressionSyntaxCannotStartWithExpression(long p_position) {
  _Error(p_position, "Expression syntax cannot start with an expression");
}


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

x86 assembly (clang, -O2):
<Error_ExpressionSyntaxCannotStartWithExpression>:
lea    0xee9(%rip),%rsi
jmp    1030 <_Error@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"Expression syntax cannot start with an expression\00"
define void @Error_ExpressionSyntaxCannotStartWithExpression(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @_Error(i64 %3, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"Expression syntax cannot start with an expression\00"
define void @Error_ExpressionSyntaxCannotStartWithExpression(i64 %0) {
%2 = tail call i32 @_Error(i64 %0, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned xrop3_202_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = S ^ D;
  stk2 = T & stk3;
  stk1 = D ^ stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


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

x86 assembly (clang, -O2):
<xrop3_202_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
mov    %eax,%edx
xor    $0xff,%edx
and    %ecx,%edx
xor    $0xff,%edx
and    %eax,%edx
not    %eax
and    %esi,%eax
xor    $0xff,%esi
or     %esi,%eax
or     %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_202_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, 255
%8 = and i32 %6, %7
%9 = xor i32 %8, 255
%10 = and i32 %9, %4
%11 = xor i32 %5, 255
%12 = xor i32 %4, -1
%13 = and i32 %12, %5
%14 = or i32 %13, %11
%15 = or i32 %14, %10
ret i32 %15
}
void call_recover_upcall(int dest_spd, int id, int type) {}


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

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

LLVM IR (-O0):
define void @call_recover_upcall(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
ret void
}

LLVM IR (-O2):
define void @call_recover_upcall(i32 %0, i32 %1, i32 %2) {
ret void
}
void dd_pbl_ios_fb_auth() {}


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

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

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

LLVM IR (-O2):
define void @dd_pbl_ios_fb_auth() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_split_spaces() {
  printf("NOT IMPLEMENTED:"
         "pa_split_spaces"
         "\n");
}


x86 assembly (clang, -O0):
<pa_split_spaces>:
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_split_spaces>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [32 x i8] c"NOT IMPLEMENTED:pa_split_spaces\00"
define i32 @pa_split_spaces() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void Output(int *outX, int *outY) { printf("%d %d\n", *outX, *outY); }


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

x86 assembly (clang, -O2):
<Output>:
mov    (%rdi),%eax
mov    (%rsi),%edx
lea    0xee5(%rip),%rdi
mov    %eax,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%d %d\0A\00"
define void @Output(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define void @Output(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, unsigned long);
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *ret = malloc(size);
  if (!ret)
    die("Can't alloc %ld bytes\n", (unsigned long)size);
  return ret;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <xmalloc+0x34>
mov    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1040 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <xmalloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1040 <die@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Can't alloc %ld bytes\0A\00"
define i8* @xmalloc(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 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @die(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [23 x i8] c"Can't alloc %ld bytes\0A\00"
define noalias i8* @xmalloc(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 @die(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(double *, int /*<<< orphan*/ *, int);
double UsefulBufUtil_CopyUint64ToDouble(uint64_t u64) {
  double d;
  memcpy(&d, &u64, sizeof(uint64_t));
  return d;
}


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

x86 assembly (clang, -O2):
<UsefulBufUtil_CopyUint64ToDouble>:
sub    $0x18,%rsp
mov    %edi,0xc(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define double @UsefulBufUtil_CopyUint64ToDouble(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = bitcast double* %3 to i8*
%5 = call i32 @memcpy(double* %3, i32* %2, i32 4)
%6 = load double, double* %3
ret double %6
}
/* Type definitions */
struct vec3i {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec3i_min(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                             int /*<<< orphan*/ *);
__attribute__((always_)) struct vec3i *
psvec3i_min(struct vec3i *result, struct vec3i *a, struct vec3i *b) {
  vec3i_min((int32_t *)result, (int32_t *)a, (int32_t *)b);
  return result;
}


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

x86 assembly (clang, -O2):
<psvec3i_min>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec3i_min@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec3i = type { i32 }
define %struct.vec3i* @psvec3i_min(%struct.vec3i* %0, %struct.vec3i* %1, %struct.vec3i* %2) {
%4 = alloca %struct.vec3i*
%5 = alloca %struct.vec3i*
%6 = alloca %struct.vec3i*
store %struct.vec3i* %0, %struct.vec3i** %4
store %struct.vec3i* %1, %struct.vec3i** %5
store %struct.vec3i* %2, %struct.vec3i** %6
%7 = load %struct.vec3i*, %struct.vec3i** %4
%8 = bitcast %struct.vec3i* %7 to i32*
%9 = load %struct.vec3i*, %struct.vec3i** %5
%10 = bitcast %struct.vec3i* %9 to i32*
%11 = load %struct.vec3i*, %struct.vec3i** %6
%12 = bitcast %struct.vec3i* %11 to i32*
%13 = call i32 @vec3i_min(i32* %8, i32* %10, i32* %12)
%14 = load %struct.vec3i*, %struct.vec3i** %4
ret %struct.vec3i* %14
}

LLVM IR (-O2):
%struct.vec3i = type { i32 }
define %struct.vec3i* @psvec3i_min(%struct.vec3i* returned %0, %struct.vec3i* %1, %struct.vec3i* %2) {
%4 = getelementptr %struct.vec3i, %struct.vec3i* %0, i64 0, i32 0
%5 = getelementptr %struct.vec3i, %struct.vec3i* %1, i64 0, i32 0
%6 = getelementptr %struct.vec3i, %struct.vec3i* %2, i64 0, i32 0
%7 = tail call i32 @vec3i_min(i32* %4, i32* %5, i32* %6)
ret %struct.vec3i* %0
}
int test_imm_41int8_reg(signed char val) {
  return ((val) & (0x41 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_41int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 65
%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_41int8_reg(i8 signext %0) {
%2 = and i8 %0, 65
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void gl_free(void *p) { free(p); }


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

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

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

LLVM IR (-O2):
define void @gl_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
float schlick_phase_func(float mu) {
  const float g = 0.76;
  const float k = 1.55 * g - 0.55 * (g * g * g);
  return (1. - k * k) / (4. * 3.14159265359 * (1. + k * mu) * (1. + k * mu));
}


x86 assembly (clang, -O0):
<schlick_phase_func>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xf0b(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xefa(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xeed(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xecc(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  0xec8(%rip),%xmm1
mulsd  %xmm0,%xmm1
movss  0xec4(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm2
movsd  0xea3(%rip),%xmm0
addsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm1
movsd  0xe8b(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<schlick_phase_func>:
mulss  0xef8(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
movsd  0xef4(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xeec(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @schlick_phase_func(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %2
store float 0x3FE851EB80000000, float* %3
store float 0x3FEDF85360000000, float* %4
%5 = load float, float* %2
%6 = fmul float 0x3FEDF85360000000, %5
%7 = fpext float %6 to double
%8 = fadd double 1.000000e+00, %7
%9 = fmul double 0x402921FB54442EEA, %8
%10 = load float, float* %2
%11 = fmul float 0x3FEDF85360000000, %10
%12 = fpext float %11 to double
%13 = fadd double 1.000000e+00, %12
%14 = fmul double %9, %13
%15 = fdiv double 0x3FBF730F00000000, %14
%16 = fptrunc double %15 to float
ret float %16
}

LLVM IR (-O2):
define float @schlick_phase_func(float %0) {
%2 = fmul float %0, 0x3FEDF85360000000
%3 = fpext float %2 to double
%4 = fadd double %3, 1.000000e+00
%5 = fmul double %4, 0x402921FB54442EEA
%6 = fmul double %4, %5
%7 = fdiv double 0x3FBF730F00000000, %6
%8 = fptrunc double %7 to float
ret float %8
}
/* Type definitions */
struct taint {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct taint *);
void destroy_taint(struct taint *vector) { free(vector); }


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

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

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

LLVM IR (-O2):
%struct.taint = type { i32 }
define void @destroy_taint(%struct.taint* nocapture %0) {
%2 = tail call i32 @free(%struct.taint* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_string(char *);
int /*<<< orphan*/ hex2int(int /*<<< orphan*/, int);
int /*<<< orphan*/ l_askNbytes(int /*<<< orphan*/, char *, int /*<<< orphan*/,
                               int);
char *long2str(char *, int /*<<< orphan*/);
char *macjobtime(char *arg) {
  return long2str(arg, hex2int(l_askNbytes(get_string(arg), "57", 0, 8), 8));
}


x86 assembly (clang, -O0):
<macjobtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <get_string@plt>
mov    %eax,%edi
lea    0xe9a(%rip),%rsi
xor    %edx,%edx
mov    $0x8,%ecx
call   1030 <l_askNbytes@plt>
mov    %eax,%edi
mov    $0x8,%esi
call   1050 <hex2int@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1060 <long2str@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<macjobtime>:
push   %rbx
mov    %rdi,%rbx
call   1040 <get_string@plt>
lea    0xeb0(%rip),%rsi
mov    %eax,%edi
xor    %edx,%edx
mov    $0x8,%ecx
call   1030 <l_askNbytes@plt>
mov    %eax,%edi
mov    $0x8,%esi
call   1050 <hex2int@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1060 <long2str@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"57\00"
define i8* @macjobtime(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @get_string(i8* %4)
%6 = call i32 @l_askNbytes(i32 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0, i32 8)
%7 = call i32 @hex2int(i32 %6, i32 8)
%8 = call i8* @long2str(i8* %3, i32 %7)
ret i8* %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"57\00"
define i8* @macjobtime(i8* %0) {
%2 = tail call i32 @get_string(i8* %0)
%3 = tail call i32 @l_askNbytes(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0, i32 8)
%4 = tail call i32 @hex2int(i32 %3, i32 8)
%5 = tail call i8* @long2str(i8* %0, i32 %4)
ret i8* %5
}
/* Type definitions */
struct timeval {
  int /*<<< orphan*/ tv_usec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ futimes(int /*<<< orphan*/, struct timeval *);
int main(void) {
  struct timeval foo[2] = {{.tv_sec = 0, .tv_usec = 0},
                           {.tv_sec = 0, .tv_usec = 0}};
  futimes(0, foo);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
lea    -0x20(%rbp),%rsi
xor    %edi,%edi
call   1030 <futimes@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
xor    %edi,%edi
call   1030 <futimes@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x %struct.timeval]
store i32 0, i32* %1
%3 = bitcast [2 x %struct.timeval]* %2 to i8*
%4 = getelementptr inbounds [2 x %struct.timeval], [2 x %struct.timeval]* %2, i64 0, i64 0
%5 = call i32 @futimes(i32 0, %struct.timeval* %4)
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @main() {
%1 = alloca [2 x %struct.timeval]
%2 = bitcast [2 x %struct.timeval]* %1 to i8*
%3 = getelementptr inbounds [2 x %struct.timeval], [2 x %struct.timeval]* %1, i64 0, i64 0
%4 = call i32 @futimes(i32 0, %struct.timeval* %3)
ret i32 0
}
main() { signal(13, 1), _(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <signal@plt>
mov    $0x0,%al
call   1040 <_@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xd,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <signal@plt>
xor    %eax,%eax
call   1040 <_@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (i32, i32, ...) bitcast (i32 (...)* @signal to i32 (i32, i32, ...)*)(i32 13, i32 1)
%2 = call i32 (...) @_()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @signal to i32 (i32, i32, ...)*)(i32 13, i32 1)
%2 = tail call i32 (...) @_()
ret i32 0
}
__attribute__((no, noclone)) signed __int128 t106_4mul(unsigned __int128 x) {
  unsigned __int128 y = (0);
  signed __int128 r;
  if (__builtin_mul_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t106_4mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%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   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x40(%rbp),%rcx
mov    -0x38(%rbp),%rdx
mov    %rdx,-0x68(%rbp)
test   %rdx,%rdx
setne  %dl
test   %rax,%rax
setne  %dil
and    %dl,%dil
mul    %rcx
mov    -0x60(%rbp),%rdx
mov    %rax,%rsi
mov    -0x68(%rbp),%rax
seto   %r8b
or     %r8b,%dil
mul    %rdx
mov    %rax,%rdx
mov    -0x60(%rbp),%rax
seto   %r8b
or     %r8b,%dil
mov    %dil,-0x51(%rbp)
add    %rdx,%rsi
mul    %rcx
mov    %rax,%rcx
mov    -0x51(%rbp),%al
add    %rsi,%rdx
setb   %sil
or     %sil,%al
test   %rdx,%rdx
sets   %sil
or     %sil,%al
mov    %rcx,-0x50(%rbp)
mov    %rdx,-0x48(%rbp)
test   $0x1,%al
jne    11c7 <t106_4mul+0xb7>
jmp    11ce <t106_4mul+0xbe>
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    $0x70,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define { i64, i64 } @t106_4mul(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 0, i128* %6
%12 = load i128, i128* %5
%13 = load i128, i128* %6
%14 = call { i128, i1 } @llvm.umul.with.overflow.i128(i128 %12, i128 %13)
%15 = extractvalue { i128, i1 } %14, 1
%16 = extractvalue { i128, i1 } %14, 0
%17 = icmp ugt i128 %16, 170141183460469231731687303715884105727
%18 = or i1 %15, %17
store i128 %16, i128* %7
br i1 %18, label %19, label %21
19: ; preds = %2
%20 = call i32 (...) @bar()
br label %21
21: ; preds = %19, %2
%22 = load i128, i128* %7
store i128 %22, i128* %3
%23 = bitcast i128* %3 to { i64, i64 }*
%24 = load { i64, i64 }, { i64, i64 }* %23
ret { i64, i64 } %24
}

LLVM IR (-O2):
define { i64, i64 } @t106_4mul(i64 %0, i64 %1) {
ret { i64, i64 } zeroinitializer
}
/* Variables and functions */
int /*<<< orphan*/ closelog();
void snake_log_release(void) { closelog(); }


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

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

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

LLVM IR (-O2):
define void @snake_log_release() {
%1 = tail call i32 (...) @closelog()
ret void
}
/* Variables and functions */
void *memalign(int, int);
void *malloc_64(int size) {
  int mod_64 = size & 0x3f;
  if (mod_64 != 0)
    size += 64 - mod_64;
  return (memalign(64, size));
}


x86 assembly (clang, -O0):
<malloc_64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3f,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     113c <malloc_64+0x2c>
mov    $0x40,%eax
sub    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x40,%edi
call   1030 <memalign@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_64>:
mov    %edi,%eax
and    $0x3f,%eax
mov    $0x40,%esi
sub    %eax,%esi
test   %eax,%eax
cmove  %eax,%esi
add    %edi,%esi
mov    $0x40,%edi
jmp    1030 <memalign@plt>

LLVM IR (-O0):
define i8* @malloc_64(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 63
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* %3
%10 = sub nsw i32 64, %9
%11 = load i32, i32* %2
%12 = add nsw i32 %11, %10
store i32 %12, i32* %2
br label %13
13: ; preds = %8, %1
%14 = load i32, i32* %2
%15 = call i8* @memalign(i32 64, i32 %14)
ret i8* %15
}

LLVM IR (-O2):
define noalias i8* @malloc_64(i32 %0) {
%2 = and i32 %0, 63
%3 = icmp eq i32 %2, 0
%4 = sub nuw nsw i32 64, %2
%5 = select i1 %3, i32 0, i32 %4
%6 = add nsw i32 %5, %0
%7 = tail call align 64 i8* @memalign(i32 64, i32 %6)
ret i8* %7
}
/* Variables and functions */
char *strcat(int /*<<< orphan*/, char *);
int /*<<< orphan*/ strgrow(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
char *strappend(char *str, char *append) {
  return strcat(strgrow(str, strlen(append)), append);
}


x86 assembly (clang, -O0):
<strappend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <strgrow@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1050 <strcat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strappend>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <strgrow@plt>
mov    %eax,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <strcat@plt>

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

LLVM IR (-O2):
define i8* @strappend(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @strgrow(i8* %0, i32 %3)
%5 = tail call i8* @strcat(i32 %4, i8* %1)
ret i8* %5
}
/* Variables and functions */
double RL_standard_uniform(double, int);
int /*<<< orphan*/ assert(int);
double RandomStandardUniform(void) {
  double x = 0.;
  x = RL_standard_uniform(x, 1);
  assert(x >= 0. && x <= 1.);
  return x;
}


x86 assembly (clang, -O0):
<RandomStandardUniform>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%edi
call   1040 <RL_standard_uniform@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x9(%rbp)
jb     116e <RandomStandardUniform+0x4e>
movsd  0xe9d(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
setae  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomStandardUniform>:
push   %rax
xorpd  %xmm0,%xmm0
mov    $0x1,%edi
call   1040 <RL_standard_uniform@plt>
movsd  %xmm0,(%rsp)
ucomisd 0xecc(%rip),%xmm0
setae  %al
movsd  0xeb9(%rip),%xmm1
ucomisd %xmm0,%xmm1
setae  %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @RandomStandardUniform() {
%1 = alloca double
store double 0.000000e+00, double* %1
%2 = load double, double* %1
%3 = call double @RL_standard_uniform(double %2, i32 1)
store double %3, double* %1
%4 = load double, double* %1
%5 = fcmp oge double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load double, double* %1
%8 = fcmp ole double %7, 1.000000e+00
br label %9
9: ; preds = %6, %0
%10 = phi i1 [ false, %0 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load double, double* %1
ret double %13
}

LLVM IR (-O2):
define double @RandomStandardUniform() {
%1 = tail call double @RL_standard_uniform(double 0.000000e+00, i32 1)
%2 = fcmp oge double %1, 0.000000e+00
%3 = fcmp ole double %1, 1.000000e+00
%4 = and i1 %2, %3
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
ret double %1
}
/* Variables and functions */
int /*<<< orphan*/ sbc_a_n();
void opcode_de() { sbc_a_n(); }


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

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

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

LLVM IR (-O2):
define void @opcode_de() {
%1 = tail call i32 (...) @sbc_a_n()
ret void
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ putchar(int);
void getchar4() {
  int c;
  while ((c = getchar()) != 1)
    putchar(c);
}


x86 assembly (clang, -O0):
<getchar4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x4(%rbp)
cmp    $0x1,%eax
je     1148 <getchar4+0x28>
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
jmp    1128 <getchar4+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getchar4>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x1,%eax
je     1145 <getchar4+0x25>
mov    %eax,%edi
call   1030 <putchar@plt>
jmp    1130 <getchar4+0x10>
pop    %rax
ret

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

LLVM IR (-O2):
define void @getchar4() {
%1 = tail call i32 (...) @getchar()
%2 = icmp eq i32 %1, 1
br i1 %2, label %8, label %3
3: ; preds = %0, %3
%4 = phi i32 [ %6, %3 ], [ %1, %0 ]
%5 = tail call i32 @putchar(i32 %4)
%6 = tail call i32 (...) @getchar()
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %3
8: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int qtd_num(int);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char *argv[]) {
  int num;
  scanf("%d", &num);
  printf("Quantidades de  numeros é = %d\n", qtd_num(num));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [33 x i8] c"Quantidades de numeros \C3\A9 = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%8 = load i32, i32* %6
%9 = call i32 @qtd_num(i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [33 x i8] c"Quantidades de numeros \C3\A9 = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = call i32 @qtd_num(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TTWAIN_CloseSource();
int /*<<< orphan*/ TTWAIN_CloseSourceManager(void *);
int /*<<< orphan*/ TTWAIN_DisableSource();
int /*<<< orphan*/ TTWAIN_EndXfer();
int /*<<< orphan*/ TTWAIN_FreeVar();
int /*<<< orphan*/ TTWAIN_UnloadSourceManager();
int TTWAIN_CloseAll(void *hwnd) {
  TTWAIN_EndXfer();
  TTWAIN_DisableSource();
  TTWAIN_CloseSource();
  TTWAIN_CloseSourceManager(hwnd);
  TTWAIN_UnloadSourceManager();
  TTWAIN_FreeVar();
  return 1;
}


x86 assembly (clang, -O0):
<TTWAIN_CloseAll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <TTWAIN_EndXfer@plt>
mov    $0x0,%al
call   1030 <TTWAIN_DisableSource@plt>
mov    $0x0,%al
call   1070 <TTWAIN_CloseSource@plt>
mov    -0x8(%rbp),%rdi
call   1060 <TTWAIN_CloseSourceManager@plt>
mov    $0x0,%al
call   1050 <TTWAIN_UnloadSourceManager@plt>
mov    $0x0,%al
call   1080 <TTWAIN_FreeVar@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TTWAIN_CloseAll>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <TTWAIN_EndXfer@plt>
xor    %eax,%eax
call   1030 <TTWAIN_DisableSource@plt>
xor    %eax,%eax
call   1070 <TTWAIN_CloseSource@plt>
mov    %rbx,%rdi
call   1060 <TTWAIN_CloseSourceManager@plt>
xor    %eax,%eax
call   1050 <TTWAIN_UnloadSourceManager@plt>
xor    %eax,%eax
call   1080 <TTWAIN_FreeVar@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @TTWAIN_CloseAll(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @TTWAIN_EndXfer()
%4 = call i32 (...) @TTWAIN_DisableSource()
%5 = call i32 (...) @TTWAIN_CloseSource()
%6 = load i8*, i8** %2
%7 = call i32 @TTWAIN_CloseSourceManager(i8* %6)
%8 = call i32 (...) @TTWAIN_UnloadSourceManager()
%9 = call i32 (...) @TTWAIN_FreeVar()
ret i32 1
}

LLVM IR (-O2):
define i32 @TTWAIN_CloseAll(i8* %0) {
%2 = tail call i32 (...) @TTWAIN_EndXfer()
%3 = tail call i32 (...) @TTWAIN_DisableSource()
%4 = tail call i32 (...) @TTWAIN_CloseSource()
%5 = tail call i32 @TTWAIN_CloseSourceManager(i8* %0)
%6 = tail call i32 (...) @TTWAIN_UnloadSourceManager()
%7 = tail call i32 (...) @TTWAIN_FreeVar()
ret i32 1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void SSIAdvFrameHoldEnable(uint32_t ui32Base) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000004))) |= 0x00000400;
}


x86 assembly (clang, -O0):
<SSIAdvFrameHoldEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x4,%eax
cltq
mov    (%rax),%ecx
or     $0x400,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSIAdvFrameHoldEnable>:
movslq %edi,%rax
orl    $0x400,0x4(%rax)
ret

LLVM IR (-O0):
define void @SSIAdvFrameHoldEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 4
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 1024
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @SSIAdvFrameHoldEnable(i32 %0) {
%2 = add nsw i32 %0, 4
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 1024
store volatile i32 %6, i32* %4
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, double *);
int main(void) {
  long int count;
  long int index;
  double *ptd;
  for (count = 0; count <= 100000000000000; count++) {
    ptd = (double *)malloc(999999 * sizeof(double));
    printf("%p\n", ptd);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movabs $0x5af3107a4000,%rax
cmp    %rax,-0x10(%rbp)
jg     117a <main+0x5a>
mov    $0x7a11f8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1137 <main+0x17>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movabs $0x5af3107a4001,%rbx
lea    0xecb(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x7a11f8,%edi
call   1040 <malloc@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
add    $0xffffffffffffffff,%rbx
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca double*
store i32 0, i32* %1
store i64 0, i64* %2
br label %5
5: ; preds = %13, %0
%6 = load i64, i64* %2
%7 = icmp sle i64 %6, 100000000000000
br i1 %7, label %8, label %16
8: ; preds = %5
%9 = call i64 @malloc(i32 7999992)
%10 = inttoptr i64 %9 to double*
store double* %10, double** %4
%11 = load double*, double** %4
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %11)
br label %13
13: ; preds = %8
%14 = load i64, i64* %2
%15 = add nsw i64 %14, 1
store i64 %15, i64* %2
br label %5
16: ; preds = %5
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@.str = [4 x i8] c"%p\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i64 [ 0, %0 ], [ %6, %1 ]
%3 = tail call i64 @malloc(i32 7999992)
%4 = inttoptr i64 %3 to double*
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %4)
%6 = add nuw nsw i64 %2, 1
%7 = icmp eq i64 %6, 100000000000001
br i1 %7, label %8, label %1
8: ; preds = %1
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ recvfrom(int, void *, size_t, int, int /*<<< orphan*/,
                            int /*<<< orphan*/);
ssize_t recv(int fd, void *buf, size_t len, int flags) {
  return recvfrom(fd, buf, len, flags, 0, 0);
}


x86 assembly (clang, -O0):
<recv>:
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    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <recvfrom@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recv>:
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <recvfrom@plt>

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

LLVM IR (-O2):
define i32 @recv(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i32 @recvfrom(i32 %0, i8* %1, i64 %2, i32 %3, i32 0, i32 0)
ret i32 %5
}
int Cyc_Execinfo_bt() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @Cyc_Execinfo_bt() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int _ls_free(void *data) {
  free(data);
  return 0;
}


x86 assembly (clang, -O0):
<_ls_free>:
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):
<_ls_free>:
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @_ls_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int get_proc_cpu_nr();
int get_sys_cpu_nr();
int /*<<< orphan*/ stderr;
int get_cpu_nr(unsigned int max_nr_cpus) {
  int cpu_nr;
  if ((cpu_nr = get_sys_cpu_nr()) == 0) {
    cpu_nr = get_proc_cpu_nr();
  }
  if (cpu_nr > max_nr_cpus) {
    fprintf(stderr, ("Cannot handle so many processors!\n"));
    exit(1);
  }
  return cpu_nr;
}


x86 assembly (clang, -O0):
<get_cpu_nr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <get_sys_cpu_nr@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jne    1168 <get_cpu_nr+0x28>
mov    $0x0,%al
call   1050 <get_proc_cpu_nr@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jbe    1193 <get_cpu_nr+0x53>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
lea    0xe7c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cpu_nr>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <get_sys_cpu_nr@plt>
test   %eax,%eax
jne    1155 <get_cpu_nr+0x15>
xor    %eax,%eax
call   1050 <get_proc_cpu_nr@plt>
cmp    %ebx,%eax
ja     115b <get_cpu_nr+0x1b>
pop    %rbx
ret
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
lea    0xe95(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"Cannot handle so many processors!\0A\00"
define i32 @get_cpu_nr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @get_sys_cpu_nr()
store i32 %4, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @get_proc_cpu_nr()
store i32 %7, i32* %3
br label %8
8: ; preds = %6, %1
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = icmp ugt i32 %9, %10
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"Cannot handle so many processors!\0A\00"
define i32 @get_cpu_nr(i32 %0) {
%2 = tail call i32 (...) @get_sys_cpu_nr()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @get_proc_cpu_nr()
br label %6
6: ; preds = %4, %1
%7 = phi i32 [ %5, %4 ], [ %2, %1 ]
%8 = icmp ugt i32 %7, %0
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%12 = tail call i32 @exit(i32 1)
unreachable
13: ; preds = %6
ret i32 %7
}