xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ CORE_DriverIRQHandler();
__attribute__((weak)) void CORE_IRQHandler(void) { CORE_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @CORE_IRQHandler() {
%1 = call i32 (...) @CORE_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @CORE_IRQHandler() {
%1 = tail call i32 (...) @CORE_DriverIRQHandler()
ret void
}
/* Type definitions */
struct pollfd {
  int fd;
  int /*<<< orphan*/ events;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ POLLIN;
int /*<<< orphan*/ io_op_timeout(struct pollfd *, int /*<<< orphan*/, void *,
                                 size_t, int);
int /*<<< orphan*/ read;
ssize_t read_timeout(int fd, void *buf, size_t buflen, int timeout_ms) {
  struct pollfd fds;
  fds.fd = fd;
  fds.events = POLLIN;
  return io_op_timeout(&fds, read, buf, buflen, timeout_ms);
}


x86 assembly (clang, -O0):
<read_timeout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
lea    -0x28(%rbp),%rdi
call   1030 <io_op_timeout@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_timeout>:
push   %rax
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,(%rsp)
mov    0x2ec4(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x4(%rsp)
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdi
call   1030 <io_op_timeout@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.pollfd = type { i32, i32 }
@POLLIN = global i32 0
@read = global i32 0
define i32 @read_timeout(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
%9 = alloca %struct.pollfd
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %9, i32 0, i32 0
store i32 %10, i32* %11
%12 = load i32, i32* @POLLIN
%13 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %9, i32 0, i32 1
store i32 %12, i32* %13
%14 = load i32, i32* @read
%15 = load i8*, i8** %6
%16 = load i64, i64* %7
%17 = load i32, i32* %8
%18 = call i32 @io_op_timeout(%struct.pollfd* %9, i32 %14, i8* %15, i64 %16, i32 %17)
ret i32 %18
}

LLVM IR (-O2):
%struct.pollfd = type { i32, i32 }
@POLLIN = global i32 0
@read = global i32 0
define i32 @read_timeout(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca %struct.pollfd
%6 = bitcast %struct.pollfd* %5 to i8*
%7 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %5, i64 0, i32 0
store i32 %0, i32* %7
%8 = load i32, i32* @POLLIN
%9 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %5, i64 0, i32 1
store i32 %8, i32* %9
%10 = load i32, i32* @read
%11 = call i32 @io_op_timeout(%struct.pollfd* %5, i32 %10, i8* %1, i64 %2, i32 %3)
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ pmu_reg_write(int, int);
void pmu_adc_reset_setting() {
  pmu_reg_write(0x3C, ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) |
                       (1 << 5) | (1 << 6) | (1 << 7) | (1 << 8) | (1 << 9) |
                       (1 << 10) | (0 << 11) | (0 << 12) | (0 << 13) |
                       (1 << 14) | (1 << 15) | (1 << 16) | (1 << 17) |
                       (1 << 18) | (1 << 19) | (1 << 20)));
}


x86 assembly (clang, -O0):
<pmu_adc_reset_setting>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3c,%edi
mov    $0x1fc7ff,%esi
call   1030 <pmu_reg_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmu_adc_reset_setting>:
mov    $0x3c,%edi
mov    $0x1fc7ff,%esi
jmp    1030 <pmu_reg_write@plt>

LLVM IR (-O0):
define void @pmu_adc_reset_setting() {
%1 = call i32 @pmu_reg_write(i32 60, i32 2082815)
ret void
}

LLVM IR (-O2):
define void @pmu_adc_reset_setting() {
%1 = tail call i32 @pmu_reg_write(i32 60, i32 2082815)
ret void
}
/* Type definitions */
struct spline_shape {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct spline_shape *);
void spline_free_shape(struct spline_shape *shape) { free(shape); }


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

x86 assembly (clang, -O2):
<spline_free_shape>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.spline_shape = type { i32 }
define void @spline_free_shape(%struct.spline_shape* %0) {
%2 = alloca %struct.spline_shape*
store %struct.spline_shape* %0, %struct.spline_shape** %2
%3 = load %struct.spline_shape*, %struct.spline_shape** %2
%4 = call i32 @free(%struct.spline_shape* %3)
ret void
}

LLVM IR (-O2):
%struct.spline_shape = type { i32 }
define void @spline_free_shape(%struct.spline_shape* nocapture %0) {
%2 = tail call i32 @free(%struct.spline_shape* %0)
ret void
}
void finish() {}


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

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

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

LLVM IR (-O2):
define void @finish() {
ret void
}
int token_count(char **tokens) {
  int count = 0;
  int i;
  for (i = 0; tokens[i]; i++) {
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<token_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1140 <token_count+0x40>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <token_count+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<token_count>:
cmpq   $0x0,(%rdi)
je     111d <token_count+0x1d>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmpq   $0x0,0x8(%rdi,%rax,8)
lea    0x1(%rax),%rax
jne    1110 <token_count+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @token_count(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
%4 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %15, %1
%6 = load i8**, i8*** %2
%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 = icmp ne i8* %10, null
br i1 %11, label %12, label %18
12: ; preds = %5
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %15
15: ; preds = %12
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
store i32 %17, i32* %4
br label %5
18: ; preds = %5
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @token_count(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %6, %4 ], [ 0, %1 ]
%6 = add nuw nsw i64 %5, 1
%7 = getelementptr inbounds i8*, i8** %0, i64 %6
%8 = load i8*, i8** %7
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %4
10: ; preds = %4
%11 = trunc i64 %6 to i32
br label %12
12: ; preds = %10, %1
%13 = phi i32 [ 0, %1 ], [ %11, %10 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ sgen(char *, char *, char *);
void cgldga(char *s) { sgen("%s\t$%s,%%rax", "movq", s); }


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

x86 assembly (clang, -O2):
<cgldga>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeec(%rip),%rsi
jmp    1030 <sgen@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%s\09$%s,%%rax\00"
@.str.1 = [5 x i8] c"movq\00"
define void @cgldga(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @sgen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s\09$%s,%%rax\00"
@.str.1 = [5 x i8] c"movq\00"
define void @cgldga(i8* %0) {
%2 = tail call i32 @sgen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
void mumps_scotch_intsize(int *scotch_intsize) { *scotch_intsize = -99999; }


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

x86 assembly (clang, -O2):
<mumps_scotch_intsize>:
movl   $0xfffe7961,(%rdi)
ret

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

LLVM IR (-O2):
define void @mumps_scotch_intsize(i32* nocapture writeonly %0) {
store i32 -99999, i32* %0
ret void
}
int do_119() { return 119; }


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

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

LLVM IR (-O0):
define i32 @do_119() {
ret i32 119
}

LLVM IR (-O2):
define i32 @do_119() {
ret i32 119
}
void arch_xir_raise(struct cpu_thread *thread __attribute__((unused))) {
  return;
}


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

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

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

LLVM IR (-O2):
%struct.cpu_thread = type opaque
define void @arch_xir_raise(%struct.cpu_thread* nocapture %0) {
ret void
}
struct student *insert(struct student *head) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.student = type opaque
define noalias %struct.student* @insert(%struct.student* nocapture readnone %0) {
ret %struct.student* null
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int __setxid(int, int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int setuid(uid_t uid) { return __setxid(213, uid, 0, 0); }


x86 assembly (clang, -O0):
<setuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0xd5,%edi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <__setxid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setuid>:
mov    %edi,%esi
mov    $0xd5,%edi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <__setxid@plt>

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

LLVM IR (-O2):
define i32 @setuid(i32 %0) {
%2 = tail call i32 @__setxid(i32 213, i32 %0, i32 0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void printUsage() {
  puts("Utilizacao: \n"
       "     ./lab5a <matriz de input>.adj");
}


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

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

LLVM IR (-O0):
@.str = [48 x i8] c"Utilizacao: \0A ./lab5a <matriz de input>.adj\00"
define void @printUsage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"Utilizacao: \0A ./lab5a <matriz de input>.adj\00"
define void @printUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_standard_Laurent_drop_variable_by_index(int k) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc4c(828, &k, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_standard_Laurent_drop_variable_by_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x33c,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_standard_Laurent_drop_variable_by_index>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x33c,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @syscon_standard_Laurent_drop_variable_by_index(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %4
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc4c(i32 828, i32* %2, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_standard_Laurent_drop_variable_by_index(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 828, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime_r(int /*<<< orphan*/ const *, struct tm *);
struct tm *ndb_localtime_r(const time_t *timep, struct tm *result) {
  return localtime_r(timep, result);
}


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

x86 assembly (clang, -O2):
<ndb_localtime_r>:
jmp    1030 <localtime_r@plt>

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

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @ndb_localtime_r(i32* %0, %struct.tm* %1) {
%3 = tail call %struct.tm* @localtime_r(i32* %0, %struct.tm* %1)
ret %struct.tm* %3
}
void RTPathRename(void) {}


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

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

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

LLVM IR (-O2):
define void @RTPathRename() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OutputGetCount(unsigned char, int *);
int MotorRotationCount(unsigned char Output) {
  int Result = 0;
  OutputGetCount(Output, &Result);
  return Result;
}


x86 assembly (clang, -O0):
<MotorRotationCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rsi
movzbl -0x1(%rbp),%edi
call   1030 <OutputGetCount@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MotorRotationCount>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
call   1030 <OutputGetCount@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @MotorRotationCount(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
%4 = load i8, i8* %2
%5 = call i32 @OutputGetCount(i8 zeroext %4, i32* %3)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @MotorRotationCount(i8 zeroext %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @OutputGetCount(i8 zeroext %0, i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show() { printf("This is the show function!\n"); }


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"This is the show function!\0A\00"
define void @show() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [27 x i8] c"This is the show function!\00"
define void @show() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
int ntohs(int);
uint16_t _bt_uint16_t(char *buf, int offset) {
  uint16_t curr_val;
  curr_val = (uint8_t)buf[offset] << 8;
  curr_val += (uint8_t)buf[offset + 1];
  curr_val = ntohs(curr_val);
  return curr_val;
}


x86 assembly (clang, -O0):
<_bt_uint16_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
shl    $0x8,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <ntohs@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_bt_uint16_t>:
movslq %esi,%rax
movsbl (%rdi,%rax,1),%ecx
shl    $0x8,%ecx
movsbl 0x1(%rdi,%rax,1),%edi
add    %ecx,%edi
jmp    1030 <ntohs@plt>

LLVM IR (-O0):
define i32 @_bt_uint16_t(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = 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 = shl i32 %11, 8
store i32 %12, i32* %5
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %13, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = load i32, i32* %5
%21 = add nsw i32 %20, %19
store i32 %21, i32* %5
%22 = load i32, i32* %5
%23 = call i32 @ntohs(i32 %22)
store i32 %23, i32* %5
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
define i32 @_bt_uint16_t(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 = shl nsw i32 %6, 8
%8 = add nsw i32 %1, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = add nsw i32 %7, %12
%14 = tail call i32 @ntohs(i32 %13)
ret i32 %14
}
void init(float *a1, float *a2) {
  float s = -1;
  int i;
  for (i = 0; i < 100000; i++) {
    a1[i] = s;
    a2[i] = i;
    s = -s;
  }
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  0xeec(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x186a0,-0x18(%rbp)
jge    1176 <init+0x76>
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
cvtsi2ssl -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
movss  -0x14(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1120 <init+0x20>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movl   $0xbf800000,(%rdi,%rax,4)
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,(%rsi,%rax,4)
lea    0x1(%rax),%ecx
xorps  %xmm0,%xmm0
cvtsi2ss %ecx,%xmm0
movl   $0x3f800000,0x4(%rdi,%rax,4)
3f
movss  %xmm0,0x4(%rsi,%rax,4)
add    $0x2,%rax
cmp    $0x186a0,%rax
jne    1110 <init+0x10>
ret

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

LLVM IR (-O2):
define void @init(float* nocapture writeonly %0, float* nocapture writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %14, %3 ]
%5 = getelementptr inbounds float, float* %0, i64 %4
store float -1.000000e+00, float* %5
%6 = trunc i64 %4 to i32
%7 = sitofp i32 %6 to float
%8 = getelementptr inbounds float, float* %1, i64 %4
store float %7, float* %8
%9 = or i64 %4, 1
%10 = getelementptr inbounds float, float* %0, i64 %9
store float 1.000000e+00, float* %10
%11 = trunc i64 %9 to i32
%12 = sitofp i32 %11 to float
%13 = getelementptr inbounds float, float* %1, i64 %9
store float %12, float* %13
%14 = add nuw nsw i64 %4, 2
%15 = icmp eq i64 %14, 100000
br i1 %15, label %16, label %3
16: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SDL_DestroyWindow(void *);
void lSDL_Window_destroy(void *ptr) { SDL_DestroyWindow(ptr); }


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

x86 assembly (clang, -O2):
<lSDL_Window_destroy>:
jmp    1030 <SDL_DestroyWindow@plt>

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

LLVM IR (-O2):
define void @lSDL_Window_destroy(i8* %0) {
%2 = tail call i32 @SDL_DestroyWindow(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_src(char *);
void bitxor_handler(void) {
  write_src("{\n");
  write_src("imm_t b = POP();\n");
  write_src("imm_t a = POP();\n");
  write_src("PUSH(a^b);\n");
  write_src("}\n");
}


x86 assembly (clang, -O0):
<bitxor_handler>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <write_src@plt>
lea    0xedc(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee2(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee8(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee8(%rip),%rdi
call   1030 <write_src@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitxor_handler>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <write_src@plt>
lea    0xedf(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee5(%rip),%rdi
call   1030 <write_src@plt>
lea    0xeeb(%rip),%rdi
call   1030 <write_src@plt>
lea    0xeeb(%rip),%rdi
pop    %rax
jmp    1030 <write_src@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"{\0A\00"
@.str.1 = [18 x i8] c"imm_t b = POP();\0A\00"
@.str.2 = [18 x i8] c"imm_t a = POP();\0A\00"
@.str.3 = [12 x i8] c"PUSH(a^b);\0A\00"
@.str.4 = [3 x i8] c"}\0A\00"
define void @bitxor_handler() {
%1 = call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @write_src(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"{\0A\00"
@.str.1 = [18 x i8] c"imm_t b = POP();\0A\00"
@.str.2 = [18 x i8] c"imm_t a = POP();\0A\00"
@.str.3 = [12 x i8] c"PUSH(a^b);\0A\00"
@.str.4 = [3 x i8] c"}\0A\00"
define void @bitxor_handler() {
%1 = tail call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @write_src(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
ret void
}
/* Type definitions */
struct rlimit {
  int rlim_cur;
};

/* Variables and functions */
int /*<<< orphan*/ RLIMIT_CPU;
int /*<<< orphan*/ getrlimit(int /*<<< orphan*/, struct rlimit *);
int /*<<< orphan*/ printf(char *, unsigned int);
int /*<<< orphan*/ setrlimit(int /*<<< orphan*/, struct rlimit *);
int main() {
  struct rlimit rl;
  getrlimit(RLIMIT_CPU, &rl);
  printf("current cpu time %u\n", (unsigned int)rl.rlim_cur);
  rl.rlim_cur = 1;
  setrlimit(RLIMIT_CPU, &rl);
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1050 <getrlimit@plt>
mov    -0x8(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x8(%rbp)
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1040 <setrlimit@plt>
jmp    1179 <main+0x49>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2e9d(%rip),%r14
mov    (%r14),%edi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <getrlimit@plt>
mov    (%rsp),%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,(%rsp)
mov    (%r14),%edi
mov    %rbx,%rsi
call   1040 <setrlimit@plt>
nopw   0x0(%rax,%rax,1)
jmp    1170 <main+0x40>

LLVM IR (-O0):
%struct.rlimit = type { i32 }
@RLIMIT_CPU = global i32 0
@.str = [21 x i8] c"current cpu time %u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.rlimit
store i32 0, i32* %1
%3 = load i32, i32* @RLIMIT_CPU
%4 = call i32 @getrlimit(i32 %3, %struct.rlimit* %2)
%5 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %2, i32 0, i32 0
%6 = load i32, i32* %5
%7 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %2, i32 0, i32 0
store i32 1, i32* %8
%9 = load i32, i32* @RLIMIT_CPU
%10 = call i32 @setrlimit(i32 %9, %struct.rlimit* %2)
br label %11
11: ; preds = %0, %11
br label %11
}

LLVM IR (-O2):
%struct.rlimit = type { i32 }
@RLIMIT_CPU = global i32 0
@.str = [21 x i8] c"current cpu time %u\0A\00"
define i32 @main() {
%1 = alloca %struct.rlimit
%2 = bitcast %struct.rlimit* %1 to i8*
%3 = load i32, i32* @RLIMIT_CPU
%4 = call i32 @getrlimit(i32 %3, %struct.rlimit* %1)
%5 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %6)
store i32 1, i32* %5
%8 = load i32, i32* @RLIMIT_CPU
%9 = call i32 @setrlimit(i32 %8, %struct.rlimit* %1)
br label %10
10: ; preds = %10, %0
br label %10
}
unsigned xrop3_64_1_1(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;
  stk2 = S & stk3;
  stk1 = T & stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_64_1_1>:
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
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xrop3_64_1_1(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 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %6
%26 = load i32, i32* %10
%27 = and i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %7
%29 = load i32, i32* %9
%30 = and i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = load i32, i32* %6
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = load i32, i32* %7
%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
%42 = load i32, i32* %5
%43 = load i32, i32* %7
%44 = and i32 %42, %43
%45 = or i32 %41, %44
ret i32 %45
}

LLVM IR (-O2):
define i32 @xrop3_64_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = or i8 %1, %0
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
int PpapiPluginMain();
int main(void) { return PpapiPluginMain(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @PpapiPluginMain()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ arm_memio_ldm_usr(int /*<<< orphan*/);
int /*<<< orphan*/ arm_memio_mult_op();
void arm_ldm_usr() { arm_memio_ldm_usr(arm_memio_mult_op()); }


x86 assembly (clang, -O0):
<arm_ldm_usr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <arm_memio_mult_op@plt>
mov    %eax,%edi
call   1040 <arm_memio_ldm_usr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_ldm_usr>:
push   %rax
xor    %eax,%eax
call   1030 <arm_memio_mult_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <arm_memio_ldm_usr@plt>

LLVM IR (-O0):
define void @arm_ldm_usr() {
%1 = call i32 (...) @arm_memio_mult_op()
%2 = call i32 @arm_memio_ldm_usr(i32 %1)
ret void
}

LLVM IR (-O2):
define void @arm_ldm_usr() {
%1 = tail call i32 (...) @arm_memio_mult_op()
%2 = tail call i32 @arm_memio_ldm_usr(i32 %1)
ret void
}
void loadfifoPointer(double value, double *fifo, unsigned int lenlista) {
  static unsigned int pointer = 0;
  if (pointer == lenlista)
    pointer = 0;
  *(fifo + pointer) = value;
  pointer++;
}


x86 assembly (clang, -O0):
<loadfifoPointer>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    0x2f0e(%rip),%eax
cmp    -0x14(%rbp),%eax
jne    1129 <loadfifoPointer+0x29>
movl   $0x0,0x2efb(%rip)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    0x2eec(%rip),%ecx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x2ee1(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ed8(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<loadfifoPointer>:
mov    0x2f1e(%rip),%eax
xor    %ecx,%ecx
cmp    %esi,%eax
cmovne %eax,%ecx
movsd  %xmm0,(%rdi,%rcx,8)
add    $0x1,%ecx
mov    %ecx,0x2f09(%rip)
ret

LLVM IR (-O0):
@loadfifoPointer.pointer = internal global i32 0
define void @loadfifoPointer(double %0, double* %1, i32 %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca i32
store double %0, double* %4
store double* %1, double** %5
store i32 %2, i32* %6
%7 = load i32, i32* @loadfifoPointer.pointer
%8 = load i32, i32* %6
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %3
store i32 0, i32* @loadfifoPointer.pointer
br label %11
11: ; preds = %10, %3
%12 = load double, double* %4
%13 = load double*, double** %5
%14 = load i32, i32* @loadfifoPointer.pointer
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds double, double* %13, i64 %15
store double %12, double* %16
%17 = load i32, i32* @loadfifoPointer.pointer
%18 = add i32 %17, 1
store i32 %18, i32* @loadfifoPointer.pointer
ret void
}

LLVM IR (-O2):
@loadfifoPointer.pointer = internal unnamed_addr global i32 0
define void @loadfifoPointer(double %0, double* nocapture writeonly %1, i32 %2) {
%4 = load i32, i32* @loadfifoPointer.pointer
%5 = icmp eq i32 %4, %2
%6 = select i1 %5, i32 0, i32 %4
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds double, double* %1, i64 %7
store double %0, double* %8
%9 = add i32 %6, 1
store i32 %9, i32* @loadfifoPointer.pointer
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
void *realloc(void *, int);
int /*<<< orphan*/ stderr;
void *hnj_realloc(void *p, int size) {
  p = realloc(p, size);
  if (p == NULL) {
    fprintf(stderr, "can't allocate %d bytes\n", size);
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<hnj_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    117c <hnj_realloc+0x4c>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
lea    0xe93(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hnj_realloc>:
push   %rbx
mov    %esi,%ebx
call   1040 <realloc@plt>
test   %rax,%rax
je     113f <hnj_realloc+0xf>
pop    %rbx
ret
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"can't allocate %d bytes\0A\00"
define i8* @hnj_realloc(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 i8* @realloc(i8* %5, i32 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i32, i32* %4
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"can't allocate %d bytes\0A\00"
define i8* @hnj_realloc(i8* %0, i32 %1) {
%3 = tail call i8* @realloc(i8* %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %1)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i8* %3
}
void fcterr(int errno, char *par) {}


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

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

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

LLVM IR (-O2):
define void @fcterr(i32 %0, i8* nocapture %1) {
ret void
}
output_line(ptr) char ptr[];
{
  output_with_tab(ptr);
  newline();
}


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

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

LLVM IR (-O0):
define i32 @output_line(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @output_with_tab to i32 (i8*, ...)*)(i8* %4)
%6 = call i32 (...) @newline()
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @output_line(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @output_with_tab to i32 (i8*, ...)*)(i8* %0)
%3 = tail call i32 (...) @newline()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__2__GeneralIO__toggle();
void LedsP__Led2__toggle(void) { Msp430GpioC__2__GeneralIO__toggle(); }


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

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

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

LLVM IR (-O2):
define void @LedsP__Led2__toggle() {
%1 = tail call i32 (...) @Msp430GpioC__2__GeneralIO__toggle()
ret void
}
unsigned short unsignedshort_ignoring_unsignedlongint(unsigned short x,
                                                      unsigned long int y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedshort_ignoring_unsignedlongint>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @unsignedshort_ignoring_unsignedlongint(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define zeroext i16 @unsignedshort_ignoring_unsignedlongint(i16 returned zeroext %0, i64 %1) {
ret i16 %0
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ mgetline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ squeeze(char *, int);
int main(void) {
  char line[1000];
  int c;
  mgetline(line, 1000);
  putchar('#');
  c = getchar();
  squeeze(line, c);
  printf("%s", line);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1070 <mgetline@plt>
mov    $0x23,%edi
call   1040 <putchar@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    %eax,-0x3f4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    -0x3f4(%rbp),%esi
call   1030 <squeeze@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xe56(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x3f0,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1070 <mgetline@plt>
mov    $0x23,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <squeeze@plt>
lea    0xe76(%rip),%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = call i32 @mgetline(i8* %4, i32 1000)
%6 = call i32 @putchar(i8 signext 35)
%7 = call i32 (...) @getchar()
store i32 %7, i32* %3
%8 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%9 = load i32, i32* %3
%10 = call i32 @squeeze(i8* %8, i32 %9)
%11 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @mgetline(i8* %2, i32 1000)
%4 = call i32 @putchar(i8 signext 35)
%5 = call i32 (...) @getchar()
%6 = call i32 @squeeze(i8* %2, i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
int main(int argc, char **argv) {
  switch (argc) {
  case 1:
    return 1;
  case 2:
    return 2;
  case 3:
    __builtin_unreachable();
  case 4:
    __builtin_unreachable();
  default:
    return 5;
  }
  return 10;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x3,%eax
ja     1153 <main+0x53>
mov    -0x18(%rbp),%rax
lea    0xece(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    115a <main+0x5a>
movl   $0x2,-0x4(%rbp)
jmp    115a <main+0x5a>
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
cmp    $0x2,%edi
setne  %al
lea    (%rax,%rax,2),%eax
add    $0x2,%eax
cmp    $0x1,%edi
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
switch i32 %6, label %11 [
i32 1, label %7
i32 2, label %8
i32 3, label %9
i32 4, label %10
]
7: ; preds = %2
store i32 1, i32* %3
br label %12
8: ; preds = %2
store i32 2, i32* %3
br label %12
9: ; preds = %2
unreachable
10: ; preds = %2
unreachable
11: ; preds = %2
store i32 5, i32* %3
br label %12
12: ; preds = %11, %8, %7
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 2
%4 = select i1 %3, i32 2, i32 5
%5 = icmp eq i32 %0, 1
%6 = select i1 %5, i32 1, i32 %4
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(unsigned char *, int /*<<< orphan*/ *, int);
void writel(unsigned char *buf, size_t offset, uint32_t value) {
  value = htonl(value);
  memcpy(buf + offset, &value, sizeof(uint32_t));
}


x86 assembly (clang, -O0):
<writel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <htonl@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
add    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @writel(i8* %0, i64 %1, i32 %2) {
%4 = alloca i32
%5 = tail call i32 @htonl(i32 %2)
store i32 %5, i32* %4
%6 = getelementptr inbounds i8, i8* %0, i64 %1
%7 = call i32 @memcpy(i8* %6, i32* %4, i32 4)
ret void
}
int imax(int a, int b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<imax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <imax+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <imax+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imax>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @imax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
void malloc_perf(void) {
  struct timeval tv;
  for (int i = 0; i < 14; i++) {
  }
}


x86 assembly (clang, -O0):
<malloc_perf>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0xc(%rbp)
cmpl   $0xe,-0xc(%rbp)
jge    1128 <malloc_perf+0x28>
jmp    111a <malloc_perf+0x1a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110b <malloc_perf+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.timeval = type { i32 }
define void @malloc_perf() {
%1 = alloca %struct.timeval
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %7, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 14
br i1 %5, label %6, label %10
6: ; preds = %3
br label %7
7: ; preds = %6
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
br label %3
10: ; preds = %3
ret void
}

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