xunge/DecIR huggingface dataset:
unsigned char make8color(unsigned char r, unsigned char g, unsigned char b) {
  return ((((r >> 5) & 7) << 5) | (((g >> 5) & 7) << 2) | ((b >> 6) & 3));
}


x86 assembly (clang, -O0):
<make8color>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x5,%eax
and    $0x7,%eax
shl    $0x5,%eax
movzbl -0x2(%rbp),%ecx
sar    $0x5,%ecx
and    $0x7,%ecx
shl    $0x2,%ecx
or     %ecx,%eax
movzbl -0x3(%rbp),%ecx
sar    $0x6,%ecx
and    $0x3,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<make8color>:
and    $0xe0,%dil
shr    $0x3,%sil
and    $0x1c,%sil
lea    (%rsi,%rdi,1),%eax
shr    $0x6,%dl
or     %dl,%al
ret

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

LLVM IR (-O2):
define zeroext i8 @make8color(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = and i8 %0, -32
%5 = lshr i8 %1, 3
%6 = and i8 %5, 28
%7 = or i8 %6, %4
%8 = lshr i8 %2, 6
%9 = or i8 %7, %8
ret i8 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ rev_str(char *);
int main(int argc, char **argv) {
  while (*++argv) {
    rev_str(*argv);
    printf("%s\n", *argv);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
cmpq   $0x0,0x8(%rax)
je     1174 <main+0x54>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <rev_str@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x8(%rsi),%rdi
test   %rdi,%rdi
je     115d <main+0x3d>
mov    %rsi,%rbx
add    $0x10,%rbx
lea    0xec5(%rip),%r14
nopl   0x0(%rax,%rax,1)
call   1040 <rev_str@plt>
mov    -0x8(%rbx),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\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
br label %6
6: ; preds = %11, %2
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i32 1
store i8** %8, i8*** %5
%9 = load i8*, i8** %8
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %18
11: ; preds = %6
%12 = load i8**, i8*** %5
%13 = load i8*, i8** %12
%14 = call i32 @rev_str(i8* %13)
%15 = load i8**, i8*** %5
%16 = load i8*, i8** %15
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %16)
br label %6
18: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %15, label %6
6: ; preds = %2, %6
%7 = phi i8* [ %13, %6 ], [ %4, %2 ]
%8 = phi i8** [ %12, %6 ], [ %3, %2 ]
%9 = tail call i32 @rev_str(i8* %7)
%10 = load i8*, i8** %8
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds i8*, i8** %8, i64 1
%13 = load i8*, i8** %12
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %6
15: ; preds = %6, %2
ret i32 0
}
int energymon_is_exclusive_rapl(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @energymon_is_exclusive_rapl() {
ret i32 0
}

LLVM IR (-O2):
define i32 @energymon_is_exclusive_rapl() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ adjust_indent(int);
int /*<<< orphan*/ output(char *);
void block_begin(void) {
  output("{");
  adjust_indent(+3);
}


x86 assembly (clang, -O0):
<block_begin>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <output@plt>
mov    $0x3,%edi
call   1040 <adjust_indent@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<block_begin>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <output@plt>
mov    $0x3,%edi
pop    %rax
jmp    1040 <adjust_indent@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"{\00"
define void @block_begin() {
%1 = call i32 @output(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @adjust_indent(i32 3)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"{\00"
define void @block_begin() {
%1 = tail call i32 @output(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @adjust_indent(i32 3)
ret void
}
void signed_char_and_unsigned_char(signed char *LHS, unsigned char RHS) {
  (*LHS) &= RHS;
}


x86 assembly (clang, -O0):
<signed_char_and_unsigned_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%edx
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
and    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<signed_char_and_unsigned_char>:
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @signed_char_and_unsigned_char(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = and i32 %9, %6
%11 = trunc i32 %10 to i8
store i8 %11, i8* %7
ret void
}

LLVM IR (-O2):
define void @signed_char_and_unsigned_char(i8* nocapture %0, i8 zeroext %1) {
%3 = load i8, i8* %0
%4 = and i8 %3, %1
store i8 %4, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ g();
int main(void) {
  g();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @g()
ret i32 0
}
/* Variables and functions */
unsigned int generarNumeroRandom(int);
unsigned int generarNumeroRandomConMin(int min, int max) {
  return generarNumeroRandom(max) + min;
}


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

x86 assembly (clang, -O2):
<generarNumeroRandomConMin>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <generarNumeroRandom@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @generarNumeroRandomConMin(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 = call i32 @generarNumeroRandom(i32 %5)
%7 = load i32, i32* %3
%8 = add i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @generarNumeroRandomConMin(i32 %0, i32 %1) {
%3 = tail call i32 @generarNumeroRandom(i32 %1)
%4 = add i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(int rc) {
  printf("usage: gettyd <device> [<device>...]\n");
  exit(rc);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"usage: gettyd <device> [<device>...]\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@str = [37 x i8] c"usage: gettyd <device> [<device>...]\00"
define void @usage(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 %0)
unreachable
}
int test_imm_5Cuint32_reg(unsigned int val) {
  return ((val) & (0x5C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Cuint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x5c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_5Cuint32_reg(i32 %0) {
%2 = and i32 %0, 92
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void output_close() {}


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

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

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

LLVM IR (-O2):
define void @output_close() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void printVoid(void *a) { fputs("Void", stdout); }


x86 assembly (clang, -O0):
<printVoid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
lea    0xed4(%rip),%rdi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printVoid>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"Void\00"
@stdout = global i32 0
define void @printVoid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"Void\00"
@stdout = global i32 0
define void @printVoid(i8* nocapture readnone %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
int main(int argc, char *argv[]) {
  char data = 43;
  printf("%d\n", printf("%d", printf("%d", data)));
  printf("name:%s\n", "test");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x2b,-0x11(%rbp)
movsbl -0x11(%rbp),%esi
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    %eax,%esi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    %eax,%esi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea4(%rip),%rdi
lea    0xea6(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeec(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2b,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebd(%rip),%rdi
lea    0xebf(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [9 x i8] c"name:%s\0A\00"
@.str.3 = [5 x i8] c"test\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8 43, i8* %6
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [9 x i8] c"name:%s\0A\00"
@.str.3 = [5 x i8] c"test\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 43)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int thread_wait(int /*<<< orphan*/, void *);
int pthread_join(pthread_t thread, void **value_ptr) {
  void *result;
  int err;
  err = thread_wait(thread, result);
  if (NULL != value_ptr)
    *value_ptr = (void *)result;
  return 0;
}


x86 assembly (clang, -O0):
<pthread_join>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1030 <thread_wait@plt>
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
je     1145 <pthread_join+0x35>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_join>:
push   %rax
call   1030 <thread_wait@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @pthread_join(i32 %0, i8** readnone %1) {
%3 = tail call i32 @thread_wait(i32 %0, i8* undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SPUclose();
int /*<<< orphan*/ upse_ps1_bios_shutdown();
int /*<<< orphan*/ upse_ps1_memory_shutdown();
int /*<<< orphan*/ upse_r3000_cpu_shutdown();
void psxShutdown() {
  upse_ps1_memory_shutdown();
  upse_ps1_bios_shutdown();
  upse_r3000_cpu_shutdown();
  SPUclose();
}


x86 assembly (clang, -O0):
<psxShutdown>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <upse_ps1_memory_shutdown@plt>
mov    $0x0,%al
call   1050 <upse_ps1_bios_shutdown@plt>
mov    $0x0,%al
call   1040 <upse_r3000_cpu_shutdown@plt>
mov    $0x0,%al
call   1030 <SPUclose@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<psxShutdown>:
push   %rax
xor    %eax,%eax
call   1060 <upse_ps1_memory_shutdown@plt>
xor    %eax,%eax
call   1050 <upse_ps1_bios_shutdown@plt>
xor    %eax,%eax
call   1040 <upse_r3000_cpu_shutdown@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <SPUclose@plt>

LLVM IR (-O0):
define void @psxShutdown() {
%1 = call i32 (...) @upse_ps1_memory_shutdown()
%2 = call i32 (...) @upse_ps1_bios_shutdown()
%3 = call i32 (...) @upse_r3000_cpu_shutdown()
%4 = call i32 (...) @SPUclose()
ret void
}

LLVM IR (-O2):
define void @psxShutdown() {
%1 = tail call i32 (...) @upse_ps1_memory_shutdown()
%2 = tail call i32 (...) @upse_ps1_bios_shutdown()
%3 = tail call i32 (...) @upse_r3000_cpu_shutdown()
%4 = tail call i32 (...) @SPUclose()
ret void
}
/* Variables and functions */
int close(int const);
int serial_close(const int fd) { return close(fd); }


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

x86 assembly (clang, -O2):
<serial_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @serial_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
void main(void) {
  char c1[30];
  int n;
  scanf("%s%n", c1, &n);
  printf("%*s", 2 * n, c1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x20(%rbp),%rsi
lea    0xecd(%rip),%rdi
lea    -0x24(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x24(%rbp),%esi
shl    $0x1,%esi
lea    -0x20(%rbp),%rdx
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"%s%n\00"
@.str.1 = [4 x i8] c"%*s\00"
define void @main() {
%1 = alloca [30 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3, i32* %2)
%5 = load i32, i32* %2
%6 = mul nsw i32 2, %5
%7 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6, i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%n\00"
@.str.1 = [4 x i8] c"%*s\00"
define void @main() {
%1 = alloca [30 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3, i32* %2)
%6 = load i32, i32* %2
%7 = shl nsw i32 %6, 1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void my_closedir(void *dir) {
  ;
  free(dir);
}


x86 assembly (clang, -O0):
<my_closedir>:
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):
<my_closedir>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @my_closedir(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int ap_do_command_only(int, int);
int ap_shuffle_playlist(int session) {
  return (ap_do_command_only(session, 0xcc28));
}


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

x86 assembly (clang, -O2):
<ap_shuffle_playlist>:
mov    $0xcc28,%esi
jmp    1030 <ap_do_command_only@plt>

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

LLVM IR (-O2):
define i32 @ap_shuffle_playlist(i32 %0) {
%2 = tail call i32 @ap_do_command_only(i32 %0, i32 52264)
ret i32 %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ time;
};
typedef TYPE_1__ XKeyEvent;

/* Variables and functions */
unsigned long get_XKeyEvent_time(void *_p) {
  return (unsigned long)((XKeyEvent *)_p)->time;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XKeyEvent_time(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XKeyEvent_time(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
void baz_int(int *x) { *x = __imag foo_int(5); }


x86 assembly (clang, -O0):
<baz_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x5,%edi
mov    $0x0,%al
call   1030 <foo_int@plt>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz_int>:
push   %rbx
mov    %rdi,%rbx
mov    $0x5,%edi
xor    %eax,%eax
call   1030 <foo_int@plt>
movl   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @baz_int(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 (i32, ...) bitcast (i32 (...)* @foo_int to i32 (i32, ...)*)(i32 5)
%4 = load i32*, i32** %2
store i32 0, i32* %4
ret void
}

LLVM IR (-O2):
define void @baz_int(i32* nocapture writeonly %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @foo_int to i32 (i32, ...)*)(i32 5)
store i32 0, i32* %0
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
char *getUsername(void) {
  char *username = malloc(sizeof(char) * 100);
  printf("Username: ");
  scanf("%s", username);
  return username;
}


x86 assembly (clang, -O0):
<getUsername>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getUsername>:
push   %rbx
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
lea    0xeba(%rip),%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Username: \00"
@.str.1 = [3 x i8] c"%s\00"
define i8* @getUsername() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 100)
store i8* %2, i8** %1
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %1
ret i8* %6
}

LLVM IR (-O2):
@.str = [11 x i8] c"Username: \00"
@.str.1 = [3 x i8] c"%s\00"
define i8* @getUsername() {
%1 = tail call dereferenceable_or_null(100) i8* @malloc(i32 100)
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void a_func_call() { printf("Hello\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"Hello\00"
define void @a_func_call() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
int do_call(unsigned type) {
  int v = 0;
  __asm__("movl %1,%%eax;						"
          "	 int $0x64;						"
          "			 movl %%eax,%0;		"
          : "=r"(v)
          : "r"(type)
          : "%eax");
  return v;
}


x86 assembly (clang, -O0):
<do_call>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
mov    %ecx,%eax
int    $0x64
mov    %eax,%ecx
mov    %ecx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_call>:
mov    %edi,%eax
int    $0x64
mov    %eax,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @do_call(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = call i32 asm "movl $1,%eax;\09\09\09\09\09\09\09 int $$0x64;\09\09\09\09\09\09\09\09\09 movl %eax,$0;\09\09", "=r,r,~{eax},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @do_call(i32 %0) {
%2 = tail call i32 asm "movl $1,%eax;\09\09\09\09\09\09\09 int $$0x64;\09\09\09\09\09\09\09\09\09 movl %eax,$0;\09\09", "=r,r,~{eax},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t mp2vpic_get_temporalreference(const uint8_t *p_mp2vpic) {
  return (p_mp2vpic[4] << 2) | (p_mp2vpic[5] >> 6);
}


x86 assembly (clang, -O0):
<mp2vpic_get_temporalreference>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%eax
shl    $0x2,%eax
mov    -0x8(%rbp),%rcx
mov    0x14(%rcx),%ecx
sar    $0x6,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vpic_get_temporalreference>:
mov    0x10(%rdi),%ecx
mov    0x14(%rdi),%eax
shl    $0x2,%ecx
sar    $0x6,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @mp2vpic_get_temporalreference(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 4
%5 = load i32, i32* %4
%6 = shl i32 %5, 2
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 5
%9 = load i32, i32* %8
%10 = ashr i32 %9, 6
%11 = or i32 %6, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @mp2vpic_get_temporalreference(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = load i32, i32* %2
%4 = shl i32 %3, 2
%5 = getelementptr inbounds i32, i32* %0, i64 5
%6 = load i32, i32* %5
%7 = ashr i32 %6, 6
%8 = or i32 %7, %4
ret i32 %8
}
double BatteryRawToVoltage(double rAct) {
  return (rAct * (4.8267 - 2.7096) + 2.7096);
}


x86 assembly (clang, -O0):
<BatteryRawToVoltage>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee6(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<BatteryRawToVoltage>:
mulsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @BatteryRawToVoltage(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fmuladd.f64(double %3, double 0x4000EFD21FF2E48E, double 2.709600e+00)
ret double %4
}

LLVM IR (-O2):
define double @BatteryRawToVoltage(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 0x4000EFD21FF2E48E, double 2.709600e+00)
ret double %2
}
void ioinit_soundcard(void) {}


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

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

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

LLVM IR (-O2):
define void @ioinit_soundcard() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dtree_error_clear();
int /*<<< orphan*/ dtree_procfs_close();
int dtree_procfs_open(char const *);
int dtree_open(const char *rootd) {
  int err = dtree_procfs_open(rootd);
  if (err == 0) {
    dtree_error_clear();
    return 0;
  }
  dtree_procfs_close();
  return err;
}


x86 assembly (clang, -O0):
<dtree_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <dtree_procfs_open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1165 <dtree_open+0x35>
mov    $0x0,%al
call   1050 <dtree_error_clear@plt>
movl   $0x0,-0x4(%rbp)
jmp    1172 <dtree_open+0x42>
mov    $0x0,%al
call   1040 <dtree_procfs_close@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtree_open>:
push   %rbx
call   1030 <dtree_procfs_open@plt>
mov    %eax,%ebx
test   %eax,%eax
je     1145 <dtree_open+0x15>
xor    %eax,%eax
call   1040 <dtree_procfs_close@plt>
jmp    114c <dtree_open+0x1c>
xor    %eax,%eax
call   1050 <dtree_error_clear@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @dtree_open(i8* %0) {
%2 = tail call i32 @dtree_procfs_open(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @dtree_error_clear()
br label %8
6: ; preds = %1
%7 = tail call i32 (...) @dtree_procfs_close()
br label %8
8: ; preds = %6, %4
ret i32 %2
}
/* Variables and functions */
int U_PMR_NODATAREC_print(char const *);
int U_PMR_RESETCLIP_print(const char *contents) {
  return (U_PMR_NODATAREC_print(contents));
}


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

x86 assembly (clang, -O2):
<U_PMR_RESETCLIP_print>:
jmp    1030 <U_PMR_NODATAREC_print@plt>

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

LLVM IR (-O2):
define i32 @U_PMR_RESETCLIP_print(i8* %0) {
%2 = tail call i32 @U_PMR_NODATAREC_print(i8* %0)
ret i32 %2
}
void ADC_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @ADC_IRQHandler() {
ret void
}
int TTWAIN_UnloadSourceManagerPD(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @TTWAIN_UnloadSourceManagerPD() {
ret i32 1
}
/* Type definitions */
struct svc_req {
  int dummy;
};

/* Variables and functions */
int l2tp_peer_profile_list_1_svc(void *, struct svc_req *);
int _l2tp_peer_profile_list_1(void *argp, void *result, struct svc_req *rqstp) {
  return (l2tp_peer_profile_list_1_svc(result, rqstp));
}


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

x86 assembly (clang, -O2):
<_l2tp_peer_profile_list_1>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <l2tp_peer_profile_list_1_svc@plt>

LLVM IR (-O0):
%struct.svc_req = type { i32 }
define i32 @_l2tp_peer_profile_list_1(i8* %0, i8* %1, %struct.svc_req* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.svc_req*
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct.svc_req* %2, %struct.svc_req** %6
%7 = load i8*, i8** %5
%8 = load %struct.svc_req*, %struct.svc_req** %6
%9 = call i32 @l2tp_peer_profile_list_1_svc(i8* %7, %struct.svc_req* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.svc_req = type { i32 }
define i32 @_l2tp_peer_profile_list_1(i8* nocapture readnone %0, i8* %1, %struct.svc_req* %2) {
%4 = tail call i32 @l2tp_peer_profile_list_1_svc(i8* %1, %struct.svc_req* %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_min_epi16(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i test_mm_min_epi16(__m128i A, __m128i B) { return _mm_min_epi16(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_min_epi16>:
jmp    1030 <_mm_min_epi16@plt>

LLVM IR (-O0):
define i32 @test_mm_min_epi16(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 @_mm_min_epi16(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_min_epi16(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_min_epi16(i32 %0, i32 %1)
ret i32 %3
}
int nc_inq_base_pe(int ncid, int *pe) {
  *pe = 0;
  return 0;
}


x86 assembly (clang, -O0):
<nc_inq_base_pe>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nc_inq_base_pe>:
movl   $0x0,(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @nc_inq_base_pe(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
store i32 0, i32* %5
ret i32 0
}

LLVM IR (-O2):
define i32 @nc_inq_base_pe(i32 %0, i32* nocapture writeonly %1) {
store i32 0, i32* %1
ret i32 0
}
int test_imm_D0uint16_mem(unsigned short *val) {
  return ((*val) & (-0xD0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D0uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffff30,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D0uint16_mem>:
movzwl (%rdi),%eax
test   $0xff30,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_D0uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -208
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void mtarch_pstart(void) {}


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

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

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

LLVM IR (-O2):
define void @mtarch_pstart() {
ret void
}
double dFunDD(double a, double b) {
  a++;
  b++;
  return a + b;
}


x86 assembly (clang, -O0):
<dFunDD>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xeea(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xed8(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dFunDD>:
movsd  0xef8(%rip),%xmm2
addsd  %xmm2,%xmm0
addsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @dFunDD(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fadd double %5, 1.000000e+00
store double %6, double* %3
%7 = load double, double* %4
%8 = fadd double %7, 1.000000e+00
store double %8, double* %4
%9 = load double, double* %3
%10 = load double, double* %4
%11 = fadd double %9, %10
ret double %11
}

LLVM IR (-O2):
define double @dFunDD(double %0, double %1) {
%3 = fadd double %0, 1.000000e+00
%4 = fadd double %1, 1.000000e+00
%5 = fadd double %3, %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ body(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ postamble(int /*<<< orphan*/);
int /*<<< orphan*/ preamble(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  preamble(stdout);
  body(stdin, stdout);
  postamble(stdout);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
call   1050 <preamble@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
mov    0x2e64(%rip),%rax
mov    (%rax),%esi
call   1030 <body@plt>
mov    0x2e56(%rip),%rax
mov    (%rax),%edi
call   1040 <postamble@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2e90(%rip),%rbx
mov    (%rbx),%edi
call   1050 <preamble@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
call   1030 <body@plt>
mov    (%rbx),%edi
call   1040 <postamble@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@stdin = global i32 0
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 = load i32, i32* @stdout
%7 = call i32 @preamble(i32 %6)
%8 = load i32, i32* @stdin
%9 = load i32, i32* @stdout
%10 = call i32 @body(i32 %8, i32 %9)
%11 = load i32, i32* @stdout
%12 = call i32 @postamble(i32 %11)
%13 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@stdin = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @preamble(i32 %3)
%5 = load i32, i32* @stdin
%6 = load i32, i32* @stdout
%7 = tail call i32 @body(i32 %5, i32 %6)
%8 = load i32, i32* @stdout
%9 = tail call i32 @postamble(i32 %8)
%10 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
struct TreeNode *build_tree(int *, int /*<<< orphan*/, int);
struct TreeNode *sortedArrayToBST(int *nums, int numsSize) {
  if (!numsSize)
    return (NULL);
  return (build_tree(nums, 0, numsSize - 1));
}


x86 assembly (clang, -O0):
<sortedArrayToBST>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1136 <sortedArrayToBST+0x26>
movq   $0x0,-0x8(%rbp)
jmp    114b <sortedArrayToBST+0x3b>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <build_tree@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sortedArrayToBST>:
test   %esi,%esi
je     1120 <sortedArrayToBST+0x10>
mov    %esi,%edx
add    $0xffffffff,%edx
xor    %esi,%esi
jmp    1030 <build_tree@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
define %struct.TreeNode* @sortedArrayToBST(i32* %0, i32 %1) {
%3 = alloca %struct.TreeNode*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %2
store %struct.TreeNode* null, %struct.TreeNode** %3
br label %14
9: ; preds = %2
%10 = load i32*, i32** %4
%11 = load i32, i32* %5
%12 = sub nsw i32 %11, 1
%13 = call %struct.TreeNode* @build_tree(i32* %10, i32 0, i32 %12)
store %struct.TreeNode* %13, %struct.TreeNode** %3
br label %14
14: ; preds = %9, %8
%15 = load %struct.TreeNode*, %struct.TreeNode** %3
ret %struct.TreeNode* %15
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define %struct.TreeNode* @sortedArrayToBST(i32* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = add nsw i32 %1, -1
%6 = tail call %struct.TreeNode* @build_tree(i32* %0, i32 0, i32 %5)
br label %7
7: ; preds = %2, %4
%8 = phi %struct.TreeNode* [ %6, %4 ], [ null, %2 ]
ret %struct.TreeNode* %8
}
double cotdg(x)
double x;
{ return (tancot(x, 1)); }


x86 assembly (clang, -O0):
<cotdg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%edi
mov    $0x1,%al
call   1030 <tancot@plt>
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cotdg>:
push   %rax
mov    $0x1,%edi
mov    $0x1,%al
call   1030 <tancot@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @cotdg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 (double, i32, ...) bitcast (i32 (...)* @tancot to i32 (double, i32, ...)*)(double %3, i32 1)
%5 = sitofp i32 %4 to double
ret double %5
}

LLVM IR (-O2):
define double @cotdg(double %0) {
%2 = tail call i32 (double, i32, ...) bitcast (i32 (...)* @tancot to i32 (double, i32, ...)*)(double %0, i32 1)
%3 = sitofp i32 %2 to double
ret double %3
}
double mcdrag_rpm(double twist, double velocity) {
  return (velocity / (twist / 60.0) * 12.0);
}


x86 assembly (clang, -O0):
<mcdrag_rpm>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xee8(%rip),%xmm2
divsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  0xed0(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcdrag_rpm>:
divsd  0xef8(%rip),%xmm0
divsd  %xmm0,%xmm1
mulsd  0xef4(%rip),%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @mcdrag_rpm(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = fdiv double %6, 6.000000e+01
%8 = fdiv double %5, %7
%9 = fmul double %8, 1.200000e+01
ret double %9
}

LLVM IR (-O2):
define double @mcdrag_rpm(double %0, double %1) {
%3 = fdiv double %0, 6.000000e+01
%4 = fdiv double %1, %3
%5 = fmul double %4, 1.200000e+01
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ atc_tasks_create();
int /*<<< orphan*/ fdc_tasks_create();
int /*<<< orphan*/ hdc_tasks_create();
int /*<<< orphan*/ stc_tasks_create();
void os_task_create() {
  hdc_tasks_create();
  atc_tasks_create();
  stc_tasks_create();
  fdc_tasks_create();
}


x86 assembly (clang, -O0):
<os_task_create>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <hdc_tasks_create@plt>
mov    $0x0,%al
call   1050 <atc_tasks_create@plt>
mov    $0x0,%al
call   1060 <stc_tasks_create@plt>
mov    $0x0,%al
call   1030 <fdc_tasks_create@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_task_create>:
push   %rax
xor    %eax,%eax
call   1040 <hdc_tasks_create@plt>
xor    %eax,%eax
call   1050 <atc_tasks_create@plt>
xor    %eax,%eax
call   1060 <stc_tasks_create@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <fdc_tasks_create@plt>

LLVM IR (-O0):
define void @os_task_create() {
%1 = call i32 (...) @hdc_tasks_create()
%2 = call i32 (...) @atc_tasks_create()
%3 = call i32 (...) @stc_tasks_create()
%4 = call i32 (...) @fdc_tasks_create()
ret void
}

LLVM IR (-O2):
define void @os_task_create() {
%1 = tail call i32 (...) @hdc_tasks_create()
%2 = tail call i32 (...) @atc_tasks_create()
%3 = tail call i32 (...) @stc_tasks_create()
%4 = tail call i32 (...) @fdc_tasks_create()
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int compare_string(const void *data, const void *other_data) {
  return strcmp((char *)data, (char *)other_data);
}


x86 assembly (clang, -O0):
<compare_string>:
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 <strcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_string>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @compare_string(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void error(const char *msg) { printf("error: %s\n", msg); }


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

x86 assembly (clang, -O2):
<error>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"error: %s\0A\00"
define void @error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
extern unsigned long readb(unsigned long addr) {
  long result =
      *(volatile int *)((addr << 5) + ((0xfffffc0000000000UL) + 0x200000000UL) +
                        0x00);
  result >>= (addr & 3) * 8;
  return 0xffUL & result;
}


x86 assembly (clang, -O0):
<readb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x5,%rax
movabs $0xfffffc0200000000,%rcx
fc ff ff
add    %rcx,%rax
mov    (%rax),%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
and    $0x3,%rcx
shl    $0x3,%rcx
mov    -0x10(%rbp),%rax
sar    %cl,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<readb>:
lea    0x0(,%rdi,8),%ecx
shl    $0x5,%rdi
movabs $0xfffffc0200000000,%rax
fc ff ff
movslq (%rdi,%rax,1),%rax
and    $0x18,%cl
sar    %cl,%rax
movzbl %al,%eax
ret

LLVM IR (-O0):
define i64 @readb(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = shl i64 %4, 5
%6 = add i64 %5, -4389456576512
%7 = add i64 %6, 0
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = sext i32 %9 to i64
store i64 %10, i64* %3
%11 = load i64, i64* %2
%12 = and i64 %11, 3
%13 = mul i64 %12, 8
%14 = load i64, i64* %3
%15 = ashr i64 %14, %13
store i64 %15, i64* %3
%16 = load i64, i64* %3
%17 = and i64 255, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @readb(i64 %0) {
%2 = shl i64 %0, 5
%3 = add i64 %2, -4389456576512
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = sext i32 %5 to i64
%7 = shl i64 %0, 3
%8 = and i64 %7, 24
%9 = ashr i64 %6, %8
%10 = and i64 %9, 255
ret i64 %10
}