#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 */
int /*<<< orphan*/ define_region(char *, int, int);
scalar_t__ error();
int object_number_of(char *);
int /*<<< orphan*/ set_region_center(int, double *);
int /*<<< orphan*/ set_region_radius(int, double);
void sphere_command(char *spherename, float x, float y, float z, float r) {
  int region_number;
  double center[3], radius;
  define_region(spherename, 1, 2);
  region_number = object_number_of(spherename);
  if (error()) {
    return;
  }
  center[0] = x;
  center[1] = y;
  center[2] = z;
  radius = r;
  set_region_center(region_number, center);
  set_region_radius(region_number, radius);
}


x86 assembly (clang, -O0):
<sphere_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  %xmm3,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <define_region@plt>
mov    -0x8(%rbp),%rdi
call   1040 <object_number_of@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1070 <error@plt>
cmp    $0x0,%rax
je     11a5 <sphere_command+0x55>
jmp    11f6 <sphere_command+0xa6>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x1c(%rbp),%edi
lea    -0x40(%rbp),%rsi
call   1050 <set_region_center@plt>
mov    -0x1c(%rbp),%edi
movsd  -0x48(%rbp),%xmm0
call   1060 <set_region_radius@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sphere_command>:
push   %rbx
sub    $0x50,%rsp
movss  %xmm3,(%rsp)
movss  %xmm2,0xc(%rsp)
movaps %xmm1,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
mov    %rdi,%rbx
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <define_region@plt>
mov    %rbx,%rdi
call   1040 <object_number_of@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1070 <error@plt>
test   %rax,%rax
jne    11da <sphere_command+0x8a>
movaps 0x10(%rsp),%xmm0
unpcklps 0x20(%rsp),%xmm0
cvtps2pd %xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x40(%rsp)
movss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,(%rsp)
lea    0x30(%rsp),%rsi
mov    %ebx,%edi
call   1050 <set_region_center@plt>
mov    %ebx,%edi
movsd  (%rsp),%xmm0
call   1060 <set_region_radius@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @sphere_command(i8* %0, float %1, float %2, float %3, float %4) {
%6 = alloca i8*
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca i32
%12 = alloca [3 x double]
%13 = alloca double
store i8* %0, i8** %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%14 = load i8*, i8** %6
%15 = call i32 @define_region(i8* %14, i32 1, i32 2)
%16 = load i8*, i8** %6
%17 = call i32 @object_number_of(i8* %16)
store i32 %17, i32* %11
%18 = call i64 (...) @error()
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %5
br label %39
21: ; preds = %5
%22 = load float, float* %7
%23 = fpext float %22 to double
%24 = getelementptr inbounds [3 x double], [3 x double]* %12, i64 0, i64 0
store double %23, double* %24
%25 = load float, float* %8
%26 = fpext float %25 to double
%27 = getelementptr inbounds [3 x double], [3 x double]* %12, i64 0, i64 1
store double %26, double* %27
%28 = load float, float* %9
%29 = fpext float %28 to double
%30 = getelementptr inbounds [3 x double], [3 x double]* %12, i64 0, i64 2
store double %29, double* %30
%31 = load float, float* %10
%32 = fpext float %31 to double
store double %32, double* %13
%33 = load i32, i32* %11
%34 = getelementptr inbounds [3 x double], [3 x double]* %12, i64 0, i64 0
%35 = call i32 @set_region_center(i32 %33, double* %34)
%36 = load i32, i32* %11
%37 = load double, double* %13
%38 = call i32 @set_region_radius(i32 %36, double %37)
br label %39
39: ; preds = %21, %20
ret void
}

LLVM IR (-O2):
define void @sphere_command(i8* %0, float %1, float %2, float %3, float %4) {
%6 = alloca [3 x double]
%7 = bitcast [3 x double]* %6 to i8*
%8 = tail call i32 @define_region(i8* %0, i32 1, i32 2)
%9 = tail call i32 @object_number_of(i8* %0)
%10 = tail call i64 (...) @error()
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %23
12: ; preds = %5
%13 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%14 = insertelement <2 x float> poison, float %1, i64 0
%15 = insertelement <2 x float> %14, float %2, i64 1
%16 = fpext <2 x float> %15 to <2 x double>
%17 = bitcast [3 x double]* %6 to <2 x double>*
store <2 x double> %16, <2 x double>* %17
%18 = fpext float %3 to double
%19 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 2
store double %18, double* %19
%20 = fpext float %4 to double
%21 = call i32 @set_region_center(i32 %9, double* %13)
%22 = call i32 @set_region_radius(i32 %9, double %20)
br label %23
23: ; preds = %5, %12
ret void
}