#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int asdfasdf(int, int);
int /*<<< orphan*/ putchar(char);
char toupper(char);
uint64_t qwerqwer(uint64_t x) {
  int i = x;
  int y = i * x + 4;
  char str[] = "some STRING";
  volatile float result = x + y;
  while (str[i + x]) {
    putchar(toupper(str[y]));
    result += x + 4;
    i++;
  }
  y = asdfasdf((int)result, i);
  putchar('\n');
  return result * x + (4 * i * y);
}


x86 assembly (clang, -O0):
<qwerqwer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x4(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    0xeab(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xea9(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
cltq
cmpb   $0x0,-0x18(%rbp,%rax,1)
je     11c0 <qwerqwer+0x90>
movslq -0xc(%rbp),%rax
movsbl -0x18(%rbp,%rax,1),%edi
call   1040 <toupper@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x4,%eax
cvtsi2ss %eax,%xmm1
movss  -0x1c(%rbp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1171 <qwerqwer+0x41>
movss  -0x1c(%rbp),%xmm0
cvttss2si %xmm0,%edi
mov    -0x8(%rbp),%esi
call   1050 <asdfasdf@plt>
mov    %eax,-0xc(%rbp)
mov    $0xa,%edi
call   1030 <putchar@plt>
movss  -0x1c(%rbp),%xmm0
cvtsi2ssl -0x4(%rbp),%xmm2
mov    -0x8(%rbp),%eax
shl    $0x2,%eax
imul   -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qwerqwer>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edi,%r14d
mov    %edi,%eax
imul   %eax,%eax
lea    0x4(%rax),%rcx
add    %edi,%ecx
cvtsi2ss %ecx,%xmm0
movss  %xmm0,0x8(%rsp)
lea    0xea9(%rip),%rcx
lea    0x4(%r14),%edx
xorps  %xmm0,%xmm0
cvtsi2ss %edx,%xmm0
movss  %xmm0,0xc(%rsp)
mov    $0xb,%ebx
sub    %r14d,%ebx
sub    %r14d,%ebx
movsbl 0x4(%rax,%rcx,1),%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1040 <toupper@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
movss  0x8(%rsp),%xmm0
addss  0xc(%rsp),%xmm0
movss  %xmm0,0x8(%rsp)
add    $0xffffffff,%ebx
jne    1180 <qwerqwer+0x50>
mov    $0xb,%ebp
sub    %r14d,%ebp
cvttss2si 0x8(%rsp),%edi
mov    %ebp,%esi
call   1050 <asdfasdf@plt>
mov    %eax,%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %r14d,%xmm0
imul   %ebp,%ebx
shl    $0x2,%ebx
cvtsi2ss %ebx,%xmm1
mulss  0x8(%rsp),%xmm0
addss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@__const.qwerqwer.str = [12 x i8] c"some STRING\00"
define i32 @qwerqwer(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [12 x i8]
%6 = alloca float
store i32 %0, i32* %2
%7 = load i32, i32* %2
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = mul nsw i32 %8, %9
%11 = add nsw i32 %10, 4
store i32 %11, i32* %4
%12 = bitcast [12 x i8]* %5 to i8*
%13 = load i32, i32* %2
%14 = load i32, i32* %4
%15 = add nsw i32 %13, %14
%16 = sitofp i32 %15 to float
store volatile float %16, float* %6
br label %17
17: ; preds = %25, %1
%18 = load i32, i32* %3
%19 = load i32, i32* %2
%20 = add nsw i32 %18, %19
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [12 x i8], [12 x i8]* %5, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = icmp ne i8 %23, 0
br i1 %24, label %25, label %39
25: ; preds = %17
%26 = load i32, i32* %4
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [12 x i8], [12 x i8]* %5, i64 0, i64 %27
%29 = load i8, i8* %28
%30 = call signext i8 @toupper(i8 signext %29)
%31 = call i32 @putchar(i8 signext %30)
%32 = load i32, i32* %2
%33 = add nsw i32 %32, 4
%34 = sitofp i32 %33 to float
%35 = load volatile float, float* %6
%36 = fadd float %35, %34
store volatile float %36, float* %6
%37 = load i32, i32* %3
%38 = add nsw i32 %37, 1
store i32 %38, i32* %3
br label %17
39: ; preds = %17
%40 = load volatile float, float* %6
%41 = fptosi float %40 to i32
%42 = load i32, i32* %3
%43 = call i32 @asdfasdf(i32 %41, i32 %42)
store i32 %43, i32* %4
%44 = call i32 @putchar(i8 signext 10)
%45 = load volatile float, float* %6
%46 = load i32, i32* %2
%47 = sitofp i32 %46 to float
%48 = load i32, i32* %3
%49 = mul nsw i32 4, %48
%50 = load i32, i32* %4
%51 = mul nsw i32 %49, %50
%52 = sitofp i32 %51 to float
%53 = call float @llvm.fmuladd.f32(float %45, float %47, float %52)
%54 = fptosi float %53 to i32
ret i32 %54
}

LLVM IR (-O2):
@__const.qwerqwer.str = [12 x i8] c"some STRING\00"
define i32 @qwerqwer(i32 %0) {
%2 = alloca float
%3 = mul nsw i32 %0, %0
%4 = add nuw nsw i32 %3, 4
%5 = bitcast float* %2 to i8*
%6 = add nsw i32 %4, %0
%7 = sitofp i32 %6 to float
store volatile float %7, float* %2
%8 = zext i32 %4 to i64
%9 = getelementptr inbounds [12 x i8], [12 x i8]* @__const.qwerqwer.str, i64 0, i64 %8
%10 = load i8, i8* %9
%11 = add nsw i32 %0, 4
%12 = sitofp i32 %11 to float
br label %13
13: ; preds = %1, %13
%14 = phi i32 [ %0, %1 ], [ %19, %13 ]
%15 = tail call signext i8 @toupper(i8 signext %10)
%16 = tail call i32 @putchar(i8 signext %15)
%17 = load volatile float, float* %2
%18 = fadd float %17, %12
store volatile float %18, float* %2
%19 = add nsw i32 %14, 1
%20 = add nsw i32 %19, %0
%21 = icmp eq i32 %20, 11
br i1 %21, label %22, label %13
22: ; preds = %13
%23 = sub i32 11, %0
%24 = load volatile float, float* %2
%25 = fptosi float %24 to i32
%26 = tail call i32 @asdfasdf(i32 %25, i32 %23)
%27 = tail call i32 @putchar(i8 signext 10)
%28 = load volatile float, float* %2
%29 = sitofp i32 %0 to float
%30 = shl nsw i32 %23, 2
%31 = mul nsw i32 %30, %26
%32 = sitofp i32 %31 to float
%33 = tail call float @llvm.fmuladd.f32(float %28, float %29, float %32)
%34 = fptosi float %33 to i32
ret i32 %34
}