xunge/DecIR huggingface dataset:
int gcd(int a, int b) {
  if (a == 0)
    return b;
  if (b == 0)
    return a;
  return gcd(b, a % b);
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1133 <gcd+0x23>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115c <gcd+0x4c>
cmpl   $0x0,-0xc(%rbp)
jne    1148 <gcd+0x38>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115c <gcd+0x4c>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <gcd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %esi,%edx
test   %edi,%edi
je     111e <gcd+0x1e>
mov    %edi,%eax
test   %edx,%edx
je     1120 <gcd+0x20>
nopl   0x0(%rax)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = icmp eq i32 %1, 0
br i1 %5, label %11, label %6
6: ; preds = %4, %6
%7 = phi i32 [ %8, %6 ], [ %0, %4 ]
%8 = phi i32 [ %9, %6 ], [ %1, %4 ]
%9 = srem i32 %7, %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6, %4, %2
%12 = phi i32 [ %1, %2 ], [ %0, %4 ], [ %8, %6 ]
ret i32 %12
}
int test_imm_49int16_reg(short val) {
  return ((val) & (-0x49 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_49int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffffb7,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_49int16_reg(i16 signext %0) {
%2 = and i16 %0, -73
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void ar5312_arch_init(void) {}


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

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

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

LLVM IR (-O2):
define void @ar5312_arch_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_vect();
int main1();
int main(void) {
  check_vect();
  return main1();
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @check_vect()
%2 = tail call i32 (...) @main1()
ret i32 %2
}
char *fdig(cp)
register char *cp;
{
  register char *c;
  for (c = cp; *c; c++)
    if (*c >= '0' && *c <= '9')
      break;
  return c;
}


x86 assembly (clang, -O0):
<fdig>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1158 <fdig+0x58>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jl     1142 <fdig+0x42>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jg     1142 <fdig+0x42>
jmp    1158 <fdig+0x58>
jmp    1147 <fdig+0x47>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <fdig+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdig>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
je     1124 <fdig+0x24>
add    $0xd0,%cl
cmp    $0x9,%cl
ja     1110 <fdig+0x10>
ret

LLVM IR (-O0):
define i8* @fdig(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %21, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %24
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 48
br i1 %13, label %14, label %20
14: ; preds = %9
%15 = load i8*, i8** %3
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 57
br i1 %18, label %19, label %20
19: ; preds = %14
br label %24
20: ; preds = %14, %9
br label %21
21: ; preds = %20
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %3
br label %5
24: ; preds = %19, %5
%25 = load i8*, i8** %3
ret i8* %25
}

LLVM IR (-O2):
define i8* @fdig(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %9, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = add i8 %4, -48
%7 = icmp ult i8 %6, 10
%8 = or i1 %5, %7
%9 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %8, label %10, label %2
10: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ die();
void *realloc(void *, size_t);
void *xrealloc(void *ptr, size_t size) {
  void *res = realloc(ptr, size);
  if (res == NULL) {
    die();
  }
  return res;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <xrealloc+0x33>
mov    $0x0,%al
call   1040 <die@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <xrealloc+0x15>
xor    %eax,%eax
call   1040 <die@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @die()
br label %7
7: ; preds = %5, %2
ret i8* %3
}
unsigned char readchar_string(unsigned char *the_string) {
  static unsigned char *strp = (unsigned char *)"";
  if (the_string)
    strp = the_string;
  return ((*strp) ? *strp++ : 0);
}


x86 assembly (clang, -O0):
<readchar_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     111e <readchar_string+0x1e>
mov    -0x8(%rbp),%rax
mov    %rax,0x2f02(%rip)
mov    0x2efb(%rip),%rax
movzbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <readchar_string+0x51>
mov    0x2ee8(%rip),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,0x2eda(%rip)
movzbl (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    115b <readchar_string+0x5b>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    115b <readchar_string+0x5b>
mov    -0xc(%rbp),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<readchar_string>:
test   %rdi,%rdi
je     110e <readchar_string+0xe>
mov    %rdi,0x2f14(%rip)
jmp    1115 <readchar_string+0x15>
mov    0x2f0b(%rip),%rdi
mov    (%rdi),%al
test   %al,%al
je     1126 <readchar_string+0x26>
add    $0x1,%rdi
mov    %rdi,0x2efa(%rip)
ret

LLVM IR (-O0):
@readchar_string.strp = internal global i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i32 0, i32 0)
@.str = [1 x i8] zeroinitializer
define zeroext i8 @readchar_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i8*, i8** %2
store i8* %6, i8** @readchar_string.strp
br label %7
7: ; preds = %5, %1
%8 = load i8*, i8** @readchar_string.strp
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %7
%13 = load i8*, i8** @readchar_string.strp
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** @readchar_string.strp
%15 = load i8, i8* %13
%16 = zext i8 %15 to i32
br label %18
17: ; preds = %7
br label %18
18: ; preds = %17, %12
%19 = phi i32 [ %16, %12 ], [ 0, %17 ]
%20 = trunc i32 %19 to i8
ret i8 %20
}

LLVM IR (-O2):
@readchar_string.strp = internal unnamed_addr global i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
@.str = [1 x i8] zeroinitializer
define zeroext i8 @readchar_string(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = load i8*, i8** @readchar_string.strp
br label %6
5: ; preds = %1
store i8* %0, i8** @readchar_string.strp
br label %6
6: ; preds = %3, %5
%7 = phi i8* [ %4, %3 ], [ %0, %5 ]
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %6
%11 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %11, i8** @readchar_string.strp
br label %12
12: ; preds = %6, %10
ret i8 %8
}
int ti_ema_start(double const *options) {
  (void)options;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @ti_ema_start(double* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int raytype(char *);
int iscameraray() { return raytype("camera"); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"camera\00"
define i32 @iscameraray() {
%1 = tail call i32 @raytype(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
double EDlog(double x) { return (1. / x); }


x86 assembly (clang, -O0):
<EDlog>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @EDlog(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double 1.000000e+00, %3
ret double %4
}

LLVM IR (-O2):
define double @EDlog(double %0) {
%2 = fdiv double 1.000000e+00, %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, float);
void print_xmm(float in, char *s) { printf("%s: %f\n", s, in); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"%s: %f\0A\00"
define void @print_xmm(float %0, i8* %1) {
%3 = alloca float
%4 = alloca i8*
store float %0, float* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load float, float* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %5, float %6)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %f\0A\00"
define void @print_xmm(float %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %1, float %0)
ret void
}
char getChar(int in) {
  if (in == 0) {
    return ' ';
  } else if (in == 1) {
    return 'X';
  } else {
    return 'O';
  }
}


x86 assembly (clang, -O0):
<getChar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111a <getChar+0x1a>
movb   $0x20,-0x1(%rbp)
jmp    1131 <getChar+0x31>
cmpl   $0x1,-0x8(%rbp)
jne    112d <getChar+0x2d>
movb   $0x58,-0x1(%rbp)
jmp    1131 <getChar+0x31>
movb   $0x4f,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getChar>:
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
lea    (%rax,%rax,8),%ecx
add    $0x4f,%ecx
test   %edi,%edi
mov    $0x20,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @getChar(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8 32, i8* %2
br label %12
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %7
store i8 88, i8* %2
br label %12
11: ; preds = %7
store i8 79, i8* %2
br label %12
12: ; preds = %11, %10, %6
%13 = load i8, i8* %2
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @getChar(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8 88, i8 79
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8 32, i8 %3
ret i8 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int, int, int);
int /*<<< orphan*/ stderr;
void cpu_registers_local(uint32_t eax, uint32_t ebx, uint32_t ecx,
                         uint32_t edx) {
  (void)fprintf(stderr, "cpu_registers:             %.8x %.8x %.8x %.8x\n", eax,
                ebx, ecx, edx);
}


x86 assembly (clang, -O0):
<cpu_registers_local>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r8d
mov    -0x10(%rbp),%r9d
lea    0xebe(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_registers_local>:
mov    %ecx,%r9d
mov    %edx,%r8d
mov    %esi,%ecx
mov    %edi,%edx
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
lea    0xed6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"cpu_registers: %.8x %.8x %.8x %.8x\0A\00"
define void @cpu_registers_local(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* @stderr
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11, i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"cpu_registers: %.8x %.8x %.8x %.8x\0A\00"
define void @cpu_registers_local(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GPUshowScreenPic(unsigned char *);
void ZN_GPUshowScreenPic(unsigned char *pMem) { GPUshowScreenPic(pMem); }


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

x86 assembly (clang, -O2):
<ZN_GPUshowScreenPic>:
jmp    1030 <GPUshowScreenPic@plt>

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

LLVM IR (-O2):
define void @ZN_GPUshowScreenPic(i8* %0) {
%2 = tail call i32 @GPUshowScreenPic(i8* %0)
ret void
}
add2(a, b) { return a + b; }


x86 assembly (clang, -O0):
<add2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add2>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @add2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @add2(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
unsigned char i2c_read(int);
int /*<<< orphan*/ i2c_restart();
int /*<<< orphan*/ i2c_start();
int /*<<< orphan*/ i2c_stop();
int /*<<< orphan*/ i2c_write(int);
unsigned char ds1337_read_register(unsigned char reg) {
  unsigned char data;
  i2c_start();
  i2c_write(0b11010000);
  i2c_write(reg);
  i2c_restart();
  i2c_write(0b11010000 | 1);
  data = i2c_read(1);
  i2c_stop();
  return data;
}


x86 assembly (clang, -O0):
<ds1337_read_register>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1070 <i2c_start@plt>
mov    $0xd0,%edi
call   1050 <i2c_write@plt>
movzbl -0x1(%rbp),%edi
call   1050 <i2c_write@plt>
mov    $0x0,%al
call   1040 <i2c_restart@plt>
mov    $0xd1,%edi
call   1050 <i2c_write@plt>
mov    $0x1,%edi
call   1030 <i2c_read@plt>
mov    %al,-0x2(%rbp)
mov    $0x0,%al
call   1060 <i2c_stop@plt>
movzbl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ds1337_read_register>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1070 <i2c_start@plt>
mov    $0xd0,%edi
call   1050 <i2c_write@plt>
mov    %ebx,%edi
call   1050 <i2c_write@plt>
xor    %eax,%eax
call   1040 <i2c_restart@plt>
mov    $0xd1,%edi
call   1050 <i2c_write@plt>
mov    $0x1,%edi
call   1030 <i2c_read@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <i2c_stop@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @ds1337_read_register(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = call i32 (...) @i2c_start()
%5 = call i32 @i2c_write(i32 208)
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = call i32 @i2c_write(i32 %7)
%9 = call i32 (...) @i2c_restart()
%10 = call i32 @i2c_write(i32 209)
%11 = call zeroext i8 @i2c_read(i32 1)
store i8 %11, i8* %3
%12 = call i32 (...) @i2c_stop()
%13 = load i8, i8* %3
ret i8 %13
}

LLVM IR (-O2):
define zeroext i8 @ds1337_read_register(i8 zeroext %0) {
%2 = tail call i32 (...) @i2c_start()
%3 = tail call i32 @i2c_write(i32 208)
%4 = zext i8 %0 to i32
%5 = tail call i32 @i2c_write(i32 %4)
%6 = tail call i32 (...) @i2c_restart()
%7 = tail call i32 @i2c_write(i32 209)
%8 = tail call zeroext i8 @i2c_read(i32 1)
%9 = tail call i32 (...) @i2c_stop()
ret i8 %8
}
void ADC_DelSig_1_IRQ_Interrupt(void) {}


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

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

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

LLVM IR (-O2):
define void @ADC_DelSig_1_IRQ_Interrupt() {
ret void
}
/* Variables and functions */
unsigned long native_save_fl();
unsigned long __raw_local_save_flags(void) { return native_save_fl(); }


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

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

LLVM IR (-O0):
define i64 @__raw_local_save_flags() {
%1 = call i64 (...) @native_save_fl()
ret i64 %1
}

LLVM IR (-O2):
define i64 @__raw_local_save_flags() {
%1 = tail call i64 (...) @native_save_fl()
ret i64 %1
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void scrypt_be32enc(void *pp, uint32_t x) {
  uint8_t *p = (uint8_t *)pp;
  p[3] = x & 0xff;
  p[2] = (x >> 8) & 0xff;
  p[1] = (x >> 16) & 0xff;
  p[0] = (x >> 24) & 0xff;
}


x86 assembly (clang, -O0):
<scrypt_be32enc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<scrypt_be32enc>:
mov    %esi,%eax
movzbl %al,%ecx
mov    %ecx,0xc(%rdi)
movzbl %ah,%ecx
mov    %ecx,0x8(%rdi)
mov    %esi,%ecx
shr    $0x10,%ecx
movzbl %cl,%ecx
mov    %ecx,0x4(%rdi)
shr    $0x18,%eax
mov    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @scrypt_be32enc(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = and i32 %1, 255
%5 = getelementptr inbounds i8, i8* %0, i64 12
%6 = bitcast i8* %5 to i32*
store i32 %4, i32* %6
%7 = lshr i32 %1, 8
%8 = and i32 %7, 255
%9 = getelementptr inbounds i8, i8* %0, i64 8
%10 = bitcast i8* %9 to i32*
store i32 %8, i32* %10
%11 = lshr i32 %1, 16
%12 = and i32 %11, 255
%13 = getelementptr inbounds i8, i8* %0, i64 4
%14 = bitcast i8* %13 to i32*
store i32 %12, i32* %14
%15 = lshr i32 %1, 24
store i32 %15, i32* %3
ret void
}
/* Type definitions */
struct net_device {
  int dummy;
};

/* Variables and functions */
int EINVAL;
int ltalk_mac_addr(struct net_device *dev, void *addr) { return -EINVAL; }


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

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

LLVM IR (-O0):
%struct.net_device = type { i32 }
@EINVAL = global i32 0
define i32 @ltalk_mac_addr(%struct.net_device* %0, i8* %1) {
%3 = alloca %struct.net_device*
%4 = alloca i8*
store %struct.net_device* %0, %struct.net_device** %3
store i8* %1, i8** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
%struct.net_device = type { i32 }
@EINVAL = global i32 0
define i32 @ltalk_mac_addr(%struct.net_device* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *umalloc(size_t l) {
  void *p = malloc(l);
  if (!p)
    abort();
  memset(p, 0, l);
  return p;
}


x86 assembly (clang, -O0):
<umalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115b <umalloc+0x2b>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<umalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <malloc@plt>
test   %rax,%rax
je     115c <umalloc+0x2c>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1040 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i8* @umalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
%7 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int a, b;
  a = atoi(argv[1]);
  b = atoi(argv[2]);
  printf("%d\n", a + b);
  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)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
add    -0x18(%rbp),%esi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   1040 <atoi@plt>
add    %eax,%ebp
lea    0xebd(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 2
%7 = load i8*, i8** %6
%8 = tail call i32 @atoi(i8* %7)
%9 = add nsw i32 %8, %5
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}
void swap16(void *d) { return; }


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

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

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

LLVM IR (-O2):
define void @swap16(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ namcoSetN163(int /*<<< orphan*/);
int /*<<< orphan*/ namco_getParams58XX(int /*<<< orphan*/);
uint8_t namco_getParams58XX_SetN163(uint16_t addr) {
  namcoSetN163(addr);
  return namco_getParams58XX(addr);
}


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

x86 assembly (clang, -O2):
<namco_getParams58XX_SetN163>:
push   %rbx
mov    %edi,%ebx
call   1030 <namcoSetN163@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <namco_getParams58XX@plt>

LLVM IR (-O0):
define i32 @namco_getParams58XX_SetN163(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @namcoSetN163(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @namco_getParams58XX(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @namco_getParams58XX_SetN163(i32 %0) {
%2 = tail call i32 @namcoSetN163(i32 %0)
%3 = tail call i32 @namco_getParams58XX(i32 %0)
ret i32 %3
}
void glStencilFuncSeparate(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glStencilFuncSeparate() {
ret void
}
void XtUngrabButton() {}


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

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

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

LLVM IR (-O2):
define void @XtUngrabButton() {
ret void
}
/* Type definitions */
struct sockaddr_in {
  int /*<<< orphan*/ sin_addr;
};

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int inet_pton(int /*<<< orphan*/, char *, int /*<<< orphan*/ *);
int isValidIpAddress(char *ipaddr) {
  struct sockaddr_in sa;
  int result = inet_pton(AF_INET, ipaddr, &(sa.sin_addr));
  return result != 0;
}


x86 assembly (clang, -O0):
<isValidIpAddress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <inet_pton@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isValidIpAddress>:
push   %rax
mov    %rdi,%rsi
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rdx
call   1030 <inet_pton@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
@AF_INET = global i32 0
define i32 @isValidIpAddress(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.sockaddr_in
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i32, i32* @AF_INET
%6 = load i8*, i8** %2
%7 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 0
%8 = call i32 @inet_pton(i32 %5, i8* %6, i32* %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
@AF_INET = global i32 0
define i32 @isValidIpAddress(i8* %0) {
%2 = alloca %struct.sockaddr_in
%3 = bitcast %struct.sockaddr_in* %2 to i8*
%4 = load i32, i32* @AF_INET
%5 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 0
%6 = call i32 @inet_pton(i32 %4, i8* %0, i32* %5)
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
unsigned int __get_cpsr();
int /*<<< orphan*/ __set_cpsr(unsigned int);
unsigned INT_disable(void) {
  unsigned _cpsr_val;
  _cpsr_val = __get_cpsr();
  __set_cpsr(_cpsr_val | (0x00000080 | 0x00000040));
  return _cpsr_val;
}


x86 assembly (clang, -O0):
<INT_disable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <__get_cpsr@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
or     $0xc0,%edi
call   1030 <__set_cpsr@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<INT_disable>:
push   %rbx
xor    %eax,%eax
call   1040 <__get_cpsr@plt>
mov    %eax,%ebx
mov    %eax,%edi
or     $0xc0,%edi
call   1030 <__set_cpsr@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @INT_disable() {
%1 = alloca i32
%2 = call i32 (...) @__get_cpsr()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = or i32 %3, 192
%5 = call i32 @__set_cpsr(i32 %4)
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @INT_disable() {
%1 = tail call i32 (...) @__get_cpsr()
%2 = or i32 %1, 192
%3 = tail call i32 @__set_cpsr(i32 %2)
ret i32 %1
}
/* Variables and functions */
bool is_position_in_region(int pos, int beg, int end) {
  if (beg <= end)
    return pos >= beg && pos <= end;
  return pos >= end && pos <= beg;
}


x86 assembly (clang, -O0):
<is_position_in_region>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1146 <is_position_in_region+0x46>
mov    -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x11(%rbp)
jl     1136 <is_position_in_region+0x36>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
setle  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    116e <is_position_in_region+0x6e>
mov    -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    -0x10(%rbp),%ecx
mov    %al,-0x12(%rbp)
jl     1163 <is_position_in_region+0x63>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setle  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_position_in_region>:
xor    %r8d,%r8d
xor    %ecx,%ecx
cmp    %esi,%edi
setle  %r8b
setge  %cl
xor    %r9d,%r9d
xor    %eax,%eax
cmp    %edx,%edi
setge  %r9b
setle  %al
cmp    %edx,%esi
cmovg  %r9d,%eax
cmovg  %r8d,%ecx
and    %eax,%ecx
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @is_position_in_region(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, %2
%5 = icmp sge i32 %0, %2
%6 = icmp sle i32 %0, %1
%7 = icmp sge i32 %0, %1
%8 = icmp sle i32 %0, %2
%9 = select i1 %4, i1 %5, i1 %8
%10 = select i1 %4, i1 %6, i1 %7
%11 = and i1 %10, %9
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long long msec_from_tv(struct timeval *);
long long currtime_ms(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return msec_from_tv(&tv);
}


x86 assembly (clang, -O0):
<currtime_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
lea    -0x8(%rbp),%rdi
call   1030 <msec_from_tv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<currtime_ms>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
mov    %rbx,%rdi
call   1030 <msec_from_tv@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i64 @currtime_ms() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = call i64 @msec_from_tv(%struct.timeval* %1)
ret i64 %3
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i64 @currtime_ms() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = call i64 @msec_from_tv(%struct.timeval* %1)
ret i64 %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void mp2vseq_set_framerate(uint8_t *p_mp2vseq, uint8_t i_framerate) {
  p_mp2vseq[7] &= 0xf0;
  p_mp2vseq[7] |= i_framerate & 0xf;
}


x86 assembly (clang, -O0):
<mp2vseq_set_framerate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%ecx
and    $0xf0,%ecx
mov    %ecx,0x1c(%rax)
mov    -0xc(%rbp),%ecx
and    $0xf,%ecx
mov    -0x8(%rbp),%rax
or     0x1c(%rax),%ecx
mov    %ecx,0x1c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vseq_set_framerate>:
mov    $0xf0,%eax
and    0x1c(%rdi),%eax
and    $0xf,%esi
or     %eax,%esi
mov    %esi,0x1c(%rdi)
ret

LLVM IR (-O0):
define void @mp2vseq_set_framerate(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 = getelementptr inbounds i32, i32* %5, i64 7
%7 = load i32, i32* %6
%8 = and i32 %7, 240
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = and i32 %9, 15
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 7
%13 = load i32, i32* %12
%14 = or i32 %13, %10
store i32 %14, i32* %12
ret void
}

LLVM IR (-O2):
define void @mp2vseq_set_framerate(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 7
%4 = load i32, i32* %3
%5 = and i32 %4, 240
%6 = and i32 %1, 15
%7 = or i32 %5, %6
store i32 %7, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ limpamlc();
int /*<<< orphan*/ mostrapenter(char);
int /*<<< orphan*/ mostraplinha(char);
int /*<<< orphan*/ sprintf(char, char *);
void frasedois(char plinha, char penter) {
  limpamlc();
  sprintf(plinha, "2: Suco c/acucar");
  mostraplinha(plinha);
  mostrapenter(penter);
}


x86 assembly (clang, -O0):
<frasedois>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    $0x0,%al
call   1030 <limpamlc@plt>
lea    0xe9e(%rip),%rsi
movsbl -0x1(%rbp),%edi
call   1040 <sprintf@plt>
movsbl -0x1(%rbp),%edi
call   1050 <mostraplinha@plt>
movsbl -0x2(%rbp),%edi
call   1060 <mostrapenter@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frasedois>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <limpamlc@plt>
lea    0xeab(%rip),%rsi
mov    %ebp,%edi
call   1040 <sprintf@plt>
mov    %ebp,%edi
call   1050 <mostraplinha@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <mostrapenter@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"2: Suco c/acucar\00"
define void @frasedois(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = call i32 (...) @limpamlc()
%6 = load i8, i8* %3
%7 = call i32 @sprintf(i8 signext %6, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%8 = load i8, i8* %3
%9 = call i32 @mostraplinha(i8 signext %8)
%10 = load i8, i8* %4
%11 = call i32 @mostrapenter(i8 signext %10)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"2: Suco c/acucar\00"
define void @frasedois(i8 signext %0, i8 signext %1) {
%3 = tail call i32 (...) @limpamlc()
%4 = tail call i32 @sprintf(i8 signext %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @mostraplinha(i8 signext %0)
%6 = tail call i32 @mostrapenter(i8 signext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ testN();
int main(void) {
  testN();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @testN()
ret i32 0
}
/* Variables and functions */
int cm206_init();
int /*<<< orphan*/ parse_options();
int __cm206_init(void) {
  int tmp;
  {
    parse_options();
    tmp = cm206_init();
    return (tmp);
  }
}


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

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

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

LLVM IR (-O2):
define i32 @__cm206_init() {
%1 = tail call i32 (...) @parse_options()
%2 = tail call i32 (...) @cm206_init()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ __softboundmpx_abort();
int /*<<< orphan*/ printf(char *);
__attribute__((__weak__, __always___)) char *softboundmpx_gets(char *s) {
  printf("[SBCETS] gets used and should not be used\n");
  __softboundmpx_abort();
  return NULL;
}


x86 assembly (clang, -O0):
<softboundmpx_gets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <__softboundmpx_abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [43 x i8] c"[SBCETS] gets used and should not be used\0A\00"
define weak i8* @softboundmpx_gets(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @__softboundmpx_abort()
ret i8* null
}

LLVM IR (-O2):
@str = [42 x i8] c"[SBCETS] gets used and should not be used\00"
define weak i8* @softboundmpx_gets(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @__softboundmpx_abort()
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ T3D_OutputMessage(char *);
void T3D_PrintHeader(void) {
  T3D_OutputMessage("Syntax : btime23d <offset> <input filenames> <output "
                    "path/filename> [options]\n"
                    "\nValid options are :\n\n");
}


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

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

LLVM IR (-O0):
@.str = [101 x i8] c"Syntax : btime23d <offset> <input filenames> <output path/filename> [options]\0A\0AValid options are :\0A\0A\00"
define void @T3D_PrintHeader() {
%1 = call i32 @T3D_OutputMessage(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [101 x i8] c"Syntax : btime23d <offset> <input filenames> <output path/filename> [options]\0A\0AValid options are :\0A\0A\00"
define void @T3D_PrintHeader() {
%1 = tail call i32 @T3D_OutputMessage(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str, i64 0, i64 0))
ret void
}
int dx_list_finder_default(void *p1, void *p2) { return p1 - p2; }


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

x86 assembly (clang, -O2):
<dx_list_finder_default>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @dx_list_finder_default(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 = ptrtoint i8* %5 to i64
%8 = ptrtoint i8* %6 to i64
%9 = sub i64 %7, %8
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @dx_list_finder_default(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
ret i32 %6
}
int pci_proc_detach_device(struct pci_dev *dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define i32 @pci_proc_detach_device(%struct.pci_dev* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ lseek(int, int /*<<< orphan*/, int);
int64_t lisp_lseek(int fd, int64_t offset, int whence) {
  return lseek(fd, offset, whence);
}


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

x86 assembly (clang, -O2):
<lisp_lseek>:
jmp    1030 <lseek@plt>

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

LLVM IR (-O2):
define i32 @lisp_lseek(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @lseek(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
void i2d_POLICYINFO(void) {}


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

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

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

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