#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 */

/* Variables and functions */
float calldoupper(float, char, float, int, int, char *, ...);
int dolower(float, float);
char doupper(int, int);
int /*<<< orphan*/ printf(char *, float);
void calldolower() {
  int y = doupper(7, 323);
  float x = calldoupper(doupper(7, 34), doupper(7, 39238), 7.5f, 3, 2,
                        "asdfasdf", &y, 'a');
  doupper(dolower(x + y, calldoupper(x, 'c', x * 0.03f, 0xffffffff, 234, "asdf",
                                     &x, 'e')),
          3);
  printf("Doing things %d", y);
  printf("Other things %f", x);
}


x86 assembly (clang, -O0):
<calldolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x7,%edi
mov    %edi,-0x14(%rbp)
mov    $0x143,%esi
call   1060 <doupper@plt>
mov    -0x14(%rbp),%edi
movsbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    $0x22,%esi
call   1060 <doupper@plt>
movsbl %al,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
mov    $0x7,%edi
mov    $0x9946,%esi
call   1060 <doupper@plt>
movss  -0x10(%rbp),%xmm0
movss  0xe6f(%rip),%xmm1
mov    $0x3,%esi
mov    $0x2,%edx
lea    0xe62(%rip),%rcx
lea    -0x4(%rbp),%r8
mov    $0x61,%r9d
movsbl %al,%edi
mov    $0x2,%al
call   1050 <calldoupper@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtsi2ssl -0x4(%rbp),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xe21(%rip),%xmm1
mulss  -0x8(%rbp),%xmm1
mov    $0x63,%edi
mov    $0xffffffff,%esi
mov    $0xea,%edx
lea    0xe12(%rip),%rcx
lea    -0x8(%rbp),%r8
mov    $0x65,%r9d
mov    $0x2,%al
call   1050 <calldoupper@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
call   1030 <dolower@plt>
mov    %eax,%edi
mov    $0x3,%esi
call   1060 <doupper@plt>
cvtsi2ssl -0x4(%rbp),%xmm0
lea    0xde1(%rip),%rdi
call   1040 <printf@plt>
movss  -0x8(%rbp),%xmm0
lea    0xde0(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calldolower>:
sub    $0x18,%rsp
mov    $0x7,%edi
mov    $0x143,%esi
call   1060 <doupper@plt>
movsbl %al,%eax
mov    %eax,0x10(%rsp)
mov    $0x7,%edi
mov    $0x22,%esi
call   1060 <doupper@plt>
movsbl %al,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,0xc(%rsp)
mov    $0x7,%edi
mov    $0x9946,%esi
call   1060 <doupper@plt>
movsbl %al,%edi
lea    0xe79(%rip),%rcx
movss  0xe69(%rip),%xmm1
lea    0x10(%rsp),%r8
movss  0xc(%rsp),%xmm0
mov    $0x3,%esi
mov    $0x2,%edx
mov    $0x61,%r9d
mov    $0x2,%al
call   1050 <calldoupper@plt>
xorps  %xmm1,%xmm1
cvtsi2ssl 0x10(%rsp),%xmm1
movss  %xmm0,0x14(%rsp)
addss  %xmm0,%xmm1
movss  %xmm1,0xc(%rsp)
movss  0xe2a(%rip),%xmm1
mulss  %xmm0,%xmm1
lea    0xe27(%rip),%rcx
lea    0x14(%rsp),%r8
mov    $0x63,%edi
mov    $0xffffffff,%esi
mov    $0xea,%edx
mov    $0x65,%r9d
mov    $0x2,%al
call   1050 <calldoupper@plt>
movaps %xmm0,%xmm1
movss  0xc(%rsp),%xmm0
call   1030 <dolower@plt>
mov    %eax,%edi
mov    $0x3,%esi
call   1060 <doupper@plt>
xorps  %xmm0,%xmm0
cvtsi2ssl 0x10(%rsp),%xmm0
lea    0xde1(%rip),%rdi
call   1040 <printf@plt>
movss  0x14(%rsp),%xmm0
lea    0xddf(%rip),%rdi
call   1040 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"asdfasdf\00"
@.str.1 = [5 x i8] c"asdf\00"
@.str.2 = [16 x i8] c"Doing things %d\00"
@.str.3 = [16 x i8] c"Other things %f\00"
define void @calldolower() {
%1 = alloca i32
%2 = alloca float
%3 = call signext i8 @doupper(i32 7, i32 323)
%4 = sext i8 %3 to i32
store i32 %4, i32* %1
%5 = call signext i8 @doupper(i32 7, i32 34)
%6 = sitofp i8 %5 to float
%7 = call signext i8 @doupper(i32 7, i32 39238)
%8 = call float (float, i8, float, i32, i32, i8*, ...) @calldoupper(float %6, i8 signext %7, float 7.500000e+00, i32 3, i32 2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32 97)
store float %8, float* %2
%9 = load float, float* %2
%10 = load i32, i32* %1
%11 = sitofp i32 %10 to float
%12 = fadd float %9, %11
%13 = load float, float* %2
%14 = load float, float* %2
%15 = fmul float %14, 0x3F9EB851E0000000
%16 = call float (float, i8, float, i32, i32, i8*, ...) @calldoupper(float %13, i8 signext 99, float %15, i32 -1, i32 234, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), float* %2, i32 101)
%17 = call i32 @dolower(float %12, float %16)
%18 = call signext i8 @doupper(i32 %17, i32 3)
%19 = load i32, i32* %1
%20 = sitofp i32 %19 to float
%21 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), float %20)
%22 = load float, float* %2
%23 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), float %22)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"asdfasdf\00"
@.str.1 = [5 x i8] c"asdf\00"
@.str.2 = [16 x i8] c"Doing things %d\00"
@.str.3 = [16 x i8] c"Other things %f\00"
define void @calldolower() {
%1 = alloca i32
%2 = alloca float
%3 = bitcast i32* %1 to i8*
%4 = tail call signext i8 @doupper(i32 7, i32 323)
%5 = sext i8 %4 to i32
store i32 %5, i32* %1
%6 = bitcast float* %2 to i8*
%7 = tail call signext i8 @doupper(i32 7, i32 34)
%8 = sitofp i8 %7 to float
%9 = tail call signext i8 @doupper(i32 7, i32 39238)
%10 = call float (float, i8, float, i32, i32, i8*, ...) @calldoupper(float %8, i8 signext %9, float 7.500000e+00, i32 3, i32 2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32 97)
store float %10, float* %2
%11 = load i32, i32* %1
%12 = sitofp i32 %11 to float
%13 = fadd float %10, %12
%14 = fmul float %10, 0x3F9EB851E0000000
%15 = call float (float, i8, float, i32, i32, i8*, ...) @calldoupper(float %10, i8 signext 99, float %14, i32 -1, i32 234, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), float* %2, i32 101)
%16 = call i32 @dolower(float %13, float %15)
%17 = call signext i8 @doupper(i32 %16, i32 3)
%18 = load i32, i32* %1
%19 = sitofp i32 %18 to float
%20 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), float %19)
%21 = load float, float* %2
%22 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), float %21)
ret void
}