#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 code_table_4_0(unsigned char **);
int code_table_4_91(unsigned char **);
int /*<<< orphan*/ int4(unsigned char *);
int /*<<< orphan*/ prt_code_table_4_91(int, double, double, char *);
double scaled2dbl(int, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *);
int /*<<< orphan*/ strlen(char *);
int f_aerosol_size(int mode, unsigned char **sec, float *data,
                   unsigned int ndata, char *inv_out, void **local) {
  int pdt, type;
  unsigned char *sec4;
  double size1, size2;
  if (mode >= 0) {
    pdt = code_table_4_0(sec);
    if (pdt < 44 || pdt > 48)
      return 0;
    type = code_table_4_91(sec);
    if (type == 255)
      return 0;
    sec4 = sec[4];
    size1 = scaled2dbl(
        ((sec4[14] & 0x80) ? -(int)(sec4[14] & 127) : (int)(sec4[14] & 127)),
        int4(sec4 + 15));
    size2 = scaled2dbl(
        ((sec4[19] & 0x80) ? -(int)(sec4[19] & 127) : (int)(sec4[19] & 127)),
        int4(sec4 + 20));
    sprintf(inv_out, "aerosol_size ");
    inv_out += strlen(inv_out);
    type = code_table_4_91(sec);
    prt_code_table_4_91(type, size1, size2, inv_out);
  }
  return 0;
}


x86 assembly (clang, -O0):
<f_aerosol_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     12fa <f_aerosol_size+0x18a>
mov    -0x10(%rbp),%rdi
call   1070 <code_table_4_0@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x2c,-0x34(%rbp)
jl     11b8 <f_aerosol_size+0x48>
cmpl   $0x30,-0x34(%rbp)
jle    11c4 <f_aerosol_size+0x54>
movl   $0x0,-0x4(%rbp)
jmp    1301 <f_aerosol_size+0x191>
mov    -0x10(%rbp),%rdi
call   1050 <code_table_4_91@plt>
mov    %eax,-0x38(%rbp)
cmpl   $0xff,-0x38(%rbp)
jne    11e9 <f_aerosol_size+0x79>
movl   $0x0,-0x4(%rbp)
jmp    1301 <f_aerosol_size+0x191>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
movzbl 0xe(%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1222 <f_aerosol_size+0xb2>
mov    -0x40(%rbp),%rax
movzbl 0xe(%rax),%ecx
and    $0x7f,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x54(%rbp)
jmp    1230 <f_aerosol_size+0xc0>
mov    -0x40(%rbp),%rax
movzbl 0xe(%rax),%eax
and    $0x7f,%eax
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%eax
mov    %eax,-0x58(%rbp)
mov    -0x40(%rbp),%rdi
add    $0xf,%rdi
call   1030 <int4@plt>
mov    -0x58(%rbp),%edi
mov    %eax,%esi
call   1090 <scaled2dbl@plt>
movsd  %xmm0,-0x48(%rbp)
mov    -0x40(%rbp),%rax
movzbl 0x13(%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     127f <f_aerosol_size+0x10f>
mov    -0x40(%rbp),%rax
movzbl 0x13(%rax),%ecx
and    $0x7f,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x5c(%rbp)
jmp    128d <f_aerosol_size+0x11d>
mov    -0x40(%rbp),%rax
movzbl 0x13(%rax),%eax
and    $0x7f,%eax
mov    %eax,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    -0x40(%rbp),%rdi
add    $0x14,%rdi
call   1030 <int4@plt>
mov    -0x60(%rbp),%edi
mov    %eax,%esi
call   1090 <scaled2dbl@plt>
movsd  %xmm0,-0x50(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xd46(%rip),%rsi
call   1080 <sprintf@plt>
mov    -0x28(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <code_table_4_91@plt>
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%edi
movsd  -0x48(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
mov    -0x28(%rbp),%rsi
call   1040 <prt_code_table_4_91@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_aerosol_size>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
test   %edi,%edi
js     1243 <f_aerosol_size+0xe3>
mov    %r8,%r14
mov    %rsi,%rbx
mov    %rsi,%rdi
call   1070 <code_table_4_0@plt>
add    $0xffffffcf,%eax
cmp    $0xfffffffb,%eax
jb     1243 <f_aerosol_size+0xe3>
mov    %rbx,%rdi
call   1050 <code_table_4_91@plt>
cmp    $0xff,%eax
je     1243 <f_aerosol_size+0xe3>
mov    0x20(%rbx),%r15
movzbl 0xe(%r15),%eax
mov    %eax,%ecx
and    $0x7f,%ecx
mov    %ecx,%ebp
neg    %ebp
test   $0x80,%al
cmove  %ecx,%ebp
lea    0xf(%r15),%rdi
call   1030 <int4@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1080 <scaled2dbl@plt>
movsd  %xmm0,0x10(%rsp)
movzbl 0x13(%r15),%eax
mov    %eax,%ecx
and    $0x7f,%ecx
mov    %ecx,%ebp
neg    %ebp
test   $0x80,%al
cmove  %ecx,%ebp
add    $0x14,%r15
mov    %r15,%rdi
call   1030 <int4@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1080 <scaled2dbl@plt>
movsd  %xmm0,0x8(%rsp)
movabs $0x5f6c6f736f726561,%rax
6f 6c 5f
mov    %rax,(%r14)
movabs $0x20657a69735f6c,%rax
mov    %rax,0x6(%r14)
mov    %r14,%rdi
call   1060 <strlen@plt>
movslq %eax,%rbp
add    %r14,%rbp
mov    %rbx,%rdi
call   1050 <code_table_4_91@plt>
mov    %eax,%edi
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mov    %rbp,%rsi
call   1040 <prt_code_table_4_91@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"aerosol_size \00"
define i32 @f_aerosol_size(i32 %0, i8** %1, float* %2, i32 %3, i8* %4, i8** %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8**
%10 = alloca float*
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8**
%14 = alloca i32
%15 = alloca i32
%16 = alloca i8*
%17 = alloca double
%18 = alloca double
store i32 %0, i32* %8
store i8** %1, i8*** %9
store float* %2, float** %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8** %5, i8*** %13
%19 = load i32, i32* %8
%20 = icmp sge i32 %19, 0
br i1 %20, label %21, label %104
21: ; preds = %6
%22 = load i8**, i8*** %9
%23 = call i32 @code_table_4_0(i8** %22)
store i32 %23, i32* %14
%24 = load i32, i32* %14
%25 = icmp slt i32 %24, 44
br i1 %25, label %29, label %26
26: ; preds = %21
%27 = load i32, i32* %14
%28 = icmp sgt i32 %27, 48
br i1 %28, label %29, label %30
29: ; preds = %26, %21
store i32 0, i32* %7
br label %105
30: ; preds = %26
%31 = load i8**, i8*** %9
%32 = call i32 @code_table_4_91(i8** %31)
store i32 %32, i32* %15
%33 = load i32, i32* %15
%34 = icmp eq i32 %33, 255
br i1 %34, label %35, label %36
35: ; preds = %30
store i32 0, i32* %7
br label %105
36: ; preds = %30
%37 = load i8**, i8*** %9
%38 = getelementptr inbounds i8*, i8** %37, i64 4
%39 = load i8*, i8** %38
store i8* %39, i8** %16
%40 = load i8*, i8** %16
%41 = getelementptr inbounds i8, i8* %40, i64 14
%42 = load i8, i8* %41
%43 = zext i8 %42 to i32
%44 = and i32 %43, 128
%45 = icmp ne i32 %44, 0
br i1 %45, label %46, label %53
46: ; preds = %36
%47 = load i8*, i8** %16
%48 = getelementptr inbounds i8, i8* %47, i64 14
%49 = load i8, i8* %48
%50 = zext i8 %49 to i32
%51 = and i32 %50, 127
%52 = sub nsw i32 0, %51
br label %59
53: ; preds = %36
%54 = load i8*, i8** %16
%55 = getelementptr inbounds i8, i8* %54, i64 14
%56 = load i8, i8* %55
%57 = zext i8 %56 to i32
%58 = and i32 %57, 127
br label %59
59: ; preds = %53, %46
%60 = phi i32 [ %52, %46 ], [ %58, %53 ]
%61 = load i8*, i8** %16
%62 = getelementptr inbounds i8, i8* %61, i64 15
%63 = call i32 @int4(i8* %62)
%64 = call double @scaled2dbl(i32 %60, i32 %63)
store double %64, double* %17
%65 = load i8*, i8** %16
%66 = getelementptr inbounds i8, i8* %65, i64 19
%67 = load i8, i8* %66
%68 = zext i8 %67 to i32
%69 = and i32 %68, 128
%70 = icmp ne i32 %69, 0
br i1 %70, label %71, label %78
71: ; preds = %59
%72 = load i8*, i8** %16
%73 = getelementptr inbounds i8, i8* %72, i64 19
%74 = load i8, i8* %73
%75 = zext i8 %74 to i32
%76 = and i32 %75, 127
%77 = sub nsw i32 0, %76
br label %84
78: ; preds = %59
%79 = load i8*, i8** %16
%80 = getelementptr inbounds i8, i8* %79, i64 19
%81 = load i8, i8* %80
%82 = zext i8 %81 to i32
%83 = and i32 %82, 127
br label %84
84: ; preds = %78, %71
%85 = phi i32 [ %77, %71 ], [ %83, %78 ]
%86 = load i8*, i8** %16
%87 = getelementptr inbounds i8, i8* %86, i64 20
%88 = call i32 @int4(i8* %87)
%89 = call double @scaled2dbl(i32 %85, i32 %88)
store double %89, double* %18
%90 = load i8*, i8** %12
%91 = call i32 @sprintf(i8* %90, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%92 = load i8*, i8** %12
%93 = call i32 @strlen(i8* %92)
%94 = load i8*, i8** %12
%95 = sext i32 %93 to i64
%96 = getelementptr inbounds i8, i8* %94, i64 %95
store i8* %96, i8** %12
%97 = load i8**, i8*** %9
%98 = call i32 @code_table_4_91(i8** %97)
store i32 %98, i32* %15
%99 = load i32, i32* %15
%100 = load double, double* %17
%101 = load double, double* %18
%102 = load i8*, i8** %12
%103 = call i32 @prt_code_table_4_91(i32 %99, double %100, double %101, i8* %102)
br label %104
104: ; preds = %84, %6
store i32 0, i32* %7
br label %105
105: ; preds = %104, %35, %29
%106 = load i32, i32* %7
ret i32 %106
}

LLVM IR (-O2):
@.str = [14 x i8] c"aerosol_size \00"
define i32 @f_aerosol_size(i32 %0, i8** %1, float* nocapture readnone %2, i32 %3, i8* %4, i8** nocapture readnone %5) {
%7 = icmp sgt i32 %0, -1
br i1 %7, label %8, label %45
8: ; preds = %6
%9 = tail call i32 @code_table_4_0(i8** %1)
%10 = add i32 %9, -49
%11 = icmp ult i32 %10, -5
br i1 %11, label %45, label %12
12: ; preds = %8
%13 = tail call i32 @code_table_4_91(i8** %1)
%14 = icmp eq i32 %13, 255
br i1 %14, label %45, label %15
15: ; preds = %12
%16 = getelementptr inbounds i8*, i8** %1, i64 4
%17 = load i8*, i8** %16
%18 = getelementptr inbounds i8, i8* %17, i64 14
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = and i32 %20, 128
%22 = icmp eq i32 %21, 0
%23 = and i32 %20, 127
%24 = sub nsw i32 0, %23
%25 = select i1 %22, i32 %23, i32 %24
%26 = getelementptr inbounds i8, i8* %17, i64 15
%27 = tail call i32 @int4(i8* %26)
%28 = tail call double @scaled2dbl(i32 %25, i32 %27)
%29 = getelementptr inbounds i8, i8* %17, i64 19
%30 = load i8, i8* %29
%31 = zext i8 %30 to i32
%32 = and i32 %31, 128
%33 = icmp eq i32 %32, 0
%34 = and i32 %31, 127
%35 = sub nsw i32 0, %34
%36 = select i1 %33, i32 %34, i32 %35
%37 = getelementptr inbounds i8, i8* %17, i64 20
%38 = tail call i32 @int4(i8* %37)
%39 = tail call double @scaled2dbl(i32 %36, i32 %38)
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(14) %4, i8* align 1 dereferenceable(14) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 14, i1 false)
%40 = tail call i32 @strlen(i8* %4)
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i8, i8* %4, i64 %41
%43 = tail call i32 @code_table_4_91(i8** %1)
%44 = tail call i32 @prt_code_table_4_91(i32 %43, double %28, double %39, i8* %42)
br label %45
45: ; preds = %6, %15, %12, %8
ret i32 0
}