xunge/DecIR huggingface dataset:
/* Variables and functions */
int strlen(char const *);
int wsh_strlen(const char *s) { return strlen(s); }


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

x86 assembly (clang, -O2):
<wsh_strlen>:
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i32 @wsh_strlen(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rol32(uint32_t word, uint32_t shift) {
  return (word << shift) | (word >> (32 - shift));
}


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

x86 assembly (clang, -O2):
<rol32>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rol32(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 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rol32(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
void sasl_mutex_free(void *mutex __attribute__((unused))) { return; }


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

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

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

LLVM IR (-O2):
define void @sasl_mutex_free(i8* nocapture %0) {
ret void
}
void foo_1_1_1_1_2_2_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_1_1_2_2_1_2_1() {
ret void
}
/* Variables and functions */
float powf(float, float);
float calc_dcyc(float sps, float note, float bend) {
  float freq = 440.0f * powf(2.0f, ((note + bend) - 69.0f) / 12.0f);
  return freq / sps;
}


x86 assembly (clang, -O0):
<calc_dcyc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
addss  -0xc(%rbp),%xmm1
movss  0xed3(%rip),%xmm0
subss  %xmm0,%xmm1
movss  0xec3(%rip),%xmm0
divss  %xmm0,%xmm1
movss  0xeb3(%rip),%xmm0
call   1030 <powf@plt>
movaps %xmm0,%xmm1
movss  0xe9f(%rip),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
divss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_dcyc>:
push   %rax
movss  %xmm0,0x4(%rsp)
addss  %xmm2,%xmm1
addss  0xedd(%rip),%xmm1
divss  0xed9(%rip),%xmm1
movaps %xmm1,%xmm0
call   1030 <exp2f@plt>
mulss  0xecd(%rip),%xmm0
divss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @calc_dcyc(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %5
%9 = load float, float* %6
%10 = fadd float %8, %9
%11 = fsub float %10, 6.900000e+01
%12 = fdiv float %11, 1.200000e+01
%13 = call float @powf(float 2.000000e+00, float %12)
%14 = fmul float 4.400000e+02, %13
store float %14, float* %7
%15 = load float, float* %7
%16 = load float, float* %4
%17 = fdiv float %15, %16
ret float %17
}

LLVM IR (-O2):
define float @calc_dcyc(float %0, float %1, float %2) {
%4 = fadd float %1, %2
%5 = fadd float %4, -6.900000e+01
%6 = fdiv float %5, 1.200000e+01
%7 = tail call float @exp2f(float %6)
%8 = fmul float %7, 4.400000e+02
%9 = fdiv float %8, %0
ret float %9
}
void g_node_unlink() {}


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

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

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

LLVM IR (-O2):
define void @g_node_unlink() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ADC_(int);
int /*<<< orphan*/ c64_memAbsoluteAddr();
void ADC_abs(void) {
  c64_memAbsoluteAddr();
  ADC_(1);
}


x86 assembly (clang, -O0):
<ADC_abs>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <c64_memAbsoluteAddr@plt>
mov    $0x1,%edi
call   1030 <ADC_@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADC_abs>:
push   %rax
xor    %eax,%eax
call   1040 <c64_memAbsoluteAddr@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <ADC_@plt>

LLVM IR (-O0):
define void @ADC_abs() {
%1 = call i32 (...) @c64_memAbsoluteAddr()
%2 = call i32 @ADC_(i32 1)
ret void
}

LLVM IR (-O2):
define void @ADC_abs() {
%1 = tail call i32 (...) @c64_memAbsoluteAddr()
%2 = tail call i32 @ADC_(i32 1)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint64_t;

/* Variables and functions */
void store64(uint8_t *x, uint64_t u) {
  for (size_t i = 0; i < 8; ++i) {
    x[i] = (uint8_t)(u >> 8 * i);
  }
}


x86 assembly (clang, -O0):
<store64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x8,-0x18(%rbp)
jae    114b <store64+0x4b>
mov    -0xc(%rbp),%eax
mov    -0x18(%rbp),%rcx
shl    $0x3,%rcx
sar    %cl,%eax
movslq %eax,%rdx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1113 <store64+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<store64>:
movslq %esi,%rax
mov    %rax,(%rdi)
mov    %eax,%ecx
sar    $0x8,%ecx
movslq %ecx,%rcx
mov    %rcx,0x8(%rdi)
mov    %eax,%ecx
sar    $0x10,%ecx
movslq %ecx,%rcx
mov    %rcx,0x10(%rdi)
sar    $0x18,%eax
cltq
mov    %rax,0x18(%rdi)
ret

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

LLVM IR (-O2):
define void @store64(i64* nocapture writeonly %0, i32 %1) {
%3 = sext i32 %1 to i64
store i64 %3, i64* %0
%4 = ashr i32 %1, 8
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i64, i64* %0, i64 1
store i64 %5, i64* %6
%7 = ashr i32 %1, 16
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i64, i64* %0, i64 2
store i64 %8, i64* %9
%10 = ashr i32 %1, 24
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i64, i64* %0, i64 3
store i64 %11, i64* %12
ret void
}
/* Variables and functions */
int f312(int *);
int f313(int *p) { return f312(p); }


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

x86 assembly (clang, -O2):
<f313>:
jmp    1030 <f312@plt>

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

LLVM IR (-O2):
define i32 @f313(i32* %0) {
%2 = tail call i32 @f312(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void putchars(char *start, int count) {
  int i = 0;
  while (i < count) {
    putchar(*(start + i));
    i++;
  }
}


x86 assembly (clang, -O0):
<putchars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <putchars+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <putchars+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchars>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1143 <putchars+0x33>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <putchars+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @putchars(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %10, %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 i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = call i32 @putchar(i8 signext %15)
%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):
define void @putchars(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @putchar(i8 signext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
unsigned int EOF;
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
unsigned int getchar();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdout;
int main(void) {
  unsigned int c;
  while (1) {
    c = getchar();
    if (c == EOF)
      break;
    printf("got byte: 0x%.2x\n", (int)c);
    fflush(stdout);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2e95(%rip),%rcx
cmp    (%rcx),%eax
jne    1160 <main+0x30>
jmp    1182 <main+0x52>
mov    -0x8(%rbp),%esi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2ea5(%rip),%r14
cmp    (%r14),%eax
je     117d <main+0x4d>
lea    0xeb1(%rip),%r15
mov    0x2e82(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
jne    1160 <main+0x30>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EOF = global i32 0
@.str = [18 x i8] c"got byte: 0x%.2x\0A\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %9
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* @EOF
%7 = icmp eq i32 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %3
br label %14
9: ; preds = %3
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* @stdout
%13 = call i32 @fflush(i32 %12)
br label %3
14: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [18 x i8] c"got byte: 0x%.2x\0A\00"
@stdout = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %12, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %9, %4 ], [ %1, %0 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @stdout
%8 = tail call i32 @fflush(i32 %7)
%9 = tail call i32 (...) @getchar()
%10 = load i32, i32* @EOF
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %4
12: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int x, y;
  x = 1;
  y = 2;
  {
    int tmp;
    tmp = x, x = y, y = tmp;
  };
  printf("x = %d, y = %d\n", x, y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"x = %d, y = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 2, i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ OS_TaskRegister();
void task_19(void) {
  OS_TaskRegister();
  while (1)
    ;
  return;
}


x86 assembly (clang, -O0):
<task_19>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <OS_TaskRegister@plt>
jmp    111b <task_19+0xb>

x86 assembly (clang, -O2):
<task_19>:
push   %rax
xor    %eax,%eax
call   1030 <OS_TaskRegister@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <task_19+0x10>

LLVM IR (-O0):
define void @task_19() {
%1 = call i32 (...) @OS_TaskRegister()
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define void @task_19() {
%1 = tail call i32 (...) @OS_TaskRegister()
br label %2
2: ; preds = %0, %2
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ portRead(char *, int, int);
scalar_t__ portWrite(char *);
char *strstr(char *, char *);
int get_TemmaGOTOstatus(char *local_buffer) {
  if (portWrite("s") < 0)
    return -1;
  portRead(local_buffer, -1, 1);
  if (strstr(local_buffer, "s") == local_buffer) {
    return 0;
  } else
    return -1;
}


x86 assembly (clang, -O0):
<get_TemmaGOTOstatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <portWrite@plt>
cmp    $0x0,%rax
jge    115e <get_TemmaGOTOstatus+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    119e <get_TemmaGOTOstatus+0x6e>
mov    -0x10(%rbp),%rdi
mov    $0xffffffff,%esi
mov    $0x1,%edx
call   1040 <portRead@plt>
mov    -0x10(%rbp),%rdi
lea    0xe84(%rip),%rsi
call   1050 <strstr@plt>
cmp    -0x10(%rbp),%rax
jne    1197 <get_TemmaGOTOstatus+0x67>
movl   $0x0,-0x4(%rbp)
jmp    119e <get_TemmaGOTOstatus+0x6e>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_TemmaGOTOstatus>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <portWrite@plt>
test   %rax,%rax
js     1153 <get_TemmaGOTOstatus+0x33>
mov    %rbx,%rdi
mov    $0xffffffff,%esi
mov    $0x1,%edx
call   1040 <portRead@plt>
xor    %eax,%eax
cmpb   $0x73,(%rbx)
setne  %al
neg    %eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"s\00"
define i32 @get_TemmaGOTOstatus(i8* %0) {
%2 = tail call i64 @portWrite(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp slt i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i32 @portRead(i8* %0, i32 -1, i32 1)
%6 = load i8, i8* %0
%7 = icmp ne i8 %6, 115
%8 = sext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ -1, %1 ], [ %8, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
int /*<<< orphan*/ VelocityDesiredHandle();
void VelocityDesiredLogging() { UAVObjLogging(VelocityDesiredHandle()); }


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

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

LLVM IR (-O0):
define void @VelocityDesiredLogging() {
%1 = call i32 (...) @VelocityDesiredHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @VelocityDesiredLogging() {
%1 = tail call i32 (...) @VelocityDesiredHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *);
FILE *abri_arquivo() {
  FILE *farq;
  if ((farq = fopen("entrada.txt", "r")) == NULL) {
    printf("Erro ao abrir o arquivo. ");
    exit(1);
  }
  return farq;
}


x86 assembly (clang, -O0):
<abri_arquivo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xec6(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    116f <abri_arquivo+0x3f>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abri_arquivo>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xecd(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     114b <abri_arquivo+0x1b>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"entrada.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [26 x i8] c"Erro ao abrir o arquivo. \00"
define i32* @abri_arquivo() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @exit(i32 1)
unreachable
7: ; preds = %0
%8 = load i32*, i32** %1
ret i32* %8
}

LLVM IR (-O2):
@.str = [12 x i8] c"entrada.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [26 x i8] c"Erro ao abrir o arquivo. \00"
define noalias i32* @abri_arquivo() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %0
ret i32* %1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int write(int, char *, int);
void writeToDevice(int fd, int reg, int val) {
  char buf[2];
  buf[0] = reg;
  buf[1] = val;
  if (write(fd, buf, 2) != 2) {
    fprintf(stderr, "Can't write to HMC5883L\n");
  }
}


x86 assembly (clang, -O0):
<writeToDevice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0xe(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0xd(%rbp)
mov    -0x4(%rbp),%edi
lea    -0xe(%rbp),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
cmp    $0x2,%eax
je     116c <writeToDevice+0x4c>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
lea    0xe99(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeToDevice>:
push   %rax
mov    %sil,0x6(%rsp)
mov    %dl,0x7(%rsp)
lea    0x6(%rsp),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
cmp    $0x2,%eax
jne    1140 <writeToDevice+0x20>
pop    %rax
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
pop    %rax
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"Can't write to HMC5883L\0A\00"
define void @writeToDevice(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [2 x i8]
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
store i8 %9, i8* %10
%11 = load i32, i32* %6
%12 = trunc i32 %11 to i8
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 1
store i8 %12, i8* %13
%14 = load i32, i32* %4
%15 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
%16 = call i32 @write(i32 %14, i8* %15, i32 2)
%17 = icmp ne i32 %16, 2
br i1 %17, label %18, label %21
18: ; preds = %3
%19 = load i32, i32* @stderr
%20 = call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %21
21: ; preds = %18, %3
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"Can't write to HMC5883L\0A\00"
define void @writeToDevice(i32 %0, i32 %1, i32 %2) {
%4 = alloca [2 x i8]
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%6 = trunc i32 %1 to i8
store i8 %6, i8* %5
%7 = trunc i32 %2 to i8
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 1
store i8 %7, i8* %8
%9 = call i32 @write(i32 %0, i8* %5, i32 2)
%10 = icmp eq i32 %9, 2
br i1 %10, label %14, label %11
11: ; preds = %3
%12 = load i32, i32* @stderr
%13 = tail call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %11, %3
ret void
}
OP(dd, d0) {
  illegal_1();
  op_d0();
}


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_d0()
ret i32 undef
}
/* Type definitions */
struct section_list {
  int dummy;
};
struct genlist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_pop_front(struct genlist *);
void section_list_pop_front(struct section_list *tthis) {
  genlist_pop_front((struct genlist *)tthis);
}


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

x86 assembly (clang, -O2):
<section_list_pop_front>:
jmp    1030 <genlist_pop_front@plt>

LLVM IR (-O0):
%struct.section_list = type { i32 }
%struct.genlist = type { i32 }
define void @section_list_pop_front(%struct.section_list* %0) {
%2 = alloca %struct.section_list*
store %struct.section_list* %0, %struct.section_list** %2
%3 = load %struct.section_list*, %struct.section_list** %2
%4 = bitcast %struct.section_list* %3 to %struct.genlist*
%5 = call i32 @genlist_pop_front(%struct.genlist* %4)
ret void
}

LLVM IR (-O2):
%struct.section_list = type { i32 }
%struct.genlist = type { i32 }
define void @section_list_pop_front(%struct.section_list* %0) {
%2 = bitcast %struct.section_list* %0 to %struct.genlist*
%3 = tail call i32 @genlist_pop_front(%struct.genlist* %2)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int numbtrop_quaddobl_size(int *nbt) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc(722, nbt, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<numbtrop_quaddobl_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x2d2,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numbtrop_quaddobl_size>:
mov    %rdi,%rsi
mov    $0x2d2,%edi
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @numbtrop_quaddobl_size(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc(i32 722, i32* %0, i32* undef, double* undef)
ret i32 %2
}
/* Type definitions */
struct pt_regs {
  int dummy;
};

/* Variables and functions */
struct pt_regs *current_frame();
__attribute__((const)) struct pt_regs *get_irq_regs(void) {
  return current_frame();
}


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

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

LLVM IR (-O0):
%struct.pt_regs = type { i32 }
define %struct.pt_regs* @get_irq_regs() {
%1 = call %struct.pt_regs* (...) @current_frame()
ret %struct.pt_regs* %1
}

LLVM IR (-O2):
%struct.pt_regs = type { i32 }
define %struct.pt_regs* @get_irq_regs() {
%1 = tail call %struct.pt_regs* (...) @current_frame()
ret %struct.pt_regs* %1
}
int check_zero(char num[], int len) {
  int i = 0;
  while (i < len) {
    if (num[i] != '0')
      return i;
    i++;
  }
  return -1;
}


x86 assembly (clang, -O0):
<check_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    114c <check_zero+0x4c>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
je     113e <check_zero+0x3e>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <check_zero+0x53>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <check_zero+0x12>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_zero>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111f <check_zero+0x1f>
mov    %esi,%edx
xor    %ecx,%ecx
nopl   (%rax)
cmpb   $0x30,(%rdi,%rcx,1)
jne    1120 <check_zero+0x20>
add    $0x1,%rcx
cmp    %rcx,%rdx
jne    1110 <check_zero+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @check_zero(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %11
%7 = phi i64 [ 0, %4 ], [ %12, %11 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 48
br i1 %10, label %11, label %14
11: ; preds = %6
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %16, label %6
14: ; preds = %6
%15 = trunc i64 %7 to i32
br label %16
16: ; preds = %11, %14, %2
%17 = phi i32 [ -1, %2 ], [ %15, %14 ], [ -1, %11 ]
ret i32 %17
}
void ff_hevc_put_hevc_epel_hv24_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_hv24_8_sse4() {
ret void
}
int test_002(int a, int c, int b, int d) { return a + b + c + (d & 1); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
and    $0x1,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
and    $0x1,%ecx
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_002(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %6
%13 = add nsw i32 %11, %12
%14 = load i32, i32* %8
%15 = and i32 %14, 1
%16 = add nsw i32 %13, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @test_002(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = and i32 %3, 1
%6 = add i32 %1, %0
%7 = add i32 %6, %2
%8 = add i32 %7, %5
ret i32 %8
}
/* Variables and functions */
int inbyte(int);
int is_empty() { return inbyte(0x3f8 + 5) & 0x20; }


x86 assembly (clang, -O0):
<is_empty>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3fd,%edi
call   1030 <inbyte@plt>
and    $0x20,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_empty>:
push   %rax
mov    $0x3fd,%edi
call   1030 <inbyte@plt>
and    $0x20,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_empty() {
%1 = call i32 @inbyte(i32 1021)
%2 = and i32 %1, 32
ret i32 %2
}

LLVM IR (-O2):
define i32 @is_empty() {
%1 = tail call i32 @inbyte(i32 1021)
%2 = and i32 %1, 32
ret i32 %2
}
int eofread(void *cookie, char *buf, int len) { return (0); }


x86 assembly (clang, -O0):
<eofread>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @eofread(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @eofread(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
void rs690_before_pci_init(void) {}


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

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

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

LLVM IR (-O2):
define void @rs690_before_pci_init() {
ret void
}
int float_is_lass_than(float f1, float f2) {
  return ((int)(f1 * 100000)) < ((int)(f2 * 100000));
}


x86 assembly (clang, -O0):
<float_is_lass_than>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  0xeea(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%eax
movss  0xed9(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
cvttss2si %xmm0,%ecx
cmp    %ecx,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_is_lass_than>:
unpcklps %xmm1,%xmm0
mulps  0xef6(%rip),%xmm0
cvttps2dq %xmm0,%xmm0
pshufd $0x55,%xmm0,%xmm1
pcmpgtd %xmm0,%xmm1
movd   %xmm1,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @float_is_lass_than(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = fmul float %5, 1.000000e+05
%7 = fptosi float %6 to i32
%8 = load float, float* %4
%9 = fmul float %8, 1.000000e+05
%10 = fptosi float %9 to i32
%11 = icmp slt i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @float_is_lass_than(float %0, float %1) {
%3 = insertelement <2 x float> poison, float %0, i64 0
%4 = insertelement <2 x float> %3, float %1, i64 1
%5 = fmul <2 x float> %4, <float 1.000000e+05, float 1.000000e+05>
%6 = fptosi <2 x float> %5 to <2 x i32>
%7 = shufflevector <2 x i32> %6, <2 x i32> poison, <2 x i32> <i32 1, i32 undef>
%8 = icmp sgt <2 x i32> %7, %6
%9 = extractelement <2 x i1> %8, i64 0
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ TIOCSCTTY;
int /*<<< orphan*/ _PATH_BSHELL;
int execl(int /*<<< orphan*/, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ ioctl(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ setenv(char *, char *, int);
int /*<<< orphan*/ setsid();
int sh(void) {
  setsid();
  ioctl(STDIN_FILENO, TIOCSCTTY, 1);
  setenv("PS1", "# ", 1);
  return execl(_PATH_BSHELL, "-sh", NULL);
}


x86 assembly (clang, -O0):
<sh>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <setsid@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    0x2e7d(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%edx
call   1040 <ioctl@plt>
lea    0xe92(%rip),%rdi
lea    0xe8f(%rip),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
lea    0xe78(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1060 <execl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sh>:
push   %rax
xor    %eax,%eax
call   1050 <setsid@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
mov    0x2e80(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%edx
call   1040 <ioctl@plt>
lea    0xe95(%rip),%rdi
lea    0xe92(%rip),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
lea    0xe7b(%rip),%rsi
xor    %edx,%edx
pop    %rax
jmp    1060 <execl@plt>

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
@TIOCSCTTY = global i32 0
@.str = [4 x i8] c"PS1\00"
@.str.1 = [3 x i8] c"# \00"
@_PATH_BSHELL = global i32 0
@.str.2 = [4 x i8] c"-sh\00"
define i32 @sh() {
%1 = call i32 (...) @setsid()
%2 = load i32, i32* @STDIN_FILENO
%3 = load i32, i32* @TIOCSCTTY
%4 = call i32 @ioctl(i32 %2, i32 %3, i32 1)
%5 = call i32 @setenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 1)
%6 = load i32, i32* @_PATH_BSHELL
%7 = call i32 @execl(i32 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32* null)
ret i32 %7
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
@TIOCSCTTY = global i32 0
@.str = [4 x i8] c"PS1\00"
@.str.1 = [3 x i8] c"# \00"
@_PATH_BSHELL = global i32 0
@.str.2 = [4 x i8] c"-sh\00"
define i32 @sh() {
%1 = tail call i32 (...) @setsid()
%2 = load i32, i32* @STDIN_FILENO
%3 = load i32, i32* @TIOCSCTTY
%4 = tail call i32 @ioctl(i32 %2, i32 %3, i32 1)
%5 = tail call i32 @setenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 1)
%6 = load i32, i32* @_PATH_BSHELL
%7 = tail call i32 @execl(i32 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32* null)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ config_save(char *);
void config_save_global() { config_save("mooboy.conf"); }


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"mooboy.conf\00"
define void @config_save_global() {
%1 = tail call i32 @config_save(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
int numcmp(const void *a, const void *b) { return *((int *)a) - *((int *)b); }


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

x86 assembly (clang, -O2):
<numcmp>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @numcmp(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @numcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ dpush(int /*<<< orphan*/);
int /*<<< orphan*/ next_object();
void primitive_next_object_impl(void) { dpush(next_object()); }


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

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

LLVM IR (-O0):
define void @primitive_next_object_impl() {
%1 = call i32 (...) @next_object()
%2 = call i32 @dpush(i32 %1)
ret void
}

LLVM IR (-O2):
define void @primitive_next_object_impl() {
%1 = tail call i32 (...) @next_object()
%2 = tail call i32 @dpush(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
char scaninput(char *procode) {
  printf("Enter Product Code or q: ");
  fgets(procode, 100, stdin);
}


x86 assembly (clang, -O0):
<scaninput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    0x2ea5(%rip),%rax
mov    (%rax),%edx
mov    $0x64,%esi
call   1040 <fgets@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scaninput>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0x64,%esi
pop    %rbx
jmp    1040 <fgets@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Enter Product Code or q: \00"
@stdin = global i32 0
define signext i8 @scaninput(i8* %0) {
%2 = alloca i8
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %3
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %5, i32 100, i32 %6)
%8 = load i8, i8* %2
ret i8 %8
}

LLVM IR (-O2):
@.str = [26 x i8] c"Enter Product Code or q: \00"
@stdin = global i32 0
define signext i8 @scaninput(i8* %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdin
%4 = tail call i32 @fgets(i8* %0, i32 100, i32 %3)
ret i8 undef
}
error(s, t) char *s, *t;
{
  note(s, t);
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <note@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
xor    %eax,%eax
call   1030 <note@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @error(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 (i8*, i8*, ...) bitcast (i32 (...)* @note to i32 (i8*, i8*, ...)*)(i8* %5, i8* %6)
unreachable
}

LLVM IR (-O2):
define i32 @error(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @note to i32 (i8*, i8*, ...)*)(i8* %0, i8* %1)
tail call void @exit(i32 1)
unreachable
}
void PrintFactSlotLength(void *theEnv, const char *logicalName,
                         void *theValue) {}


x86 assembly (clang, -O0):
<PrintFactSlotLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @PrintFactSlotLength(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @PrintFactSlotLength(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
void rescale(uint16_t *rgbwVal, uint16_t *outputVal) {
  for (int i = 0; i < 4; i++) {
    outputVal[i] = rgbwVal[i] / 4;
  }
}


x86 assembly (clang, -O0):
<rescale>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    114b <rescale+0x4b>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <rescale+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rescale>:
mov    (%rdi),%eax
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
sar    $0x2,%ecx
mov    %ecx,(%rsi)
mov    0x4(%rdi),%eax
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
sar    $0x2,%ecx
mov    %ecx,0x4(%rsi)
mov    0x8(%rdi),%eax
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
sar    $0x2,%ecx
mov    %ecx,0x8(%rsi)
mov    0xc(%rdi),%eax
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
sar    $0x2,%ecx
mov    %ecx,0xc(%rsi)
ret

LLVM IR (-O0):
define void @rescale(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 = %20, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 4
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load i32*, i32** %3
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
%14 = load i32, i32* %13
%15 = sdiv i32 %14, 4
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
store i32 %15, i32* %19
br label %20
20: ; preds = %9
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %6
23: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @rescale(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = sdiv i32 %3, 4
store i32 %4, i32* %1
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = sdiv i32 %6, 4
%8 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %7, i32* %8
%9 = getelementptr inbounds i32, i32* %0, i64 2
%10 = load i32, i32* %9
%11 = sdiv i32 %10, 4
%12 = getelementptr inbounds i32, i32* %1, i64 2
store i32 %11, i32* %12
%13 = getelementptr inbounds i32, i32* %0, i64 3
%14 = load i32, i32* %13
%15 = sdiv i32 %14, 4
%16 = getelementptr inbounds i32, i32* %1, i64 3
store i32 %15, i32* %16
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ sleep(int);
int main() {
  int i;
  char *array;
  array = malloc(1024 * 1024 * 256);
  for (i = 0; i < 1024 * 1024 * 256; i += 4096) {
    array[i] = 'c';
    sleep(1);
  }
  sleep(100000);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x10000000,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x10000000,-0x8(%rbp)
jge    1177 <main+0x57>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movb   $0x63,(%rax,%rcx,1)
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    -0x8(%rbp),%eax
add    $0x1000,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <main+0x24>
mov    $0x186a0,%edi
call   1040 <sleep@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xfffff000,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <sleep@plt>
add    $0x1000,%ebx
cmp    $0xffff000,%ebx
jb     1120 <main+0x10>
mov    $0x186a0,%edi
call   1030 <sleep@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @sleep(i32 1)
%4 = add nuw nsw i32 %2, 4096
%5 = icmp ult i32 %2, 268431360
br i1 %5, label %1, label %6
6: ; preds = %1
%7 = tail call i32 @sleep(i32 100000)
ret i32 0
}
int test_imm_B4uint8_mem(unsigned char *val) {
  return ((*val) & (-0xB4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B4uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xffffff4c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B4uint8_mem>:
testb  $0x4c,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B4uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 76
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}