xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char our_string[20];
  printf("You want to say:");
  scanf("%s", our_string);
  printf("I understood: %s\n", our_string);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"You want to say:\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [18 x i8] c"I understood: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [20 x i8], [20 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 [20 x i8], [20 x i8]* %2, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"You want to say:\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [18 x i8] c"I understood: %s\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 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 ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int64_t cfs_basic_lchown(const char *path, int64_t uid, int64_t gid) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @cfs_basic_lchown(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
ret i32 0
}

LLVM IR (-O2):
define i32 @cfs_basic_lchown(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
void *proxy_aligned_alloc(void *, size_t, int, char const *, unsigned int);
void *proxy_alloc(void *data, size_t size, const char *filename,
                  unsigned int fileline) {
  return proxy_aligned_alloc(data, size, 8, filename, fileline);
}


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

x86 assembly (clang, -O2):
<proxy_alloc>:
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    $0x8,%edx
jmp    1030 <proxy_aligned_alloc@plt>

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

LLVM IR (-O2):
define i8* @proxy_alloc(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = tail call i8* @proxy_aligned_alloc(i8* %0, i64 %1, i32 8, i8* %2, i32 %3)
ret i8* %5
}
char *fgaj_white(int c) { return c ? "[0;37m" : ""; }


x86 assembly (clang, -O0):
<fgaj_white>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xef6(%rip),%rax
lea    0xee8(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgaj_white>:
test   %edi,%edi
lea    0xefe(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[0;37m\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @fgaj_white(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0)
ret i8* %6
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[0;37m\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @fgaj_white(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ blue(char *);
int /*<<< orphan*/ printColor(int /*<<< orphan*/);
void cmBlue(char *str) { printColor(blue(str)); }


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

x86 assembly (clang, -O2):
<cmBlue>:
push   %rax
call   1040 <blue@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <printColor@plt>

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

LLVM IR (-O2):
define void @cmBlue(i8* %0) {
%2 = tail call i32 @blue(i8* %0)
%3 = tail call i32 @printColor(i32 %2)
ret void
}
void rop3_42_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T & S;
  stk2 = ~stk2;
  stk1 = *D & stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_42_0_1>:
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
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%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_42_0_1>:
and    %edx,%esi
not    %sil
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_42_0_1(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 = and i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %8
%15 = load i8, i8* %8
%16 = zext i8 %15 to i32
%17 = xor i32 %16, -1
%18 = trunc i32 %17 to i8
store i8 %18, i8* %8
%19 = load i8*, i8** %4
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = and i32 %21, %23
%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 = and i32 %27, %29
%31 = load i8, i8* %7
%32 = zext i8 %31 to i32
%33 = load i8, i8* %6
%34 = zext i8 %33 to i32
%35 = xor i32 %34, -1
%36 = and i32 %32, %35
%37 = or i32 %30, %36
%38 = load i8, i8* %6
%39 = zext i8 %38 to i32
%40 = load i8, i8* %5
%41 = zext i8 %40 to i32
%42 = xor i32 %41, -1
%43 = and i32 %39, %42
%44 = load i8*, i8** %4
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
%47 = and i32 %43, %46
%48 = or i32 %37, %47
%49 = trunc i32 %48 to i8
%50 = load i8*, i8** %4
store i8 %49, i8* %50
ret void
}

LLVM IR (-O2):
define void @rop3_42_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %1, %2
%6 = xor i8 %5, -1
%7 = and i8 %4, %6
store i8 %7, i8* %0
ret void
}
int lenstr(char *s) {
  char *c;
  for (c = s; *c; c++)
    ;
  return (c - s);
}


x86 assembly (clang, -O0):
<lenstr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1133 <lenstr+0x33>
jmp    1122 <lenstr+0x22>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <lenstr+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lenstr>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <lenstr+0x10>
ret

LLVM IR (-O0):
define i32 @lenstr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %10, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %5
br label %10
10: ; preds = %9
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
br label %5
13: ; preds = %5
%14 = load i8*, i8** %3
%15 = load i8*, i8** %2
%16 = ptrtoint i8* %14 to i64
%17 = ptrtoint i8* %15 to i64
%18 = sub i64 %16, %17
%19 = trunc i64 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @lenstr(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int cfgetospeed(struct termios *);
int termios_cfgetospeed(struct termios *t) { return cfgetospeed(t); }


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

x86 assembly (clang, -O2):
<termios_cfgetospeed>:
jmp    1030 <cfgetospeed@plt>

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

LLVM IR (-O2):
%struct.termios = type { i32 }
define i32 @termios_cfgetospeed(%struct.termios* %0) {
%2 = tail call i32 @cfgetospeed(%struct.termios* %0)
ret i32 %2
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *copyString(char *str) {
  char *tmp = malloc(strlen(str) + 1);
  if (tmp)
    strcpy(tmp, str);
  return tmp;
}


x86 assembly (clang, -O0):
<copyString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <copyString+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyString>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <copyString+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @copyString(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int strlen(char *);
void clear_msg(char *buf) {
  int len = strlen(buf) - 1;
  for (; len >= 0; --len)
    buf[len] = '\b';
  printf(buf);
}


x86 assembly (clang, -O0):
<clear_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     115f <clear_msg+0x3f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x8,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    113b <clear_msg+0x1b>
mov    -0x8(%rbp),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_msg>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    114c <clear_msg+0x1c>
mov    %eax,%edx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1050 <memset@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
define void @clear_msg(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sub nsw i32 %5, 1
store i32 %6, i32* %3
br label %7
7: ; preds = %15, %1
%8 = load i32, i32* %3
%9 = icmp sge i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = load i8*, i8** %2
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8 8, i8* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %3
%17 = add nsw i32 %16, -1
store i32 %17, i32* %3
br label %7
18: ; preds = %7
%19 = load i8*, i8** %2
%20 = call i32 @printf(i8* %19)
ret void
}

LLVM IR (-O2):
define void @clear_msg(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @printf(i8* dereferenceable(1) %0)
ret void
}
int test_imm_F4uint8_reg(unsigned char val) {
  return ((val) & (-0xF4 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_F4uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 12
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int smbw_close(int);
scalar_t__ smbw_fd(int);
int stub1(int);
int closex(int fd, int (*f)(int fd)) {
  if (smbw_fd(fd)) {
    return smbw_close(fd);
  }
  return (*f)(fd);
}


x86 assembly (clang, -O0):
<closex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <smbw_fd@plt>
cmp    $0x0,%rax
je     1151 <closex+0x31>
mov    -0x8(%rbp),%edi
call   1040 <smbw_close@plt>
mov    %eax,-0x4(%rbp)
jmp    115d <closex+0x3d>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%edi
call   *%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closex>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
call   1030 <smbw_fd@plt>
mov    %ebx,%edi
test   %rax,%rax
je     1141 <closex+0x21>
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <smbw_close@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    *%rax

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

LLVM IR (-O2):
define i32 @closex(i32 %0, i32 (i32)* nocapture %1) {
%3 = tail call i64 @smbw_fd(i32 %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @smbw_close(i32 %0)
br label %9
7: ; preds = %2
%8 = tail call i32 %1(i32 %0)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void store(int flag, void *dst1, void *src1, size_t size1, void *dst2,
           void *src2, size_t size2) {
#pragma HLS inline off
  if (flag) {
    memcpy(dst1, src1, size1);
    memcpy(dst2, src2, size2);
  }
}


x86 assembly (clang, -O0):
<store>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     115f <store+0x4f>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    0x10(%rbp),%rdx
call   1030 <memcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<store>:
test   %edi,%edi
je     1145 <store+0x35>
push   %r15
push   %r14
push   %rbx
mov    %r9,%r14
mov    %r8,%rbx
mov    0x20(%rsp),%r15
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <memcpy@plt>
ret

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

LLVM IR (-O2):
define void @store(i32 %0, i8* %1, i8* %2, i64 %3, i8* %4, i8* %5, i64 %6) {
%8 = icmp eq i32 %0, 0
br i1 %8, label %12, label %9
9: ; preds = %7
%10 = tail call i32 @memcpy(i8* %1, i8* %2, i64 %3)
%11 = tail call i32 @memcpy(i8* %4, i8* %5, i64 %6)
br label %12
12: ; preds = %9, %7
ret void
}
int is3ByteStarter(unsigned char c) { return c >= 224 && c < 240; }


x86 assembly (clang, -O0):
<is3ByteStarter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0xe0,%ecx
mov    %al,-0x2(%rbp)
jl     112e <is3ByteStarter+0x2e>
movzbl -0x1(%rbp),%eax
cmp    $0xf0,%eax
setl   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is3ByteStarter>:
and    $0xf0,%dil
xor    %eax,%eax
cmp    $0xe0,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is3ByteStarter(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp sge i32 %4, 224
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp slt i32 %8, 240
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is3ByteStarter(i8 zeroext %0) {
%2 = and i8 %0, -16
%3 = icmp eq i8 %2, -32
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int s_mp_tovalue(char, int);
int mp_char2value(char ch, int r) { return s_mp_tovalue(ch, r); }


x86 assembly (clang, -O0):
<mp_char2value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%esi
movsbl %al,%edi
call   1030 <s_mp_tovalue@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_char2value>:
jmp    1030 <s_mp_tovalue@plt>

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

LLVM IR (-O2):
define i32 @mp_char2value(i8 signext %0, i32 %1) {
%3 = tail call i32 @s_mp_tovalue(i8 signext %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void YesNo(unsigned uSelect) {
  if (uSelect)
    printf("Yes");
  else
    printf("No");
}


x86 assembly (clang, -O0):
<YesNo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1136 <YesNo+0x26>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
jmp    1142 <YesNo+0x32>
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<YesNo>:
test   %edi,%edi
lea    0xeeb(%rip),%rax
lea    0xee0(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"Yes\00"
@.str.1 = [3 x i8] c"No\00"
define void @YesNo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"Yes\00"
@.str.1 = [3 x i8] c"No\00"
define void @YesNo(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
%4 = tail call i32 @printf(i8* dereferenceable(1) %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void AV_WB16(uint8_t *dst, unsigned val) {
  *dst++ = val >> 8;
  *dst++ = val;
}


x86 assembly (clang, -O0):
<AV_WB16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
shr    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AV_WB16>:
mov    %esi,%eax
shr    $0x8,%eax
mov    %eax,(%rdi)
mov    %esi,0x4(%rdi)
ret

LLVM IR (-O0):
define void @AV_WB16(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = lshr i32 %5, 8
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i32 1
store i32* %8, i32** %3
store i32 %6, i32* %7
%9 = load i32, i32* %4
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i32 1
store i32* %11, i32** %3
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
define void @AV_WB16(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %3, i32* %0
store i32 %1, i32* %4
ret void
}
int vbr_getquant_2pass1(void *state) { return (2); }


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

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

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

LLVM IR (-O2):
define i32 @vbr_getquant_2pass1(i8* nocapture readnone %0) {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ arc4random_buf(char *, int);
int /*<<< orphan*/ memcpy(long *, char *, int);
long rand_long() {
  char bytes[8];
  arc4random_buf(bytes, 8);
  long rand;
  memcpy(&rand, bytes, 8);
  return rand;
}


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

x86 assembly (clang, -O2):
<rand_long>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <arc4random_buf@plt>
mov    %rsp,%rdi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
mov    (%rsp),%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i64 @rand_long() {
%1 = alloca [8 x i8]
%2 = alloca i64
%3 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%4 = call i32 @arc4random_buf(i8* %3, i32 8)
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%6 = call i32 @memcpy(i64* %2, i8* %5, i32 8)
%7 = load i64, i64* %2
ret i64 %7
}

LLVM IR (-O2):
define i64 @rand_long() {
%1 = alloca [8 x i8]
%2 = alloca i64
%3 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%4 = call i32 @arc4random_buf(i8* %3, i32 8)
%5 = bitcast i64* %2 to i8*
%6 = call i32 @memcpy(i64* %2, i8* %3, i32 8)
%7 = load i64, i64* %2
ret i64 %7
}
int fun_5b() { return 5; }


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

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

LLVM IR (-O0):
define i32 @fun_5b() {
ret i32 5
}

LLVM IR (-O2):
define i32 @fun_5b() {
ret i32 5
}
unsigned addval_112(unsigned x) { return x + 3281113481U; }


x86 assembly (clang, -O0):
<addval_112>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc391d189,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addval_112>:
lea    -0x3c6e2e77(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @addval_112(i32 %0) {
%2 = add i32 %0, -1013853815
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ message_reader_read_uint32();
int message_reader_read_int() {
  uint32_t d = message_reader_read_uint32();
  return *(int *)(&d);
}


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

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

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

LLVM IR (-O2):
define i32 @message_reader_read_int() {
%1 = tail call i32 (...) @message_reader_read_uint32()
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t tommy_le_uint32_read(const void *ptr) { return *(uint32_t *)ptr; }


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

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

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

LLVM IR (-O2):
define i32 @tommy_le_uint32_read(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
int test_imm_F0uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xF0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F0uint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0xf0,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F0uint64_midword_reg>:
test   $0xf00000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_F0uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 15728640
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Inst_Printf(char *, char *);
int /*<<< orphan*/ Label_Printf(char *);
void Dico_String_Start(int nb_consts) {
  Label_Printf(".section\t.rodata");
  Inst_Printf(".align", "3");
}


x86 assembly (clang, -O0):
<Dico_String_Start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1040 <Label_Printf@plt>
lea    0xed3(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1030 <Inst_Printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Dico_String_Start>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <Label_Printf@plt>
lea    0xedd(%rip),%rdi
lea    0xedd(%rip),%rsi
pop    %rax
jmp    1030 <Inst_Printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c".section\09.rodata\00"
@.str.1 = [7 x i8] c".align\00"
@.str.2 = [2 x i8] c"3\00"
define void @Dico_String_Start(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @Label_Printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @Inst_Printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c".section\09.rodata\00"
@.str.1 = [7 x i8] c".align\00"
@.str.2 = [2 x i8] c"3\00"
define void @Dico_String_Start(i32 %0) {
%2 = tail call i32 @Label_Printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int rand1();
int RandNum(int num) {
  int temp;
  if (num == 0)
    return (0);
  temp = (int)(rand1() * num);
  if (temp == num)
    return (0);
  else
    return ((int)temp);
}


x86 assembly (clang, -O0):
<RandNum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <RandNum+0x21>
movl   $0x0,-0x4(%rbp)
jmp    115d <RandNum+0x4d>
mov    $0x0,%al
call   1030 <rand1@plt>
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1157 <RandNum+0x47>
movl   $0x0,-0x4(%rbp)
jmp    115d <RandNum+0x4d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandNum>:
test   %edi,%edi
je     1131 <RandNum+0x21>
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <rand1@plt>
imul   %ebx,%eax
cmp    %ebx,%eax
cmove  %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @RandNum(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i32 (...) @rand1()
%5 = mul nsw i32 %4, %0
%6 = icmp eq i32 %5, %0
%7 = select i1 %6, i32 0, i32 %5
br label %8
8: ; preds = %3, %1
%9 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_request_name(void *bus, const char *name, uint64_t flags) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_request_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
mov    0x2ec8(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_request_name>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_request_name(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_request_name(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ private_merge_sort_str(char const **, int /*<<< orphan*/,
                                          int, unsigned char);
void merge_sort_list_str(const char **list, int size,
                         unsigned char ascending_order) {
  private_merge_sort_str(list, 0, size - 1, ascending_order);
}


x86 assembly (clang, -O0):
<merge_sort_list_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
movzbl -0xd(%rbp),%ecx
call   1030 <private_merge_sort_str@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<merge_sort_list_str>:
mov    %edx,%ecx
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <private_merge_sort_str@plt>

LLVM IR (-O0):
define void @merge_sort_list_str(i8** %0, i32 %1, i8 zeroext %2) {
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i8
store i8** %0, i8*** %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = load i8**, i8*** %4
%8 = load i32, i32* %5
%9 = sub nsw i32 %8, 1
%10 = load i8, i8* %6
%11 = call i32 @private_merge_sort_str(i8** %7, i32 0, i32 %9, i8 zeroext %10)
ret void
}

LLVM IR (-O2):
define void @merge_sort_list_str(i8** %0, i32 %1, i8 zeroext %2) {
%4 = add nsw i32 %1, -1
%5 = tail call i32 @private_merge_sort_str(i8** %0, i32 0, i32 %4, i8 zeroext %2)
ret void
}
void deallocate(ptr) void *ptr;
{ free(ptr); }


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

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

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

LLVM IR (-O2):
define void @deallocate(i8* nocapture %0) {
tail call void @free(i8* %0)
ret void
}
void vmem_32_uninit(struct vmem_32 *vmem32) {}


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

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

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

LLVM IR (-O2):
%struct.vmem_32 = type opaque
define void @vmem_32_uninit(%struct.vmem_32* nocapture %0) {
ret void
}
void usb_hp_handler(void) {}


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

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

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

LLVM IR (-O2):
define void @usb_hp_handler() {
ret void
}
void Ctypes_hook_wr_ten_s8s(void) {}


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

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

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

LLVM IR (-O2):
define void @Ctypes_hook_wr_ten_s8s() {
ret void
}
long function() {
  long a;
  int b;
  a + b;
  b + a;
  return a;
}


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

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

LLVM IR (-O0):
define i64 @function() {
%1 = alloca i64
%2 = alloca i32
%3 = load i64, i64* %1
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = add nsw i64 %3, %5
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = load i64, i64* %1
%10 = add nsw i64 %8, %9
%11 = load i64, i64* %1
ret i64 %11
}

LLVM IR (-O2):
define i64 @function() {
ret i64 undef
}
/* Variables and functions */
int /*<<< orphan*/ invertDisplay(int);
int /*<<< orphan*/ usleep(int);
void display_invert_normal() {
  invertDisplay(0x01);
  usleep(1000000);
  invertDisplay(0x00);
  usleep(1000000);
}


x86 assembly (clang, -O0):
<display_invert_normal>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <invertDisplay@plt>
mov    $0xf4240,%edi
call   1040 <usleep@plt>
xor    %edi,%edi
call   1030 <invertDisplay@plt>
mov    $0xf4240,%edi
call   1040 <usleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_invert_normal>:
push   %rax
mov    $0x1,%edi
call   1030 <invertDisplay@plt>
mov    $0xf4240,%edi
call   1040 <usleep@plt>
xor    %edi,%edi
call   1030 <invertDisplay@plt>
mov    $0xf4240,%edi
pop    %rax
jmp    1040 <usleep@plt>

LLVM IR (-O0):
define void @display_invert_normal() {
%1 = call i32 @invertDisplay(i32 1)
%2 = call i32 @usleep(i32 1000000)
%3 = call i32 @invertDisplay(i32 0)
%4 = call i32 @usleep(i32 1000000)
ret void
}

LLVM IR (-O2):
define void @display_invert_normal() {
%1 = tail call i32 @invertDisplay(i32 1)
%2 = tail call i32 @usleep(i32 1000000)
%3 = tail call i32 @invertDisplay(i32 0)
%4 = tail call i32 @usleep(i32 1000000)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void closefile(FILE **fp) {
  if (*fp)
    fclose(*fp);
}


x86 assembly (clang, -O0):
<closefile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1136 <closefile+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closefile>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <closefile+0xd>
jmp    1030 <fclose@plt>
ret

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

LLVM IR (-O2):
define void @closefile(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
void literal_pool(int n) {}


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

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

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

LLVM IR (-O2):
define void @literal_pool(i32 %0) {
ret void
}
void bfqg_stats_update_io_merged(struct bfq_group *bfqg, int rw) {}


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

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

LLVM IR (-O0):
%struct.bfq_group = type opaque
define void @bfqg_stats_update_io_merged(%struct.bfq_group* %0, i32 %1) {
%3 = alloca %struct.bfq_group*
%4 = alloca i32
store %struct.bfq_group* %0, %struct.bfq_group** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.bfq_group = type opaque
define void @bfqg_stats_update_io_merged(%struct.bfq_group* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello Universe");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Hello Universe\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Hello Universe\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
char *strcat(char *, char *);
void syserr(char *prog, char *msg) {
  char *str_temp = strcat(prog, " - "
                                "\033[31m"
                                "error"
                                "\e[0m"
                                ": ");
  str_temp = strcat(str_temp, msg);
  perror(str_temp);
  exit(1);
}


x86 assembly (clang, -O0):
<syserr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1040 <strcat@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcat@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<syserr>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
movups 0xeaa(%rip),%xmm0
movups %xmm0,(%rbx,%rax,1)
movl   $0x203a6d,0x10(%rbx,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcat@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c" - \1B[31merror\1B[0m: \00"
define void @syserr(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 i8* @strcat(i8* %6, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i8*, i8** %4
%10 = call i8* @strcat(i8* %8, i8* %9)
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = call i32 @perror(i8* %11)
%13 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [20 x i8] c" - \1B[31merror\1B[0m: \00"
define void @syserr(i8* %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = getelementptr i8, i8* %0, i64 %3
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(20) %4, i8* align 1 dereferenceable(20) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 20, i1 false)
%5 = tail call i8* @strcat(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%6 = tail call i32 @perror(i8* %0)
%7 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void mostra(char p[200], int i, int f) {
  int c = 0;
  for (c = i; c < f; c++)
    printf("%c", p[c]);
  printf("\n");
}


x86 assembly (clang, -O0):
<mostra>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1163 <mostra+0x53>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112f <mostra+0x1f>
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mostra>:
push   %r15
push   %r14
push   %rbx
cmp    %edx,%esi
jge    1143 <mostra+0x33>
mov    %edx,%r15d
mov    %rdi,%r14
movslq %esi,%rax
add    %rax,%r14
sub    %esi,%r15d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <mostra+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @mostra(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %16
5: ; preds = %3
%6 = sext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ %6, %5 ], [ %13, %7 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = tail call i32 @putchar(i32 %11)
%13 = add nsw i64 %8, 1
%14 = trunc i64 %13 to i32
%15 = icmp eq i32 %14, %2
br i1 %15, label %16, label %7
16: ; preds = %7, %3
%17 = tail call i32 @putchar(i32 10)
ret void
}