#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*/ CmdEndParagraph(int /*<<< orphan*/);
int /*<<< orphan*/ PopEnvironment();
int /*<<< orphan*/ PushEnvironment(int);
int /*<<< orphan*/ free(char *);
char *getBraceParam();
int getLineSpacing();
int /*<<< orphan*/ setLineSpacing(int);
int /*<<< orphan*/ sscanf(char *, char *, float *);
void CmdSpacingEnviron(int code) {
  char *sizeParam;
  static int originalSpacing = 240;
  float spacing;
  int true_code = code & ~0x4000;
  if (code & 0x4000) {
    originalSpacing = getLineSpacing();
    if (true_code == 2)
      setLineSpacing(480);
    else {
      sizeParam = getBraceParam();
      if (*sizeParam) {
        sscanf(sizeParam, "%f", &spacing);
        setLineSpacing((int)240 * spacing);
        free(sizeParam);
      }
    }
    PushEnvironment(28);
    return;
  }
  CmdEndParagraph(0);
  PopEnvironment();
  setLineSpacing(originalSpacing);
}


x86 assembly (clang, -O0):
<CmdSpacingEnviron>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffbfff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
and    $0x4000,%eax
cmp    $0x0,%eax
je     122c <CmdSpacingEnviron+0xac>
mov    $0x0,%al
call   10a0 <getLineSpacing@plt>
mov    %eax,0x2eac(%rip)
cmpl   $0x2,-0x18(%rbp)
jne    11cd <CmdSpacingEnviron+0x4d>
mov    $0x1e0,%edi
call   1060 <setLineSpacing@plt>
jmp    121d <CmdSpacingEnviron+0x9d>
mov    $0x0,%al
call   1050 <getBraceParam@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1218 <CmdSpacingEnviron+0x98>
mov    -0x10(%rbp),%rdi
lea    0xe14(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1070 <sscanf@plt>
movss  0xdff(%rip),%xmm0
mulss  -0x14(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1060 <setLineSpacing@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
jmp    121d <CmdSpacingEnviron+0x9d>
mov    $0x1c,%edi
call   1040 <PushEnvironment@plt>
jmp    1245 <CmdSpacingEnviron+0xc5>
xor    %edi,%edi
call   1090 <CmdEndParagraph@plt>
mov    $0x0,%al
call   1080 <PopEnvironment@plt>
mov    0x2e20(%rip),%edi
call   1060 <setLineSpacing@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdSpacingEnviron>:
push   %rbx
sub    $0x10,%rsp
test   $0x4000,%edi
jne    11ab <CmdSpacingEnviron+0x2b>
xor    %edi,%edi
call   1090 <CmdEndParagraph@plt>
xor    %eax,%eax
call   1080 <PopEnvironment@plt>
mov    0x2ebf(%rip),%edi
add    $0x10,%rsp
pop    %rbx
jmp    1060 <setLineSpacing@plt>
mov    %edi,%ebx
and    $0xffffbfff,%ebx
xor    %eax,%eax
call   10a0 <getLineSpacing@plt>
mov    %eax,0x2ea0(%rip)
cmp    $0x2,%ebx
jne    11d1 <CmdSpacingEnviron+0x51>
mov    $0x1e0,%edi
call   1060 <setLineSpacing@plt>
jmp    1213 <CmdSpacingEnviron+0x93>
xor    %eax,%eax
call   1050 <getBraceParam@plt>
cmpb   $0x0,(%rax)
je     1213 <CmdSpacingEnviron+0x93>
mov    %rax,%rbx
lea    0xe1d(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rax,%rdi
call   1070 <sscanf@plt>
movss  0xc(%rsp),%xmm0
mulss  0xdfe(%rip),%xmm0
cvttss2si %xmm0,%edi
call   1060 <setLineSpacing@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    $0x1c,%edi
call   1040 <PushEnvironment@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@CmdSpacingEnviron.originalSpacing = internal global i32 240
@.str = [3 x i8] c"%f\00"
define void @CmdSpacingEnviron(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca float
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = and i32 %6, -16385
store i32 %7, i32* %5
%8 = load i32, i32* %2
%9 = and i32 %8, 16384
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %34
11: ; preds = %1
%12 = call i32 (...) @getLineSpacing()
store i32 %12, i32* @CmdSpacingEnviron.originalSpacing
%13 = load i32, i32* %5
%14 = icmp eq i32 %13, 2
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = call i32 @setLineSpacing(i32 480)
br label %32
17: ; preds = %11
%18 = call i8* (...) @getBraceParam()
store i8* %18, i8** %3
%19 = load i8*, i8** %3
%20 = load i8, i8* %19
%21 = icmp ne i8 %20, 0
br i1 %21, label %22, label %31
22: ; preds = %17
%23 = load i8*, i8** %3
%24 = call i32 @sscanf(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %4)
%25 = load float, float* %4
%26 = fmul float 2.400000e+02, %25
%27 = fptosi float %26 to i32
%28 = call i32 @setLineSpacing(i32 %27)
%29 = load i8*, i8** %3
%30 = call i32 @free(i8* %29)
br label %31
31: ; preds = %22, %17
br label %32
32: ; preds = %31, %15
%33 = call i32 @PushEnvironment(i32 28)
br label %39
34: ; preds = %1
%35 = call i32 @CmdEndParagraph(i32 0)
%36 = call i32 (...) @PopEnvironment()
%37 = load i32, i32* @CmdSpacingEnviron.originalSpacing
%38 = call i32 @setLineSpacing(i32 %37)
br label %39
39: ; preds = %34, %32
ret void
}

LLVM IR (-O2):
@CmdSpacingEnviron.originalSpacing = internal unnamed_addr global i32 240
@.str = [3 x i8] c"%f\00"
define void @CmdSpacingEnviron(i32 %0) {
%2 = alloca float
%3 = bitcast float* %2 to i8*
%4 = and i32 %0, 16384
%5 = icmp eq i32 %4, 0
br i1 %5, label %25, label %6
6: ; preds = %1
%7 = and i32 %0, -16385
%8 = tail call i32 (...) @getLineSpacing()
store i32 %8, i32* @CmdSpacingEnviron.originalSpacing
%9 = icmp eq i32 %7, 2
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = tail call i32 @setLineSpacing(i32 480)
br label %23
12: ; preds = %6
%13 = tail call i8* (...) @getBraceParam()
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %23, label %16
16: ; preds = %12
%17 = call i32 @sscanf(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%18 = load float, float* %2
%19 = fmul float %18, 2.400000e+02
%20 = fptosi float %19 to i32
%21 = call i32 @setLineSpacing(i32 %20)
%22 = call i32 @free(i8* %13)
br label %23
23: ; preds = %12, %16, %10
%24 = call i32 @PushEnvironment(i32 28)
br label %30
25: ; preds = %1
%26 = tail call i32 @CmdEndParagraph(i32 0)
%27 = tail call i32 (...) @PopEnvironment()
%28 = load i32, i32* @CmdSpacingEnviron.originalSpacing
%29 = tail call i32 @setLineSpacing(i32 %28)
br label %30
30: ; preds = %25, %23
ret void
}