xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ mlVectorCopy(float *, float *);
int /*<<< orphan*/ mlVectorRotateTo(float *, float const *, float, float *);
void mlVectorRotate(float *a, const float *axis, float angle) {
  float result[3];
  mlVectorRotateTo(a, axis, angle, result);
  mlVectorCopy(result, a);
}


x86 assembly (clang, -O0):
<mlVectorRotate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movss  -0x14(%rbp),%xmm0
lea    -0x20(%rbp),%rdx
call   1040 <mlVectorRotateTo@plt>
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <mlVectorCopy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mlVectorRotate>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%r14
mov    %r14,%rdx
call   1040 <mlVectorRotateTo@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <mlVectorCopy@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @mlVectorRotate(float* %0, float* %1, float %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float
%7 = alloca [3 x float]
store float* %0, float** %4
store float* %1, float** %5
store float %2, float* %6
%8 = load float*, float** %4
%9 = load float*, float** %5
%10 = load float, float* %6
%11 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 0
%12 = call i32 @mlVectorRotateTo(float* %8, float* %9, float %10, float* %11)
%13 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 0
%14 = load float*, float** %4
%15 = call i32 @mlVectorCopy(float* %13, float* %14)
ret void
}

LLVM IR (-O2):
define void @mlVectorRotate(float* %0, float* %1, float %2) {
%4 = alloca [3 x float]
%5 = bitcast [3 x float]* %4 to i8*
%6 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 0, i64 0
%7 = call i32 @mlVectorRotateTo(float* %0, float* %1, float %2, float* %6)
%8 = call i32 @mlVectorCopy(float* %6, float* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int _start(int argc, char **argv) {
  char *message = "Hello, World!\n";
  write(1, message, 14);
  return 0;
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
mov    $0x1,%edi
mov    $0xe,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_start>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
mov    $0xe,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, World!\0A\00"
define i32 @_start(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = load i8*, i8** %5
%7 = call i32 @write(i32 1, i8* %6, i32 14)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Hello, World!\0A\00"
define i32 @_start(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 14)
ret i32 0
}
/* Variables and functions */
void *stub1(void *, char const *, size_t);
int emit(const char *s, size_t n, void *(*cons)(void *, const char *, size_t),
         void **parg) {
  if ((*parg = (*cons)(*parg, s, n)) == NULL)
    return (-1);
  else
    return 0;
}


x86 assembly (clang, -O0):
<emit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    (%rcx),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   *%rax
mov    -0x28(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
jne    114a <emit+0x4a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1151 <emit+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit>:
push   %rbx
mov    %rcx,%rbx
mov    %rdx,%rax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    (%rcx),%rdi
call   *%rax
mov    %rax,(%rbx)
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @emit(i8* %0, i64 %1, i8* (i8*, i8*, i64)* nocapture %2, i8** nocapture %3) {
%5 = load i8*, i8** %3
%6 = tail call i8* %2(i8* %5, i8* %0, i64 %1)
store i8* %6, i8** %3
%7 = icmp eq i8* %6, null
%8 = sext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ OutputClearCount(unsigned char);
int /*<<< orphan*/ OutputReset(unsigned char);
void ResetAllTachoCounts(unsigned char Outputs) {
  OutputReset(Outputs);
  OutputClearCount(Outputs);
}


x86 assembly (clang, -O0):
<ResetAllTachoCounts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1040 <OutputReset@plt>
movzbl -0x1(%rbp),%edi
call   1030 <OutputClearCount@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @ResetAllTachoCounts(i8 zeroext %0) {
%2 = tail call i32 @OutputReset(i8 zeroext %0)
%3 = tail call i32 @OutputClearCount(i8 zeroext %0)
ret void
}
/* Variables and functions */
int StatMomentFloat(float *, int, int, int);
double StatVarnFloat(float a[], int n, int s) {
  return StatMomentFloat(a, n, s, 2) / n;
}


x86 assembly (clang, -O0):
<StatVarnFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0x2,%ecx
call   1030 <StatMomentFloat@plt>
cltd
idivl  -0xc(%rbp)
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StatVarnFloat>:
push   %rbx
mov    %esi,%ebx
mov    $0x2,%ecx
call   1030 <StatMomentFloat@plt>
cltd
idiv   %ebx
cvtsi2sd %eax,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @StatVarnFloat(float* %0, i32 %1, i32 %2) {
%4 = alloca float*
%5 = alloca i32
%6 = alloca i32
store float* %0, float** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load float*, float** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @StatMomentFloat(float* %7, i32 %8, i32 %9, i32 2)
%11 = load i32, i32* %5
%12 = sdiv i32 %10, %11
%13 = sitofp i32 %12 to double
ret double %13
}

LLVM IR (-O2):
define double @StatVarnFloat(float* %0, i32 %1, i32 %2) {
%4 = tail call i32 @StatMomentFloat(float* %0, i32 %1, i32 %2, i32 2)
%5 = sdiv i32 %4, %1
%6 = sitofp i32 %5 to double
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ f1();
int /*<<< orphan*/ f2();
int main(int argc, char *argv[]) {
  f1();
  f2();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <f1@plt>
xor    %eax,%eax
call   1030 <f2@plt>
xor    %eax,%eax
pop    %rcx
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 = call i32 (...) @f1()
%7 = call i32 (...) @f2()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @f1()
%4 = tail call i32 (...) @f2()
ret i32 0
}
void copy_str1(char str_dest[], const char str_src[]) {
  for (int i = 0; (str_dest[i] = str_src[i]) != '\0'; ++i)
    ;
}


x86 assembly (clang, -O0):
<copy_str1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rdx
mov    %al,(%rcx,%rdx,1)
movsbl %al,%eax
cmp    $0x0,%eax
je     1148 <copy_str1+0x48>
jmp    113a <copy_str1+0x3a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <copy_str1+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_str1>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <copy_str1+0x10>
ret

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

LLVM IR (-O2):
define void @copy_str1(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %9, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %6, i8* %7
%8 = icmp eq i8 %6, 0
%9 = add nuw i64 %4, 1
br i1 %8, label %10, label %3
10: ; preds = %3
ret void
}
int main() {
  int a;
  int b;
  int c;
A:
  if (a && (b + a)) {
    c = -a;
  } else {
    b = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1131 <main+0x31>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
cmp    $0x0,%eax
je     1131 <main+0x31>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1138 <main+0x38>
movl   $0x0,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ x;
typedef int /*<<< orphan*/ uint32_t;
struct jit_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ emit_bytes(struct jit_state *, int /*<<< orphan*/ *, int);
void emit4(struct jit_state *state, uint32_t x) {
  emit_bytes(state, &x, sizeof(x));
}


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

x86 assembly (clang, -O2):
<emit4>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <emit_bytes@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.jit_state = type { i32 }
define void @emit4(%struct.jit_state* %0, i32 %1) {
%3 = alloca %struct.jit_state*
%4 = alloca i32
store %struct.jit_state* %0, %struct.jit_state** %3
store i32 %1, i32* %4
%5 = load %struct.jit_state*, %struct.jit_state** %3
%6 = call i32 @emit_bytes(%struct.jit_state* %5, i32* %4, i32 4)
ret void
}

LLVM IR (-O2):
%struct.jit_state = type { i32 }
define void @emit4(%struct.jit_state* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @emit_bytes(%struct.jit_state* %0, i32* %3, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_timespec_load() {
  printf("NOT IMPLEMENTED:"
         "pa_timespec_load"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"NOT IMPLEMENTED:pa_timespec_load\0A\00"
define i32 @pa_timespec_load() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_timespec_load\00"
define i32 @pa_timespec_load() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/
__softboundcets_propagate_metadata_shadow_stack_from(int, int /*<<< orphan*/);
char *strchr(char const *, int);
__attribute__((__weak__, __always___)) char *softboundcets_strchr(const char *s,
                                                                  int c) {
  char *ret_ptr = strchr(s, c);
  __softboundcets_propagate_metadata_shadow_stack_from(1, 0);
  return ret_ptr;
}


x86 assembly (clang, -O0):
<softboundcets_strchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <__softboundcets_propagate_metadata_shadow_stack_from@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundcets_strchr>:
push   %rbx
call   1030 <strchr@plt>
mov    %rax,%rbx
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <__softboundcets_propagate_metadata_shadow_stack_from@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define weak i8* @softboundcets_strchr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i8* @strchr(i8* %6, i32 %7)
store i8* %8, i8** %5
%9 = call i32 @__softboundcets_propagate_metadata_shadow_stack_from(i32 1, i32 0)
%10 = load i8*, i8** %5
ret i8* %10
}

LLVM IR (-O2):
define weak i8* @softboundcets_strchr(i8* %0, i32 %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 %1)
%4 = tail call i32 @__softboundcets_propagate_metadata_shadow_stack_from(i32 1, i32 0)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t ev3_color_sensor_get_color(int32_t port) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ev3_color_sensor_get_color(i32 %0) {
ret i32 0
}
int color_offset_f4(int x, int y) {
  return ((y << 10) + (((x << 10) * 157) / 52) - (12055 << 10)) >> 10;
}


x86 assembly (clang, -O0):
<color_offset_f4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xa,%eax
imul   $0x9d,%eax,%eax
mov    $0x34,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
sub    $0xbc5c00,%eax
sar    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<color_offset_f4>:
shl    $0xa,%esi
imul   $0x27400,%edi,%eax
cltq
imul   $0x4ec4ec4f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x24,%rax
add    %ecx,%eax
add    %esi,%eax
add    $0xff43a400,%eax
sar    $0xa,%eax
ret

LLVM IR (-O0):
define i32 @color_offset_f4(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 %5, 10
%7 = load i32, i32* %3
%8 = shl i32 %7, 10
%9 = mul nsw i32 %8, 157
%10 = sdiv i32 %9, 52
%11 = add nsw i32 %6, %10
%12 = sub nsw i32 %11, 12344320
%13 = ashr i32 %12, 10
ret i32 %13
}

LLVM IR (-O2):
define i32 @color_offset_f4(i32 %0, i32 %1) {
%3 = shl i32 %1, 10
%4 = mul i32 %0, 160768
%5 = sdiv i32 %4, 52
%6 = add nsw i32 %5, -12344320
%7 = add i32 %6, %3
%8 = ashr i32 %7, 10
ret i32 %8
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int random_standard_complex(double *re, double *im) {
  int *a, *b, fail;
  double c[2];
  fail = _ada_use_c2phc4c(280, a, b, c, 0);
  *re = c[0];
  *im = c[1];
  return fail;
}


x86 assembly (clang, -O0):
<random_standard_complex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    -0x40(%rbp),%rcx
mov    $0x118,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x24(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x38(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x24(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_standard_complex>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%rcx
mov    $0x118,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
movsd  (%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @random_standard_complex(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca [2 x double]
store double* %0, double** %3
store double* %1, double** %4
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 0
%12 = call i32 @_ada_use_c2phc4c(i32 280, i32* %9, i32* %10, double* %11, i32 0)
store i32 %12, i32* %7
%13 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 0
%14 = load double, double* %13
%15 = load double*, double** %3
store double %14, double* %15
%16 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 1
%17 = load double, double* %16
%18 = load double*, double** %4
store double %17, double* %18
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
define i32 @random_standard_complex(double* nocapture writeonly %0, double* nocapture writeonly %1) {
%3 = alloca [2 x double]
%4 = bitcast [2 x double]* %3 to i8*
%5 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 0
%6 = call i32 @_ada_use_c2phc4c(i32 280, i32* undef, i32* undef, double* %5, i32 0)
%7 = load double, double* %5
store double %7, double* %0
%8 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 1
%9 = load double, double* %8
store double %9, double* %1
ret i32 %6
}
/* Variables and functions */
int cgetc();
int cgetw(void) {
  int c = cgetc();
  return (c << 8) | cgetc();
}


x86 assembly (clang, -O0):
<cgetw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <cgetc@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <cgetc@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgetw>:
push   %rbx
xor    %eax,%eax
call   1030 <cgetc@plt>
mov    %eax,%ebx
shl    $0x8,%ebx
xor    %eax,%eax
call   1030 <cgetc@plt>
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cgetw() {
%1 = alloca i32
%2 = call i32 (...) @cgetc()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = shl i32 %3, 8
%5 = call i32 (...) @cgetc()
%6 = or i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @cgetw() {
%1 = tail call i32 (...) @cgetc()
%2 = shl i32 %1, 8
%3 = tail call i32 (...) @cgetc()
%4 = or i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int rand();
int rnd(int x) {
  if (x <= 1)
    return 0;
  return rand() % x;
}


x86 assembly (clang, -O0):
<rnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1131 <rnd+0x21>
movl   $0x0,-0x4(%rbp)
jmp    113f <rnd+0x2f>
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     1127 <rnd+0x17>
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rnd(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %11
7: ; preds = %1
%8 = call i32 (...) @rand()
%9 = load i32, i32* %3
%10 = srem i32 %8, %9
store i32 %10, i32* %2
br label %11
11: ; preds = %7, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @rnd(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, %0
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ i2cWrite(int, int);
void PCA9685Sleep() { i2cWrite(0x00, 0x11); }


x86 assembly (clang, -O0):
<PCA9685Sleep>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x11,%esi
call   1030 <i2cWrite@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PCA9685Sleep>:
xor    %edi,%edi
mov    $0x11,%esi
jmp    1030 <i2cWrite@plt>

LLVM IR (-O0):
define void @PCA9685Sleep() {
%1 = call i32 @i2cWrite(i32 0, i32 17)
ret void
}

LLVM IR (-O2):
define void @PCA9685Sleep() {
%1 = tail call i32 @i2cWrite(i32 0, i32 17)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void divistion(int x, int y) { printf("%i\n", (x / y)); }


x86 assembly (clang, -O0):
<divistion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%esi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<divistion>:
mov    %edi,%eax
cltd
idiv   %esi
lea    0xee4(%rip),%rdi
mov    %eax,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%i\0A\00"
define void @divistion(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 = sdiv i32 %5, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define void @divistion(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ newline();
int /*<<< orphan*/ output_string(char *);
int /*<<< orphan*/ output_with_tab(char *);
void gen_call(char *sname) {
  output_with_tab("jsr ");
  output_string(sname);
  newline();
}


x86 assembly (clang, -O0):
<gen_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1050 <output_with_tab@plt>
mov    -0x8(%rbp),%rdi
call   1040 <output_string@plt>
mov    $0x0,%al
call   1030 <newline@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_call>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1050 <output_with_tab@plt>
mov    %rbx,%rdi
call   1040 <output_string@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <newline@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"jsr \00"
define void @gen_call(i8* %0) {
%2 = tail call i32 @output_with_tab(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @output_string(i8* %0)
%4 = tail call i32 (...) @newline()
ret void
}
__attribute__((gnu_)) double carmen_fmax(double val1, double val2) {
  if (val2 > val1)
    return val2;
  return val1;
}


x86 assembly (clang, -O0):
<carmen_fmax>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <carmen_fmax+0x2d>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1137 <carmen_fmax+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<carmen_fmax>:
maxsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @carmen_fmax(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %5
%7 = load double, double* %4
%8 = fcmp ogt double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %5
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %4
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @carmen_fmax(double %0, double %1) {
%3 = fcmp ogt double %1, %0
%4 = select i1 %3, double %1, double %0
ret double %4
}
/* Variables and functions */
int c_fun();
int b_fun() { return c_fun(); }


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

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

LLVM IR (-O0):
define i32 @b_fun() {
%1 = call i32 (...) @c_fun()
ret i32 %1
}

LLVM IR (-O2):
define i32 @b_fun() {
%1 = tail call i32 (...) @c_fun()
ret i32 %1
}
/* Variables and functions */
int strcmp(char *, char *);
int bst_comp_str(void *data1, void *data2) {
  return strcmp((char *)data1, (char *)data2);
}


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

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

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

LLVM IR (-O2):
define i32 @bst_comp_str(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ dump(int);
int /*<<< orphan*/ printf(char *);
extern void trust_signature(int len) {
  printf("\t\tLevel - ");
  dump(1);
  printf("\n");
  printf("\t\tAmount - ");
  dump(1);
  printf("\n");
}


x86 assembly (clang, -O0):
<trust_signature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <dump@plt>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <dump@plt>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trust_signature>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <dump@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <dump@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"\09\09Level - \00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [12 x i8] c"\09\09Amount - \00"
define void @trust_signature(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @dump(i32 1)
%5 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @dump(i32 1)
%8 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\09\09Level - \00"
@.str.2 = [12 x i8] c"\09\09Amount - \00"
define void @trust_signature(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @dump(i32 1)
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @dump(i32 1)
%7 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printbinary(int code, int size) {
  int i;
  for (i = 0; i < size; i++) {
    printf("%d", code % 2);
    code /= 2;
  }
}


x86 assembly (clang, -O0):
<printbinary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1166 <printbinary+0x56>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1125 <printbinary+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printbinary>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
test   %esi,%esi
jle    114d <printbinary+0x3d>
mov    %edi,%esi
lea    0xedd(%rip),%r14
mov    %edi,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
shr    $0x1f,%ebp
add    %esi,%ebp
mov    %ebp,%eax
and    $0xfffffffe,%eax
sub    %eax,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
sar    %ebp
mov    %ebp,%esi
add    $0xffffffff,%ebx
jne    1130 <printbinary+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @printbinary(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ 0, %2 ]
%6 = phi i32 [ %9, %4 ], [ %0, %2 ]
%7 = srem i32 %6, 2
%8 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = sdiv i32 %6, 2
%10 = add nuw nsw i32 %5, 1
%11 = icmp eq i32 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpge_pd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d test_mm_cmpge_pd(__m128d __a, __m128d __b) {
  return _mm_cmpge_pd(__a, __b);
}


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

x86 assembly (clang, -O2):
<test_mm_cmpge_pd>:
jmp    1030 <_mm_cmpge_pd@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cmpge_pd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpge_pd(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
double get_rn_dbl_simple();
double fget_rn_dbl_sim(void) { return get_rn_dbl_simple(); }


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

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

LLVM IR (-O0):
define double @fget_rn_dbl_sim() {
%1 = call double (...) @get_rn_dbl_simple()
ret double %1
}

LLVM IR (-O2):
define double @fget_rn_dbl_sim() {
%1 = tail call double (...) @get_rn_dbl_simple()
ret double %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sequenze(char *, int /*<<< orphan*/, int);
int main() {
  char a[] = {'b', 'a', 'r', 'c', 'a', 'r'};
  printf("N° sequenze: %d", sequenze(a, 0, 5));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xa(%rbp),%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1040 <sequenze@plt>
mov    %eax,%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0x7261,0x4(%rsp)
movl   $0x63726162,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1040 <sequenze@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.a = [6 x i8] c"barcar"
@.str = [17 x i8] c"N\C2\B0 sequenze: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
store i32 0, i32* %1
%3 = bitcast [6 x i8]* %2 to i8*
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%5 = call i32 @sequenze(i8* %4, i32 0, i32 5)
%6 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [6 x i8] c"barcar"
@.str = [17 x i8] c"N\C2\B0 sequenze: %d\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 @sequenze(i8* %2, i32 0, i32 5)
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  for (int i = 0; i < 5; i++) {
    printf("Hola Munro\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    114a <main+0x3a>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [11 x i8] c"Hola Munro\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t bitfn_swap16(uint16_t a) { return (a << 8) | (a >> 8); }


x86 assembly (clang, -O0):
<bitfn_swap16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitfn_swap16>:
mov    %edi,%eax
shl    $0x8,%eax
sar    $0x8,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @bitfn_swap16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = load i32, i32* %2
%6 = ashr i32 %5, 8
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @bitfn_swap16(i32 %0) {
%2 = shl i32 %0, 8
%3 = ashr i32 %0, 8
%4 = or i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ log_f(char *);
void keyb_none_done(void) { log_f("keyb:none: keyb_none_done()\n"); }


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"keyb:none: keyb_none_done()\0A\00"
define void @keyb_none_done() {
%1 = call i32 @log_f(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"keyb:none: keyb_none_done()\0A\00"
define void @keyb_none_done() {
%1 = tail call i32 @log_f(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int rand();
int get_new_speed(int old_speed) {
  int new_speed = old_speed + (rand() % (3 * 2 + 1)) - 3;
  if (new_speed > 8) {
    return 8 - 1;
  }
  if (new_speed < -8) {
    return -8 + 1;
  }
  return new_speed;
}


x86 assembly (clang, -O0):
<get_new_speed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
add    %edx,%eax
sub    $0x3,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jle    1151 <get_new_speed+0x41>
movl   $0x7,-0x4(%rbp)
jmp    116d <get_new_speed+0x5d>
cmpl   $0xfffffff8,-0xc(%rbp)
jge    1167 <get_new_speed+0x57>
movl   $0xfffffff9,-0x4(%rbp)
jmp    116d <get_new_speed+0x5d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_new_speed>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0xffffffff92492493,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x2,%ecx
add    %edx,%ecx
lea    0x0(,%rcx,8),%edx
sub    %edx,%ecx
add    %eax,%ecx
lea    (%rbx,%rcx,1),%eax
add    $0xfffffffd,%eax
add    %ebx,%ecx
cmp    $0xfffffffb,%ecx
mov    $0xfffffff9,%edx
cmovge %eax,%edx
cmp    $0xc,%ecx
mov    $0x7,%eax
cmovl  %edx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @get_new_speed(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, 7
%4 = add nsw i32 %3, %0
%5 = add nsw i32 %4, -3
%6 = icmp sgt i32 %4, 11
%7 = icmp slt i32 %4, -5
%8 = select i1 %7, i32 -7, i32 %5
%9 = select i1 %6, i32 7, i32 %8
ret i32 %9
}
int strcasecmp(const char *s1, const char *s2) {
  return ({
    extern __typeof__(strcasecmp) module_libc_strcasecmp;
    &module_libc_strcasecmp;
  })(s1, s2);
}


x86 assembly (clang, -O0):
<strcasecmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec9(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcasecmp>:
jmp    1030 <module_libc_strcasecmp@plt>

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

LLVM IR (-O2):
define i32 @strcasecmp(i8* %0, i8* %1) {
%3 = tail call i32 @module_libc_strcasecmp(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void doubleout(double number, int mode) {
  double fabs(double);
  if (mode == 1) {
    if (fabs(number) < 100) {
      printf("  %19.16f", number);
    } else {
      printf("  %19g", number);
    }
  }
}


x86 assembly (clang, -O0):
<doubleout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1178 <doubleout+0x68>
movsd  -0x8(%rbp),%xmm1
movaps 0xeda(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xebe(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1162 <doubleout+0x52>
movsd  -0x8(%rbp),%xmm0
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
jmp    1173 <doubleout+0x63>
movsd  -0x8(%rbp),%xmm0
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
jmp    1178 <doubleout+0x68>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doubleout>:
cmp    $0x1,%edi
jne    1144 <doubleout+0x34>
movapd 0xee3(%rip),%xmm1
andpd  %xmm0,%xmm1
movsd  0xee7(%rip),%xmm2
ucomisd %xmm1,%xmm2
lea    0xee4(%rip),%rax
lea    0xee7(%rip),%rdi
cmova  %rax,%rdi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [10 x i8] c" %19.16f\00"
@.str.1 = [7 x i8] c" %19g\00"
define void @doubleout(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %18
7: ; preds = %2
%8 = load double, double* %3
%9 = call double @llvm.fabs.f64(double %8)
%10 = fcmp olt double %9, 1.000000e+02
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load double, double* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %12)
br label %17
14: ; preds = %7
%15 = load double, double* %3
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %15)
br label %17
17: ; preds = %14, %11
br label %18
18: ; preds = %17, %2
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c" %19.16f\00"
@.str.1 = [7 x i8] c" %19g\00"
define void @doubleout(double %0, i32 %1) {
%3 = icmp eq i32 %1, 1
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = tail call double @llvm.fabs.f64(double %0)
%6 = fcmp olt double %5, 1.000000e+02
%7 = select i1 %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%8 = tail call i32 @printf(i8* %7, double %0)
br label %9
9: ; preds = %4, %2
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISREG(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int stat(char *, struct stat *);
int isRegularFile(char *fn) {
  struct stat sbuf;
  int statrc, rv;
  statrc = stat(fn, &sbuf);
  if (statrc) {
    perror("WARNING: isRegularFile");
    rv = 0;
  } else {
    rv = S_ISREG(sbuf.st_mode);
  }
  return rv;
}


x86 assembly (clang, -O0):
<isRegularFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     116e <isRegularFile+0x3e>
lea    0xea3(%rip),%rdi
call   1050 <perror@plt>
movl   $0x0,-0x18(%rbp)
jmp    1179 <isRegularFile+0x49>
mov    -0x10(%rbp),%edi
call   1040 <S_ISREG@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isRegularFile>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %eax,%eax
jne    1146 <isRegularFile+0x16>
mov    (%rsp),%edi
pop    %rax
jmp    1040 <S_ISREG@plt>
lea    0xeb3(%rip),%rdi
call   1050 <perror@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [23 x i8] c"WARNING: isRegularFile\00"
define i32 @isRegularFile(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @stat(i8* %6, %struct.stat* %3)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %5
br label %16
12: ; preds = %1
%13 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%14 = load i32, i32* %13
%15 = call i32 @S_ISREG(i32 %14)
store i32 %15, i32* %5
br label %16
16: ; preds = %12, %10
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [23 x i8] c"WARNING: isRegularFile\00"
define i32 @isRegularFile(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %12
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%10 = load i32, i32* %9
%11 = tail call i32 @S_ISREG(i32 %10)
br label %12
12: ; preds = %8, %6
%13 = phi i32 [ 0, %6 ], [ %11, %8 ]
ret i32 %13
}
void gtk_menu_get_attach_widget() {}


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

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

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

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