#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*/ slaStringExport(char *, char *, int);
int /*<<< orphan*/ slaStringImport(char *, int, char *);
int /*<<< orphan*/ sla_obs_(int *, char *, char *, double *, double *, double *,
                            int const, int const);
void slaObs(int n, char *c, char *name, double *w, double *p, double *h) {
  int N;
  char C[10];
  const int C_length = 10;
  char NAME[40];
  const int NAME_length = 40;
  double W;
  double P;
  double H;
  if (n < 1) {
    slaStringExport(c, C, 10);
  } else {
    slaStringExport("", C, 10);
  }
  N = n;
  W = *w;
  P = *p;
  H = *h;
  sla_obs_(&N, C, NAME, &W, &P, &H, C_length, NAME_length);
  slaStringImport(NAME, 40, name);
  if (n > 0 && name[0] != '?') {
    slaStringImport(C, 10, c);
  }
  *w = W;
  *p = P;
  *h = H;
}


x86 assembly (clang, -O0):
<slaObs>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0xa,-0x44(%rbp)
movl   $0x28,-0x74(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    1181 <slaObs+0x51>
mov    -0x10(%rbp),%rdi
lea    -0x3e(%rbp),%rsi
mov    $0xa,%edx
call   1050 <slaStringExport@plt>
jmp    1196 <slaObs+0x66>
lea    -0x3e(%rbp),%rsi
lea    0xe74(%rip),%rdi
mov    $0xa,%edx
call   1050 <slaStringExport@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
lea    -0x3e(%rbp),%rsi
lea    -0x70(%rbp),%rdx
lea    -0x34(%rbp),%rdi
lea    -0x80(%rbp),%rcx
lea    -0x88(%rbp),%r8
lea    -0x90(%rbp),%r9
movl   $0xa,(%rsp)
movl   $0x28,0x8(%rsp)
call   1030 <sla_obs_@plt>
lea    -0x70(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x28,%esi
call   1040 <slaStringImport@plt>
cmpl   $0x0,-0x4(%rbp)
jle    1239 <slaObs+0x109>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3f,%eax
je     1239 <slaObs+0x109>
lea    -0x3e(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0xa,%esi
call   1040 <slaStringImport@plt>
movsd  -0x80(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x88(%rbp),%xmm0
ff
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x90(%rbp),%xmm0
ff
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slaObs>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %r9,%rbx
mov    %r8,%rbp
mov    %rcx,%r13
mov    %rdx,%r15
mov    %edi,%r12d
test   %edi,%edi
lea    0xeaa(%rip),%rdi
mov    %rsi,0x38(%rsp)
cmovle %rsi,%rdi
lea    0x2e(%rsp),%rsi
mov    $0xa,%edx
call   1050 <slaStringExport@plt>
mov    %r12d,0xc(%rsp)
movsd  0x0(%r13),%xmm0
movsd  %xmm0,0x20(%rsp)
mov    %rbp,0x40(%rsp)
movsd  0x0(%rbp),%xmm0
movsd  %xmm0,0x18(%rsp)
mov    %rbx,0x48(%rsp)
movsd  (%rbx),%xmm0
movsd  %xmm0,0x10(%rsp)
lea    0xc(%rsp),%rdi
lea    0x50(%rsp),%r14
lea    0x20(%rsp),%rcx
lea    0x18(%rsp),%r8
lea    0x10(%rsp),%r9
lea    0x2e(%rsp),%rsi
mov    %r14,%rdx
push   $0x28
push   $0xa
call   1030 <sla_obs_@plt>
add    $0x10,%rsp
mov    %r14,%rdi
mov    $0x28,%esi
mov    %r15,%rdx
call   1040 <slaStringImport@plt>
test   %r12d,%r12d
jle    11fb <slaObs+0xcb>
cmpb   $0x3f,(%r15)
je     11fb <slaObs+0xcb>
lea    0x2e(%rsp),%rdi
mov    $0xa,%esi
mov    0x38(%rsp),%rdx
call   1040 <slaStringImport@plt>
movsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x0(%r13)
movsd  0x18(%rsp),%xmm0
mov    0x40(%rsp),%rax
movsd  %xmm0,(%rax)
movsd  0x10(%rsp),%xmm0
mov    0x48(%rsp),%rax
movsd  %xmm0,(%rax)
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @slaObs(i32 %0, i8* %1, i8* %2, double* %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca i32
%14 = alloca [10 x i8]
%15 = alloca i32
%16 = alloca [40 x i8]
%17 = alloca i32
%18 = alloca double
%19 = alloca double
%20 = alloca double
store i32 %0, i32* %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store double* %3, double** %10
store double* %4, double** %11
store double* %5, double** %12
store i32 10, i32* %15
store i32 40, i32* %17
%21 = load i32, i32* %7
%22 = icmp slt i32 %21, 1
br i1 %22, label %23, label %27
23: ; preds = %6
%24 = load i8*, i8** %8
%25 = getelementptr inbounds [10 x i8], [10 x i8]* %14, i64 0, i64 0
%26 = call i32 @slaStringExport(i8* %24, i8* %25, i32 10)
br label %30
27: ; preds = %6
%28 = getelementptr inbounds [10 x i8], [10 x i8]* %14, i64 0, i64 0
%29 = call i32 @slaStringExport(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %28, i32 10)
br label %30
30: ; preds = %27, %23
%31 = load i32, i32* %7
store i32 %31, i32* %13
%32 = load double*, double** %10
%33 = load double, double* %32
store double %33, double* %18
%34 = load double*, double** %11
%35 = load double, double* %34
store double %35, double* %19
%36 = load double*, double** %12
%37 = load double, double* %36
store double %37, double* %20
%38 = getelementptr inbounds [10 x i8], [10 x i8]* %14, i64 0, i64 0
%39 = getelementptr inbounds [40 x i8], [40 x i8]* %16, i64 0, i64 0
%40 = call i32 @sla_obs_(i32* %13, i8* %38, i8* %39, double* %18, double* %19, double* %20, i32 10, i32 40)
%41 = getelementptr inbounds [40 x i8], [40 x i8]* %16, i64 0, i64 0
%42 = load i8*, i8** %9
%43 = call i32 @slaStringImport(i8* %41, i32 40, i8* %42)
%44 = load i32, i32* %7
%45 = icmp sgt i32 %44, 0
br i1 %45, label %46, label %56
46: ; preds = %30
%47 = load i8*, i8** %9
%48 = getelementptr inbounds i8, i8* %47, i64 0
%49 = load i8, i8* %48
%50 = sext i8 %49 to i32
%51 = icmp ne i32 %50, 63
br i1 %51, label %52, label %56
52: ; preds = %46
%53 = getelementptr inbounds [10 x i8], [10 x i8]* %14, i64 0, i64 0
%54 = load i8*, i8** %8
%55 = call i32 @slaStringImport(i8* %53, i32 10, i8* %54)
br label %56
56: ; preds = %52, %46, %30
%57 = load double, double* %18
%58 = load double*, double** %10
store double %57, double* %58
%59 = load double, double* %19
%60 = load double*, double** %11
store double %59, double* %60
%61 = load double, double* %20
%62 = load double*, double** %12
store double %61, double* %62
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @slaObs(i32 %0, i8* %1, i8* %2, double* nocapture %3, double* nocapture %4, double* nocapture %5) {
%7 = alloca i32
%8 = alloca [10 x i8]
%9 = alloca [40 x i8]
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = bitcast i32* %7 to i8*
%14 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%15 = getelementptr inbounds [40 x i8], [40 x i8]* %9, i64 0, i64 0
%16 = bitcast double* %10 to i8*
%17 = bitcast double* %11 to i8*
%18 = bitcast double* %12 to i8*
%19 = icmp slt i32 %0, 1
%20 = select i1 %19, i8* %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
%21 = call i32 @slaStringExport(i8* %20, i8* %14, i32 10)
store i32 %0, i32* %7
%22 = load double, double* %3
store double %22, double* %10
%23 = load double, double* %4
store double %23, double* %11
%24 = load double, double* %5
store double %24, double* %12
%25 = call i32 @sla_obs_(i32* %7, i8* %14, i8* %15, double* %10, double* %11, double* %12, i32 10, i32 40)
%26 = call i32 @slaStringImport(i8* %15, i32 40, i8* %2)
%27 = icmp sgt i32 %0, 0
br i1 %27, label %28, label %33
28: ; preds = %6
%29 = load i8, i8* %2
%30 = icmp eq i8 %29, 63
br i1 %30, label %33, label %31
31: ; preds = %28
%32 = call i32 @slaStringImport(i8* %14, i32 10, i8* %1)
br label %33
33: ; preds = %31, %28, %6
%34 = load double, double* %10
store double %34, double* %3
%35 = load double, double* %11
store double %35, double* %4
%36 = load double, double* %12
store double %36, double* %5
ret void
}