xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ syntax();
void usage() {
  syntax();
  printf("Attach network interface to Y-net serial device\n");
  printf("    -s SPD  Set line speed\n");
  printf("    -c PROG Run PROG when the line is hung up\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <syntax@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
call   1030 <printf@plt>
lea    0xf03(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
xor    %eax,%eax
call   1040 <syntax@plt>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    0xef5(%rip),%rdi
call   1030 <puts@plt>
lea    0xf04(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"Attach network interface to Y-net serial device\0A\00"
@.str.1 = [28 x i8] c" -s SPD Set line speed\0A\00"
@.str.2 = [47 x i8] c" -c PROG Run PROG when the line is hung up\0A\00"
define void @usage() {
%1 = call i32 (...) @syntax()
%2 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [48 x i8] c"Attach network interface to Y-net serial device\00"
@str.3 = [27 x i8] c" -s SPD Set line speed\00"
@str.4 = [46 x i8] c" -c PROG Run PROG when the line is hung up\00"
define void @usage() {
%1 = tail call i32 (...) @syntax()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.4, i64 0, i64 0))
ret void
}
void stabs_function(void) {}


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

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

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

LLVM IR (-O2):
define void @stabs_function() {
ret void
}
/* Variables and functions */
int gpio_pin_oper(unsigned int, unsigned int, int);
int gpio_set_pin(unsigned int port, unsigned int pin) {
  return gpio_pin_oper(port, pin, 1);
}


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

x86 assembly (clang, -O2):
<gpio_set_pin>:
mov    $0x1,%edx
jmp    1030 <gpio_pin_oper@plt>

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

LLVM IR (-O2):
define i32 @gpio_set_pin(i32 %0, i32 %1) {
%3 = tail call i32 @gpio_pin_oper(i32 %0, i32 %1, i32 1)
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fork();
int /*<<< orphan*/ logger_run();
pid_t logger_start() {
  pid_t pid = fork();
  char buffer[65536];
  if (pid < 0)
    return -1;
  if (pid == 0) {
    logger_run();
    exit(0);
  } else {
    return pid;
  }
}


x86 assembly (clang, -O0):
<logger_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10010,%rsp
mov    $0x0,%al
call   1050 <fork@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    115e <logger_start+0x2e>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    117f <logger_start+0x4f>
cmpq   $0x0,-0x10(%rbp)
jne    1177 <logger_start+0x47>
mov    $0x0,%al
call   1030 <logger_run@plt>
xor    %edi,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logger_start>:
push   %rax
xor    %eax,%eax
call   1050 <fork@plt>
test   %rax,%rax
js     1141 <logger_start+0x11>
je     114a <logger_start+0x1a>
pop    %rcx
ret
mov    $0xffffffffffffffff,%rax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <logger_run@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i64 @logger_start() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca [65536 x i8]
%4 = call i64 (...) @fork()
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
store i64 -1, i64* %1
br label %16
8: ; preds = %0
%9 = load i64, i64* %2
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = call i32 (...) @logger_run()
%13 = call i32 @exit(i32 0)
unreachable
14: ; preds = %8
%15 = load i64, i64* %2
store i64 %15, i64* %1
br label %16
16: ; preds = %14, %7
%17 = load i64, i64* %1
ret i64 %17
}

LLVM IR (-O2):
define i64 @logger_start() {
%1 = tail call i64 (...) @fork()
%2 = icmp slt i64 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = icmp eq i64 %1, 0
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = tail call i32 (...) @logger_run()
%7 = tail call i32 @exit(i32 0)
unreachable
8: ; preds = %3, %0
%9 = phi i64 [ -1, %0 ], [ %1, %3 ]
ret i64 %9
}
/* Variables and functions */
int write_header_string(int, long, int, char const *, char const *, int *,
                        int *);
edf_write_header_line(int stream, long int DataNumber, int DataChain,
                      const char *keyword, const char *Value, int *pErrorValue,
                      int *pstatus) {
  return (write_header_string(stream, DataNumber, DataChain, keyword, Value,
                              pErrorValue, pstatus));
}


x86 assembly (clang, -O0):
<edf_write_header_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <write_header_string@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<edf_write_header_line>:
jmp    1030 <write_header_string@plt>

LLVM IR (-O0):
define i32 @edf_write_header_line(i32 %0, i64 %1, i32 %2, i8* %3, i8* %4, i32* %5, i32* %6) {
%8 = alloca i32
%9 = alloca i64
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i32*
%14 = alloca i32*
store i32 %0, i32* %8
store i64 %1, i64* %9
store i32 %2, i32* %10
store i8* %3, i8** %11
store i8* %4, i8** %12
store i32* %5, i32** %13
store i32* %6, i32** %14
%15 = load i32, i32* %8
%16 = load i64, i64* %9
%17 = load i32, i32* %10
%18 = load i8*, i8** %11
%19 = load i8*, i8** %12
%20 = load i32*, i32** %13
%21 = load i32*, i32** %14
%22 = call i32 @write_header_string(i32 %15, i64 %16, i32 %17, i8* %18, i8* %19, i32* %20, i32* %21)
ret i32 %22
}

LLVM IR (-O2):
define i32 @edf_write_header_line(i32 %0, i64 %1, i32 %2, i8* %3, i8* %4, i32* %5, i32* %6) {
%8 = tail call i32 @write_header_string(i32 %0, i64 %1, i32 %2, i8* %3, i8* %4, i32* %5, i32* %6)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
unsigned int sleep4(int);
int main(void) {
  printf("Going to sleep for 5 seconds.\n");
  unsigned int sleep_left = sleep4(5);
  printf("Woke up after %u seconds.\n", 5 - sleep_left);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x5,%edi
call   1040 <sleep4@plt>
mov    %eax,-0x8(%rbp)
mov    $0x5,%esi
sub    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x5,%ebx
mov    $0x5,%edi
call   1050 <sleep4@plt>
sub    %eax,%ebx
lea    0xeab(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Going to sleep for 5 seconds.\0A\00"
@.str.1 = [27 x i8] c"Woke up after %u seconds.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @sleep4(i32 5)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = sub i32 5, %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [27 x i8] c"Woke up after %u seconds.\0A\00"
@str = [30 x i8] c"Going to sleep for 5 seconds.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @sleep4(i32 5)
%3 = sub i32 5, %2
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
char *getSegmentSelector(char *logicalAdd) {
  static char segSel[5] = {'\0'};
  int i;
  for (i = 0; i < 4; ++i) {
    segSel[i] = logicalAdd[i];
  }
  return segSel;
}


x86 assembly (clang, -O0):
<getSegmentSelector>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1140 <getSegmentSelector+0x40>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
movslq -0xc(%rbp),%rcx
lea    0x2ef2(%rip),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <getSegmentSelector+0xf>
lea    0x2eda(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSegmentSelector>:
mov    (%rdi),%al
mov    %al,0x2f19(%rip)
lea    0x2f12(%rip),%rax
mov    0x1(%rdi),%cl
mov    %cl,0x2f0a(%rip)
mov    0x2(%rdi),%cl
mov    %cl,0x2f02(%rip)
mov    0x3(%rdi),%cl
mov    %cl,0x2efa(%rip)
ret

LLVM IR (-O0):
@getSegmentSelector.segSel = internal global [5 x i8] zeroinitializer
define i8* @getSegmentSelector(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %16, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 4
br i1 %6, label %7, label %19
7: ; preds = %4
%8 = load i8*, i8** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [5 x i8], [5 x i8]* @getSegmentSelector.segSel, i64 0, i64 %14
store i8 %12, i8* %15
br label %16
16: ; preds = %7
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %4
19: ; preds = %4
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @getSegmentSelector.segSel, i64 0, i64 0)
}

LLVM IR (-O2):
@getSegmentSelector.segSel = internal global [5 x i8] zeroinitializer
define i8* @getSegmentSelector(i8* nocapture %0) {
%2 = load i8, i8* %0
store i8 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @getSegmentSelector.segSel, i64 0, i64 0)
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
store i8 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @getSegmentSelector.segSel, i64 0, i64 1)
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
store i8 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @getSegmentSelector.segSel, i64 0, i64 2)
%7 = getelementptr inbounds i8, i8* %0, i64 3
%8 = load i8, i8* %7
store i8 %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @getSegmentSelector.segSel, i64 0, i64 3)
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @getSegmentSelector.segSel, i64 0, i64 0)
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int copy_multprec_container_to_start_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(288, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<copy_multprec_container_to_start_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x120,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_multprec_container_to_start_solutions>:
mov    $0x120,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @copy_multprec_container_to_start_solutions() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 288, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_multprec_container_to_start_solutions() {
%1 = tail call i32 @_ada_use_c2phc(i32 288, i32* undef, i32* undef, double* undef)
ret i32 %1
}
double foo(float x, double y) { return x + y + 3; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movsd  %xmm1,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xedc(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cvtss2sd %xmm0,%xmm0
addsd  %xmm1,%xmm0
addsd  0xef0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @foo(float %0, double %1) {
%3 = alloca float
%4 = alloca double
store float %0, float* %3
store double %1, double* %4
%5 = load float, float* %3
%6 = fpext float %5 to double
%7 = load double, double* %4
%8 = fadd double %6, %7
%9 = fadd double %8, 3.000000e+00
ret double %9
}

LLVM IR (-O2):
define double @foo(float %0, double %1) {
%3 = fpext float %0 to double
%4 = fadd double %3, %1
%5 = fadd double %4, 3.000000e+00
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void printflo(float c) { printf("%f\n", c); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define void @printflo(float %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %0)
ret void
}
/* Variables and functions */
float fabsolute(float const);
void vec3Abs(float *__restrict _result, const float *__restrict _a) {
  _result[0] = fabsolute(_a[0]);
  _result[1] = fabsolute(_a[1]);
  _result[2] = fabsolute(_a[2]);
}


x86 assembly (clang, -O0):
<vec3Abs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <fabsolute@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
call   1030 <fabsolute@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
call   1030 <fabsolute@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3Abs>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
movss  (%rsi),%xmm0
call   1030 <fabsolute@plt>
movss  %xmm0,(%r14)
movss  0x4(%rbx),%xmm0
call   1030 <fabsolute@plt>
movss  %xmm0,0x4(%r14)
movss  0x8(%rbx),%xmm0
call   1030 <fabsolute@plt>
movss  %xmm0,0x8(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @vec3Abs(float* noalias %0, float* noalias %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %4
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = call float @fabsolute(float %7)
%9 = load float*, float** %3
%10 = getelementptr inbounds float, float* %9, i64 0
store float %8, float* %10
%11 = load float*, float** %4
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = call float @fabsolute(float %13)
%15 = load float*, float** %3
%16 = getelementptr inbounds float, float* %15, i64 1
store float %14, float* %16
%17 = load float*, float** %4
%18 = getelementptr inbounds float, float* %17, i64 2
%19 = load float, float* %18
%20 = call float @fabsolute(float %19)
%21 = load float*, float** %3
%22 = getelementptr inbounds float, float* %21, i64 2
store float %20, float* %22
ret void
}

LLVM IR (-O2):
define void @vec3Abs(float* noalias nocapture writeonly %0, float* noalias nocapture %1) {
%3 = load float, float* %1
%4 = tail call float @fabsolute(float %3)
store float %4, float* %0
%5 = getelementptr inbounds float, float* %1, i64 1
%6 = load float, float* %5
%7 = tail call float @fabsolute(float %6)
%8 = getelementptr inbounds float, float* %0, i64 1
store float %7, float* %8
%9 = getelementptr inbounds float, float* %1, i64 2
%10 = load float, float* %9
%11 = tail call float @fabsolute(float %10)
%12 = getelementptr inbounds float, float* %0, i64 2
store float %11, float* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ promedio(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  printf("Ingrese el total de numeros: ");
  scanf("%i", &n);
  promedio(n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1050 <promedio@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <promedio@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Ingrese el total de numeros: \00"
@.str.1 = [3 x i8] c"%i\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @promedio(i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"Ingrese el total de numeros: \00"
@.str.1 = [3 x i8] c"%i\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @promedio(i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DCSMReadZone2EXEONLY();
unsigned long DCSMGetZone2EXEstatus(unsigned long sector) {
  ;
  DCSMReadZone2EXEONLY();
  if ((((*((volatile unsigned long *)(0x400FB400 + 0x000000B4))) >> sector) &
       0x00000001) == 1) {
    return (1);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<DCSMGetZone2EXEstatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <DCSMReadZone2EXEONLY@plt>
mov    $0x400fb4b4,%eax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
shr    %cl,%rax
and    $0x1,%rax
cmp    $0x1,%rax
jne    114d <DCSMGetZone2EXEstatus+0x3d>
movq   $0x1,-0x8(%rbp)
jmp    1155 <DCSMGetZone2EXEstatus+0x45>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DCSMGetZone2EXEstatus>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <DCSMReadZone2EXEONLY@plt>
mov    0x400fb4b4,%rax
40
mov    %ebx,%ecx
shr    %cl,%rax
and    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @DCSMGetZone2EXEstatus(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = call i32 (...) @DCSMReadZone2EXEONLY()
%5 = load volatile i64, i64* inttoptr (i64 1074771124 to i64*)
%6 = load i64, i64* %3
%7 = lshr i64 %5, %6
%8 = and i64 %7, 1
%9 = icmp eq i64 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %1
store i64 1, i64* %2
br label %12
11: ; preds = %1
store i64 0, i64* %2
br label %12
12: ; preds = %11, %10
%13 = load i64, i64* %2
ret i64 %13
}

LLVM IR (-O2):
define i64 @DCSMGetZone2EXEstatus(i64 %0) {
%2 = tail call i32 (...) @DCSMReadZone2EXEONLY()
%3 = load volatile i64, i64* inttoptr (i64 1074771124 to i64*)
%4 = lshr i64 %3, %0
%5 = and i64 %4, 1
ret i64 %5
}
/* Variables and functions */
scalar_t__ LINES;
int /*<<< orphan*/ getch();
int /*<<< orphan*/ move(scalar_t__, int);
int /*<<< orphan*/ printw(char *);
int /*<<< orphan*/ refresh();
void endPause() {
  move(LINES - 1, 1);
  printw("COMPLETE: Press any key to continue");
  refresh();
  getch();
}


x86 assembly (clang, -O0):
<endPause>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e9d(%rip),%rax
mov    (%rax),%rdi
sub    $0x1,%rdi
mov    $0x1,%esi
call   1060 <move@plt>
lea    0xe9d(%rip),%rdi
call   1030 <printw@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
mov    $0x0,%al
call   1050 <getch@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<endPause>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    (%rax),%rdi
add    $0xffffffffffffffff,%rdi
mov    $0x1,%esi
call   1060 <move@plt>
lea    0xea0(%rip),%rdi
call   1030 <printw@plt>
xor    %eax,%eax
call   1040 <refresh@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <getch@plt>

LLVM IR (-O0):
@LINES = global i64 0
@.str = [36 x i8] c"COMPLETE: Press any key to continue\00"
define void @endPause() {
%1 = load i64, i64* @LINES
%2 = sub nsw i64 %1, 1
%3 = call i32 @move(i64 %2, i32 1)
%4 = call i32 @printw(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @refresh()
%6 = call i32 (...) @getch()
ret void
}

LLVM IR (-O2):
@LINES = global i64 0
@.str = [36 x i8] c"COMPLETE: Press any key to continue\00"
define void @endPause() {
%1 = load i64, i64* @LINES
%2 = add nsw i64 %1, -1
%3 = tail call i32 @move(i64 %2, i32 1)
%4 = tail call i32 @printw(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (...) @refresh()
%6 = tail call i32 (...) @getch()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int setnoblock(int fd1) {
  int flags;
  if ((flags = fcntl(fd1, F_GETFL, 0)) == -1)
    perror("fcntl");
  return (fcntl(fd1, F_SETFL, flags | O_NONBLOCK));
}


x86 assembly (clang, -O0):
<setnoblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xffffffff,%eax
jne    1156 <setnoblock+0x36>
lea    0xeaf(%rip),%rdi
call   1040 <perror@plt>
mov    -0x4(%rbp),%edi
mov    0x2e78(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2e7c(%rip),%rax
or     (%rax),%edx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setnoblock>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
je     115d <setnoblock+0x3d>
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
mov    0x2e9c(%rip),%rax
mov    (%rax),%edx
or     %ebp,%edx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fcntl@plt>
lea    0xe9c(%rip),%rdi
call   1040 <perror@plt>
jmp    113c <setnoblock+0x1c>

LLVM IR (-O0):
@F_GETFL = global i32 0
@.str = [6 x i8] c"fcntl\00"
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @setnoblock(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 @fcntl(i32 %4, i32 %5, i32 0)
store i32 %6, i32* %3
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i32, i32* %2
%12 = load i32, i32* @F_SETFL
%13 = load i32, i32* %3
%14 = load i32, i32* @O_NONBLOCK
%15 = or i32 %13, %14
%16 = call i32 @fcntl(i32 %11, i32 %12, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@.str = [6 x i8] c"fcntl\00"
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @setnoblock(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = load i32, i32* @F_SETFL
%9 = load i32, i32* @O_NONBLOCK
%10 = or i32 %9, %3
%11 = tail call i32 @fcntl(i32 %0, i32 %8, i32 %10)
ret i32 %11
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool mp2vpicx_get_concealmentmv(const uint8_t *p_mp2vpicx) {
  return !!(p_mp2vpicx[7] & 0x20);
}


x86 assembly (clang, -O0):
<mp2vpicx_get_concealmentmv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%eax
and    $0x20,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vpicx_get_concealmentmv>:
mov    0x1c(%rdi),%eax
shr    $0x5,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @mp2vpicx_get_concealmentmv(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 7
%5 = load i32, i32* %4
%6 = and i32 %5, 32
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @mp2vpicx_get_concealmentmv(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 7
%3 = load i32, i32* %2
%4 = lshr i32 %3, 5
%5 = and i32 %4, 1
ret i32 %5
}
void gtk_tree_view_column_set_widget() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_column_set_widget() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ get_rand(int);
uint8_t rand8(void) { return (get_rand(8)); }


x86 assembly (clang, -O0):
<rand8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
call   1030 <get_rand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand8>:
mov    $0x8,%edi
jmp    1030 <get_rand@plt>

LLVM IR (-O0):
define i32 @rand8() {
%1 = call i32 @get_rand(i32 8)
ret i32 %1
}

LLVM IR (-O2):
define i32 @rand8() {
%1 = tail call i32 @get_rand(i32 8)
ret i32 %1
}
/* Type definitions */
typedef void ushort;

/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ memcpy(void *, void *, int);
void *list_copy_ushort(void *_data) {
  ushort *new_data = malloc(sizeof(ushort));
  memcpy(new_data, _data, sizeof(ushort));
  return new_data;
}


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

x86 assembly (clang, -O2):
<list_copy_ushort>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @list_copy_ushort(i8* %0) {
%2 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%3 = tail call i32 @memcpy(i8* %2, i8* %0, i32 1)
ret i8* %2
}
/* Type definitions */
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int connect(int, struct sockaddr *, int);
int errno;
int os_connect(int s, struct sockaddr *addr, int addrlen) {
  int retval;
  retval = connect(s, addr, addrlen);
  if (retval == -1)
    retval = -errno;
  return retval;
}


x86 assembly (clang, -O0):
<os_connect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <connect@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    114c <os_connect+0x3c>
xor    %eax,%eax
mov    0x2e99(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_connect>:
push   %rax
call   1030 <connect@plt>
mov    0x2ec3(%rip),%rcx
xor    %edx,%edx
sub    (%rcx),%edx
cmp    $0xffffffff,%eax
cmove  %edx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@errno = global i32 0
define i32 @os_connect(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = tail call i32 @connect(i32 %0, %struct.sockaddr* %1, i32 %2)
%5 = icmp eq i32 %4, -1
%6 = load i32, i32* @errno
%7 = sub nsw i32 0, %6
%8 = select i1 %5, i32 %7, i32 %4
ret i32 %8
}
float divide(float a, float b) {
  if (b == 0)
    b = 1;
  return a / b;
}


x86 assembly (clang, -O0):
<divide>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1132 <divide+0x32>
jp     1132 <divide+0x32>
movss  0xed3(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<divide>:
xorps  %xmm2,%xmm2
cmpeqss %xmm1,%xmm2
movss  0xef0(%rip),%xmm3
andps  %xmm2,%xmm3
andnps %xmm1,%xmm2
orps   %xmm3,%xmm2
divss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @divide(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = fcmp oeq float %5, 0.000000e+00
br i1 %6, label %7, label %8
7: ; preds = %2
store float 1.000000e+00, float* %4
br label %8
8: ; preds = %7, %2
%9 = load float, float* %3
%10 = load float, float* %4
%11 = fdiv float %9, %10
ret float %11
}

LLVM IR (-O2):
define float @divide(float %0, float %1) {
%3 = fcmp oeq float %1, 0.000000e+00
%4 = select i1 %3, float 1.000000e+00, float %1
%5 = fdiv float %0, %4
ret float %5
}
int imgl_munge_name(buf)
char *buf;
{
  int j;
  j = 0;
  while (buf[j] != '\n')
    j++;
  buf[j] = '\0';
  return 0;
}


x86 assembly (clang, -O0):
<imgl_munge_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
je     1132 <imgl_munge_name+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <imgl_munge_name+0xf>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imgl_munge_name>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0xa,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <imgl_munge_name+0x10>
mov    %eax,%eax
movb   $0x0,(%rdi,%rax,1)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @imgl_munge_name(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 10
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = and i64 %3, 4294967295
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 0, i8* %10
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ init_ns_type(int, char *);
void init_available_ns(void) {
  init_ns_type(0x08000000, "ipc");
  init_ns_type(0x00020000, "mnt");
  init_ns_type(0x40000000, "net");
  init_ns_type(0x20000000, "pid");
  init_ns_type(0x04000000, "uts");
}


x86 assembly (clang, -O0):
<init_available_ns>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8000000,%edi
lea    0xee0(%rip),%rsi
call   1030 <init_ns_type@plt>
mov    $0x20000,%edi
lea    0xed3(%rip),%rsi
call   1030 <init_ns_type@plt>
mov    $0x40000000,%edi
lea    0xec6(%rip),%rsi
call   1030 <init_ns_type@plt>
mov    $0x20000000,%edi
lea    0xeb9(%rip),%rsi
call   1030 <init_ns_type@plt>
mov    $0x4000000,%edi
lea    0xeac(%rip),%rsi
call   1030 <init_ns_type@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_available_ns>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x8000000,%edi
call   1030 <init_ns_type@plt>
lea    0xedb(%rip),%rsi
mov    $0x20000,%edi
call   1030 <init_ns_type@plt>
lea    0xece(%rip),%rsi
mov    $0x40000000,%edi
call   1030 <init_ns_type@plt>
lea    0xec1(%rip),%rsi
mov    $0x20000000,%edi
call   1030 <init_ns_type@plt>
lea    0xeb4(%rip),%rsi
mov    $0x4000000,%edi
pop    %rax
jmp    1030 <init_ns_type@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"ipc\00"
@.str.1 = [4 x i8] c"mnt\00"
@.str.2 = [4 x i8] c"net\00"
@.str.3 = [4 x i8] c"pid\00"
@.str.4 = [4 x i8] c"uts\00"
define void @init_available_ns() {
%1 = call i32 @init_ns_type(i32 134217728, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @init_ns_type(i32 131072, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @init_ns_type(i32 1073741824, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @init_ns_type(i32 536870912, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @init_ns_type(i32 67108864, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"ipc\00"
@.str.1 = [4 x i8] c"mnt\00"
@.str.2 = [4 x i8] c"net\00"
@.str.3 = [4 x i8] c"pid\00"
@.str.4 = [4 x i8] c"uts\00"
define void @init_available_ns() {
%1 = tail call i32 @init_ns_type(i32 134217728, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @init_ns_type(i32 131072, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @init_ns_type(i32 1073741824, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @init_ns_type(i32 536870912, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @init_ns_type(i32 67108864, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
ret void
}
void omap_bandgap_resume_after_idle(void) {}


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

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

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

LLVM IR (-O2):
define void @omap_bandgap_resume_after_idle() {
ret void
}
int isspace(int character) {
  return (character == ' ') || (character == '\t') || (character == '\n') ||
         (character == '\v') || (character == '\f') || (character == '\r');
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xb,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xc,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
cmpl   $0xd,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
mov    $0x1,%eax
lea    -0x9(%rdi),%ecx
cmp    $0x4,%ecx
jae    110e <isspace+0xe>
ret
cmp    $0x20,%edi
je     110d <isspace+0xd>
xor    %eax,%eax
cmp    $0xd,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %5
i32 12, label %5
i32 11, label %5
i32 10, label %5
i32 9, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 13
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ hrt(double, double, char *);
int /*<<< orphan*/ printf(char *, double, double);
void print_nine(double x, double y) {
  printf("        <rect x=\"%.2fin\" y=\"%.2fin\" width=\"5.75in\" "
         "height=\"1.00in\" fill=\"#0000e0\" />\n",
         x, y);
  hrt(x, y, "9");
}


x86 assembly (clang, -O0):
<print_nine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xefd(%rip),%rdi
call   1030 <hrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_nine>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
lea    0xf13(%rip),%rdi
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
add    $0x18,%rsp
jmp    1030 <hrt@plt>

LLVM IR (-O0):
@.str = [86 x i8] c" <rect x=\22%.2fin\22 y=\22%.2fin\22 width=\225.75in\22 height=\221.00in\22 fill=\22e0\22 />\0A\00"
@.str.1 = [2 x i8] c"9\00"
define void @print_nine(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0), double %5, double %6)
%8 = load double, double* %3
%9 = load double, double* %4
%10 = call i32 @hrt(double %8, double %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [86 x i8] c" <rect x=\22%.2fin\22 y=\22%.2fin\22 width=\225.75in\22 height=\221.00in\22 fill=\22e0\22 />\0A\00"
@.str.1 = [2 x i8] c"9\00"
define void @print_nine(double %0, double %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0), double %0, double %1)
%4 = tail call i32 @hrt(double %0, double %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned xrop3_211_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = D | S;
  stk2 = T & stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_211_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_211_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
lea    (%rax,%rdi,1),%ecx
mov    %esi,%edx
shl    $0x8,%edx
or     %esi,%edx
or     $0xff,%eax
and    %edx,%eax
or     %ecx,%eax
not    %eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_211_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = or i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %7
%27 = load i32, i32* %10
%28 = and i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %6
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = xor i32 %32, -1
store i32 %33, i32* %8
%34 = load i32, i32* %8
%35 = load i32, i32* %6
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = load i32, i32* %5
%39 = load i32, i32* %6
%40 = and i32 %38, %39
%41 = or i32 %37, %40
ret i32 %41
}

LLVM IR (-O2):
define i32 @xrop3_211_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = or i32 %4, %3
%6 = zext i8 %1 to i32
%7 = mul nuw nsw i32 %6, 257
%8 = or i32 %4, 255
%9 = and i32 %7, %8
%10 = or i32 %5, %9
%11 = xor i32 %10, -1
%12 = or i32 %11, %3
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const);
void reverse(const char *str) {
  if (NULL != str && '\0' != *str) {
    reverse(str + 1);
    printf("%c", *str);
  }
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     1169 <reverse+0x49>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     1169 <reverse+0x49>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1030 <reverse@plt>
mov    -0x8(%rbp),%rax
lea    0xe9f(%rip),%rdi
movsbl (%rax),%esi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
push   %rbx
test   %rdi,%rdi
je     1147 <reverse+0x27>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1147 <reverse+0x27>
lea    0x1(%rbx),%rdi
call   1030 <reverse@plt>
movsbl (%rbx),%esi
lea    0xebf(%rip),%rdi
pop    %rbx
jmp    1040 <printf@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @reverse(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1, %3, %7
ret void
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %0, i64 1
tail call void @reverse(i8* %8)
%9 = load i8, i8* %0
%10 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %9)
br label %6
}
extern int cel_lzw_decode_file(char *srcfile, char *dstfile) { return 1; }


x86 assembly (clang, -O0):
<cel_lzw_decode_file>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cel_lzw_decode_file(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i32 1
}

LLVM IR (-O2):
define i32 @cel_lzw_decode_file(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 1
}
unsigned char GetBeaconAmpLeft(void) { return 0; }


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

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

LLVM IR (-O0):
define zeroext i8 @GetBeaconAmpLeft() {
ret i8 0
}

LLVM IR (-O2):
define zeroext i8 @GetBeaconAmpLeft() {
ret i8 0
}