xunge/DecIR huggingface dataset:
char **copyblk(v)
register char **v;
{
  register char **nv =
      (char **)malloc((unsigned)((blklen(v) + 1) * sizeof(char **)));
  if (nv == (char **)0)
    fatal("Out of memory");
  return (blkcpy(nv, v));
}


x86 assembly (clang, -O0):
<copyblk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <blklen@plt>
add    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%eax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1186 <copyblk+0x46>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1050 <fatal@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1060 <blkcpy@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyblk>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <blklen@plt>
lea    0x8(,%rax,8),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1170 <copyblk+0x30>
lea    0xe97(%rip),%rdi
xor    %eax,%eax
call   1050 <fatal@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <blkcpy@plt>
cltq
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Out of memory\00"
define i8** @copyblk(i8** %0) {
%2 = alloca i8**
%3 = alloca i8**
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = call i32 (i8**, ...) bitcast (i32 (...)* @blklen to i32 (i8**, ...)*)(i8** %4)
%6 = add nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = mul i64 %7, 8
%9 = trunc i64 %8 to i32
%10 = zext i32 %9 to i64
%11 = call i8* @malloc(i64 %10)
%12 = bitcast i8* %11 to i8**
store i8** %12, i8*** %3
%13 = load i8**, i8*** %3
%14 = icmp eq i8** %13, null
br i1 %14, label %15, label %17
15: ; preds = %1
%16 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %1
%18 = load i8**, i8*** %3
%19 = load i8**, i8*** %2
%20 = call i32 (i8**, i8**, ...) bitcast (i32 (...)* @blkcpy to i32 (i8**, i8**, ...)*)(i8** %18, i8** %19)
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to i8**
ret i8** %22
}

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
define i8** @copyblk(i8** %0) {
%2 = tail call i32 (i8**, ...) bitcast (i32 (...)* @blklen to i32 (i8**, ...)*)(i8** %0)
%3 = shl i32 %2, 3
%4 = add i32 %3, 8
%5 = zext i32 %4 to i64
%6 = tail call i8* @malloc(i64 %5)
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = tail call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = bitcast i8* %6 to i8**
%12 = tail call i32 (i8**, i8**, ...) bitcast (i32 (...)* @blkcpy to i32 (i8**, i8**, ...)*)(i8** %11, i8** %0)
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i8**
ret i8** %14
}
/* Type definitions */
struct sqlConnection {
  int dummy;
};
struct slName {
  int dummy;
};

/* Variables and functions */
struct slName *extNamesForId(struct sqlConnection *, int, char *);
struct slName *genePixRefSeq(struct sqlConnection *conn, int id) {
  return extNamesForId(conn, id, "refSeq");
}


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

x86 assembly (clang, -O2):
<genePixRefSeq>:
lea    0xee9(%rip),%rdx
jmp    1030 <extNamesForId@plt>

LLVM IR (-O0):
%struct.slName = type { i32 }
%struct.sqlConnection = type { i32 }
@.str = [7 x i8] c"refSeq\00"
define %struct.slName* @genePixRefSeq(%struct.sqlConnection* %0, i32 %1) {
%3 = alloca %struct.sqlConnection*
%4 = alloca i32
store %struct.sqlConnection* %0, %struct.sqlConnection** %3
store i32 %1, i32* %4
%5 = load %struct.sqlConnection*, %struct.sqlConnection** %3
%6 = load i32, i32* %4
%7 = call %struct.slName* @extNamesForId(%struct.sqlConnection* %5, i32 %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret %struct.slName* %7
}

LLVM IR (-O2):
%struct.slName = type { i32 }
%struct.sqlConnection = type { i32 }
@.str = [7 x i8] c"refSeq\00"
define %struct.slName* @genePixRefSeq(%struct.sqlConnection* %0, i32 %1) {
%3 = tail call %struct.slName* @extNamesForId(%struct.sqlConnection* %0, i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret %struct.slName* %3
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int intcmp(const void *a, const void *b) {
  return (*(int64_t *)a - *(int64_t *)b);
}


x86 assembly (clang, -O0):
<intcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intcmp>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @intcmp(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @intcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int edit_istep(void *, int, int);
int edit_iprev(void *h, int n) { return (edit_istep(h, n, -1)); }


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

x86 assembly (clang, -O2):
<edit_iprev>:
mov    $0xffffffff,%edx
jmp    1030 <edit_istep@plt>

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

LLVM IR (-O2):
define i32 @edit_iprev(i8* %0, i32 %1) {
%3 = tail call i32 @edit_istep(i8* %0, i32 %1, i32 -1)
ret i32 %3
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ fork();
int getpid();
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  pid_t pid;
  int i;
  fork();
  pid = getpid();
  for (i = 1; i <= 200; i++)
    printf("*This line is from pid %d, value = %d\n", pid, i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0xc8,-0xc(%rbp)
jg     1184 <main+0x54>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe8f(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1157 <main+0x27>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1050 <fork@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebx
mov    $0x1,%ebp
lea    0xeb0(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    $0xc9,%ebp
jne    1150 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [39 x i8] c"*This line is from pid %d, value = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @fork()
%5 = call i32 (...) @getpid()
store i32 %5, i32* %2
store i32 1, i32* %3
br label %6
6: ; preds = %13, %0
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 200
br i1 %8, label %9, label %16
9: ; preds = %6
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
br label %13
13: ; preds = %9
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %6
16: ; preds = %6
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@.str = [39 x i8] c"*This line is from pid %d, value = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @fork()
%2 = tail call i32 (...) @getpid()
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 1, %0 ], [ %6, %3 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %4)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 201
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 0
}
/* Variables and functions */
long long ReadLongLong();
double ReadDouble() {
  union {
    double d;
    long long ll;
  } v;
  v.ll = ReadLongLong();
  return v.d;
}


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

x86 assembly (clang, -O2):
<ReadDouble>:
push   %rax
xor    %eax,%eax
call   1030 <ReadLongLong@plt>
movq   %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%union.anon = type { double }
define double @ReadDouble() {
%1 = alloca %union.anon
%2 = call i64 (...) @ReadLongLong()
%3 = bitcast %union.anon* %1 to i64*
store i64 %2, i64* %3
%4 = bitcast %union.anon* %1 to double*
%5 = load double, double* %4
ret double %5
}

LLVM IR (-O2):
define double @ReadDouble() {
%1 = tail call i64 (...) @ReadLongLong()
%2 = bitcast i64 %1 to double
ret double %2
}
void ff_hevc_put_hevc_uni_w_epel_h48_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_epel_h48_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dup2(int, int);
int do_piping(int pipe_in, int pipe_out) {
  if (pipe_in != -1)
    dup2(pipe_in, 0);
  if (pipe_out != -1)
    dup2(pipe_out, 1);
  return 0;
}


x86 assembly (clang, -O0):
<do_piping>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
je     1132 <do_piping+0x22>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <dup2@plt>
cmpl   $0xffffffff,-0x8(%rbp)
je     1149 <do_piping+0x39>
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
call   1030 <dup2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_piping>:
push   %rbx
mov    %esi,%ebx
cmp    $0xffffffff,%edi
je     111f <do_piping+0xf>
xor    %esi,%esi
call   1030 <dup2@plt>
cmp    $0xffffffff,%ebx
je     1130 <do_piping+0x20>
mov    %ebx,%edi
mov    $0x1,%esi
call   1030 <dup2@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @do_piping(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 = icmp ne i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %3
%9 = call i32 @dup2(i32 %8, i32 0)
br label %10
10: ; preds = %7, %2
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, -1
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* %4
%15 = call i32 @dup2(i32 %14, i32 1)
br label %16
16: ; preds = %13, %10
ret i32 0
}

LLVM IR (-O2):
define i32 @do_piping(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, -1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @dup2(i32 %0, i32 0)
br label %6
6: ; preds = %4, %2
%7 = icmp eq i32 %1, -1
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call i32 @dup2(i32 %1, i32 1)
br label %10
10: ; preds = %8, %6
ret i32 0
}
void e1(void) { return; }


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

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

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

LLVM IR (-O2):
define void @e1() {
ret void
}
/* Variables and functions */
scalar_t__ output_check(int);
int /*<<< orphan*/ output_timing();
void problem_output() {
  if (output_check(10000000.)) {
    output_timing();
  }
}


x86 assembly (clang, -O0):
<problem_output>:
push   %rbp
mov    %rsp,%rbp
mov    $0x989680,%edi
call   1040 <output_check@plt>
cmp    $0x0,%rax
je     113f <problem_output+0x1f>
mov    $0x0,%al
call   1030 <output_timing@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<problem_output>:
push   %rax
mov    $0x989680,%edi
call   1040 <output_check@plt>
test   %rax,%rax
je     1138 <problem_output+0x18>
xor    %eax,%eax
pop    %rcx
jmp    1030 <output_timing@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @problem_output() {
%1 = call i64 @output_check(i32 10000000)
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @output_timing()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @problem_output() {
%1 = tail call i64 @output_check(i32 10000000)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @output_timing()
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int dup2(int oldfd, int newfd) {
  assert(0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @dup2(i32 %0, i32 %1) {
%3 = tail call i32 @assert(i32 0)
ret i32 0
}
int test_imm_67uint8_mem(unsigned char *val) {
  return ((*val) & (0x67 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_67uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 103
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ die(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void print_version() {
  fprintf(stdout, "%s\n", "fss 2.0");
  fflush(stdout);
  die(0);
}


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
lea    0xeb9(%rip),%rdx
call   1030 <fprintf@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %edi,%edi
call   1050 <die@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_version>:
push   %rbx
mov    0x2ea8(%rip),%rbx
mov    (%rbx),%edi
lea    0xebf(%rip),%rsi
lea    0xebc(%rip),%rdx
call   1030 <fprintf@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
xor    %edi,%edi
pop    %rbx
jmp    1050 <die@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [8 x i8] c"fss 2.0\00"
define void @print_version() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
%5 = call i32 @die(i32 0)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [8 x i8] c"fss 2.0\00"
define void @print_version() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
%5 = tail call i32 @die(i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t _fread(void *, size_t, int /*<<< orphan*/ *);
size_t fread(void *ptr, size_t size, size_t nmemb, FILE *f) {
  return _fread(ptr, size * nmemb, f) / size;
}


x86 assembly (clang, -O0):
<fread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
imul   -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <_fread@plt>
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fread>:
push   %rbx
mov    %rsi,%rbx
imul   %rsi,%rdx
mov    %rdx,%rsi
mov    %rcx,%rdx
call   1030 <_fread@plt>
mov    %rax,%rcx
or     %rbx,%rcx
shr    $0x20,%rcx
je     1136 <fread+0x26>
xor    %edx,%edx
div    %rbx
pop    %rbx
ret
xor    %edx,%edx
div    %ebx
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @fread(i8* %0, i64 %1, i64 %2, i32* %3) {
%5 = mul i64 %2, %1
%6 = tail call i64 @_fread(i8* %0, i64 %5, i32* %3)
%7 = udiv i64 %6, %1
ret i64 %7
}
/* Variables and functions */
float wrap_cosf(float);
float wrap_sinf(float);
float my_sin_cos(float x, float *s, float *c) {
  *s = wrap_sinf(x);
  *c = wrap_cosf(x);
}


x86 assembly (clang, -O0):
<my_sin_cos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <wrap_sinf@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x8(%rbp),%xmm0
call   1040 <wrap_cosf@plt>
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_sin_cos>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movss  %xmm0,0x4(%rsp)
call   1030 <wrap_sinf@plt>
movss  %xmm0,(%rbx)
movss  0x4(%rsp),%xmm0
call   1040 <wrap_cosf@plt>
movss  %xmm0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define float @my_sin_cos(float %0, float* %1, float* %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float*
%7 = alloca float*
store float %0, float* %5
store float* %1, float** %6
store float* %2, float** %7
%8 = load float, float* %5
%9 = call float @wrap_sinf(float %8)
%10 = load float*, float** %6
store float %9, float* %10
%11 = load float, float* %5
%12 = call float @wrap_cosf(float %11)
%13 = load float*, float** %7
store float %12, float* %13
%14 = load float, float* %4
ret float %14
}

LLVM IR (-O2):
define float @my_sin_cos(float %0, float* nocapture writeonly %1, float* nocapture writeonly %2) {
%4 = tail call float @wrap_sinf(float %0)
store float %4, float* %1
%5 = tail call float @wrap_cosf(float %0)
store float %5, float* %2
ret float undef
}
void wpas_dbus_signal_debug_show_keys_changed(struct wpa_global *global) {}


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

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

LLVM IR (-O0):
%struct.wpa_global = type opaque
define void @wpas_dbus_signal_debug_show_keys_changed(%struct.wpa_global* %0) {
%2 = alloca %struct.wpa_global*
store %struct.wpa_global* %0, %struct.wpa_global** %2
ret void
}

LLVM IR (-O2):
%struct.wpa_global = type opaque
define void @wpas_dbus_signal_debug_show_keys_changed(%struct.wpa_global* nocapture %0) {
ret void
}
/* Variables and functions */
char *stringprep_convert(char const *, int /*<<< orphan*/, char *,
                         int /*<<< orphan*/);
int /*<<< orphan*/ stringprep_locale_charset();
char *stringprep_utf8_to_locale(const char *str) {
  return stringprep_convert(str, stringprep_locale_charset(), "UTF-8", 0);
}


x86 assembly (clang, -O0):
<stringprep_utf8_to_locale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <stringprep_locale_charset@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
lea    0xeb8(%rip),%rdx
xor    %ecx,%ecx
call   1040 <stringprep_convert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringprep_utf8_to_locale>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <stringprep_locale_charset@plt>
lea    0xece(%rip),%rdx
mov    %rbx,%rdi
mov    %eax,%esi
xor    %ecx,%ecx
pop    %rbx
jmp    1040 <stringprep_convert@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"UTF-8\00"
define i8* @stringprep_utf8_to_locale(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (...) @stringprep_locale_charset()
%5 = call i8* @stringprep_convert(i8* %3, i32 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 0)
ret i8* %5
}

LLVM IR (-O2):
@.str = [6 x i8] c"UTF-8\00"
define i8* @stringprep_utf8_to_locale(i8* %0) {
%2 = tail call i32 (...) @stringprep_locale_charset()
%3 = tail call i8* @stringprep_convert(i8* %0, i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 0)
ret i8* %3
}
int dal_var_field_get(unsigned int field_offset, unsigned int field_len,
                      unsigned int *pFieldValue, unsigned int value) {
  if ((field_len == 0x20) && (0 == field_offset)) {
    *pFieldValue = value;
  } else {
    *pFieldValue = (value >> field_offset) & ((~(0xFFFFFFFF << (field_len))));
  }
  return 0;
}


x86 assembly (clang, -O0):
<dal_var_field_get>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
cmpl   $0x20,-0x8(%rbp)
jne    1134 <dal_var_field_get+0x34>
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
jne    1134 <dal_var_field_get+0x34>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    1157 <dal_var_field_get+0x57>
mov    -0x14(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    %cl,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
mov    -0x18(%rbp),%ecx
xor    $0xffffffff,%eax
and    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dal_var_field_get>:
mov    %ecx,%r8d
mov    %esi,%r10d
mov    %edi,%r9d
mov    %ecx,%edi
mov    %r9d,%ecx
shr    %cl,%edi
mov    $0xffffffff,%eax
mov    %r10d,%ecx
shl    %cl,%eax
xor    $0x20,%esi
not    %eax
and    %edi,%eax
or     %r9d,%esi
cmove  %r8d,%eax
mov    %eax,(%rdx)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @dal_var_field_get(i32 %0, i32 %1, i32* nocapture writeonly %2, i32 %3) {
%5 = icmp eq i32 %1, 32
%6 = icmp eq i32 %0, 0
%7 = and i1 %6, %5
%8 = lshr i32 %3, %0
%9 = shl nsw i32 -1, %1
%10 = xor i32 %9, -1
%11 = and i32 %8, %10
%12 = select i1 %7, i32 %3, i32 %11
store i32 %12, i32* %2
ret i32 0
}
/* Type definitions */
typedef int int8_t;

/* Variables and functions */
int8_t gt_int8_t(int8_t a, int8_t b) { return a > b; }


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

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

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

LLVM IR (-O2):
define i32 @gt_int8_t(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ stepBackground(int /*<<< orphan*/);
int /*<<< orphan*/ stepMonsters();
int /*<<< orphan*/ stepPlayer();
int /*<<< orphan*/ stepProjectiles();
int /*<<< orphan*/ stepSprites();
void gamePlayLoop() {
  stepBackground(0);
  stepPlayer();
  stepMonsters();
  stepProjectiles();
  stepSprites();
}


x86 assembly (clang, -O0):
<gamePlayLoop>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1050 <stepBackground@plt>
mov    $0x0,%al
call   1070 <stepPlayer@plt>
mov    $0x0,%al
call   1060 <stepMonsters@plt>
mov    $0x0,%al
call   1030 <stepProjectiles@plt>
mov    $0x0,%al
call   1040 <stepSprites@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gamePlayLoop>:
push   %rax
xor    %edi,%edi
call   1050 <stepBackground@plt>
xor    %eax,%eax
call   1070 <stepPlayer@plt>
xor    %eax,%eax
call   1060 <stepMonsters@plt>
xor    %eax,%eax
call   1030 <stepProjectiles@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <stepSprites@plt>

LLVM IR (-O0):
define void @gamePlayLoop() {
%1 = call i32 @stepBackground(i32 0)
%2 = call i32 (...) @stepPlayer()
%3 = call i32 (...) @stepMonsters()
%4 = call i32 (...) @stepProjectiles()
%5 = call i32 (...) @stepSprites()
ret void
}

LLVM IR (-O2):
define void @gamePlayLoop() {
%1 = tail call i32 @stepBackground(i32 0)
%2 = tail call i32 (...) @stepPlayer()
%3 = tail call i32 (...) @stepMonsters()
%4 = tail call i32 (...) @stepProjectiles()
%5 = tail call i32 (...) @stepSprites()
ret void
}
unsigned long int fibonacci(int n) {
  if (n == 1 || n == 2)
    return 1;
  else
    return fibonacci(n - 1) + fibonacci(n - 2);
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
je     112f <fibonacci+0x1f>
cmpl   $0x2,-0xc(%rbp)
jne    113c <fibonacci+0x2c>
movq   $0x1,-0x8(%rbp)
jmp    1164 <fibonacci+0x54>
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonacci@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonacci@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
add    $0xffffffff,%ebp
mov    $0x1,%ebx
cmp    $0x2,%ebp
jb     1146 <fibonacci+0x36>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebp,%edi
call   1030 <fibonacci@plt>
add    %rax,%rbx
add    $0xfffffffe,%ebp
cmp    $0x1,%ebp
ja     1130 <fibonacci+0x20>
add    $0x1,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i64 @fibonacci(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 2
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %9, %4 ], [ %0, %1 ]
%7 = phi i64 [ %10, %4 ], [ 0, %1 ]
%8 = tail call i64 @fibonacci(i32 %5)
%9 = add nsw i32 %6, -2
%10 = add i64 %8, %7
%11 = add i32 %6, -3
%12 = icmp ult i32 %11, 2
br i1 %12, label %13, label %4
13: ; preds = %4
%14 = add i64 %10, 1
br label %15
15: ; preds = %13, %1
%16 = phi i64 [ 1, %1 ], [ %14, %13 ]
ret i64 %16
}
void swap(char **arr, int i, int j) {
  char *temp = arr[i];
  arr[i] = arr[j];
  arr[j] = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rcx
movslq %edx,%rdx
mov    (%rdi,%rdx,8),%rsi
mov    %rsi,(%rdi,%rax,8)
mov    %rcx,(%rdi,%rdx,8)
ret

LLVM IR (-O0):
define void @swap(i8** %0, i32 %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8** %0, i8*** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8**, i8*** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8*, i8** %8, i64 %10
%12 = load i8*, i8** %11
store i8* %12, i8** %7
%13 = load i8**, i8*** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = load i8**, i8*** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8*, i8** %18, i64 %20
store i8* %17, i8** %21
%22 = load i8*, i8** %7
%23 = load i8**, i8*** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8*, i8** %23, i64 %25
store i8* %22, i8** %26
ret void
}

LLVM IR (-O2):
define void @swap(i8** nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
store i8* %9, i8** %5
store i8* %6, i8** %8
ret void
}
int test_imm_0Cuint8_reg(unsigned char val) {
  return ((val) & (-0x0C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_0Cuint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -12
%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_0Cuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -12
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int f232(int *);
int f233(int *p) { return f232(p); }


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

x86 assembly (clang, -O2):
<f233>:
jmp    1030 <f232@plt>

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

LLVM IR (-O2):
define i32 @f233(i32* %0) {
%2 = tail call i32 @f232(i32* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ exit(int);
scalar_t__ fputs(char const *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
void Fputs(const char *ptr, FILE *stream) {
  if (fputs(ptr, stream) == EOF) {
    printf("fputs error\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<Fputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fputs@plt>
mov    0x2e94(%rip),%rcx
cmp    (%rcx),%rax
jne    1173 <Fputs+0x43>
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fputs>:
push   %rax
call   1040 <fputs@plt>
mov    0x2eab(%rip),%rcx
cmp    (%rcx),%rax
je     1144 <Fputs+0x14>
pop    %rax
ret
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EOF = global i64 0
@.str = [13 x i8] c"fputs error\0A\00"
define void @Fputs(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
%7 = call i64 @fputs(i8* %5, i32* %6)
%8 = load i64, i64* @EOF
%9 = icmp eq i64 %7, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@EOF = global i64 0
@str = [12 x i8] c"fputs error\00"
define void @Fputs(i8* nocapture %0, i32* nocapture %1) {
%3 = tail call i64 @fputs(i8* %0, i32* %1)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret void
}
/* Type definitions */
typedef size_t uint32_t;
struct can_frame {
  int /*<<< orphan*/ *data;
};

/* Variables and functions */
int /*<<< orphan*/ byteorder(size_t *, int /*<<< orphan*/ *, int);
size_t sdo_get_indicated_size(const struct can_frame *frame) {
  uint32_t size;
  byteorder(&size, &frame->data[4], 4);
  return size;
}


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

x86 assembly (clang, -O2):
<sdo_get_indicated_size>:
push   %rax
mov    (%rdi),%rsi
add    $0x10,%rsi
mov    %rsp,%rdi
mov    $0x4,%edx
call   1030 <byteorder@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.can_frame = type { i32* }
define i64 @sdo_get_indicated_size(%struct.can_frame* %0) {
%2 = alloca %struct.can_frame*
%3 = alloca i64
store %struct.can_frame* %0, %struct.can_frame** %2
%4 = load %struct.can_frame*, %struct.can_frame** %2
%5 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %4, i32 0, i32 0
%6 = load i32*, i32** %5
%7 = getelementptr inbounds i32, i32* %6, i64 4
%8 = call i32 @byteorder(i64* %3, i32* %7, i32 4)
%9 = load i64, i64* %3
ret i64 %9
}

LLVM IR (-O2):
%struct.can_frame = type { i32* }
define i64 @sdo_get_indicated_size(%struct.can_frame* nocapture %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %0, i64 0, i32 0
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 4
%7 = call i32 @byteorder(i64* %2, i32* %6, i32 4)
%8 = load i64, i64* %2
ret i64 %8
}
int sub1() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @sub1() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ le64toh(int /*<<< orphan*/);
uint64_t readq(void *a) {
  uint64_t *p = a;
  return le64toh(*p);
}


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

x86 assembly (clang, -O2):
<readq>:
mov    (%rdi),%edi
jmp    1030 <le64toh@plt>

LLVM IR (-O0):
define i32 @readq(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = call i32 @le64toh(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @readq(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @le64toh(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cfw_stream_close(void *);
void dtor(void *ptr) { cfw_stream_close(ptr); }


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

x86 assembly (clang, -O2):
<dtor>:
jmp    1030 <cfw_stream_close@plt>

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

LLVM IR (-O2):
define void @dtor(i8* %0) {
%2 = tail call i32 @cfw_stream_close(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int triangularNumber;
  triangularNumber = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8;
  printf("The eighth triangular number is %i\n", triangularNumber);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x24,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [36 x i8] c"The eighth triangular number is %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 36, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"The eighth triangular number is %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 36)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char, char, char);
int main(int argc, char *argv[]) {
  char one = 'a';
  char two = 'A';
  char three = 'x';
  char four = 'X';
  printf("Lowercase a is %d, uppercase A is %d;\nlowercase x is %d, uppercase "
         "X is %d\n",
         one, two, three, four);
  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)
movb   $0x61,-0x11(%rbp)
movb   $0x41,-0x12(%rbp)
movb   $0x78,-0x13(%rbp)
movb   $0x58,-0x14(%rbp)
mov    -0x11(%rbp),%dl
mov    -0x12(%rbp),%cl
mov    -0x13(%rbp),%al
lea    0xeba(%rip),%rdi
movsbl %dl,%esi
movsbl %cl,%edx
movsbl %al,%ecx
movsbl -0x14(%rbp),%r8d
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x61,%esi
mov    $0x41,%edx
mov    $0x78,%ecx
mov    $0x58,%r8d
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [76 x i8] c"Lowercase a is %d, uppercase A is %d;\0Alowercase x is %d, uppercase X is %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8 97, i8* %6
store i8 65, i8* %7
store i8 120, i8* %8
store i8 88, i8* %9
%10 = load i8, i8* %6
%11 = load i8, i8* %7
%12 = load i8, i8* %8
%13 = load i8, i8* %9
%14 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i8 signext %10, i8 signext %11, i8 signext %12, i8 signext %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [76 x i8] c"Lowercase a is %d, uppercase A is %d;\0Alowercase x is %d, uppercase X is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i8 signext 97, i8 signext 65, i8 signext 120, i8 signext 88)
ret i32 0
}
/* Variables and functions */
int rand();
int rand_fig() {
  static int last = -1;
  int next;
  do {
    next = rand() % 7;
  } while (next == last);
  return last = next;
}


x86 assembly (clang, -O0):
<rand_fig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    0x2ef5(%rip),%eax
je     1118 <rand_fig+0x8>
mov    -0x4(%rbp),%eax
mov    %eax,0x2ee6(%rip)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_fig>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
movslq %eax,%rcx
imul   $0xffffffff92492493,%rcx,%rax
shr    $0x20,%rax
add    %ecx,%eax
mov    %eax,%edx
shr    $0x1f,%edx
sar    $0x2,%eax
add    %edx,%eax
lea    0x0(,%rax,8),%edx
sub    %edx,%eax
add    %ecx,%eax
cmp    0x2ed6(%rip),%eax
je     1120 <rand_fig+0x10>
mov    %eax,0x2ece(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@rand_fig.last = internal global i32 -1
define i32 @rand_fig() {
%1 = alloca i32
br label %2
2: ; preds = %5, %0
%3 = call i32 (...) @rand()
%4 = srem i32 %3, 7
store i32 %4, i32* %1
br label %5
5: ; preds = %2
%6 = load i32, i32* %1
%7 = load i32, i32* @rand_fig.last
%8 = icmp eq i32 %6, %7
br i1 %8, label %2, label %9
9: ; preds = %5
%10 = load i32, i32* %1
store i32 %10, i32* @rand_fig.last
ret i32 %10
}

LLVM IR (-O2):
@rand_fig.last = internal unnamed_addr global i32 -1
define i32 @rand_fig() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, 7
%4 = load i32, i32* @rand_fig.last
%5 = icmp eq i32 %3, %4
br i1 %5, label %1, label %6
6: ; preds = %1
store i32 %3, i32* @rand_fig.last
ret i32 %3
}
/* Variables and functions */
int MPI_Comm_size(int, int *);
int getsize() {
  int errorcode, size;
  errorcode = MPI_Comm_size((1), &size);
  return size;
}


x86 assembly (clang, -O0):
<getsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
lea    -0x8(%rbp),%rsi
call   1030 <MPI_Comm_size@plt>
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsize>:
push   %rax
lea    0x4(%rsp),%rsi
mov    $0x1,%edi
call   1030 <MPI_Comm_size@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @getsize() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @MPI_Comm_size(i32 1, i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}
/* Type definitions */
struct ttyent {
  int dummy;
};

/* Variables and functions */
scalar_t__ change_ttyflags(struct ttyent *);
struct ttyent *getttyent();
int change_all(void) {
  struct ttyent *tep;
  int rval;
  rval = 0;
  for (tep = getttyent(); tep != NULL; tep = getttyent())
    if (change_ttyflags(tep))
      rval = 1;
  return (rval);
}


x86 assembly (clang, -O0):
<change_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <getttyent@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1174 <change_all+0x54>
mov    -0x8(%rbp),%rdi
call   1040 <change_ttyflags@plt>
cmp    $0x0,%rax
je     115f <change_all+0x3f>
movl   $0x1,-0xc(%rbp)
jmp    1164 <change_all+0x44>
mov    $0x0,%al
call   1030 <getttyent@plt>
mov    %rax,-0x8(%rbp)
jmp    113a <change_all+0x1a>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<change_all>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <getttyent@plt>
test   %rax,%rax
je     115a <change_all+0x3a>
mov    $0x1,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %rax,%rdi
call   1040 <change_ttyflags@plt>
test   %rax,%rax
cmovne %ebp,%ebx
xor    %eax,%eax
call   1030 <getttyent@plt>
test   %rax,%rax
jne    1140 <change_all+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
%struct.ttyent = type { i32 }
define i32 @change_all() {
%1 = tail call %struct.ttyent* (...) @getttyent()
%2 = icmp eq %struct.ttyent* %1, null
br i1 %2, label %11, label %3
3: ; preds = %0, %3
%4 = phi i32 [ %8, %3 ], [ 0, %0 ]
%5 = phi %struct.ttyent* [ %9, %3 ], [ %1, %0 ]
%6 = tail call i64 @change_ttyflags(%struct.ttyent* %5)
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i32 %4, i32 1
%9 = tail call %struct.ttyent* (...) @getttyent()
%10 = icmp eq %struct.ttyent* %9, null
br i1 %10, label %11, label %3
11: ; preds = %3, %0
%12 = phi i32 [ 0, %0 ], [ %8, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO(int);
long int BNCSine() {
  long int stat = 99;
  BNCIO(22);
  return (stat);
}


x86 assembly (clang, -O0):
<BNCSine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x63,-0x8(%rbp)
mov    $0x16,%edi
call   1030 <BNCIO@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNCSine>:
push   %rax
mov    $0x16,%edi
call   1030 <BNCIO@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @BNCSine() {
%1 = alloca i64
store i64 99, i64* %1
%2 = call i32 @BNCIO(i32 22)
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @BNCSine() {
%1 = tail call i32 @BNCIO(i32 22)
ret i64 99
}