xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ logger();
int /*<<< orphan*/ loop();
int /*<<< orphan*/ messager();
int main() {
  messager();
  loop();
  logger();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <messager@plt>
mov    $0x0,%al
call   1030 <loop@plt>
mov    $0x0,%al
call   1040 <logger@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @messager()
%2 = call i32 (...) @loop()
%3 = call i32 (...) @logger()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @messager()
%2 = tail call i32 (...) @loop()
%3 = tail call i32 (...) @logger()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int seteuid(uid_t uid) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @seteuid(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello World\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World\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 ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello World\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ stressone(unsigned long long);
void *stressthread(void *arg) {
  unsigned long long ramsizeMB = *(unsigned long long *)arg;
  stressone(ramsizeMB);
  return NULL;
}


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

x86 assembly (clang, -O2):
<stressthread>:
push   %rax
mov    (%rdi),%rdi
call   1030 <stressone@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define noalias i8* @stressthread(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = tail call i32 @stressone(i64 %3)
ret i8* null
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRA2_get(void) { return U_WMRCORENONE_get("U_WMRA2"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRA2\00"
define i32 @U_WMRA2_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRA2\00"
define i32 @U_WMRA2_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
void peek_stat(struct stat *sb) { return; }


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

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

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

LLVM IR (-O2):
%struct.stat = type opaque
define void @peek_stat(%struct.stat* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ trap(int, int);
void quit(int status) { trap(1, status); }


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

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

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

LLVM IR (-O2):
define void @quit(i32 %0) {
%2 = tail call i32 @trap(i32 1, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(double *, double *, int);
void load(int flag, double *dst, double *src, int num_rows) {
#pragma HLS inline off
  if (flag) {
    memcpy(dst, src, sizeof(double) * 1024 * num_rows);
  }
}


x86 assembly (clang, -O0):
<load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1147 <load+0x37>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
movslq -0x1c(%rbp),%rax
shl    $0xd,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load>:
test   %edi,%edi
je     1124 <load+0x14>
shl    $0xd,%ecx
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
jmp    1030 <memcpy@plt>
ret

LLVM IR (-O0):
define void @load(i32 %0, double* %1, double* %2, i32 %3) {
%5 = alloca i32
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
store i32 %0, i32* %5
store double* %1, double** %6
store double* %2, double** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %4
%12 = load double*, double** %6
%13 = load double*, double** %7
%14 = load i32, i32* %8
%15 = sext i32 %14 to i64
%16 = mul i64 8192, %15
%17 = trunc i64 %16 to i32
%18 = call i32 @memcpy(double* %12, double* %13, i32 %17)
br label %19
19: ; preds = %11, %4
ret void
}

LLVM IR (-O2):
define void @load(i32 %0, double* %1, double* %2, i32 %3) {
%5 = icmp eq i32 %0, 0
br i1 %5, label %9, label %6
6: ; preds = %4
%7 = shl i32 %3, 13
%8 = tail call i32 @memcpy(double* %1, double* %2, i32 %7)
br label %9
9: ; preds = %6, %4
ret void
}
int list_milestones(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @list_milestones() {
ret i32 1
}
void SWAP_short(short *val) {
  char *p = (char *)val;
  char t;
  t = p[0];
  p[0] = p[1];
  p[1] = t;
}


x86 assembly (clang, -O0):
<SWAP_short>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SWAP_short>:
rolw   $0x8,(%rdi)
ret

LLVM IR (-O0):
define void @SWAP_short(i16* %0) {
%2 = alloca i16*
%3 = alloca i8*
%4 = alloca i8
store i16* %0, i16** %2
%5 = load i16*, i16** %2
%6 = bitcast i16* %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
store i8 %9, i8* %4
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 0
store i8 %12, i8* %14
%15 = load i8, i8* %4
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8 %15, i8* %17
ret void
}

LLVM IR (-O2):
define void @SWAP_short(i16* nocapture %0) {
%2 = bitcast i16* %0 to i8*
%3 = load i8, i8* %2
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = load i8, i8* %4
store i8 %5, i8* %2
store i8 %3, i8* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, char *);
char *Off_Reg_Bank(int offset) {
  static char str[20];
  sprintf(str, "%d(%s)", offset, "%ebx");
  return str;
}


x86 assembly (clang, -O0):
<Off_Reg_Bank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0x2f1b(%rip),%rdi
lea    0xed4(%rip),%rsi
lea    0xed4(%rip),%rcx
call   1030 <sprintf@plt>
lea    0x2f01(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@Off_Reg_Bank.str = internal global [20 x i8] zeroinitializer
@.str = [7 x i8] c"%d(%s)\00"
@.str.1 = [5 x i8] c"%ebx\00"
define i8* @Off_Reg_Bank(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @Off_Reg_Bank.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @Off_Reg_Bank.str, i64 0, i64 0)
}

LLVM IR (-O2):
@Off_Reg_Bank.str = internal global [20 x i8] zeroinitializer
@.str = [7 x i8] c"%d(%s)\00"
@.str.1 = [5 x i8] c"%ebx\00"
define i8* @Off_Reg_Bank(i32 %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @Off_Reg_Bank.str, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @Off_Reg_Bank.str, i64 0, i64 0)
}
void decrypt_sub(unsigned char *buf, unsigned char *c) {
  unsigned char a;
  int i;
  for (i = 0; i < 0x100; i++) {
    a = buf[i];
    a = a ^ *c;
    buf[i] = a;
    (*c)--;
    (*c)--;
  }
}


x86 assembly (clang, -O0):
<decrypt_sub>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x100,-0x18(%rbp)
jge    1170 <decrypt_sub+0x70>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
add    $0xff,%cl
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
add    $0xff,%cl
mov    %cl,(%rax)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1113 <decrypt_sub+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<decrypt_sub>:
mov    (%rsi),%cl
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %cl,(%rdi,%rax,1)
movzbl (%rsi),%ecx
add    $0xfe,%cl
mov    %cl,(%rsi)
xor    %cl,0x1(%rdi,%rax,1)
movzbl (%rsi),%ecx
add    $0xfe,%cl
mov    %cl,(%rsi)
add    $0x2,%rax
cmp    $0x100,%rax
jne    1110 <decrypt_sub+0x10>
ret

LLVM IR (-O0):
define void @decrypt_sub(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %6
br label %7
7: ; preds = %34, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 256
br i1 %9, label %10, label %37
10: ; preds = %7
%11 = load i8*, i8** %3
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
store i8 %15, i8* %5
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
%18 = load i8*, i8** %4
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = xor i32 %17, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %5
%23 = load i8, i8* %5
%24 = load i8*, i8** %3
%25 = load i32, i32* %6
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %24, i64 %26
store i8 %23, i8* %27
%28 = load i8*, i8** %4
%29 = load i8, i8* %28
%30 = add i8 %29, -1
store i8 %30, i8* %28
%31 = load i8*, i8** %4
%32 = load i8, i8* %31
%33 = add i8 %32, -1
store i8 %33, i8* %31
br label %34
34: ; preds = %10
%35 = load i32, i32* %6
%36 = add nsw i32 %35, 1
store i32 %36, i32* %6
br label %7
37: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @decrypt_sub(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %1
br label %4
4: ; preds = %4, %2
%5 = phi i8 [ %3, %2 ], [ %17, %4 ]
%6 = phi i64 [ 0, %2 ], [ %18, %4 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = xor i8 %5, %8
store i8 %9, i8* %7
%10 = load i8, i8* %1
%11 = add i8 %10, -2
store i8 %11, i8* %1
%12 = or i64 %6, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = xor i8 %11, %14
store i8 %15, i8* %13
%16 = load i8, i8* %1
%17 = add i8 %16, -2
store i8 %17, i8* %1
%18 = add nuw nsw i64 %6, 2
%19 = icmp eq i64 %18, 256
br i1 %19, label %20, label %4
20: ; preds = %4
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
void dump_H(const uint32_t *h) {
  int i;
  for (i = 0; i < (5); ++i) {
    printf(" %08x", h[i]);
  }
}


x86 assembly (clang, -O0):
<dump_H>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1152 <dump_H+0x42>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <dump_H+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_H>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%esi
lea    0xee0(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x4(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x8(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0xc(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x10(%rbx),%esi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c" %08x\00"
define void @dump_H(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = load i32, i32* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds i32, i32* %0, i64 3
%11 = load i32, i32* %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = getelementptr inbounds i32, i32* %0, i64 4
%14 = load i32, i32* %13
%15 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %14)
ret void
}
void case2() {}


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

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

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

LLVM IR (-O2):
define void @case2() {
ret void
}
/* Variables and functions */
int isfinite(float);
int __pruabi_isfinitef(float a) { return isfinite(a); }


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

x86 assembly (clang, -O2):
<__pruabi_isfinitef>:
jmp    1030 <isfinite@plt>

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

LLVM IR (-O2):
define i32 @__pruabi_isfinitef(float %0) {
%2 = tail call i32 @isfinite(float %0)
ret i32 %2
}
/* Type definitions */
struct sys_sigaction {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SYS_rt_sigaction;
int syscall4(int /*<<< orphan*/, int, uintptr_t, uintptr_t, size_t);
int sys_sigaction(int signum, const struct sys_sigaction *act,
                  struct sys_sigaction *oldact) {
  size_t masksize = 8;
  return syscall4(SYS_rt_sigaction, signum, (uintptr_t)act, (uintptr_t)oldact,
                  masksize);
}


x86 assembly (clang, -O0):
<sys_sigaction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x8,-0x20(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1030 <syscall4@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_sigaction>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
mov    $0x8,%r8d
jmp    1030 <syscall4@plt>

LLVM IR (-O0):
%struct.sys_sigaction = type { i32 }
@SYS_rt_sigaction = global i32 0
define i32 @sys_sigaction(i32 %0, %struct.sys_sigaction* %1, %struct.sys_sigaction* %2) {
%4 = alloca i32
%5 = alloca %struct.sys_sigaction*
%6 = alloca %struct.sys_sigaction*
%7 = alloca i64
store i32 %0, i32* %4
store %struct.sys_sigaction* %1, %struct.sys_sigaction** %5
store %struct.sys_sigaction* %2, %struct.sys_sigaction** %6
store i64 8, i64* %7
%8 = load i32, i32* @SYS_rt_sigaction
%9 = load i32, i32* %4
%10 = load %struct.sys_sigaction*, %struct.sys_sigaction** %5
%11 = ptrtoint %struct.sys_sigaction* %10 to i64
%12 = load %struct.sys_sigaction*, %struct.sys_sigaction** %6
%13 = ptrtoint %struct.sys_sigaction* %12 to i64
%14 = load i64, i64* %7
%15 = call i32 @syscall4(i32 %8, i32 %9, i64 %11, i64 %13, i64 %14)
ret i32 %15
}

LLVM IR (-O2):
%struct.sys_sigaction = type { i32 }
@SYS_rt_sigaction = global i32 0
define i32 @sys_sigaction(i32 %0, %struct.sys_sigaction* %1, %struct.sys_sigaction* %2) {
%4 = load i32, i32* @SYS_rt_sigaction
%5 = ptrtoint %struct.sys_sigaction* %1 to i64
%6 = ptrtoint %struct.sys_sigaction* %2 to i64
%7 = tail call i32 @syscall4(i32 %4, i32 %0, i64 %5, i64 %6, i64 8)
ret i32 %7
}
int kcm_is_token_separator(char ch) { return (' ' == ch) || ('\t' == ch); }


x86 assembly (clang, -O0):
<kcm_is_token_separator>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
mov    $0x1,%al
mov    $0x20,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
je     1131 <kcm_is_token_separator+0x31>
movsbl -0x1(%rbp),%ecx
mov    $0x9,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kcm_is_token_separator>:
cmp    $0x20,%dil
sete   %al
cmp    $0x9,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @kcm_is_token_separator(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 32, %4
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 9, %8
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @kcm_is_token_separator(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = icmp eq i8 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void cmd_del() {}


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

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

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

LLVM IR (-O2):
define void @cmd_del() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar1(int);
void putchar(int c) {
  if (c == '\n')
    putchar1('\r');
  putchar1(c);
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jne    112f <putchar+0x1f>
mov    $0xd,%edi
call   1030 <putchar1@plt>
mov    -0x4(%rbp),%edi
call   1030 <putchar1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
push   %rbx
mov    %edi,%ebx
cmp    $0xa,%edi
jne    1122 <putchar+0x12>
mov    $0xd,%edi
call   1030 <putchar1@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <putchar1@plt>

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

LLVM IR (-O2):
define void @putchar(i32 %0) {
%2 = icmp eq i32 %0, 10
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @putchar1(i32 13)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @putchar1(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
scalar_t__ strlen(char *);
void cmdline_parser_print_version(void) {
  printf("%s %s\n", (strlen("quvi") ? "quvi" : "quvi"), "");
}


x86 assembly (clang, -O0):
<cmdline_parser_print_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xedc(%rip),%rdi
call   1030 <strlen@plt>
lea    0xed0(%rip),%rsi
cmp    $0x0,%rax
cmovne %rsi,%rsi
lea    0xeba(%rip),%rdi
lea    0xeb9(%rip),%rdx
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmdline_parser_print_version>:
lea    0xee9(%rip),%rdi
lea    0xee9(%rip),%rsi
lea    0xee1(%rip),%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [5 x i8] c"quvi\00"
@.str.2 = [1 x i8] zeroinitializer
define void @cmdline_parser_print_version() {
%1 = call i64 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [5 x i8] c"quvi\00"
@.str.2 = [1 x i8] zeroinitializer
define void @cmdline_parser_print_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char name[40];
  printf("What's your name? ");
  scanf("%s", name);
  printf("Hello, %s. %s\n", name, "You are an extraordinary begin.");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rsi
lea    0xecb(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x30(%rbp),%rsi
lea    0xebe(%rip),%rdi
lea    0xec6(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xeca(%rip),%rdi
lea    0xed2(%rip),%rdx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"What's your name? \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [15 x i8] c"Hello, %s. %s\0A\00"
@.str.3 = [32 x i8] c"You are an extraordinary begin.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [40 x i8]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %6, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"What's your name? \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [15 x i8] c"Hello, %s. %s\0A\00"
@.str.3 = [32 x i8] c"You are an extraordinary begin.\00"
define i32 @main() {
%1 = alloca [40 x i8]
%2 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %2, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
void ecspi5_iomux_config() {}


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

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

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

LLVM IR (-O2):
define void @ecspi5_iomux_config() {
ret void
}
void __sigign(int sig) {
  (void)sig;
  return;
}


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

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

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

LLVM IR (-O2):
define void @__sigign(i32 %0) {
ret void
}
/* Variables and functions */
char *str_expand(char *, char *, char const *);
char *chr_expand(char *arg, char c, const char *rep) {
  char s[2];
  s[0] = c;
  s[1] = '\0';
  return str_expand(arg, s, rep);
}


x86 assembly (clang, -O0):
<chr_expand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0x1a(%rbp)
movb   $0x0,-0x19(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x1a(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <str_expand@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chr_expand>:
push   %rax
mov    %sil,0x6(%rsp)
movb   $0x0,0x7(%rsp)
lea    0x6(%rsp),%rsi
call   1030 <str_expand@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i8* @chr_expand(i8* %0, i8 signext %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8*
%7 = alloca [2 x i8]
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8* %2, i8** %6
%8 = load i8, i8* %5
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
store i8 %8, i8* %9
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 1
store i8 0, i8* %10
%11 = load i8*, i8** %4
%12 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
%13 = load i8*, i8** %6
%14 = call i8* @str_expand(i8* %11, i8* %12, i8* %13)
ret i8* %14
}

LLVM IR (-O2):
define i8* @chr_expand(i8* %0, i8 signext %1, i8* %2) {
%4 = alloca [2 x i8]
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
store i8 %1, i8* %5
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 1
store i8 0, i8* %6
%7 = call i8* @str_expand(i8* %0, i8* %5, i8* %2)
ret i8* %7
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fork();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ wait(int *);
int main(int argc, char **argv) {
  int estado;
  printf("Hola\n");
  pid_t id = fork();
  if (id == 0) {
    printf("Adios hijo\n");
  } else {
    printf("Adios padre\n");
  }
  wait(&estado);
  exit(0);
  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    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1060 <fork@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1189 <main+0x49>
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
jmp    1195 <main+0x55>
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
lea    -0x14(%rbp),%rdi
call   1050 <wait@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <fork@plt>
test   %rax,%rax
lea    0xeb3(%rip),%rax
lea    0xea0(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
lea    0x4(%rsp),%rdi
call   1050 <wait@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"Hola\0A\00"
@.str.1 = [12 x i8] c"Adios hijo\0A\00"
@.str.2 = [13 x i8] c"Adios padre\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%9 = call i64 (...) @fork()
store i64 %9, i64* %7
%10 = load i64, i64* %7
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %16
14: ; preds = %2
%15 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %16
16: ; preds = %14, %12
%17 = call i32 @wait(i32* %6)
%18 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [5 x i8] c"Hola\00"
@str.3 = [12 x i8] c"Adios padre\00"
@str.4 = [11 x i8] c"Adios hijo\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%6 = tail call i64 (...) @fork()
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str.3, i64 0, i64 0)
%9 = tail call i32 @puts(i8* dereferenceable(1) %8)
%10 = call i32 @wait(i32* %3)
%11 = call i32 @exit(i32 0)
unreachable
}
__attribute__((noclone, no, long_call)) int foo(int a, int b, int c, int d,
                                                double i) {
  return a;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo(i32 returned %0, i32 %1, i32 %2, i32 %3, double %4) {
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint32_t;

/* Variables and functions */
scalar_t__ wip_pwm_validate_map(int /*<<< orphan*/ volatile *);
uint32_t wip_reg_read(volatile uint32_t *ptr, int reg) {
  if (wip_pwm_validate_map(ptr) >= 0) {
    return *(ptr + (reg >> 2));
  }
  return 0;
}


x86 assembly (clang, -O0):
<wip_reg_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <wip_pwm_validate_map@plt>
cmp    $0x0,%rax
jl     114a <wip_reg_read+0x3a>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sar    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
jmp    1151 <wip_reg_read+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wip_reg_read>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <wip_pwm_validate_map@plt>
test   %rax,%rax
js     112d <wip_reg_read+0x1d>
sar    $0x2,%ebp
movslq %ebp,%rax
mov    (%rbx,%rax,4),%eax
jmp    112f <wip_reg_read+0x1f>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @wip_reg_read(i32* %0, i32 %1) {
%3 = tail call i64 @wip_pwm_validate_map(i32* %0)
%4 = icmp sgt i64 %3, -1
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = ashr i32 %1, 2
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load volatile i32, i32* %8
br label %10
10: ; preds = %2, %5
%11 = phi i32 [ %9, %5 ], [ 0, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void traitement_signal() { waitpid(-1, NULL, WNOHANG); }


x86 assembly (clang, -O0):
<traitement_signal>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <waitpid@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<traitement_signal>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
jmp    1030 <waitpid@plt>

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @traitement_signal() {
%1 = load i32, i32* @WNOHANG
%2 = call i32 @waitpid(i32 -1, i32* null, i32 %1)
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @traitement_signal() {
%1 = load i32, i32* @WNOHANG
%2 = tail call i32 @waitpid(i32 -1, i32* null, i32 %1)
ret void
}
void nullhandler(int signal) {}


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

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

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

LLVM IR (-O2):
define void @nullhandler(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e_izpy();
int /*<<< orphan*/ e_ora();
void e_ora_izpy() {
  e_izpy();
  e_ora();
}


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

x86 assembly (clang, -O2):
<e_ora_izpy>:
push   %rax
xor    %eax,%eax
call   1030 <e_izpy@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <e_ora@plt>

LLVM IR (-O0):
define void @e_ora_izpy() {
%1 = call i32 (...) @e_izpy()
%2 = call i32 (...) @e_ora()
ret void
}

LLVM IR (-O2):
define void @e_ora_izpy() {
%1 = tail call i32 (...) @e_izpy()
%2 = tail call i32 (...) @e_ora()
ret void
}
int strcmp(const char *a, const char *b) {
  while (*a == *b && *a != '\0') {
    a++;
    b++;
  }
  return *a - *b;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x11(%rbp)
jne    1137 <strcmp+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <strcmp+0x47>
jmp    1164 <strcmp+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
mov    (%rsi),%cl
test   %al,%al
je     1134 <strcmp+0x34>
cmp    %cl,%al
jne    1134 <strcmp+0x34>
mov    $0x1,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rdi,%rdx,1),%eax
movzbl (%rsi,%rdx,1),%ecx
test   %al,%al
je     1134 <strcmp+0x34>
add    $0x1,%rdx
cmp    %cl,%al
je     1120 <strcmp+0x20>
movsbl %al,%eax
movsbl %cl,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %20, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %8, %11
br i1 %12, label %13, label %18
13: ; preds = %5
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 0
br label %18
18: ; preds = %13, %5
%19 = phi i1 [ false, %5 ], [ %17, %13 ]
br i1 %19, label %20, label %25
20: ; preds = %18
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %4
br label %5
25: ; preds = %18
%26 = load i8*, i8** %3
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = load i8*, i8** %4
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = sub nsw i32 %28, %31
ret i32 %32
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp ne i8 %3, %4
%6 = icmp eq i8 %3, 0
%7 = or i1 %6, %5
br i1 %7, label %18, label %8
8: ; preds = %2, %8
%9 = phi i8* [ %12, %8 ], [ %1, %2 ]
%10 = phi i8* [ %11, %8 ], [ %0, %2 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = load i8, i8* %11
%14 = load i8, i8* %12
%15 = icmp ne i8 %13, %14
%16 = icmp eq i8 %13, 0
%17 = or i1 %16, %15
br i1 %17, label %18, label %8
18: ; preds = %8, %2
%19 = phi i8 [ %3, %2 ], [ %13, %8 ]
%20 = phi i8 [ %4, %2 ], [ %14, %8 ]
%21 = sext i8 %19 to i32
%22 = sext i8 %20 to i32
%23 = sub nsw i32 %21, %22
ret i32 %23
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int wchar_string_to_cp850_string(char *, int /*<<< orphan*/ *, unsigned int);
int wchar_string_to_dos_string(char *out, wchar_t *in, unsigned int out_size) {
  return wchar_string_to_cp850_string(out, in, out_size);
}


x86 assembly (clang, -O0):
<wchar_string_to_dos_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <wchar_string_to_cp850_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wchar_string_to_dos_string>:
jmp    1030 <wchar_string_to_cp850_string@plt>

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

LLVM IR (-O2):
define i32 @wchar_string_to_dos_string(i8* %0, i32* %1, i32 %2) {
%4 = tail call i32 @wchar_string_to_cp850_string(i8* %0, i32* %1, i32 %2)
ret i32 %4
}
int htab_int_cmp(const void *data1, const void *data2) {
  const unsigned int *v1 = data1;
  const unsigned int *v2 = data2;
  return (*v1) - (*v2);
}


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

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

LLVM IR (-O0):
define i32 @htab_int_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = sub i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @htab_int_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub i32 %5, %6
ret i32 %7
}
void send_intr(void) {}


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

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

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

LLVM IR (-O2):
define void @send_intr() {
ret void
}
/* Variables and functions */
int rand();
int generar_dato(void) { return (rand() % 6); }


x86 assembly (clang, -O0):
<generar_dato>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<generar_dato>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @generar_dato() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 6
ret i32 %2
}

LLVM IR (-O2):
define i32 @generar_dato() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 6
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(int);
void bar(void) {
  void *p = malloc(16);
  free(p);
}


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

x86 assembly (clang, -O2):
<bar>:
push   %rax
mov    $0x10,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @bar() {
%1 = tail call dereferenceable_or_null(16) i8* @malloc(i32 16)
%2 = tail call i32 @free(i8* %1)
ret void
}
void executeFunction(void (*f)(void)) { f(); }


x86 assembly (clang, -O0):
<executeFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<executeFunction>:
jmp    *%rdi

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

LLVM IR (-O2):
define void @executeFunction(void ()* nocapture %0) {
tail call void %0()
ret void
}
/* Variables and functions */
int core13_safe(char const *);
int U_EMRALPHABLEND_safe(const char *record) { return (core13_safe(record)); }


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

x86 assembly (clang, -O2):
<U_EMRALPHABLEND_safe>:
jmp    1030 <core13_safe@plt>

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

LLVM IR (-O2):
define i32 @U_EMRALPHABLEND_safe(i8* %0) {
%2 = tail call i32 @core13_safe(i8* %0)
ret i32 %2
}
__attribute__((no, noclone)) unsigned int foo(unsigned char *p) {
  return ((unsigned int)p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    (%rdi),%eax
bswap  %eax
ret

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

LLVM IR (-O2):
define i32 @foo(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}