xunge/DecIR huggingface dataset:
/* Variables and functions */
int getline_my(char *);
int /*<<< orphan*/ printf(char *, ...);
void main() {
  char *line;
  int len = 0;
  printf("\ninput please line:\n\n");
  len = getline_my(line);
  printf("in rez len = %d; and line = '%s';\n", len, line);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0xc(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <getline_my@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rdx
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeeb(%rip),%rdi
call   1030 <puts@plt>
call   1050 <getline_my@plt>
lea    0xeb7(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
pop    %rcx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"\0Ainput please line:\0A\0A\00"
@.str.1 = [35 x i8] c"in rez len = %d; and line = '%s';\0A\00"
define void @main() {
%1 = alloca i8*
%2 = alloca i32
store i32 0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %1
%5 = call i32 @getline_my(i8* %4)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = load i8*, i8** %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %6, i8* %7)
ret void
}

LLVM IR (-O2):
@.str.1 = [35 x i8] c"in rez len = %d; and line = '%s';\0A\00"
@str = [21 x i8] c"\0Ainput please line:\0A\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @getline_my(i8* undef)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %2, i8* undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printPic(int r, int c, char str[1000][1000]) {
  int i;
  for (i = r + 1; i >= 0; i--) {
    printf("%s\n", str[i]);
  }
}


x86 assembly (clang, -O0):
<printPic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1161 <printPic+0x51>
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
imul   $0x3e8,%rax,%rax
add    %rax,%rsi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <printPic+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printPic>:
push   %r15
push   %r14
push   %rbx
cmp    $0xffffffff,%edi
jl     1159 <printPic+0x49>
mov    %rdx,%r14
mov    %edi,%ebx
lea    0x1(%rbx),%eax
add    $0x2,%ebx
imul   $0x3e8,%rax,%rax
add    %rax,%r14
lea    0xeca(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
add    $0xfffffffffffffc18,%r14
test   %ebx,%ebx
jg     1140 <printPic+0x30>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @printPic(i32 %0, i32 %1, [1000 x i8]* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca [1000 x i8]*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store [1000 x i8]* %2, [1000 x i8]** %6
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 1
store i32 %9, i32* %7
br label %10
10: ; preds = %20, %3
%11 = load i32, i32* %7
%12 = icmp sge i32 %11, 0
br i1 %12, label %13, label %23
13: ; preds = %10
%14 = load [1000 x i8]*, [1000 x i8]** %6
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [1000 x i8], [1000 x i8]* %14, i64 %16
%18 = getelementptr inbounds [1000 x i8], [1000 x i8]* %17, i64 0, i64 0
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %18)
br label %20
20: ; preds = %13
%21 = load i32, i32* %7
%22 = add nsw i32 %21, -1
store i32 %22, i32* %7
br label %10
23: ; preds = %10
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @printPic(i32 %0, i32 %1, [1000 x i8]* %2) {
%4 = icmp sgt i32 %0, -2
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = add i32 %0, 1
%7 = zext i32 %6 to i64
br label %8
8: ; preds = %5, %8
%9 = phi i64 [ %7, %5 ], [ %12, %8 ]
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 %9, i64 0
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = add nsw i64 %9, -1
%13 = trunc i64 %9 to i32
%14 = icmp sgt i32 %13, 0
br i1 %14, label %8, label %15
15: ; preds = %8, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *, char *);
void abort1(char *msg) {
  printf("ERROR - %s\n", msg);
  abort();
}


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

x86 assembly (clang, -O2):
<abort1>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"ERROR - %s\0A\00"
define void @abort1(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
float norm(float, float);
float distance(float a, float b, float c, float d) {
  return norm((a - c), (b - d));
}


x86 assembly (clang, -O0):
<distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
subss  -0x10(%rbp),%xmm1
call   1030 <norm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance>:
subss  %xmm2,%xmm0
subss  %xmm3,%xmm1
jmp    1030 <norm@plt>

LLVM IR (-O0):
define float @distance(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = load float, float* %7
%11 = fsub float %9, %10
%12 = load float, float* %6
%13 = load float, float* %8
%14 = fsub float %12, %13
%15 = call float @norm(float %11, float %14)
ret float %15
}

LLVM IR (-O2):
define float @distance(float %0, float %1, float %2, float %3) {
%5 = fsub float %0, %2
%6 = fsub float %1, %3
%7 = tail call float @norm(float %5, float %6)
ret float %7
}
/* Variables and functions */
unsigned int arc4random();
unsigned int CC3RandomUInt() { return arc4random(); }


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

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

LLVM IR (-O0):
define i32 @CC3RandomUInt() {
%1 = call i32 (...) @arc4random()
ret i32 %1
}

LLVM IR (-O2):
define i32 @CC3RandomUInt() {
%1 = tail call i32 (...) @arc4random()
ret i32 %1
}
/* Variables and functions */
void *malloc(int);
void *calls_malloc(void) {
  void *result = malloc(1024);
  return result;
}


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

x86 assembly (clang, -O2):
<calls_malloc>:
mov    $0x400,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @calls_malloc() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 1024)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define noalias i8* @calls_malloc() {
%1 = tail call dereferenceable_or_null(1024) i8* @malloc(i32 1024)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ putico();
int main() {
  putico();
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <putico@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <putico@plt>
xor    %eax,%eax
call   1030 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @putico()
%3 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @putico()
%2 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fork();
int /*<<< orphan*/ snprintf(char *, int, char *, int, char *);
int /*<<< orphan*/ system(char *);
void strace(int pid, char *outputFile) {
  char straceCommand[100];
  snprintf(straceCommand, 100, "su -c \"strace -p %d -o %s\" &", pid,
           outputFile);
  if (!fork()) {
    system(straceCommand);
  }
}


x86 assembly (clang, -O0):
<strace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%r8
mov    $0x64,%esi
lea    0xea7(%rip),%rdx
call   1040 <snprintf@plt>
mov    $0x0,%al
call   1050 <fork@plt>
cmp    $0x0,%eax
jne    1177 <strace+0x47>
lea    -0x80(%rbp),%rdi
call   1030 <system@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strace>:
sub    $0x68,%rsp
mov    %rsi,%r8
mov    %edi,%ecx
lea    0xec0(%rip),%rdx
mov    %rsp,%rdi
mov    $0x64,%esi
call   1040 <snprintf@plt>
xor    %eax,%eax
call   1050 <fork@plt>
test   %eax,%eax
je     115d <strace+0x2d>
add    $0x68,%rsp
ret
mov    %rsp,%rdi
call   1030 <system@plt>
add    $0x68,%rsp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"su -c \22strace -p %d -o %s\22 &\00"
define void @strace(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [100 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = call i32 @snprintf(i8* %6, i32 100, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8)
%10 = call i32 (...) @fork()
%11 = icmp ne i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %2
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%14 = call i32 @system(i8* %13)
br label %15
15: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"su -c \22strace -p %d -o %s\22 &\00"
define void @strace(i32 %0, i8* %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 100, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
%6 = call i32 (...) @fork()
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @system(i8* %4)
br label %10
10: ; preds = %8, %2
ret void
}
unsigned nextMultiple(unsigned u, unsigned m) { return (u + m - 1) / m * m; }


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

x86 assembly (clang, -O2):
<nextMultiple>:
lea    (%rdi,%rsi,1),%ecx
add    $0xffffffff,%ecx
mov    %ecx,%eax
xor    %edx,%edx
div    %esi
sub    %edx,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @nextMultiple(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 = add i32 %5, %6
%8 = sub i32 %7, 1
%9 = load i32, i32* %4
%10 = udiv i32 %8, %9
%11 = load i32, i32* %4
%12 = mul i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @nextMultiple(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
%5 = urem i32 %4, %1
%6 = sub i32 %4, %5
ret i32 %6
}
void debugf(const char *fmt, ...) { (void)fmt; }


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

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

LLVM IR (-O0):
define void @debugf(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @debugf(i8* nocapture %0, ...) {
ret void
}
int re_match(bufp, string, size, pos, regs)
struct re_pattern_buffer *bufp;
const char *string;
int size, pos;
struct re_registers *regs;
{
  int result;
  result = byte_re_match_2_internal(bufp, (void *)0, 0, string, size, pos, regs,
                                    size);
  return result;
}


x86 assembly (clang, -O0):
<re_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    -0x20(%rbp),%r10
mov    -0x14(%rbp),%eax
xor    %edx,%edx
mov    %edx,%esi
xor    %edx,%edx
mov    %r10,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1030 <byte_re_match_2_internal@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<re_match>:
push   %rax
mov    %r8,%r10
mov    %ecx,%r9d
mov    %edx,%r8d
mov    %rsi,%rcx
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
push   %r8
push   %r10
call   1030 <byte_re_match_2_internal@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
%struct.re_pattern_buffer = type opaque
%struct.re_registers = type opaque
define i32 @re_match(%struct.re_pattern_buffer* %0, i8* %1, i32 %2, i32 %3, %struct.re_registers* %4) {
%6 = alloca %struct.re_pattern_buffer*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca %struct.re_registers*
%11 = alloca i32
store %struct.re_pattern_buffer* %0, %struct.re_pattern_buffer** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store %struct.re_registers* %4, %struct.re_registers** %10
%12 = load %struct.re_pattern_buffer*, %struct.re_pattern_buffer** %6
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load %struct.re_registers*, %struct.re_registers** %10
%17 = load i32, i32* %8
%18 = call i32 (%struct.re_pattern_buffer*, i8*, i32, i8*, i32, i32, %struct.re_registers*, i32, ...) bitcast (i32 (...)* @byte_re_match_2_internal to i32 (%struct.re_pattern_buffer*, i8*, i32, i8*, i32, i32, %struct.re_registers*, i32, ...)*)(%struct.re_pattern_buffer* %12, i8* null, i32 0, i8* %13, i32 %14, i32 %15, %struct.re_registers* %16, i32 %17)
store i32 %18, i32* %11
%19 = load i32, i32* %11
ret i32 %19
}

LLVM IR (-O2):
%struct.re_pattern_buffer = type opaque
%struct.re_registers = type opaque
define i32 @re_match(%struct.re_pattern_buffer* %0, i8* %1, i32 %2, i32 %3, %struct.re_registers* %4) {
%6 = tail call i32 (%struct.re_pattern_buffer*, i8*, i32, i8*, i32, i32, %struct.re_registers*, i32, ...) bitcast (i32 (...)* @byte_re_match_2_internal to i32 (%struct.re_pattern_buffer*, i8*, i32, i8*, i32, i32, %struct.re_registers*, i32, ...)*)(%struct.re_pattern_buffer* %0, i8* null, i32 0, i8* %1, i32 %2, i32 %3, %struct.re_registers* %4, i32 %2)
ret i32 %6
}
void rep_nop(void) { __asm__ __volatile__("rep;nop" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @rep_nop() {
tail call void asm sideeffect "rep;nop", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
float subtract(float first, float second) { return first - second; }


x86 assembly (clang, -O0):
<subtract>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<subtract>:
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @subtract(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fsub float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @subtract(float %0, float %1) {
%3 = fsub float %0, %1
ret float %3
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcat(char *, char const *);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *concat(const char *s1, const char *s2) {
  char *result = malloc(strlen(s1) + strlen(s2) + 1);
  strcpy(result, s1);
  strcat(result, s2);
  return result;
}


x86 assembly (clang, -O0):
<concat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<concat>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1040 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%r15,%rax,1),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @concat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %7, %9
%11 = add nsw i64 %10, 1
%12 = call i8* @malloc(i64 %11)
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %5
%17 = load i8*, i8** %4
%18 = call i32 @strcat(i8* %16, i8* %17)
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define i8* @concat(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i8* @malloc(i64 %6)
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
%9 = tail call i32 @strcat(i8* %7, i8* %1)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number;
  scanf("%d", &number);
  switch (number) {
  case 10:
    printf("Number is 10\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
jne    115c <main+0x3c>
jmp    1150 <main+0x30>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0xa,0x4(%rsp)
jne    1145 <main+0x25>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [14 x i8] c"Number is 10\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
switch i32 %4, label %7 [
i32 10, label %5
]
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [13 x i8] c"Number is 10\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 10
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %0, %6
ret i32 0
}
/* Variables and functions */
int color_eqn(int, int, int /*<<< orphan*/, int, int, int);
int r_cyg_cymg_yemg(int entrycyg, int entrycymg, int entryyeg, int entryyemg) {
  return color_eqn(87, entryyemg, 0, entrycymg, -62, entrycyg);
}


x86 assembly (clang, -O0):
<r_cyg_cymg_yemg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%r9d
mov    $0x57,%edi
xor    %edx,%edx
mov    $0xffffffc2,%r8d
call   1030 <color_eqn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_cyg_cymg_yemg>:
mov    %esi,%eax
mov    %edi,%r9d
mov    $0x57,%edi
mov    %ecx,%esi
xor    %edx,%edx
mov    %eax,%ecx
mov    $0xffffffc2,%r8d
jmp    1030 <color_eqn@plt>

LLVM IR (-O0):
define i32 @r_cyg_cymg_yemg(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* %8
%10 = load i32, i32* %6
%11 = load i32, i32* %5
%12 = call i32 @color_eqn(i32 87, i32 %9, i32 0, i32 %10, i32 -62, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @r_cyg_cymg_yemg(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @color_eqn(i32 87, i32 %3, i32 0, i32 %1, i32 -62, i32 %0)
ret i32 %5
}
void vcpuinsFinal() {}


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

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

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

LLVM IR (-O2):
define void @vcpuinsFinal() {
ret void
}
int fun1057() { return 1057; }


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

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

LLVM IR (-O0):
define i32 @fun1057() {
ret i32 1057
}

LLVM IR (-O2):
define i32 @fun1057() {
ret i32 1057
}
/* Type definitions */
typedef int uint32_t;
typedef int Y;

/* Variables and functions */
uint32_t emfat_encode_cma_time(int D, int M, int Y, int h, int m, int s) {
  return ((((((Y)-1980) << 9) | ((M) << 5) | (D)) << 16) |
          (((h) << 11) | ((m) << 5) | (s >> 1)));
}


x86 assembly (clang, -O0):
<emfat_encode_cma_time>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x7bc,%eax
shl    $0x9,%eax
mov    -0x8(%rbp),%ecx
shl    $0x5,%ecx
or     %ecx,%eax
or     -0x4(%rbp),%eax
shl    $0x10,%eax
mov    -0x10(%rbp),%ecx
shl    $0xb,%ecx
mov    -0x14(%rbp),%edx
shl    $0x5,%edx
or     %edx,%ecx
mov    -0x18(%rbp),%edx
sar    $0x1,%edx
or     %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<emfat_encode_cma_time>:
shl    $0x9,%edx
lea    0x8800(%rdx),%eax
shl    $0x5,%esi
or     %edi,%esi
or     %esi,%eax
shl    $0x10,%eax
shl    $0xb,%ecx
shl    $0x5,%r8d
or     %ecx,%r8d
sar    %r9d
or     %r8d,%r9d
or     %r9d,%eax
ret

LLVM IR (-O0):
define i32 @emfat_encode_cma_time(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32, i32* %9
%14 = sub nsw i32 %13, 1980
%15 = shl i32 %14, 9
%16 = load i32, i32* %8
%17 = shl i32 %16, 5
%18 = or i32 %15, %17
%19 = load i32, i32* %7
%20 = or i32 %18, %19
%21 = shl i32 %20, 16
%22 = load i32, i32* %10
%23 = shl i32 %22, 11
%24 = load i32, i32* %11
%25 = shl i32 %24, 5
%26 = or i32 %23, %25
%27 = load i32, i32* %12
%28 = ashr i32 %27, 1
%29 = or i32 %26, %28
%30 = or i32 %21, %29
ret i32 %30
}

LLVM IR (-O2):
define i32 @emfat_encode_cma_time(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = shl i32 %2, 9
%8 = add i32 %7, 34816
%9 = shl i32 %1, 5
%10 = or i32 %9, %0
%11 = or i32 %10, %8
%12 = shl i32 %11, 16
%13 = shl i32 %3, 11
%14 = shl i32 %4, 5
%15 = or i32 %14, %13
%16 = ashr i32 %5, 1
%17 = or i32 %15, %16
%18 = or i32 %17, %12
ret i32 %18
}
unsigned int rup2pof2(unsigned int r) {
  r--;
  if (!r)
    return 2;
  r |= r >> 1;
  r |= r >> 2;
  r |= r >> 4;
  r |= r >> 8;
  r |= r >> 16;
  return r + 1;
}


x86 assembly (clang, -O0):
<rup2pof2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1126 <rup2pof2+0x26>
movl   $0x2,-0x4(%rbp)
jmp    116b <rup2pof2+0x6b>
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x2,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x4,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x8,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x10,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rup2pof2>:
add    $0xffffffff,%edi
je     112b <rup2pof2+0x2b>
mov    %edi,%eax
shr    %eax
or     %edi,%eax
mov    %eax,%ecx
shr    $0x2,%ecx
or     %eax,%ecx
mov    %ecx,%eax
shr    $0x4,%eax
or     %ecx,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
or     %eax,%ecx
mov    %ecx,%eax
shr    $0x10,%eax
or     %ecx,%eax
add    $0x1,%eax
ret
mov    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @rup2pof2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = add i32 %4, -1
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %1
store i32 2, i32* %2
br label %32
9: ; preds = %1
%10 = load i32, i32* %3
%11 = lshr i32 %10, 1
%12 = load i32, i32* %3
%13 = or i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = lshr i32 %14, 2
%16 = load i32, i32* %3
%17 = or i32 %16, %15
store i32 %17, i32* %3
%18 = load i32, i32* %3
%19 = lshr i32 %18, 4
%20 = load i32, i32* %3
%21 = or i32 %20, %19
store i32 %21, i32* %3
%22 = load i32, i32* %3
%23 = lshr i32 %22, 8
%24 = load i32, i32* %3
%25 = or i32 %24, %23
store i32 %25, i32* %3
%26 = load i32, i32* %3
%27 = lshr i32 %26, 16
%28 = load i32, i32* %3
%29 = or i32 %28, %27
store i32 %29, i32* %3
%30 = load i32, i32* %3
%31 = add i32 %30, 1
store i32 %31, i32* %2
br label %32
32: ; preds = %9, %8
%33 = load i32, i32* %2
ret i32 %33
}

LLVM IR (-O2):
define i32 @rup2pof2(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp eq i32 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1
%5 = lshr i32 %2, 1
%6 = or i32 %5, %2
%7 = lshr i32 %6, 2
%8 = or i32 %7, %6
%9 = lshr i32 %8, 4
%10 = or i32 %9, %8
%11 = lshr i32 %10, 8
%12 = or i32 %11, %10
%13 = lshr i32 %12, 16
%14 = or i32 %13, %12
%15 = add i32 %14, 1
br label %16
16: ; preds = %1, %4
%17 = phi i32 [ %15, %4 ], [ 2, %1 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *sha1sum(char *, int /*<<< orphan*/, char *);
int /*<<< orphan*/ strlen(char *);
int main(int argc, char **argv) {
  char buff[] = "hello world";
  char sum[40];
  printf("%s\n", sha1sum(buff, strlen(buff), sum));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeb3(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xeb1(%rip),%eax
mov    %eax,-0x14(%rbp)
lea    -0x1c(%rbp),%rax
mov    %rax,-0x58(%rbp)
lea    -0x1c(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x58(%rbp),%rdi
mov    %eax,%esi
lea    -0x50(%rbp),%rdx
call   1030 <sha1sum@plt>
mov    %rax,%rsi
lea    0xe88(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
movabs $0x6f77206f6c6c6568,%rax
20 77 6f
mov    %rax,(%rsp)
movl   $0x646c72,0x8(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0x10(%rsp),%rdx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <sha1sum@plt>
lea    0xea0(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.buff = [12 x i8] c"hello world\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [12 x i8]
%7 = alloca [40 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [12 x i8]* %6 to i8*
%9 = getelementptr inbounds [12 x i8], [12 x i8]* %6, i64 0, i64 0
%10 = getelementptr inbounds [12 x i8], [12 x i8]* %6, i64 0, i64 0
%11 = call i32 @strlen(i8* %10)
%12 = getelementptr inbounds [40 x i8], [40 x i8]* %7, i64 0, i64 0
%13 = call i8* @sha1sum(i8* %9, i32 %11, i8* %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %13)
ret i32 0
}

LLVM IR (-O2):
@__const.main.buff = [12 x i8] c"hello world\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [12 x i8]
%4 = alloca [40 x i8]
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [40 x i8], [40 x i8]* %4, i64 0, i64 0
%7 = call i32 @strlen(i8* %5)
%8 = call i8* @sha1sum(i8* %5, i32 %7, i8* %6)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}
long __ccaprice_syscall_args_1(long A0, long A1) {
  unsigned long R;
  __asm__ __volatile__("int $0x80" : "=a"(R) : "a"(A0), "b"(A1) : "memory");
  return R;
}


x86 assembly (clang, -O0):
<__ccaprice_syscall_args_1>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rbx
int    $0x80
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ccaprice_syscall_args_1>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rax
int    $0x80
pop    %rbx
ret

LLVM IR (-O0):
define i64 @__ccaprice_syscall_args_1(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i64 asm sideeffect "int $$0x80", "={ax},{ax},{bx},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %6, i64 %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
ret i64 %9
}

LLVM IR (-O2):
define i64 @__ccaprice_syscall_args_1(i64 %0, i64 %1) {
%3 = tail call i64 asm sideeffect "int $$0x80", "={ax},{ax},{bx},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
double foo(int /*<<< orphan*/);
int main() {
  if (foo(0) != 0.0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1040 <foo@plt>
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    114e <main+0x2e>
jp     114e <main+0x2e>
jmp    1155 <main+0x35>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <foo@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1138 <main+0x18>
jp     1138 <main+0x18>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @foo(i32 0)
%3 = fcmp une double %2, 0.000000e+00
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call double @foo(i32 0)
%2 = fcmp une double %1, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
void foo084() {}


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

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

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

LLVM IR (-O2):
define void @foo084() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Show_library(int /*<<< orphan*/);
int /*<<< orphan*/ triList(int);
void IF_show_libprog(void) { Show_library(triList(4)); }


x86 assembly (clang, -O0):
<IF_show_libprog>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
call   1040 <triList@plt>
mov    %eax,%edi
call   1030 <Show_library@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IF_show_libprog>:
push   %rax
mov    $0x4,%edi
call   1040 <triList@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <Show_library@plt>

LLVM IR (-O0):
define void @IF_show_libprog() {
%1 = call i32 @triList(i32 4)
%2 = call i32 @Show_library(i32 %1)
ret void
}

LLVM IR (-O2):
define void @IF_show_libprog() {
%1 = tail call i32 @triList(i32 4)
%2 = tail call i32 @Show_library(i32 %1)
ret void
}
int(tolower)(int ch) {
  return ((((ch & 0xff) < 'A') || ((ch & 0xff) > 'Z'))
              ? (ch & 0xff)
              : ((((ch & 0xff) - 'A') + 'a') % 0xff));
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
cmp    $0x41,%eax
jl     1129 <tolower+0x29>
mov    -0x4(%rbp),%eax
and    $0xff,%eax
cmp    $0x5a,%eax
jle    113a <tolower+0x3a>
mov    -0x4(%rbp),%edx
and    $0xff,%edx
mov    %edx,-0x8(%rbp)
jmp    1153 <tolower+0x53>
mov    -0x4(%rbp),%eax
and    $0xff,%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    $0xff,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
movzbl %dil,%eax
lea    -0x5b(%rax),%ecx
cmp    $0xffffffe6,%ecx
jb     1122 <tolower+0x22>
lea    0x20(%rdi),%eax
add    $0x21,%dil
cmp    $0xff,%al
movzbl %dil,%ecx
movzbl %al,%eax
cmove  %ecx,%eax
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = icmp slt i32 %4, 65
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = and i32 %7, 255
%9 = icmp sgt i32 %8, 90
br i1 %9, label %10, label %13
10: ; preds = %6, %1
%11 = load i32, i32* %2
%12 = and i32 %11, 255
br label %19
13: ; preds = %6
%14 = load i32, i32* %2
%15 = and i32 %14, 255
%16 = sub nsw i32 %15, 65
%17 = add nsw i32 %16, 97
%18 = srem i32 %17, 255
br label %19
19: ; preds = %13, %10
%20 = phi i32 [ %12, %10 ], [ %18, %13 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = and i32 %0, 255
%3 = add nsw i32 %2, -91
%4 = icmp ult i32 %3, -26
br i1 %4, label %12, label %5
5: ; preds = %1
%6 = trunc i32 %0 to i8
%7 = add i8 %6, 32
%8 = icmp eq i8 %7, -1
%9 = add i8 %6, 33
%10 = select i1 %8, i8 %9, i8 %7
%11 = zext i8 %10 to i32
br label %12
12: ; preds = %1, %5
%13 = phi i32 [ %11, %5 ], [ %2, %1 ]
ret i32 %13
}
/* Variables and functions */
int get_retval();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("C seems to be working.\n");
  return get_retval();
}


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)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <get_retval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <get_retval@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"C seems to be working.\0A\00"
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 i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @get_retval()
ret i32 %7
}

LLVM IR (-O2):
@str = [23 x i8] c"C seems to be working.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @get_retval()
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fftss_kern_r4_ia64_b(double *, double *, double *, double *,
                                        long, long, int, int);
void fftss_r4_ia64_o_b(double *in, double *out, double *w, long bsize,
                       long blocks) {
  fftss_kern_r4_ia64_b(in, out, w, w + bsize * blocks * 6, bsize * blocks,
                       bsize, 14, 110);
}


x86 assembly (clang, -O0):
<fftss_r4_ia64_o_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
imul   -0x28(%rbp),%rax
imul   $0x6,%rax,%rax
shl    $0x3,%rax
add    %rax,%rcx
mov    -0x20(%rbp),%r8
imul   -0x28(%rbp),%r8
mov    -0x20(%rbp),%r9
movl   $0xe,(%rsp)
movl   $0x6e,0x8(%rsp)
call   1030 <fftss_kern_r4_ia64_b@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fftss_r4_ia64_o_b>:
push   %rax
mov    %rcx,%r9
imul   %rcx,%r8
lea    (%r8,%r8,2),%rcx
shl    $0x4,%rcx
add    %rdx,%rcx
push   $0x6e
push   $0xe
call   1030 <fftss_kern_r4_ia64_b@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
define void @fftss_r4_ia64_o_b(double* %0, double* %1, double* %2, i64 %3, i64 %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca i64
%10 = alloca i64
store double* %0, double** %6
store double* %1, double** %7
store double* %2, double** %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load double*, double** %6
%12 = load double*, double** %7
%13 = load double*, double** %8
%14 = load double*, double** %8
%15 = load i64, i64* %9
%16 = load i64, i64* %10
%17 = mul nsw i64 %15, %16
%18 = mul nsw i64 %17, 6
%19 = getelementptr inbounds double, double* %14, i64 %18
%20 = load i64, i64* %9
%21 = load i64, i64* %10
%22 = mul nsw i64 %20, %21
%23 = load i64, i64* %9
%24 = call i32 @fftss_kern_r4_ia64_b(double* %11, double* %12, double* %13, double* %19, i64 %22, i64 %23, i32 14, i32 110)
ret void
}

LLVM IR (-O2):
define void @fftss_r4_ia64_o_b(double* %0, double* %1, double* %2, i64 %3, i64 %4) {
%6 = mul nsw i64 %4, %3
%7 = mul nsw i64 %6, 6
%8 = getelementptr inbounds double, double* %2, i64 %7
%9 = tail call i32 @fftss_kern_r4_ia64_b(double* %0, double* %1, double* %2, double* %8, i64 %6, i64 %3, i32 14, i32 110)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UART_DEB_UartInit();
void UART_DEB_Init(void) { UART_DEB_UartInit(); }


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

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

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

LLVM IR (-O2):
define void @UART_DEB_Init() {
%1 = tail call i32 (...) @UART_DEB_UartInit()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IF_dupC_i(int);
void IF_dupC(void) { IF_dupC_i(1); }


x86 assembly (clang, -O0):
<IF_dupC>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <IF_dupC_i@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IF_dupC>:
mov    $0x1,%edi
jmp    1030 <IF_dupC_i@plt>

LLVM IR (-O0):
define void @IF_dupC() {
%1 = call i32 @IF_dupC_i(i32 1)
ret void
}

LLVM IR (-O2):
define void @IF_dupC() {
%1 = tail call i32 @IF_dupC_i(i32 1)
ret void
}
void rop3_1_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T | S;
  stk1 = *D | stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_1_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_1_1_0>:
or     %esi,%edx
mov    (%rdi),%al
or     %al,%dl
not    %dl
and    %al,%sil
or     %dl,%sil
mov    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_1_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = or i8 %2, %1
%5 = load i8, i8* %0
%6 = or i8 %4, %5
%7 = xor i8 %6, -1
%8 = and i8 %5, %1
%9 = or i8 %8, %7
store i8 %9, i8* %0
ret void
}
void DMA1_Stream4_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @DMA1_Stream4_IRQHandler() {
ret void
}
void gtk_icon_theme_has_icon() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_theme_has_icon() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ pthread_exit(void *);
int /*<<< orphan*/ sleep(int);
void *thr_fn2(void *arg) {
  printf("sleep 5s\n");
  sleep(5);
  printf("thread 2 exiting\n");
  pthread_exit((void *)2);
}


x86 assembly (clang, -O0):
<thr_fn2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5,%edi
call   1050 <sleep@plt>
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thr_fn2>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x5,%edi
call   1050 <sleep@plt>
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"sleep 5s\0A\00"
@.str.1 = [18 x i8] c"thread 2 exiting\0A\00"
define i8* @thr_fn2(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @sleep(i32 5)
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @pthread_exit(i8* inttoptr (i64 2 to i8*))
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
@str = [9 x i8] c"sleep 5s\00"
@str.2 = [17 x i8] c"thread 2 exiting\00"
define noalias i8* @thr_fn2(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 5)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.2, i64 0, i64 0))
%5 = tail call i32 @pthread_exit(i8* inttoptr (i64 2 to i8*))
ret i8* undef
}
/* Variables and functions */
int foo(int, long, long, long, long, long, long, long, long);
int main() { return foo(1, 3L, 5L, 0L, 0L, 0L, 7L, 11L, 19L); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x3,%esi
mov    $0x5,%edx
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%rcx
mov    %r9,%r8
movq   $0x7,(%rsp)
movq   $0xb,0x8(%rsp)
movq   $0x13,0x10(%rsp)
call   1030 <foo@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
sub    $0x8,%rsp
mov    $0x3,%esi
mov    $0x5,%edx
mov    $0x1,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x13
push   $0xb
push   $0x7
call   1030 <foo@plt>
add    $0x20,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 1, i64 3, i64 5, i64 0, i64 0, i64 0, i64 7, i64 11, i64 19)
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 1, i64 3, i64 5, i64 0, i64 0, i64 0, i64 7, i64 11, i64 19)
ret i32 %1
}
void tosNet_init(void) {}


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

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

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

LLVM IR (-O2):
define void @tosNet_init() {
ret void
}
int isnan(double x) { return __builtin_isnan(x); }


x86 assembly (clang, -O0):
<isnan>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm0,%xmm0
setp   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnan>:
xor    %eax,%eax
ucomisd %xmm0,%xmm0
setp   %al
ret

LLVM IR (-O0):
define i32 @isnan(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp uno double %3, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @isnan(double %0) {
%2 = fcmp uno double %0, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void mc_fill_zero(void *mem, size_t size) { memset(mem, 0, size); }


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

x86 assembly (clang, -O2):
<mc_fill_zero>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @mc_fill_zero(i8* %0, i64 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i64 %1)
ret void
}