xunge/DecIR huggingface dataset:
/* Variables and functions */
double rand();
int Pl_M_Random_Integer(int n) {
  return (int)((double)n * rand() / ((((unsigned)-1) >> 1) + 1.0));
}


x86 assembly (clang, -O0):
<Pl_M_Random_Integer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xec0(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pl_M_Random_Integer>:
push   %rax
cvtsi2sd %edi,%xmm0
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mulsd  (%rsp),%xmm0
mulsd  0xed2(%rip),%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Pl_M_Random_Integer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = call double (...) @rand()
%6 = fmul double %4, %5
%7 = fdiv double %6, 0x41E0000000000000
%8 = fptosi double %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @Pl_M_Random_Integer(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = tail call double (...) @rand()
%4 = fmul double %3, %2
%5 = fmul double %4, 0x3E00000000000000
%6 = fptosi double %5 to i32
ret i32 %6
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int64_t min(int64_t a, int64_t b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <min+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <min+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @min(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t cpu_to_le64(uint64_t v) { return (v); }


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

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

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

LLVM IR (-O2):
define i32 @cpu_to_le64(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int putc(int, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int putchar(int c) { return putc(c, stdout); }


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <putc@plt>

LLVM IR (-O0):
@stdout = global i32 0
define i32 @putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @stdout
%5 = call i32 @putc(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @putchar(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @putc(i32 %0, i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fscanf(int /*<<< orphan*/ *, char *, unsigned int *, unsigned int *);
void ReadProtocol(FILE *fp, unsigned int *protocol) {
  int ret;
  ret = fscanf(fp, "%x/%x\n", &protocol[0], &protocol[1]);
  if (ret != 2)
    return;
}


x86 assembly (clang, -O0):
<ReadProtocol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x10(%rbp),%rcx
add    $0x4,%rcx
lea    0xec9(%rip),%rsi
call   1030 <fscanf@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
je     114e <ReadProtocol+0x3e>
jmp    114e <ReadProtocol+0x3e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadProtocol>:
mov    %rsi,%rdx
lea    0x4(%rsi),%rcx
lea    0xee2(%rip),%rsi
jmp    1030 <fscanf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%x/%x\0A\00"
define void @ReadProtocol(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = call i32 @fscanf(i32* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %8, i32* %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = icmp ne i32 %12, 2
br i1 %13, label %14, label %15
14: ; preds = %2
br label %15
15: ; preds = %14, %2
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%x/%x\0A\00"
define void @ReadProtocol(i32* nocapture %0, i32* %1) {
%3 = getelementptr inbounds i32, i32* %1, i64 1
%4 = tail call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %3)
ret void
}
int fun1330() { return 1330; }


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

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

LLVM IR (-O0):
define i32 @fun1330() {
ret i32 1330
}

LLVM IR (-O2):
define i32 @fun1330() {
ret i32 1330
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void print_indent(FILE *fp, int depth) {
  int i;
  for (i = 0; i < depth; i++) {
    fprintf(fp, "%s", "  ");
  }
}


x86 assembly (clang, -O0):
<print_indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <print_indent+0x47>
mov    -0x8(%rbp),%rdi
lea    0xec3(%rip),%rsi
lea    0xebf(%rip),%rdx
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_indent+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_indent>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    114a <print_indent+0x3a>
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xedb(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r15,%rdi
mov    %r14,%rcx
call   1030 <fwrite@plt>
add    $0xffffffff,%ebx
jne    1130 <print_indent+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c" \00"
define void @print_indent(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64 2, i64 1, i32* %0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
int random(int);
int skrand(int range) {
  int temp;
  temp = random(range) + random(range);
  if (temp > range - 1)
    temp = 2 * range - 1 - temp;
  return (temp);
}


x86 assembly (clang, -O0):
<skrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <random@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <random@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jle    1158 <skrand+0x48>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skrand>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <random@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <random@plt>
add    %ebp,%eax
cmp    %ebx,%eax
mov    %eax,%ecx
not    %ecx
lea    (%rcx,%rbx,2),%ecx
cmovge %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @skrand(i32 %0) {
%2 = tail call i32 @random(i32 %0)
%3 = tail call i32 @random(i32 %0)
%4 = add nsw i32 %3, %2
%5 = icmp slt i32 %4, %0
%6 = shl nsw i32 %0, 1
%7 = xor i32 %4, -1
%8 = add i32 %6, %7
%9 = select i1 %5, i32 %4, i32 %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void do_software_interrupt(void) { puts("BAD\n"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"BAD\0A\00"
define void @do_software_interrupt() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, int);
void print_error(const char *type, int size) {
  printf("#error weird '%s' size (%d)\n", type, size);
}


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

x86 assembly (clang, -O2):
<print_error>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"#error weird '%s' size (%d)\0A\00"
define void @print_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"#error weird '%s' size (%d)\0A\00"
define void @print_error(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ myPow(double, int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(void) {
  printf("%lf\n", myPow(8.88023, 3));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
mov    $0x3,%edi
call   1040 <myPow@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
mov    $0x3,%edi
call   1040 <myPow@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @myPow(double 8.880230e+00, i32 3)
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = tail call i32 @myPow(double 8.880230e+00, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int atoi(scalar_t__);
scalar_t__ getenv(char *);
int screen_columns() {
  if (getenv("COLUMNS"))
    return atoi(getenv("COLUMNS"));
  return 80;
}


x86 assembly (clang, -O0):
<screen_columns>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%rax
je     115a <screen_columns+0x3a>
lea    0xebb(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rdi
call   1040 <atoi@plt>
mov    %eax,-0x4(%rbp)
jmp    1161 <screen_columns+0x41>
movl   $0x50,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<screen_columns>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     113b <screen_columns+0x1b>
mov    %rax,%rdi
pop    %rax
jmp    1040 <atoi@plt>
mov    $0x50,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"COLUMNS\00"
define i32 @screen_columns() {
%1 = tail call i64 @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @atoi(i64 %1)
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ 80, %0 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ TOSH_CLR_ADC5_PIN();
int /*<<< orphan*/ TOSH_MAKE_ADC5_INPUT();
int /*<<< orphan*/ TOSH_MAKE_ADC5_OUTPUT();
int /*<<< orphan*/ TOSH_uwait(int);
void ds2751_writeBit(int bit) {
  if (bit) {
    TOSH_MAKE_ADC5_OUTPUT();
    TOSH_CLR_ADC5_PIN();
    TOSH_uwait(4);
    TOSH_MAKE_ADC5_INPUT();
    TOSH_uwait(50);
  } else {
    TOSH_MAKE_ADC5_OUTPUT();
    TOSH_CLR_ADC5_PIN();
    TOSH_uwait(50);
    TOSH_MAKE_ADC5_INPUT();
    TOSH_uwait(8);
  }
}


x86 assembly (clang, -O0):
<ds2751_writeBit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1183 <ds2751_writeBit+0x43>
mov    $0x0,%al
call   1040 <TOSH_MAKE_ADC5_OUTPUT@plt>
mov    $0x0,%al
call   1050 <TOSH_CLR_ADC5_PIN@plt>
mov    $0x4,%edi
call   1060 <TOSH_uwait@plt>
mov    $0x0,%al
call   1030 <TOSH_MAKE_ADC5_INPUT@plt>
mov    $0x32,%edi
call   1060 <TOSH_uwait@plt>
jmp    11ac <ds2751_writeBit+0x6c>
mov    $0x0,%al
call   1040 <TOSH_MAKE_ADC5_OUTPUT@plt>
mov    $0x0,%al
call   1050 <TOSH_CLR_ADC5_PIN@plt>
mov    $0x32,%edi
call   1060 <TOSH_uwait@plt>
mov    $0x0,%al
call   1030 <TOSH_MAKE_ADC5_INPUT@plt>
mov    $0x8,%edi
call   1060 <TOSH_uwait@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ds2751_writeBit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <TOSH_MAKE_ADC5_OUTPUT@plt>
xor    %eax,%eax
call   1050 <TOSH_CLR_ADC5_PIN@plt>
test   %ebx,%ebx
mov    $0x32,%eax
mov    $0x4,%edi
cmove  %eax,%edi
mov    $0x8,%ebx
cmovne %eax,%ebx
call   1060 <TOSH_uwait@plt>
xor    %eax,%eax
call   1030 <TOSH_MAKE_ADC5_INPUT@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1060 <TOSH_uwait@plt>

LLVM IR (-O0):
define void @ds2751_writeBit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = call i32 (...) @TOSH_MAKE_ADC5_OUTPUT()
%7 = call i32 (...) @TOSH_CLR_ADC5_PIN()
%8 = call i32 @TOSH_uwait(i32 4)
%9 = call i32 (...) @TOSH_MAKE_ADC5_INPUT()
%10 = call i32 @TOSH_uwait(i32 50)
br label %17
11: ; preds = %1
%12 = call i32 (...) @TOSH_MAKE_ADC5_OUTPUT()
%13 = call i32 (...) @TOSH_CLR_ADC5_PIN()
%14 = call i32 @TOSH_uwait(i32 50)
%15 = call i32 (...) @TOSH_MAKE_ADC5_INPUT()
%16 = call i32 @TOSH_uwait(i32 8)
br label %17
17: ; preds = %11, %5
ret void
}

LLVM IR (-O2):
define void @ds2751_writeBit(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = tail call i32 (...) @TOSH_MAKE_ADC5_OUTPUT()
%4 = tail call i32 (...) @TOSH_CLR_ADC5_PIN()
%5 = select i1 %2, i32 50, i32 4
%6 = select i1 %2, i32 8, i32 50
%7 = tail call i32 @TOSH_uwait(i32 %5)
%8 = tail call i32 (...) @TOSH_MAKE_ADC5_INPUT()
%9 = tail call i32 @TOSH_uwait(i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nocall(char *);
void findentry(void) { nocall("findentry"); }


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"findentry\00"
define void @findentry() {
%1 = tail call i32 @nocall(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
int f_le_rc2(float a1) { return !(((a1) <= (100))); }


x86 assembly (clang, -O0):
<f_le_rc2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
setae  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_le_rc2>:
movss  0xef8(%rip),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setb   %al
ret

LLVM IR (-O0):
define i32 @f_le_rc2(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp ole float %3, 1.000000e+02
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @f_le_rc2(float %0) {
%2 = fcmp ugt float %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
int val(char input) {
  if (input == 'x')
    return 3;
  else if (input == 'o')
    return 5;
  return 2;
}


x86 assembly (clang, -O0):
<val>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x78,%eax
jne    1123 <val+0x23>
movl   $0x3,-0x4(%rbp)
jmp    1148 <val+0x48>
movsbl -0x5(%rbp),%eax
cmp    $0x6f,%eax
jne    113c <val+0x3c>
movl   $0x5,-0x4(%rbp)
jmp    1148 <val+0x48>
jmp    1141 <val+0x41>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<val>:
xor    %eax,%eax
cmp    $0x6f,%dil
sete   %al
lea    (%rax,%rax,2),%ecx
add    $0x2,%ecx
cmp    $0x78,%dil
mov    $0x3,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @val(i8 signext %0) {
%2 = icmp eq i8 %0, 111
%3 = select i1 %2, i32 5, i32 2
%4 = icmp eq i8 %0, 120
%5 = select i1 %4, i32 3, i32 %3
ret i32 %5
}
double do_pow_0_5_nosqrt(double a) { return __builtin_pow(a, 0.5); }


x86 assembly (clang, -O0):
<do_pow_0_5_nosqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_pow_0_5_nosqrt>:
movsd  0xee8(%rip),%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @do_pow_0_5_nosqrt(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double %3, double 5.000000e-01)
ret double %4
}

LLVM IR (-O2):
define double @do_pow_0_5_nosqrt(double %0) {
%2 = tail call double @pow(double %0, double 5.000000e-01)
ret double %2
}
char *strset(char *s, int ch) {
  char *pstr = s;
  while (*pstr != '\0') {
    *pstr++ = (char)ch;
  }
  return (s);
}


x86 assembly (clang, -O0):
<strset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113e <strset+0x3e>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    1113 <strset+0x13>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strset>:
mov    %rdi,%rax
cmpb   $0x0,(%rdi)
je     111d <strset+0x1d>
lea    0x1(%rax),%rcx
nopl   0x0(%rax)
mov    %sil,-0x1(%rcx)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strset+0x10>
ret

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

LLVM IR (-O2):
define i8* @strset(i8* returned %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %7
%8 = phi i8* [ %0, %5 ], [ %9, %7 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %6, i8* %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %7
12: ; preds = %7, %2
ret i8* %0
}
/* Variables and functions */
char *emalloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *my_strdup(const char *str) {
  char *dup = emalloc(strlen(str) + 1);
  strcpy(dup, str);
  return dup;
}


x86 assembly (clang, -O0):
<my_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <emalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @my_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @emalloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @my_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @emalloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
void rm_tmp(s) char *s;
{
  extern int unlink();
  (void)unlink(s);
}


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

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

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

LLVM IR (-O2):
define void @rm_tmp(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @unlink to i32 (i8*, ...)*)(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
wchar_t *wcscpy(wchar_t *__restrict s1, const wchar_t *__restrict s2) {
  wchar_t *cp;
  cp = s1;
  while ((*cp++ = *s2++) != L'\0')
    ;
  return (s1);
}


x86 assembly (clang, -O0):
<wcscpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x4,%rdx
mov    %rdx,-0x18(%rbp)
mov    %eax,(%rcx)
cmp    $0x0,%eax
je     1144 <wcscpy+0x44>
jmp    1114 <wcscpy+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcscpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rsi,%rcx,1),%edx
mov    %edx,(%rax,%rcx,1)
add    $0x4,%rcx
test   %edx,%edx
jne    1110 <wcscpy+0x10>
ret

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

LLVM IR (-O2):
define i32* @wcscpy(i32* noalias returned writeonly %0, i32* noalias nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32* [ %1, %2 ], [ %6, %3 ]
%5 = phi i32* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i32, i32* %4, i64 1
%7 = load i32, i32* %4
%8 = getelementptr inbounds i32, i32* %5, i64 1
store i32 %7, i32* %5
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i32* %0
}
short __ocl_convert_short_short(short src) { return (short)src; }


x86 assembly (clang, -O0):
<__ocl_convert_short_short>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i16 @__ocl_convert_short_short(i16 returned signext %0) {
ret i16 %0
}
int returnIP(char *buf, int i) {
  int x = 0;
  if (buf[i] < 0)
    x = buf[i] + 256;
  else
    x = buf[i];
  return x;
}


x86 assembly (clang, -O0):
<returnIP>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jge    1140 <returnIP+0x40>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
add    $0x100,%eax
mov    %eax,-0x10(%rbp)
jmp    114f <returnIP+0x4f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<returnIP>:
movslq %esi,%rax
movsbl (%rdi,%rax,1),%ecx
lea    0x100(%rcx),%eax
test   %ecx,%ecx
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @returnIP(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp slt i8 %5, 0
%8 = add nsw i32 %6, 256
%9 = select i1 %7, i32 %8, i32 %6
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i = 0;
  do {
    i++;
    printf("\n%d --> %c", i, i);
  } while (i < 255);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0xff,-0x8(%rbp)
jl     1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xee0(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [11 x i8] c"\0A%d --> %c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
br label %9
9: ; preds = %3
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, 255
br i1 %11, label %3, label %12
12: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"\0A%d --> %c\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %3, %1 ]
%3 = add nuw nsw i32 %2, 1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %3)
%5 = icmp eq i32 %3, 255
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Type definitions */
typedef int uint32_t;
typedef int volatile uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
uint16_t EMACLPIStatus(uint32_t ui32Base) {
  ASSERT(ui32Base == 0x400EC000);
  return ((*((volatile uint32_t *)(ui32Base + 0x00000030))) & 0xFFFF);
}


x86 assembly (clang, -O0):
<EMACLPIStatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x400ec000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
cltq
mov    (%rax),%eax
and    $0xffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EMACLPIStatus>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x400ec000,%ebx
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
mov    0x30(%rax),%eax
movzwl %ax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @EMACLPIStatus(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1074708480
%5 = zext i1 %4 to i32
%6 = call i32 @ASSERT(i32 %5)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 48
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = and i32 %11, 65535
ret i32 %12
}

LLVM IR (-O2):
define i32 @EMACLPIStatus(i32 %0) {
%2 = icmp eq i32 %0, 1074708480
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
%5 = add nsw i32 %0, 48
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, 65535
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ file_is_stdin(char const *);
void close_file(FILE *fp, const char *file) {
  if (!file_is_stdin(file))
    fclose(fp);
}


x86 assembly (clang, -O0):
<close_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <file_is_stdin@plt>
cmp    $0x0,%eax
jne    114b <close_file+0x2b>
mov    -0x8(%rbp),%rdi
call   1040 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_file>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <file_is_stdin@plt>
test   %eax,%eax
je     1132 <close_file+0x12>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <fclose@plt>

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

LLVM IR (-O2):
define void @close_file(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @file_is_stdin(i8* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @fclose(i32* %0)
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ countSort(int *, int, int);
int getMax(int *, int);
void radixSort(int vetor[], int tam) {
  int m = getMax(vetor, tam);
  for (int exp = 1; m / exp > 0; exp *= 10)
    countSort(vetor, tam, exp);
}


x86 assembly (clang, -O0):
<radixSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <getMax@plt>
mov    %eax,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cltd
idivl  -0x14(%rbp)
cmp    $0x0,%eax
jle    1170 <radixSort+0x50>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <countSort@plt>
imul   $0xa,-0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1145 <radixSort+0x25>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radixSort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%r15
call   1040 <getMax@plt>
test   %eax,%eax
jle    115b <radixSort+0x3b>
mov    %eax,%ebp
mov    $0x1,%ebx
nopl   (%rax)
mov    %r15,%rdi
mov    %r14d,%esi
mov    %ebx,%edx
call   1030 <countSort@plt>
add    %ebx,%ebx
lea    (%rbx,%rbx,4),%ebx
mov    %ebp,%eax
cltd
idiv   %ebx
test   %eax,%eax
jg     1140 <radixSort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @radixSort(i32* %0, i32 %1) {
%3 = tail call i32 @getMax(i32* %0, i32 %1)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %6, %2
ret void
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ 1, %2 ]
%8 = tail call i32 @countSort(i32* %0, i32 %1, i32 %7)
%9 = mul nsw i32 %7, 10
%10 = sdiv i32 %3, %9
%11 = icmp sgt i32 %10, 0
br i1 %11, label %6, label %5
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char const *, char *, int *);
int parseInt(const char *str) {
  int i;
  sscanf(str, "%i", &i);
  return i;
}


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

x86 assembly (clang, -O2):
<parseInt>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define i32 @parseInt(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ ToonGetRootWindow(int /*<<< orphan*/ *, int,
                                     int /*<<< orphan*/ *);
Window ToonGetRoot(Display *dpy, int screen) {
  Window client;
  return ToonGetRootWindow(dpy, screen, &client);
}


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

x86 assembly (clang, -O2):
<ToonGetRoot>:
push   %rax
lea    0x4(%rsp),%rdx
call   1030 <ToonGetRootWindow@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ToonGetRoot(i32* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @ToonGetRootWindow(i32* %0, i32 %1, i32* %3)
ret i32 %5
}
OP(fd, b0) { op_b0(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_b0()
ret i32 undef
}
int is_whitespace(char ch) {
  if (ch == ' ') {
    return 1;
  }
  if (ch == '\t') {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jne    1123 <is_whitespace+0x23>
movl   $0x1,-0x4(%rbp)
jmp    1143 <is_whitespace+0x43>
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
jne    113c <is_whitespace+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1143 <is_whitespace+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @is_whitespace(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = icmp eq i8 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
int IsDigit(int enc __attribute__((unused)), int c) {
  if (c >= 0x30 && c <= 0x39)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<IsDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x30,-0xc(%rbp)
jl     112a <IsDigit+0x2a>
cmpl   $0x39,-0xc(%rbp)
jg     112a <IsDigit+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1131 <IsDigit+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsDigit>:
add    $0xffffffd0,%esi
xor    %eax,%eax
cmp    $0xa,%esi
setb   %al
ret

LLVM IR (-O0):
define i32 @IsDigit(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* %5
%7 = icmp sge i32 %6, 48
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 1, i32* %3
br label %13
12: ; preds = %8, %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @IsDigit(i32 %0, i32 %1) {
%3 = add i32 %1, -48
%4 = icmp ult i32 %3, 10
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void UARTModemControlClear(uint32_t ui32Base, uint32_t ui32Control) {
  uint32_t ui32Temp;
  ;
  ;
  ui32Temp = (*((volatile uint32_t *)(ui32Base + 0x00000030)));
  ui32Temp &= ~(ui32Control & (0x00000800 | 0x00000400));
  (*((volatile uint32_t *)(ui32Base + 0x00000030))) = ui32Temp;
}


x86 assembly (clang, -O0):
<UARTModemControlClear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%eax
cltq
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xc00,%eax
xor    $0xffffffff,%eax
and    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x30,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTModemControlClear>:
not    %esi
movslq %edi,%rax
or     $0xfffff3ff,%esi
and    %esi,0x30(%rax)
ret

LLVM IR (-O0):
define void @UARTModemControlClear(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 48
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
store i32 %10, i32* %5
%11 = load i32, i32* %4
%12 = and i32 %11, 3072
%13 = xor i32 %12, -1
%14 = load i32, i32* %5
%15 = and i32 %14, %13
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 48
%19 = sext i32 %18 to i64
%20 = inttoptr i64 %19 to i32*
store volatile i32 %16, i32* %20
ret void
}

LLVM IR (-O2):
define void @UARTModemControlClear(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 48
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %1, 3072
%8 = xor i32 %7, -1
%9 = and i32 %6, %8
store volatile i32 %9, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, size_t);
void rtv_from_buf_len(unsigned char **pp, unsigned char *b, size_t l) {
  unsigned char *p;
  p = *pp;
  memcpy(p, b, l);
  p += l;
  *pp = p;
}


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

x86 assembly (clang, -O2):
<rtv_from_buf_len>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rdi,%r15
mov    (%rdi),%rbx
mov    %rbx,%rdi
call   1030 <memcpy@plt>
add    %r14,%rbx
mov    %rbx,(%r15)
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @rtv_from_buf_len(i8** nocapture %0, i8* %1, i64 %2) {
%4 = load i8*, i8** %0
%5 = tail call i32 @memcpy(i8* %4, i8* %1, i64 %2)
%6 = getelementptr inbounds i8, i8* %4, i64 %2
store i8* %6, i8** %0
ret void
}
/* Type definitions */
struct ir_remote {
  int dummy;
};

/* Variables and functions */
scalar_t__ bte_automaton();
char *decode_all(struct ir_remote *);
char *bte_rec(struct ir_remote *remotes) {
  do {
  } while (0);
  if (bte_automaton())
    return decode_all(remotes);
  else
    return NULL;
}


x86 assembly (clang, -O0):
<bte_rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
jmp    1131 <bte_rec+0x11>
mov    $0x0,%al
call   1030 <bte_automaton@plt>
cmp    $0x0,%rax
je     1154 <bte_rec+0x34>
mov    -0x10(%rbp),%rdi
call   1040 <decode_all@plt>
mov    %rax,-0x8(%rbp)
jmp    115c <bte_rec+0x3c>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bte_rec>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <bte_automaton@plt>
test   %rax,%rax
je     1139 <bte_rec+0x19>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <decode_all@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.ir_remote = type { i32 }
define i8* @bte_rec(%struct.ir_remote* %0) {
%2 = alloca i8*
%3 = alloca %struct.ir_remote*
store %struct.ir_remote* %0, %struct.ir_remote** %3
br label %4
4: ; preds = %1
br label %5
5: ; preds = %4
%6 = call i64 (...) @bte_automaton()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load %struct.ir_remote*, %struct.ir_remote** %3
%10 = call i8* @decode_all(%struct.ir_remote* %9)
store i8* %10, i8** %2
br label %12
11: ; preds = %5
store i8* null, i8** %2
br label %12
12: ; preds = %11, %8
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
%struct.ir_remote = type { i32 }
define i8* @bte_rec(%struct.ir_remote* %0) {
%2 = tail call i64 (...) @bte_automaton()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i8* @decode_all(%struct.ir_remote* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i8* [ %5, %4 ], [ null, %1 ]
ret i8* %7
}
void INT_Excep_PERIA_INTA208(void) {}


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

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

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

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