xunge/DecIR huggingface dataset:
long int labs(long int i) { return i < 0 ? -i : i; }


x86 assembly (clang, -O0):
<labs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1122 <labs+0x22>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <labs+0x2a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<labs>:
mov    %rdi,%rax
neg    %rax
cmovs  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @labs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = sub nsw i64 0, %6
br label %10
8: ; preds = %1
%9 = load i64, i64* %2
br label %10
10: ; preds = %8, %5
%11 = phi i64 [ %7, %5 ], [ %9, %8 ]
ret i64 %11
}

LLVM IR (-O2):
define i64 @labs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(const char *mess) {
  fprintf(stderr, "Error: %s\n", mess);
  fprintf(stderr, "Usage: r7800 input_file output_file\n");
  fprintf(stderr, "\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xeb4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xec7(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeda(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
@.str.1 = [37 x i8] c"Usage: r7800 input_file output_file\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
@.str.1 = [37 x i8] c"Usage: r7800 input_file output_file\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
char *getRev(char *comp, size_t complen) {
  for (int i = complen - 1; i >= 0; i--) {
    printf("%c", comp[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<getRev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
sub    $0x1,%rax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     115d <getRev+0x4d>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    112b <getRev+0x1b>
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRev>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %r14d,%eax
add    $0xffffffff,%eax
js     1145 <getRev+0x35>
mov    %rdi,%rbx
mov    %eax,%eax
add    %rax,%rbx
nopw   0x0(%rax,%rax,1)
movsbl (%rbx),%edi
call   1030 <putchar@plt>
add    $0xffffffff,%r14d
add    $0xffffffffffffffff,%rbx
test   %r14d,%r14d
jg     1130 <getRev+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c"\0A\00"
define i8* @getRev(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i64, i64* %5
%8 = sub i64 %7, 1
%9 = trunc i64 %8 to i32
store i32 %9, i32* %6
br label %10
10: ; preds = %21, %2
%11 = load i32, i32* %6
%12 = icmp sge i32 %11, 0
br i1 %12, label %13, label %24
13: ; preds = %10
%14 = load i8*, i8** %4
%15 = load i32, i32* %6
%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* %6
%23 = add nsw i32 %22, -1
store i32 %23, i32* %6
br label %10
24: ; preds = %10
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%26 = load i8*, i8** %3
ret i8* %26
}

LLVM IR (-O2):
define noalias i8* @getRev(i8* nocapture %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = add i32 %3, -1
%5 = icmp sgt i32 %4, -1
br i1 %5, label %8, label %6
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret i8* undef
8: ; preds = %2, %8
%9 = phi i32 [ %15, %8 ], [ %4, %2 ]
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = tail call i32 @putchar(i32 %13)
%15 = add nsw i32 %9, -1
%16 = icmp sgt i32 %9, 0
br i1 %16, label %8, label %6
}
/* Variables and functions */
int /*<<< orphan*/ glInitNames();
int /*<<< orphan*/ printf(char *, ...);
void trace_glInitNames(void) {
  printf("%20s(", "glInitNames");
  printf(");\n");
  glInitNames();
}


x86 assembly (clang, -O0):
<trace_glInitNames>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed4(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <glInitNames@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<trace_glInitNames>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xec7(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <glInitNames@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%20s(\00"
@.str.1 = [12 x i8] c"glInitNames\00"
@.str.2 = [4 x i8] c");\0A\00"
define void @trace_glInitNames() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 (...) @glInitNames()
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%20s(\00"
@.str.1 = [12 x i8] c"glInitNames\00"
@str = [3 x i8] c");\00"
define void @trace_glInitNames() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @glInitNames()
ret void
}
void rop3_223_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D & T;
  stk2 = ~stk2;
  stk1 = S | stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


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

LLVM IR (-O0):
define void @rop3_223_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** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = and i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = xor i32 %17, -1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8, i8* %5
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = or 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_223_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %2, -1
%6 = and i8 %4, %2
%7 = or i8 %6, %1
%8 = or i8 %7, %5
store i8 %8, i8* %0
ret void
}
/* Variables and functions */
char *dupstr(char const *);
int eval(char *, int);
int strlen(char *);
int eval_bin(const char *s) {
  char *p;
  p = dupstr(s);
  p[strlen(p) - 1] = '\0';
  return eval(p, 2);
}


x86 assembly (clang, -O0):
<eval_bin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <dupstr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1040 <eval@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_bin>:
push   %rbx
call   1050 <dupstr@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,%rdi
mov    $0x2,%esi
pop    %rbx
jmp    1040 <eval@plt>

LLVM IR (-O0):
define i32 @eval_bin(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @dupstr(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = sub nsw i32 %8, 1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %6, i64 %10
store i8 0, i8* %11
%12 = load i8*, i8** %3
%13 = call i32 @eval(i8* %12, i32 2)
ret i32 %13
}

LLVM IR (-O2):
define i32 @eval_bin(i8* %0) {
%2 = tail call i8* @dupstr(i8* %0)
%3 = tail call i32 @strlen(i8* %2)
%4 = add nsw i32 %3, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %2, i64 %5
store i8 0, i8* %6
%7 = tail call i32 @eval(i8* %2, i32 2)
ret i32 %7
}
/* Type definitions */
struct pqos_cap {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ _pqos_cap_get(struct pqos_cap const **,
                                 int /*<<< orphan*/ *);
int resctrl_alloc_task_search(unsigned int *, struct pqos_cap const *,
                              int /*<<< orphan*/ const);
int resctrl_alloc_assoc_get_pid(const pid_t task, unsigned *class_id) {
  const struct pqos_cap *cap;
  _pqos_cap_get(&cap, NULL);
  return resctrl_alloc_task_search(class_id, cap, task);
}


x86 assembly (clang, -O0):
<resctrl_alloc_assoc_get_pid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <_pqos_cap_get@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x4(%rbp),%edx
call   1040 <resctrl_alloc_task_search@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resctrl_alloc_assoc_get_pid>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <_pqos_cap_get@plt>
mov    (%rsp),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
call   1040 <resctrl_alloc_task_search@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.pqos_cap = type { i32 }
define i32 @resctrl_alloc_assoc_get_pid(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca %struct.pqos_cap*
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = call i32 @_pqos_cap_get(%struct.pqos_cap** %5, i32* null)
%7 = load i32*, i32** %4
%8 = load %struct.pqos_cap*, %struct.pqos_cap** %5
%9 = load i32, i32* %3
%10 = call i32 @resctrl_alloc_task_search(i32* %7, %struct.pqos_cap* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.pqos_cap = type { i32 }
define i32 @resctrl_alloc_assoc_get_pid(i32 %0, i32* %1) {
%3 = alloca %struct.pqos_cap*
%4 = bitcast %struct.pqos_cap** %3 to i8*
%5 = call i32 @_pqos_cap_get(%struct.pqos_cap** %3, i32* null)
%6 = load %struct.pqos_cap*, %struct.pqos_cap** %3
%7 = call i32 @resctrl_alloc_task_search(i32* %1, %struct.pqos_cap* %6, i32 %0)
ret i32 %7
}
unsigned uDivTest4(unsigned X, unsigned Y) { return (X == Y ? 0 : Y); }


x86 assembly (clang, -O0):
<uDivTest4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1120 <uDivTest4+0x20>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1126 <uDivTest4+0x26>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDivTest4>:
xor    %eax,%eax
cmp    %esi,%edi
cmovne %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @uDivTest4(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = select i1 %3, i32 0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memset(unsigned char *, int, int);
void vmwClearScreenY(int starty, int color, unsigned char *buffer) {
  memset(buffer + (starty * 640), color,
         640 * (480 - starty) * sizeof(unsigned char));
}


x86 assembly (clang, -O0):
<vmwClearScreenY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
imul   $0x280,-0x4(%rbp),%eax
cltq
add    %rax,%rdi
mov    -0x8(%rbp),%esi
mov    $0x1e0,%eax
sub    -0x4(%rbp),%eax
imul   $0x280,%eax,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edx
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmwClearScreenY>:
mov    $0x1e0,%eax
sub    %edi,%eax
mov    %edi,%ecx
shl    $0x7,%ecx
lea    (%rcx,%rcx,4),%ecx
movslq %ecx,%rdi
add    %rdx,%rdi
shl    $0x7,%eax
lea    (%rax,%rax,4),%edx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @vmwClearScreenY(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i32, i32* %4
%9 = mul nsw i32 %8, 640
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %7, i64 %10
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = sub nsw i32 480, %13
%15 = mul nsw i32 640, %14
%16 = sext i32 %15 to i64
%17 = mul i64 %16, 1
%18 = trunc i64 %17 to i32
%19 = call i32 @memset(i8* %11, i32 %12, i32 %18)
ret void
}

LLVM IR (-O2):
define void @vmwClearScreenY(i32 %0, i32 %1, i8* %2) {
%4 = mul nsw i32 %0, 640
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %2, i64 %5
%7 = sub nsw i32 480, %0
%8 = mul nsw i32 %7, 640
%9 = tail call i32 @memset(i8* %6, i32 %1, i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TextPrintMsg(char *);
void ShowDivider(void) {
  TextPrintMsg(
      "\n------------------------------------------------------------\n\n");
}


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

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

LLVM IR (-O0):
@.str = [64 x i8] c"\0A------------------------------------------------------------\0A\0A\00"
define void @ShowDivider() {
%1 = call i32 @TextPrintMsg(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [64 x i8] c"\0A------------------------------------------------------------\0A\0A\00"
define void @ShowDivider() {
%1 = tail call i32 @TextPrintMsg(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int a;
  a = 2;
  printf("%d %d", a << 1, a >> 2);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 1
%5 = load i32, i32* %2
%6 = ashr i32 %5, 2
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 4, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gfn(int *, int *);
void foo(int *x, int *y) { gfn(x, y); }


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

x86 assembly (clang, -O2):
<foo>:
jmp    1030 <gfn@plt>

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

LLVM IR (-O2):
define void @foo(i32* %0, i32* %1) {
%3 = tail call i32 @gfn(i32* %0, i32* %1)
ret void
}
I0R1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if (22 <= r1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<I0R1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movswl -0x8(%rbp),%ecx
mov    $0x16,%eax
cmp    %ecx,%eax
jg     113c <I0R1+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1143 <I0R1+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I0R1>:
xor    %eax,%eax
cmp    $0x16,%si
setge  %al
ret

LLVM IR (-O0):
define i32 @I0R1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16, i16* %9
%17 = sext i16 %16 to i32
%18 = icmp sle i32 22, %17
br i1 %18, label %19, label %20
19: ; preds = %6
store i32 1, i32* %7
br label %21
20: ; preds = %6
store i32 0, i32* %7
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @I0R1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture readnone %5) {
%7 = trunc i32 %1 to i16
%8 = icmp sgt i16 %7, 21
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRD8_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRD8_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRD8_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int timerfd_create(int /*<<< orphan*/, int /*<<< orphan*/);
int itimer_create(void) { return timerfd_create(CLOCK_MONOTONIC, 0); }


x86 assembly (clang, -O0):
<itimer_create>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <timerfd_create@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<itimer_create>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
jmp    1030 <timerfd_create@plt>

LLVM IR (-O0):
@CLOCK_MONOTONIC = global i32 0
define i32 @itimer_create() {
%1 = load i32, i32* @CLOCK_MONOTONIC
%2 = call i32 @timerfd_create(i32 %1, i32 0)
ret i32 %2
}

LLVM IR (-O2):
@CLOCK_MONOTONIC = global i32 0
define i32 @itimer_create() {
%1 = load i32, i32* @CLOCK_MONOTONIC
%2 = tail call i32 @timerfd_create(i32 %1, i32 0)
ret i32 %2
}
void DMTimerResetConfigure(unsigned int baseAdd, unsigned int rstOption) {
  (*((volatile unsigned int *)(baseAdd + (0x54)))) &= ~(0x00000002u);
  (*((volatile unsigned int *)(baseAdd + (0x54)))) |=
      (rstOption & (0x00000002u));
}


x86 assembly (clang, -O0):
<DMTimerResetConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x54,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xfffffffd,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
and    $0x2,%edx
mov    -0x4(%rbp),%eax
add    $0x54,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<DMTimerResetConfigure>:
add    $0x54,%edi
andl   $0xfffffffd,(%rdi)
and    $0x2,%esi
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @DMTimerResetConfigure(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = add i32 %5, 84
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -3
store volatile i32 %10, i32* %8
%11 = load i32, i32* %4
%12 = and i32 %11, 2
%13 = load i32, i32* %3
%14 = add i32 %13, 84
%15 = zext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
%17 = load volatile i32, i32* %16
%18 = or i32 %17, %12
store volatile i32 %18, i32* %16
ret void
}

LLVM IR (-O2):
define void @DMTimerResetConfigure(i32 %0, i32 %1) {
%3 = add i32 %0, 84
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -3
store volatile i32 %7, i32* %5
%8 = and i32 %1, 2
%9 = load volatile i32, i32* %5
%10 = or i32 %9, %8
store volatile i32 %10, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void malloc_error(void) {
  fputs("safeu: unable to allocate memory\n", stderr);
  exit(1);
}


x86 assembly (clang, -O0):
<malloc_error>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<malloc_error>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"safeu: unable to allocate memory\0A\00"
@stderr = global i32 0
define void @malloc_error() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [34 x i8] c"safeu: unable to allocate memory\0A\00"
@stderr = global i32 0
define void @malloc_error() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void Usage(char *prog_name) {
  fprintf(stderr, "usage: %s <thread_count> <m> <n>\n", prog_name);
  exit(0);
}


x86 assembly (clang, -O0):
<Usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"usage: %s <thread_count> <m> <n>\0A\00"
define void @Usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"usage: %s <thread_count> <m> <n>\0A\00"
define void @Usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
void *calloc(int, size_t);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t);
int /*<<< orphan*/ stderr;
void *pgp_new(size_t size) {
  void *vp;
  if ((vp = calloc(1, size)) == NULL) {
    (void)fprintf(stderr,
                  "allocation failure for %"
                  "z"
                  "u bytes",
                  size);
  }
  return vp;
}


x86 assembly (clang, -O0):
<pgp_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1161 <pgp_new+0x41>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xea4(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pgp_new>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x1,%edi
mov    %r14,%rsi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1154 <pgp_new+0x34>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
lea    0xeb4(%rip),%rsi
mov    %r14,%rdx
call   1040 <fprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"allocation failure for %zu bytes\00"
define i8* @pgp_new(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @calloc(i32 1, i64 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = load i64, i64* %2
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 %9)
br label %11
11: ; preds = %7, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"allocation failure for %zu bytes\00"
define i8* @pgp_new(i64 %0) {
%2 = tail call i8* @calloc(i32 1, i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %7
7: ; preds = %4, %1
ret i8* %2
}
p1(c, f1, s, d1, i, f2, l, d2) char c;
float f1;
short s;
double d1;
int i;
float f2;
long l;
double d2;
{ printf("%c %f %d %f %d %f %d %f\n", c, f1, s, d1, i, f2, l, d2); }


x86 assembly (clang, -O0):
<p1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm2,-0x38(%rbp)
mov    %esi,%eax
movaps %xmm0,%xmm2
movsd  -0x38(%rbp),%xmm0
mov    %dil,%sil
cvtsd2ss %xmm2,%xmm2
cvtsd2ss %xmm0,%xmm0
mov    %sil,-0x5(%rbp)
movss  %xmm2,-0xc(%rbp)
mov    %ax,-0xe(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movss  %xmm0,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movsd  %xmm3,-0x30(%rbp)
movsbl -0x5(%rbp),%esi
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movswl -0xe(%rbp),%edx
movsd  -0x18(%rbp),%xmm1
mov    -0x1c(%rbp),%ecx
movss  -0x20(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
mov    -0x28(%rbp),%r8
movsd  -0x30(%rbp),%xmm3
lea    0xe79(%rip),%rdi
mov    $0x4,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p1>:
mov    %rcx,%r8
mov    %edx,%ecx
cvtsd2ss %xmm0,%xmm0
cvtsd2ss %xmm2,%xmm2
movsbl %dil,%eax
cvtss2sd %xmm0,%xmm0
movswl %si,%edx
cvtss2sd %xmm2,%xmm2
lea    0xecd(%rip),%rdi
mov    %eax,%esi
mov    $0x4,%al
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"%c %f %d %f %d %f %d %f\0A\00"
define i32 @p1(i32 %0, double %1, i32 %2, double %3, i32 %4, double %5, i64 %6, double %7) {
%9 = alloca i32
%10 = alloca i8
%11 = alloca float
%12 = alloca i16
%13 = alloca double
%14 = alloca i32
%15 = alloca float
%16 = alloca i64
%17 = alloca double
%18 = trunc i32 %0 to i8
%19 = fptrunc double %1 to float
%20 = trunc i32 %2 to i16
%21 = fptrunc double %5 to float
store i8 %18, i8* %10
store float %19, float* %11
store i16 %20, i16* %12
store double %3, double* %13
store i32 %4, i32* %14
store float %21, float* %15
store i64 %6, i64* %16
store double %7, double* %17
%22 = load i8, i8* %10
%23 = sext i8 %22 to i32
%24 = load float, float* %11
%25 = fpext float %24 to double
%26 = load i16, i16* %12
%27 = sext i16 %26 to i32
%28 = load double, double* %13
%29 = load i32, i32* %14
%30 = load float, float* %15
%31 = fpext float %30 to double
%32 = load i64, i64* %16
%33 = load double, double* %17
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %23, double %25, i32 %27, double %28, i32 %29, double %31, i64 %32, double %33)
%35 = load i32, i32* %9
ret i32 %35
}

LLVM IR (-O2):
@.str = [25 x i8] c"%c %f %d %f %d %f %d %f\0A\00"
define i32 @p1(i32 %0, double %1, i32 %2, double %3, i32 %4, double %5, i64 %6, double %7) {
%9 = fptrunc double %1 to float
%10 = fptrunc double %5 to float
%11 = shl i32 %0, 24
%12 = ashr exact i32 %11, 24
%13 = fpext float %9 to double
%14 = shl i32 %2, 16
%15 = ashr exact i32 %14, 16
%16 = fpext float %10 to double
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %12, double %13, i32 %15, double %3, i32 %4, double %16, i64 %6, double %7)
ret i32 undef
}
void g_cache_key_foreach() {}


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

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

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

LLVM IR (-O2):
define void @g_cache_key_foreach() {
ret void
}
int buf_put2c(char *buf, const char *src) {
  buf[0] = src[0];
  buf[1] = src[1];
  buf[2] = '\0';
  return 2;
}


x86 assembly (clang, -O0):
<buf_put2c>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x2(%rax)
mov    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_put2c>:
mov    (%rsi),%al
mov    %al,(%rdi)
mov    0x1(%rsi),%al
mov    %al,0x1(%rdi)
movb   $0x0,0x2(%rdi)
mov    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @buf_put2c(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i8*, i8** %4
%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 1
store i8 %12, i8* %14
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 2
store i8 0, i8* %16
ret i32 2
}

LLVM IR (-O2):
define i32 @buf_put2c(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
store i8 %3, i8* %0
%4 = getelementptr inbounds i8, i8* %1, i64 1
%5 = load i8, i8* %4
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = getelementptr inbounds i8, i8* %0, i64 2
store i8 0, i8* %7
ret i32 2
}
/* Variables and functions */
int atoi(char *);
int decVal(int);
int /*<<< orphan*/ printf(char *, int, int);
void decHex(char dec[4]) {
  int num;
  int temp1, temp2;
  num = atoi(dec);
  temp1 = decVal(num % 16);
  num /= 16;
  temp2 = decVal(num % 16);
  printf("%c%c", temp2, temp1);
}


x86 assembly (clang, -O0):
<decHex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1030 <decVal@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1030 <decVal@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe73(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decHex>:
push   %rbp
push   %rbx
push   %rax
call   1050 <atoi@plt>
lea    0xf(%rax),%ebx
test   %eax,%eax
cmovns %eax,%ebx
mov    %ebx,%ecx
and    $0xfffffff0,%ecx
sub    %ecx,%eax
mov    %eax,%edi
call   1030 <decVal@plt>
mov    %eax,%ebp
sar    $0x4,%ebx
lea    0xf(%rbx),%eax
test   %ebx,%ebx
cmovns %ebx,%eax
and    $0xfffffff0,%eax
sub    %eax,%ebx
mov    %ebx,%edi
call   1030 <decVal@plt>
lea    0xe92(%rip),%rdi
mov    %eax,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%c%c\00"
define void @decHex(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @atoi(i8* %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = srem i32 %8, 16
%10 = call i32 @decVal(i32 %9)
store i32 %10, i32* %4
%11 = load i32, i32* %3
%12 = sdiv i32 %11, 16
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = srem i32 %13, 16
%15 = call i32 @decVal(i32 %14)
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = load i32, i32* %4
%18 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %17)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%c%c\00"
define void @decHex(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
%3 = srem i32 %2, 16
%4 = tail call i32 @decVal(i32 %3)
%5 = sdiv i32 %2, 16
%6 = srem i32 %5, 16
%7 = tail call i32 @decVal(i32 %6)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %4)
ret void
}
/* Variables and functions */
int current_month();
int month_left() { return 12 - current_month(); }


x86 assembly (clang, -O0):
<month_left>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <current_month@plt>
mov    %eax,%ecx
mov    $0xc,%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<month_left>:
push   %rax
xor    %eax,%eax
call   1030 <current_month@plt>
mov    $0xc,%ecx
sub    %eax,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @month_left() {
%1 = call i32 (...) @current_month()
%2 = sub nsw i32 12, %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @month_left() {
%1 = tail call i32 (...) @current_month()
%2 = sub nsw i32 12, %1
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int send_msg_to_aggregator(int *, int, char *);
int aggregator_register(int proc_id, char *server_ip) {
  uint8_t msg[1];
  msg[0] = proc_id;
  return send_msg_to_aggregator(msg, 1, server_ip);
}


x86 assembly (clang, -O0):
<aggregator_register>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x1,%esi
call   1030 <send_msg_to_aggregator@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aggregator_register>:
push   %rax
mov    %rsi,%rdx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
call   1030 <send_msg_to_aggregator@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @aggregator_register(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [1 x i32]
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
store i32 %6, i32* %7
%8 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%9 = load i8*, i8** %4
%10 = call i32 @send_msg_to_aggregator(i32* %8, i32 1, i8* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @aggregator_register(i32 %0, i8* %1) {
%3 = alloca [1 x i32]
%4 = bitcast [1 x i32]* %3 to i8*
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
store i32 %0, i32* %5
%6 = call i32 @send_msg_to_aggregator(i32* %5, i32 1, i8* %1)
ret i32 %6
}
/* Variables and functions */
int PAPI_read_counters(long long *, int);
void papif_read_counters_(long long *values, int *array_len, int *check) {
  *check = PAPI_read_counters(values, *array_len);
}


x86 assembly (clang, -O0):
<papif_read_counters_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1030 <PAPI_read_counters@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_read_counters_>:
push   %rbx
mov    %rdx,%rbx
mov    (%rsi),%esi
call   1030 <PAPI_read_counters@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_read_counters_(i64* %0, i32* %1, i32* %2) {
%4 = alloca i64*
%5 = alloca i32*
%6 = alloca i32*
store i64* %0, i64** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i64*, i64** %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
%10 = call i32 @PAPI_read_counters(i64* %7, i32 %9)
%11 = load i32*, i32** %6
store i32 %10, i32* %11
ret void
}

LLVM IR (-O2):
define void @papif_read_counters_(i64* %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %1
%5 = tail call i32 @PAPI_read_counters(i64* %0, i32 %4)
store i32 %5, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ execlp(char *, char *, char *, char *, char *,
                          int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  execlp("ls", "ls", "-l", "-a", "-h", NULL);
  printf("failed\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    0xec3(%rip),%rsi
lea    0xebf(%rip),%rdx
lea    0xebb(%rip),%rcx
lea    0xeb7(%rip),%r8
xor    %eax,%eax
mov    %eax,%r9d
mov    %rsi,%rdi
call   1040 <execlp@plt>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed4(%rip),%rdx
lea    0xed0(%rip),%rcx
lea    0xecc(%rip),%r8
mov    %rdi,%rsi
xor    %r9d,%r9d
call   1040 <execlp@plt>
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"ls\00"
@.str.1 = [3 x i8] c"-l\00"
@.str.2 = [3 x i8] c"-a\00"
@.str.3 = [3 x i8] c"-h\00"
@.str.4 = [8 x i8] c"failed\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 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* null)
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"ls\00"
@.str.1 = [3 x i8] c"-l\00"
@.str.2 = [3 x i8] c"-a\00"
@.str.3 = [3 x i8] c"-h\00"
@str = [7 x i8] c"failed\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* null)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int little_endian(char ch) {
  if (ch == 0x78)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<little_endian>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x78,%eax
jne    1123 <little_endian+0x23>
movl   $0x1,-0x4(%rbp)
jmp    112a <little_endian+0x2a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<little_endian>:
xor    %eax,%eax
cmp    $0x78,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @little_endian(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 120
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @little_endian(i8 signext %0) {
%2 = icmp eq i8 %0, 120
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fftss_cleanup_threads();
void fftss_cleanup_threads__(void) { fftss_cleanup_threads(); }


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

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

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

LLVM IR (-O2):
define void @fftss_cleanup_threads__() {
%1 = tail call i32 (...) @fftss_cleanup_threads()
ret void
}
/* Type definitions */
typedef scalar_t__ volatile uint16_t;

/* Variables and functions */
uint16_t volatile_fetch_sub_u16(volatile uint16_t *dest, uint16_t val) {
  uint16_t result = *dest;
  *dest = result - val;
  return result;
}


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

x86 assembly (clang, -O2):
<volatile_fetch_sub_u16>:
mov    %rsi,-0x8(%rsp)
mov    (%rdi),%rax
mov    %rax,-0x10(%rsp)
mov    -0x10(%rsp),%rax
sub    -0x8(%rsp),%rax
mov    %rax,(%rdi)
mov    -0x10(%rsp),%rax
ret

LLVM IR (-O0):
define i64 @volatile_fetch_sub_u16(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
store i64* %0, i64** %3
store volatile i64 %1, i64* %4
%6 = load i64*, i64** %3
%7 = load volatile i64, i64* %6
store volatile i64 %7, i64* %5
%8 = load volatile i64, i64* %5
%9 = load volatile i64, i64* %4
%10 = sub nsw i64 %8, %9
%11 = load i64*, i64** %3
store volatile i64 %10, i64* %11
%12 = load volatile i64, i64* %5
ret i64 %12
}

LLVM IR (-O2):
define i64 @volatile_fetch_sub_u16(i64* %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %1, i64* %3
%5 = bitcast i64* %4 to i8*
%6 = load volatile i64, i64* %0
store volatile i64 %6, i64* %4
%7 = load volatile i64, i64* %4
%8 = load volatile i64, i64* %3
%9 = sub nsw i64 %7, %8
store volatile i64 %9, i64* %0
%10 = load volatile i64, i64* %4
ret i64 %10
}