#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_91b(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_wavelength(int mode, unsigned char **sec, float *data,
                         unsigned int ndata, char *inv_out, void **local) {
  int pdt, type;
  unsigned char *sec4;
  double wave1, wave2;
  if (mode >= 0) {
    pdt = code_table_4_0(sec);
    if (pdt != 48)
      return 0;
    type = code_table_4_91b(sec);
    if (type == 255)
      return 0;
    sec4 = sec[4];
    wave1 = scaled2dbl(
        ((sec4[25] & 0x80) ? -(int)(sec4[25] & 127) : (int)(sec4[25] & 127)),
        int4(sec4 + 26));
    wave2 = scaled2dbl(
        ((sec4[30] & 0x80) ? -(int)(sec4[30] & 127) : (int)(sec4[30] & 127)),
        int4(sec4 + 31));
    sprintf(inv_out, "aerosol_wavelength ");
    inv_out += strlen(inv_out);
    prt_code_table_4_91(type, wave1, wave2, inv_out);
  }
  return 0;
}


x86 assembly (clang, -O0):
<f_aerosol_wavelength>:
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     12e4 <f_aerosol_wavelength+0x174>
mov    -0x10(%rbp),%rdi
call   1070 <code_table_4_0@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x30,-0x34(%rbp)
je     11ba <f_aerosol_wavelength+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    12eb <f_aerosol_wavelength+0x17b>
mov    -0x10(%rbp),%rdi
call   1060 <code_table_4_91b@plt>
mov    %eax,-0x38(%rbp)
cmpl   $0xff,-0x38(%rbp)
jne    11df <f_aerosol_wavelength+0x6f>
movl   $0x0,-0x4(%rbp)
jmp    12eb <f_aerosol_wavelength+0x17b>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
movzbl 0x19(%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1218 <f_aerosol_wavelength+0xa8>
mov    -0x40(%rbp),%rax
movzbl 0x19(%rax),%ecx
and    $0x7f,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x54(%rbp)
jmp    1226 <f_aerosol_wavelength+0xb6>
mov    -0x40(%rbp),%rax
movzbl 0x19(%rax),%eax
and    $0x7f,%eax
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%eax
mov    %eax,-0x58(%rbp)
mov    -0x40(%rbp),%rdi
add    $0x1a,%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 0x1e(%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1275 <f_aerosol_wavelength+0x105>
mov    -0x40(%rbp),%rax
movzbl 0x1e(%rax),%ecx
and    $0x7f,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x5c(%rbp)
jmp    1283 <f_aerosol_wavelength+0x113>
mov    -0x40(%rbp),%rax
movzbl 0x1e(%rax),%eax
and    $0x7f,%eax
mov    %eax,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    -0x40(%rbp),%rdi
add    $0x1f,%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    0xd50(%rip),%rsi
call   1080 <sprintf@plt>
mov    -0x28(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%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_wavelength>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
test   %edi,%edi
js     122f <f_aerosol_wavelength+0xcf>
mov    %r8,%r15
mov    %rsi,%rbp
mov    %rsi,%rdi
call   1070 <code_table_4_0@plt>
cmp    $0x30,%eax
jne    122f <f_aerosol_wavelength+0xcf>
mov    %rbp,%rdi
call   1060 <code_table_4_91b@plt>
cmp    $0xff,%eax
je     122f <f_aerosol_wavelength+0xcf>
mov    %eax,%r14d
mov    0x20(%rbp),%rbp
movzbl 0x19(%rbp),%eax
mov    %eax,%ecx
and    $0x7f,%ecx
mov    %ecx,%ebx
neg    %ebx
test   $0x80,%al
cmove  %ecx,%ebx
lea    0x1a(%rbp),%rdi
call   1030 <int4@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1080 <scaled2dbl@plt>
movsd  %xmm0,0x10(%rsp)
movzbl 0x1e(%rbp),%eax
mov    %eax,%ecx
and    $0x7f,%ecx
mov    %ecx,%ebx
neg    %ebx
test   $0x80,%al
cmove  %ecx,%ebx
add    $0x1f,%rbp
mov    %rbp,%rdi
call   1030 <int4@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1080 <scaled2dbl@plt>
movsd  %xmm0,0x8(%rsp)
movups 0xdff(%rip),%xmm0
movups %xmm0,(%r15)
movl   $0x206874,0x10(%r15)
mov    %r15,%rdi
call   1050 <strlen@plt>
movslq %eax,%rsi
add    %r15,%rsi
mov    %r14d,%edi
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
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 = [20 x i8] c"aerosol_wavelength \00"
define i32 @f_aerosol_wavelength(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 %99
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 ne i32 %24, 48
br i1 %25, label %26, label %27
26: ; preds = %21
store i32 0, i32* %7
br label %100
27: ; preds = %21
%28 = load i8**, i8*** %9
%29 = call i32 @code_table_4_91b(i8** %28)
store i32 %29, i32* %15
%30 = load i32, i32* %15
%31 = icmp eq i32 %30, 255
br i1 %31, label %32, label %33
32: ; preds = %27
store i32 0, i32* %7
br label %100
33: ; preds = %27
%34 = load i8**, i8*** %9
%35 = getelementptr inbounds i8*, i8** %34, i64 4
%36 = load i8*, i8** %35
store i8* %36, i8** %16
%37 = load i8*, i8** %16
%38 = getelementptr inbounds i8, i8* %37, i64 25
%39 = load i8, i8* %38
%40 = zext i8 %39 to i32
%41 = and i32 %40, 128
%42 = icmp ne i32 %41, 0
br i1 %42, label %43, label %50
43: ; preds = %33
%44 = load i8*, i8** %16
%45 = getelementptr inbounds i8, i8* %44, i64 25
%46 = load i8, i8* %45
%47 = zext i8 %46 to i32
%48 = and i32 %47, 127
%49 = sub nsw i32 0, %48
br label %56
50: ; preds = %33
%51 = load i8*, i8** %16
%52 = getelementptr inbounds i8, i8* %51, i64 25
%53 = load i8, i8* %52
%54 = zext i8 %53 to i32
%55 = and i32 %54, 127
br label %56
56: ; preds = %50, %43
%57 = phi i32 [ %49, %43 ], [ %55, %50 ]
%58 = load i8*, i8** %16
%59 = getelementptr inbounds i8, i8* %58, i64 26
%60 = call i32 @int4(i8* %59)
%61 = call double @scaled2dbl(i32 %57, i32 %60)
store double %61, double* %17
%62 = load i8*, i8** %16
%63 = getelementptr inbounds i8, i8* %62, i64 30
%64 = load i8, i8* %63
%65 = zext i8 %64 to i32
%66 = and i32 %65, 128
%67 = icmp ne i32 %66, 0
br i1 %67, label %68, label %75
68: ; preds = %56
%69 = load i8*, i8** %16
%70 = getelementptr inbounds i8, i8* %69, i64 30
%71 = load i8, i8* %70
%72 = zext i8 %71 to i32
%73 = and i32 %72, 127
%74 = sub nsw i32 0, %73
br label %81
75: ; preds = %56
%76 = load i8*, i8** %16
%77 = getelementptr inbounds i8, i8* %76, i64 30
%78 = load i8, i8* %77
%79 = zext i8 %78 to i32
%80 = and i32 %79, 127
br label %81
81: ; preds = %75, %68
%82 = phi i32 [ %74, %68 ], [ %80, %75 ]
%83 = load i8*, i8** %16
%84 = getelementptr inbounds i8, i8* %83, i64 31
%85 = call i32 @int4(i8* %84)
%86 = call double @scaled2dbl(i32 %82, i32 %85)
store double %86, double* %18
%87 = load i8*, i8** %12
%88 = call i32 @sprintf(i8* %87, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%89 = load i8*, i8** %12
%90 = call i32 @strlen(i8* %89)
%91 = load i8*, i8** %12
%92 = sext i32 %90 to i64
%93 = getelementptr inbounds i8, i8* %91, i64 %92
store i8* %93, i8** %12
%94 = load i32, i32* %15
%95 = load double, double* %17
%96 = load double, double* %18
%97 = load i8*, i8** %12
%98 = call i32 @prt_code_table_4_91(i32 %94, double %95, double %96, i8* %97)
br label %99
99: ; preds = %81, %6
store i32 0, i32* %7
br label %100
100: ; preds = %99, %32, %26
%101 = load i32, i32* %7
ret i32 %101
}

LLVM IR (-O2):
@.str = [20 x i8] c"aerosol_wavelength \00"
define i32 @f_aerosol_wavelength(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 %43
8: ; preds = %6
%9 = tail call i32 @code_table_4_0(i8** %1)
%10 = icmp eq i32 %9, 48
br i1 %10, label %11, label %43
11: ; preds = %8
%12 = tail call i32 @code_table_4_91b(i8** %1)
%13 = icmp eq i32 %12, 255
br i1 %13, label %43, label %14
14: ; preds = %11
%15 = getelementptr inbounds i8*, i8** %1, i64 4
%16 = load i8*, i8** %15
%17 = getelementptr inbounds i8, i8* %16, i64 25
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = and i32 %19, 128
%21 = icmp eq i32 %20, 0
%22 = and i32 %19, 127
%23 = sub nsw i32 0, %22
%24 = select i1 %21, i32 %22, i32 %23
%25 = getelementptr inbounds i8, i8* %16, i64 26
%26 = tail call i32 @int4(i8* %25)
%27 = tail call double @scaled2dbl(i32 %24, i32 %26)
%28 = getelementptr inbounds i8, i8* %16, i64 30
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = and i32 %30, 128
%32 = icmp eq i32 %31, 0
%33 = and i32 %30, 127
%34 = sub nsw i32 0, %33
%35 = select i1 %32, i32 %33, i32 %34
%36 = getelementptr inbounds i8, i8* %16, i64 31
%37 = tail call i32 @int4(i8* %36)
%38 = tail call double @scaled2dbl(i32 %35, i32 %37)
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(20) %4, i8* align 1 dereferenceable(20) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 20, i1 false)
%39 = tail call i32 @strlen(i8* %4)
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8, i8* %4, i64 %40
%42 = tail call i32 @prt_code_table_4_91(i32 %12, double %27, double %38, i8* %41)
br label %43
43: ; preds = %6, %14, %11, %8
ret i32 0
}