xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_219() {
  Assert_real((isqrt(219) == 14),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              1100, ("Integer square root of 219 should be 14"));
}


x86 assembly (clang, -O0):
<t_sqrt_219>:
push   %rbp
mov    %rsp,%rbp
mov    $0xdb,%edi
call   1030 <isqrt@plt>
cmp    $0xe,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x44c,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_219>:
push   %rax
mov    $0xdb,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xe,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x44c,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 219 should be 14\00"
define void @t_sqrt_219() {
%1 = call i32 @isqrt(i32 219)
%2 = icmp eq i32 %1, 14
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1100, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 219 should be 14\00"
define void @t_sqrt_219() {
%1 = tail call i32 @isqrt(i32 219)
%2 = icmp eq i32 %1, 14
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1100, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void foo135(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo135(i32 %0) {
ret void
}
double euros(double unite) {
  double euros = 0;
  euros = unite / 655.96;
  return euros;
}


x86 assembly (clang, -O0):
<euros>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<euros>:
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @euros(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
store double 0.000000e+00, double* %3
%4 = load double, double* %2
%5 = fdiv double %4, 6.559600e+02
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @euros(double %0) {
%2 = fdiv double %0, 6.559600e+02
ret double %2
}
/* Variables and functions */
void *realloc(void *, int);
void *naRealloc(void *b, int n) { return realloc(b, n); }


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

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

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

LLVM IR (-O2):
define i8* @naRealloc(i8* %0, i32 %1) {
%3 = tail call i8* @realloc(i8* %0, i32 %1)
ret i8* %3
}
void ccp_sendmsg() { ; }


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

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

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

LLVM IR (-O2):
define void @ccp_sendmsg() {
ret void
}
int parse() {}


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

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

LLVM IR (-O0):
define i32 @parse() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @parse() {
ret i32 undef
}
void INT_Excep_USB1_D0FIFO1(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_USB1_D0FIFO1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ myexit();
void quit(int status, void *pid) { myexit(); }


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

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

LLVM IR (-O0):
define void @quit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = call i32 (...) @myexit()
ret void
}

LLVM IR (-O2):
define void @quit(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 (...) @myexit()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ i;

/* Variables and functions */
int /*<<< orphan*/ err(int, char *, char const *);
scalar_t__ sysctlbyname(char const *, int *, size_t *, int /*<<< orphan*/ *,
                        int /*<<< orphan*/);
int getsysctl(const char *name) {
  size_t len;
  int i;
  len = sizeof(i);
  if (sysctlbyname(name, &i, &len, NULL, 0) < 0)
    err(-1, "%s", name);
  return (i);
}


x86 assembly (clang, -O0):
<getsysctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x4,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x10(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
call   1040 <sysctlbyname@plt>
cmp    $0x0,%rax
jge    116b <getsysctl+0x4b>
mov    -0x8(%rbp),%rdx
mov    $0xffffffff,%edi
lea    0xe9a(%rip),%rsi
call   1030 <err@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsysctl>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movq   $0x4,0x8(%rsp)
lea    0x4(%rsp),%rsi
lea    0x8(%rsp),%rdx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <sysctlbyname@plt>
test   %rax,%rax
jns    115e <getsysctl+0x3e>
lea    0xeaf(%rip),%rsi
mov    $0xffffffff,%edi
mov    %rbx,%rdx
call   1030 <err@plt>
mov    0x4(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @getsysctl(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i32
store i8* %0, i8** %2
store i64 4, i64* %3
%5 = load i8*, i8** %2
%6 = call i64 @sysctlbyname(i8* %5, i32* %4, i64* %3, i32* null, i32 0)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @err(i32 -1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %1
%12 = load i32, i32* %4
ret i32 %12
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @getsysctl(i8* %0) {
%2 = alloca i64
%3 = alloca i32
%4 = bitcast i64* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i64 4, i64* %2
%6 = call i64 @sysctlbyname(i8* %0, i32* %3, i64* %2, i32* null, i32 0)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @err(i32 -1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %10
10: ; preds = %8, %1
%11 = load i32, i32* %3
ret i32 %11
}
/* Type definitions */
struct strbuf {
  int dummy;
};

/* Variables and functions */
struct strbuf **strbuf_split_buf(char const *, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ strlen(char const *);
struct strbuf **strbuf_split_str(const char *str, int terminator, int max) {
  return strbuf_split_buf(str, strlen(str), terminator, max);
}


x86 assembly (clang, -O0):
<strbuf_split_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1040 <strbuf_split_buf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strbuf_split_str>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <strbuf_split_buf@plt>

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

LLVM IR (-O2):
%struct.strbuf = type { i32 }
define %struct.strbuf** @strbuf_split_str(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call %struct.strbuf** @strbuf_split_buf(i8* %0, i32 %4, i32 %1, i32 %2)
ret %struct.strbuf** %5
}
/* Variables and functions */
int ctest_main(int, char const **);
int main(int argc, const char *argv[]) {
  int i = ctest_main(argc, argv);
  return i;
}


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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <ctest_main@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <ctest_main@plt>

LLVM IR (-O0):
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 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 @ctest_main(i32 %7, i8** %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
ret i32 %10
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @ctest_main(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ SPK_Close();
void PCS_Close() { SPK_Close(); }


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

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

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

LLVM IR (-O2):
define void @PCS_Close() {
%1 = tail call i32 (...) @SPK_Close()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void HandleUSR2(int sig) {
  static int count = 0;
  if (++count == 2)
    exit(0);
}


x86 assembly (clang, -O0):
<HandleUSR2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2f0b(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f02(%rip)
cmp    $0x2,%eax
jne    113a <HandleUSR2+0x2a>
xor    %edi,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HandleUSR2>:
push   %rax
mov    0x2f15(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f0c(%rip)
cmp    $0x2,%eax
je     1127 <HandleUSR2+0x17>
pop    %rax
ret
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@HandleUSR2.count = internal global i32 0
define void @HandleUSR2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @HandleUSR2.count
%4 = add nsw i32 %3, 1
store i32 %4, i32* @HandleUSR2.count
%5 = icmp eq i32 %4, 2
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @exit(i32 0)
unreachable
8: ; preds = %1
ret void
}

LLVM IR (-O2):
@HandleUSR2.count = internal unnamed_addr global i32 0
define void @HandleUSR2(i32 %0) {
%2 = load i32, i32* @HandleUSR2.count
%3 = add nsw i32 %2, 1
store i32 %3, i32* @HandleUSR2.count
%4 = icmp eq i32 %3, 2
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %1
ret void
}
int ftruncate(int fd, unsigned length) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ftruncate(i32 %0, i32 %1) {
ret i32 0
}
/* Type definitions */
struct input_stream {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ input_stream_getdelims(struct input_stream *, char **,
                                          size_t *, char *);
ssize_t input_stream_getline(struct input_stream *in, char **lineptr,
                             size_t *n) {
  return input_stream_getdelims(in, lineptr, n, "\n");
}


x86 assembly (clang, -O0):
<input_stream_getline>:
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
lea    0xec9(%rip),%rcx
call   1030 <input_stream_getdelims@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_stream_getline>:
lea    0xee9(%rip),%rcx
jmp    1030 <input_stream_getdelims@plt>

LLVM IR (-O0):
%struct.input_stream = type { i32 }
@.str = [2 x i8] c"\0A\00"
define i32 @input_stream_getline(%struct.input_stream* %0, i8** %1, i64* %2) {
%4 = alloca %struct.input_stream*
%5 = alloca i8**
%6 = alloca i64*
store %struct.input_stream* %0, %struct.input_stream** %4
store i8** %1, i8*** %5
store i64* %2, i64** %6
%7 = load %struct.input_stream*, %struct.input_stream** %4
%8 = load i8**, i8*** %5
%9 = load i64*, i64** %6
%10 = call i32 @input_stream_getdelims(%struct.input_stream* %7, i8** %8, i64* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 %10
}

LLVM IR (-O2):
%struct.input_stream = type { i32 }
@.str = [2 x i8] c"\0A\00"
define i32 @input_stream_getline(%struct.input_stream* %0, i8** %1, i64* %2) {
%4 = tail call i32 @input_stream_getdelims(%struct.input_stream* %0, i8** %1, i64* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}
/* Type definitions */
struct struct_automata {
  int dummy;
};

/* Variables and functions */
int *_func_empty_input(struct struct_automata *, int /*<<< orphan*/);
int *func_empty_input(struct struct_automata *p) {
  return _func_empty_input(p, 0);
}


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

x86 assembly (clang, -O2):
<func_empty_input>:
xor    %esi,%esi
jmp    1030 <_func_empty_input@plt>

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

LLVM IR (-O2):
%struct.struct_automata = type { i32 }
define i32* @func_empty_input(%struct.struct_automata* %0) {
%2 = tail call i32* @_func_empty_input(%struct.struct_automata* %0, i32 0)
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ test(char *, char *);
void TEST_for_stmt(void) {
  test("321", "main(){int i=0; for (i=3;i;i=i-1) { printf(\"%d\", i); }}");
  test("321", "main(){int i=0; for (i=3;i;i=i-1)   printf(\"%d\", i);}");
  test("321", "main(){for (int i=3;i;i=i-1) printf(\"%d\", i);}");
}


x86 assembly (clang, -O0):
<TEST_for_stmt>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee2(%rip),%rsi
call   1030 <test@plt>
lea    0xed2(%rip),%rdi
lea    0xf07(%rip),%rsi
call   1030 <test@plt>
lea    0xebf(%rip),%rdi
lea    0xf2a(%rip),%rsi
call   1030 <test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TEST_for_stmt>:
push   %rbx
lea    0xee8(%rip),%rbx
lea    0xee5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test@plt>
lea    0xf0e(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test@plt>
lea    0xf35(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <test@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"321\00"
@.str.1 = [56 x i8] c"main(){int i=0; for (i=3;i;i=i-1) { printf(\22%d\22, i); }}\00"
@.str.2 = [54 x i8] c"main(){int i=0; for (i=3;i;i=i-1) printf(\22%d\22, i);}\00"
@.str.3 = [47 x i8] c"main(){for (int i=3;i;i=i-1) printf(\22%d\22, i);}\00"
define void @TEST_for_stmt() {
%1 = call i32 @test(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 @test(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"321\00"
@.str.1 = [56 x i8] c"main(){int i=0; for (i=3;i;i=i-1) { printf(\22%d\22, i); }}\00"
@.str.2 = [54 x i8] c"main(){int i=0; for (i=3;i;i=i-1) printf(\22%d\22, i);}\00"
@.str.3 = [47 x i8] c"main(){for (int i=3;i;i=i-1) printf(\22%d\22, i);}\00"
define void @TEST_for_stmt() {
%1 = tail call i32 @test(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @test(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
char *malloc(int);
int /*<<< orphan*/ stderr;
char *alloc_memory(int size) {
  char *m = malloc(size);
  if (!m) {
    fprintf(stderr, "out of memory\n");
    exit(1);
  }
  return m;
}


x86 assembly (clang, -O0):
<alloc_memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1171 <alloc_memory+0x41>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_memory>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <alloc_memory+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"out of memory\0A\00"
define i8* @alloc_memory(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"out of memory\0A\00"
define noalias i8* @alloc_memory(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  long year_s_count = 3.156 * 10e7;
  printf("请输入你的年龄");
  int age;
  scanf("%d", &age);
  long age_s_count = age * year_s_count;
  printf("%d岁大约%ld秒", age, age_s_count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x12cfac80,-0x10(%rbp)
12
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
movslq -0x14(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0x4(%rsp),%rsi
imul   $0x12cfac80,%rsi,%rdx
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E4\BD\A0\E7\9A\84\E5\B9\B4\E9\BE\84\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"%d\E5\B2\81\E5\A4\A7\E7\BA\A6%ld\E7\A7\92\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32
%4 = alloca i64
store i32 0, i32* %1
store i64 315600000, i64* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = load i64, i64* %2
%10 = mul nsw i64 %8, %9
store i64 %10, i64* %4
%11 = load i32, i32* %3
%12 = load i64, i64* %4
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %11, i64 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E4\BD\A0\E7\9A\84\E5\B9\B4\E9\BE\84\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"%d\E5\B2\81\E5\A4\A7\E7\BA\A6%ld\E7\A7\92\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = bitcast i32* %1 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = sext i32 %5 to i64
%7 = mul nsw i64 %6, 315600000
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %5, i64 %7)
ret i32 0
}
/* Variables and functions */
scalar_t__ shim_enosys(int /*<<< orphan*/, int, unsigned long,
                       unsigned long const *, unsigned long const *);
long shim_migrate_pages(int pid, unsigned long maxnode,
                        const unsigned long *old_nodes,
                        const unsigned long *new_nodes) {
  return (long)shim_enosys(0, pid, maxnode, old_nodes, new_nodes);
}


x86 assembly (clang, -O0):
<shim_migrate_pages>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
xor    %edi,%edi
call   1030 <shim_enosys@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shim_migrate_pages>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

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

LLVM IR (-O2):
define i64 @shim_migrate_pages(i32 %0, i64 %1, i64* %2, i64* %3) {
%5 = tail call i64 @shim_enosys(i32 0, i32 %0, i64 %1, i64* %2, i64* %3)
ret i64 %5
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int print_option(char *option) {
  if ((strcmp(option, "y") == 0) || (strcmp(option, "yes") == 0))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<print_option>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1150 <print_option+0x40>
mov    -0x10(%rbp),%rdi
lea    0xec1(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    115c <print_option+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1163 <print_option+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_option>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1141 <print_option+0x31>
lea    0xed6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"y\00"
@.str.1 = [4 x i8] c"yes\00"
define i32 @print_option(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i32 1, i32* %2
br label %13
12: ; preds = %7
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [2 x i8] c"y\00"
@.str.1 = [4 x i8] c"yes\00"
define i32 @print_option(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int d16(int);
int d17(int a) { return d16(d16(a)); }


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

x86 assembly (clang, -O2):
<d17>:
push   %rax
call   1030 <d16@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <d16@plt>

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

LLVM IR (-O2):
define i32 @d17(i32 %0) {
%2 = tail call i32 @d16(i32 %0)
%3 = tail call i32 @d16(i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t swap16(uint16_t x) { return (x >> 8) | (x << 8); }


x86 assembly (clang, -O0):
<swap16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap16>:
mov    %edi,%eax
sar    $0x8,%eax
shl    $0x8,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @swap16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = load i32, i32* %2
%6 = shl i32 %5, 8
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @swap16(i32 %0) {
%2 = ashr i32 %0, 8
%3 = shl i32 %0, 8
%4 = or i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void welcome_message() {
  printf("---***---***----***----***----***---\n\n");
  printf("|<--     Welcome to our Diary    -->|\n\n");
  printf("---***---***----***----***---***---\n\n");
}


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

x86 assembly (clang, -O2):
<welcome_message>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf02(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1d(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"---***---***----***----***----***---\0A\0A\00"
@.str.1 = [40 x i8] c"|<-- Welcome to our Diary -->|\0A\0A\00"
@.str.2 = [38 x i8] c"---***---***----***----***---***---\0A\0A\00"
define void @welcome_message() {
%1 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [38 x i8] c"---***---***----***----***----***---\0A\00"
@str.3 = [39 x i8] c"|<-- Welcome to our Diary -->|\0A\00"
@str.4 = [37 x i8] c"---***---***----***----***---***---\0A\00"
define void @welcome_message() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(float);
void fail_test() {
  while (1) {
    putchar('F');
  }
}


x86 assembly (clang, -O0):
<fail_test>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <fail_test+0x9>
movss  0xedf(%rip),%xmm0
call   1030 <putchar@plt>
jmp    1119 <fail_test+0x9>

x86 assembly (clang, -O2):
<fail_test>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movss  0xed8(%rip),%xmm0
call   1030 <putchar@plt>
jmp    1120 <fail_test+0x10>

LLVM IR (-O0):
define void @fail_test() {
br label %1
1: ; preds = %0, %1
%2 = call i32 @putchar(float 7.000000e+01)
br label %1
}

LLVM IR (-O2):
define void @fail_test() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @putchar(float 7.000000e+01)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void freearray(int *ip) {
  if (ip)
    free(ip);
}


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

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

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

LLVM IR (-O2):
define void @freearray(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i32* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
scalar_t__ sm3_test1();
scalar_t__ sm3_test2();
int main(int argc, char *argv[]) {
  if (sm3_test1())
    return -1;
  if (sm3_test2())
    return -2;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <sm3_test1@plt>
cmp    $0x0,%rax
je     1153 <main+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    1177 <main+0x57>
mov    $0x0,%al
call   1030 <sm3_test2@plt>
cmp    $0x0,%rax
je     1170 <main+0x50>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1177 <main+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <sm3_test1@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     1137 <main+0x17>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <sm3_test2@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
lea    (%rcx,%rcx,1),%eax
add    $0xfffffffe,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i64 (...) @sm3_test1()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 -1, i32* %3
br label %14
9: ; preds = %2
%10 = call i64 (...) @sm3_test2()
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 -2, i32* %3
br label %14
13: ; preds = %9
store i32 0, i32* %3
br label %14
14: ; preds = %13, %12, %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @sm3_test1()
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i64 (...) @sm3_test2()
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i32 0, i32 -2
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ -1, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ abort();
long long min();
void foo(long long j) {
  if (j > 10 || j < min())
    abort();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0xa,-0x8(%rbp)
jg     1156 <foo+0x36>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <min@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
jge    115d <foo+0x3d>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
cmp    $0xa,%rdi
jg     1138 <foo+0x18>
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <min@plt>
cmp    %rbx,%rax
jg     1138 <foo+0x18>
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @foo(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sgt i64 %3, 10
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = load i64, i64* %2
%7 = call i64 (...) @min()
%8 = icmp slt i64 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %5, %1
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @foo(i64 %0) {
%2 = icmp sgt i64 %0, 10
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i64 (...) @min()
%5 = icmp sgt i64 %4, %0
br i1 %5, label %6, label %8
6: ; preds = %3, %1
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %3
ret void
}
double warmup() {
  double d = 0.1;
  int i = 0;
  for (i = 0; i < 1000000; i++)
    d *= d + i;
  return d;
}


x86 assembly (clang, -O0):
<warmup>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xf4240,-0xc(%rbp)
jge    1152 <warmup+0x52>
movsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
addsd  %xmm1,%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <warmup+0x1f>
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<warmup>:
movsd  0xef8(%rip),%xmm0
xorpd  %xmm1,%xmm1
mov    $0x4,%eax
movsd  0xeef(%rip),%xmm2
nopl   0x0(%rax)
movapd %xmm0,%xmm3
addsd  %xmm1,%xmm3
lea    -0x3(%rax),%ecx
xorps  %xmm4,%xmm4
cvtsi2sd %ecx,%xmm4
mulsd  %xmm0,%xmm3
addsd  %xmm3,%xmm4
mulsd  %xmm3,%xmm4
lea    -0x2(%rax),%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
addsd  %xmm4,%xmm0
mulsd  %xmm4,%xmm0
lea    -0x1(%rax),%ecx
xorps  %xmm3,%xmm3
cvtsi2sd %ecx,%xmm3
addsd  %xmm0,%xmm3
mulsd  %xmm0,%xmm3
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  %xmm3,%xmm0
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm1
add    $0x5,%eax
cmp    $0xf4244,%eax
jne    1120 <warmup+0x20>
ret

LLVM IR (-O0):
define double @warmup() {
%1 = alloca double
%2 = alloca i32
store double 1.000000e-01, double* %1
store i32 0, i32* %2
store i32 0, i32* %2
br label %3
3: ; preds = %13, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 1000000
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = load double, double* %1
%8 = load i32, i32* %2
%9 = sitofp i32 %8 to double
%10 = fadd double %7, %9
%11 = load double, double* %1
%12 = fmul double %11, %10
store double %12, double* %1
br label %13
13: ; preds = %6
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %3
16: ; preds = %3
%17 = load double, double* %1
ret double %17
}

LLVM IR (-O2):
define double @warmup() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %23, %1 ]
%3 = phi double [ 1.000000e-01, %0 ], [ %22, %1 ]
%4 = sitofp i32 %2 to double
%5 = fadd double %3, %4
%6 = fmul double %3, %5
%7 = add nuw nsw i32 %2, 1
%8 = sitofp i32 %7 to double
%9 = fadd double %6, %8
%10 = fmul double %6, %9
%11 = add nuw nsw i32 %2, 2
%12 = sitofp i32 %11 to double
%13 = fadd double %10, %12
%14 = fmul double %10, %13
%15 = add nuw nsw i32 %2, 3
%16 = sitofp i32 %15 to double
%17 = fadd double %14, %16
%18 = fmul double %14, %17
%19 = add nuw nsw i32 %2, 4
%20 = sitofp i32 %19 to double
%21 = fadd double %18, %20
%22 = fmul double %18, %21
%23 = add nuw nsw i32 %2, 5
%24 = icmp eq i32 %23, 1000000
br i1 %24, label %25, label %1
25: ; preds = %1
ret double %22
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int run_tests(int *);
int main(int argc, char *argv[]) {
  int count;
  int fails;
  if ((fails = run_tests(&count)) != 0) {
    printf("Failed test count: %d\n", fails);
  } else {
    printf("*** %d TESTS COMPLETED SUCCESSFULLY ***\n", count);
  }
  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    -0x14(%rbp),%rdi
call   1040 <run_tests@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
je     115f <main+0x3f>
mov    -0x18(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
jmp    116e <main+0x4e>
mov    -0x14(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
call   1040 <run_tests@plt>
test   %eax,%eax
je     113a <main+0x1a>
lea    0xeca(%rip),%rdi
mov    %eax,%esi
jmp    1145 <main+0x25>
mov    0x4(%rsp),%esi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Failed test count: %d\0A\00"
@.str.1 = [41 x i8] c"*** %d TESTS COMPLETED SUCCESSFULLY ***\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @run_tests(i32* %6)
store i32 %8, i32* %7
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* %7
%12 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %16
13: ; preds = %2
%14 = load i32, i32* %6
%15 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %13, %10
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Failed test count: %d\0A\00"
@.str.1 = [41 x i8] c"*** %d TESTS COMPLETED SUCCESSFULLY ***\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @run_tests(i32* %3)
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %12
9: ; preds = %2
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %9, %7
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ std_err(char *);
badchar() {
  std_err("Usage: mknod name c major minor\n");
  exit(1);
}


x86 assembly (clang, -O0):
<badchar>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <std_err@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
@.str = [33 x i8] c"Usage: mknod name c major minor\0A\00"
define i32 @badchar() {
%1 = call i32 @std_err(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [33 x i8] c"Usage: mknod name c major minor\0A\00"
define i32 @badchar() {
%1 = tail call i32 @std_err(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ memset(float *, int /*<<< orphan*/, int);
void finn_vec3_zero(float *vec) { memset(vec, 0, sizeof(float) * 3); }


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

x86 assembly (clang, -O2):
<finn_vec3_zero>:
xor    %esi,%esi
mov    $0xc,%edx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @finn_vec3_zero(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = call i32 @memset(float* %3, i32 0, i32 12)
ret void
}

LLVM IR (-O2):
define void @finn_vec3_zero(float* %0) {
%2 = tail call i32 @memset(float* %0, i32 0, i32 12)
ret void
}
void init_add_pixel_pt_funcs_c(void) {}


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

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

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

LLVM IR (-O2):
define void @init_add_pixel_pt_funcs_c() {
ret void
}
void something() {}


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

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

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

LLVM IR (-O2):
define void @something() {
ret void
}
void led_init(void) {
  (*((volatile unsigned long *)0x400FE108)) = 0x00000020;
  __asm__("nop");
  (*((volatile unsigned long *)0x40025400)) = 0x01;
  (*((volatile unsigned long *)0x4002551C)) = 0x01;
}


x86 assembly (clang, -O0):
<led_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fe108,%eax
movq   $0x20,(%rax)
nop
mov    $0x40025400,%eax
movq   $0x1,(%rax)
mov    $0x4002551c,%eax
movq   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_init>:
movq   $0x20,0x400fe108
nop
movq   $0x1,0x40025400
movq   $0x1,0x4002551c
ret

LLVM IR (-O0):
define void @led_init() {
store volatile i64 32, i64* inttoptr (i64 1074782472 to i64*)
store volatile i64 1, i64* inttoptr (i64 1073894400 to i64*)
store volatile i64 1, i64* inttoptr (i64 1073894684 to i64*)
ret void
}

LLVM IR (-O2):
define void @led_init() {
store volatile i64 32, i64* inttoptr (i64 1074782472 to i64*)
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
store volatile i64 1, i64* inttoptr (i64 1073894400 to i64*)
store volatile i64 1, i64* inttoptr (i64 1073894684 to i64*)
ret void
}
unsigned char clamp(int x) {
  if (x > 255) {
    return 255;
  }
  if (x < 0) {
    return 0;
  }
  return (unsigned char)x;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jle    111d <clamp+0x1d>
movb   $0xff,-0x1(%rbp)
jmp    1136 <clamp+0x36>
cmpl   $0x0,-0x8(%rbp)
jge    1130 <clamp+0x30>
movb   $0x0,-0x1(%rbp)
jmp    1136 <clamp+0x36>
mov    -0x8(%rbp),%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
xor    %ecx,%ecx
test   %edi,%edi
cmovns %edi,%ecx
cmp    $0xff,%ecx
mov    $0xff,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @clamp(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 255
br i1 %5, label %6, label %7
6: ; preds = %1
store i8 -1, i8* %2
br label %14
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7
store i8 0, i8* %2
br label %14
11: ; preds = %7
%12 = load i32, i32* %3
%13 = trunc i32 %12 to i8
store i8 %13, i8* %2
br label %14
14: ; preds = %11, %10, %6
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
define zeroext i8 @clamp(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = select i1 %2, i32 %0, i32 0
%4 = icmp ult i32 %3, 255
%5 = select i1 %4, i32 %3, i32 255
%6 = trunc i32 %5 to i8
ret i8 %6
}
/* Variables and functions */
char *trim_left_inplace(int /*<<< orphan*/, char const *);
int /*<<< orphan*/ trim_right_inplace(char *, char const *);
char *trim_inplace(char *s, const char *delimiters) {
  return trim_left_inplace(trim_right_inplace(s, delimiters), delimiters);
}


x86 assembly (clang, -O0):
<trim_inplace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <trim_right_inplace@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <trim_left_inplace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim_inplace>:
push   %rbx
mov    %rsi,%rbx
call   1030 <trim_right_inplace@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <trim_left_inplace@plt>

LLVM IR (-O0):
define i8* @trim_inplace(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 @trim_right_inplace(i8* %5, i8* %6)
%8 = load i8*, i8** %4
%9 = call i8* @trim_left_inplace(i32 %7, i8* %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @trim_inplace(i8* %0, i8* %1) {
%3 = tail call i32 @trim_right_inplace(i8* %0, i8* %1)
%4 = tail call i8* @trim_left_inplace(i32 %3, i8* %1)
ret i8* %4
}
int fun714() { return 714; }


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

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

LLVM IR (-O0):
define i32 @fun714() {
ret i32 714
}

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


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

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

LLVM IR (-O2):
@str = [36 x i8] c"NOT IMPLEMENTED:pa_own_uid_in_group\00"
define i32 @pa_own_uid_in_group() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int test_read_magic_number(char *device, int argc, char *argv[]) { return 0; }


x86 assembly (clang, -O0):
<test_read_magic_number>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_read_magic_number(i8* %0, i32 %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8**
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
ret i32 0
}

LLVM IR (-O2):
define i32 @test_read_magic_number(i8* nocapture readnone %0, i32 %1, i8** nocapture readnone %2) {
ret i32 0
}