#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*/ call_module(char *);
int /*<<< orphan*/ fuselage_module(char *, float, float, float);
int /*<<< orphan*/ sprintf(char *, char *, int /*<<< orphan*/);
void fuselage(float length, float r1, float r2) {
  static int modnum = 0;
  char mname[100];
  sprintf(mname, "fuselage_m_%d", modnum++);
  fuselage_module(mname, length, r1, r2);
  call_module(mname);
}


x86 assembly (clang, -O0):
<fuselage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
lea    -0x70(%rbp),%rdi
mov    0x2eeb(%rip),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,0x2ee0(%rip)
lea    0xe9d(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x70(%rbp),%rdi
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1040 <fuselage_module@plt>
lea    -0x70(%rbp),%rdi
call   1030 <call_module@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fuselage>:
push   %rbx
sub    $0x80,%rsp
movss  %xmm2,0xc(%rsp)
movss  %xmm1,0x8(%rsp)
movss  %xmm0,0x4(%rsp)
mov    0x2eec(%rip),%edx
lea    0x1(%rdx),%eax
mov    %eax,0x2ee3(%rip)
lea    0xea0(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
movss  0x4(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
movss  0xc(%rsp),%xmm2
call   1040 <fuselage_module@plt>
mov    %rbx,%rdi
call   1030 <call_module@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@fuselage.modnum = internal global i32 0
@.str = [14 x i8] c"fuselage_m_%d\00"
define void @fuselage(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca [100 x i8]
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%9 = load i32, i32* @fuselage.modnum
%10 = add nsw i32 %9, 1
store i32 %10, i32* @fuselage.modnum
%11 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %9)
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%13 = load float, float* %4
%14 = load float, float* %5
%15 = load float, float* %6
%16 = call i32 @fuselage_module(i8* %12, float %13, float %14, float %15)
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%18 = call i32 @call_module(i8* %17)
ret void
}

LLVM IR (-O2):
@fuselage.modnum = internal unnamed_addr global i32 0
@.str = [14 x i8] c"fuselage_m_%d\00"
define void @fuselage(float %0, float %1, float %2) {
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%6 = load i32, i32* @fuselage.modnum
%7 = add nsw i32 %6, 1
store i32 %7, i32* @fuselage.modnum
%8 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %6)
%9 = call i32 @fuselage_module(i8* %5, float %0, float %1, float %2)
%10 = call i32 @call_module(i8* %5)
ret void
}