#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*/ sprintf(char *, char *, unsigned char, unsigned char,
                           unsigned char, unsigned char, unsigned char,
                           unsigned char, int, int, unsigned long);
scalar_t__ uint8(unsigned char *);
int f_Sec0(int mode, unsigned char **sec, float *data, unsigned int ndata,
           char *inv_out, void **local) {
  unsigned char *p;
  if (mode >= 0) {
    p = sec[0];
    sprintf(inv_out,
            "Sec0=%c%c%c%c reserved 0x%.2x%.2x Discipline=%d Grib_Edition=%d "
            "len=%lu",
            p[0], p[1], p[2], p[3], p[4], p[5], (int)((int)(sec[0][6])),
            (int)((int)(sec[0][7])), (unsigned long int)uint8(&(sec[0][8])));
  }
  return 0;
}


x86 assembly (clang, -O0):
<f_Sec0>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %edi,-0x14(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %ecx,-0x2c(%rbp)
mov    %r8,-0x38(%rbp)
mov    %r9,-0x40(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1215 <f_Sec0+0xf5>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x48(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x48(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x54(%rbp)
mov    -0x48(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x53(%rbp)
mov    -0x48(%rbp),%rax
mov    0x2(%rax),%al
mov    %al,-0x52(%rbp)
mov    -0x48(%rbp),%rax
mov    0x3(%rax),%al
mov    %al,-0x51(%rbp)
mov    -0x48(%rbp),%rax
mov    0x4(%rax),%r14b
mov    -0x48(%rbp),%rax
mov    0x5(%rax),%bl
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
movzbl 0x6(%rax),%eax
mov    %eax,-0x50(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
movzbl 0x7(%rax),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
add    $0x8,%rdi
call   1030 <uint8@plt>
mov    -0x60(%rbp),%rdi
mov    -0x54(%rbp),%dl
mov    -0x53(%rbp),%cl
mov    -0x52(%rbp),%r8b
mov    -0x51(%rbp),%r9b
mov    -0x50(%rbp),%r11d
mov    -0x4c(%rbp),%r10d
lea    0xe1c(%rip),%rsi
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl %r8b,%r8d
movzbl %r9b,%r9d
movzbl %r14b,%r14d
mov    %r14d,(%rsp)
movzbl %bl,%ebx
mov    %ebx,0x8(%rsp)
mov    %r11d,0x10(%rsp)
mov    %r10d,0x18(%rsp)
mov    %rax,0x20(%rsp)
call   1040 <sprintf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_Sec0>:
test   %edi,%edi
js     11b1 <f_Sec0+0x91>
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r8,%rbx
mov    (%rsi),%rdi
movzbl (%rdi),%ebp
movzbl 0x1(%rdi),%r14d
movzbl 0x2(%rdi),%r15d
movzbl 0x3(%rdi),%r12d
movzbl 0x4(%rdi),%eax
mov    %rax,0x10(%rsp)
movzbl 0x5(%rdi),%eax
mov    %rax,0x8(%rsp)
movzbl 0x6(%rdi),%eax
mov    %rax,(%rsp)
movzbl 0x7(%rdi),%r13d
add    $0x8,%rdi
call   1030 <uint8@plt>
sub    $0x8,%rsp
lea    0xe7f(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
mov    %r14d,%ecx
mov    %r15d,%r8d
mov    %r12d,%r9d
push   %rax
push   %r13
push   0x18(%rsp)
push   0x28(%rsp)
push   0x38(%rsp)
call   1040 <sprintf@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [72 x i8] c"Sec0=%c%c%c%c reserved 0x%.2x%.2x Discipline=%d Grib_Edition=%d len=%lu\00"
define i32 @f_Sec0(i32 %0, i8** %1, float* %2, i32 %3, i8* %4, i8** %5) {
%7 = alloca i32
%8 = alloca i8**
%9 = alloca float*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8**
%13 = alloca i8*
store i32 %0, i32* %7
store i8** %1, i8*** %8
store float* %2, float** %9
store i32 %3, i32* %10
store i8* %4, i8** %11
store i8** %5, i8*** %12
%14 = load i32, i32* %7
%15 = icmp sge i32 %14, 0
br i1 %15, label %16, label %57
16: ; preds = %6
%17 = load i8**, i8*** %8
%18 = getelementptr inbounds i8*, i8** %17, i64 0
%19 = load i8*, i8** %18
store i8* %19, i8** %13
%20 = load i8*, i8** %11
%21 = load i8*, i8** %13
%22 = getelementptr inbounds i8, i8* %21, i64 0
%23 = load i8, i8* %22
%24 = load i8*, i8** %13
%25 = getelementptr inbounds i8, i8* %24, i64 1
%26 = load i8, i8* %25
%27 = load i8*, i8** %13
%28 = getelementptr inbounds i8, i8* %27, i64 2
%29 = load i8, i8* %28
%30 = load i8*, i8** %13
%31 = getelementptr inbounds i8, i8* %30, i64 3
%32 = load i8, i8* %31
%33 = load i8*, i8** %13
%34 = getelementptr inbounds i8, i8* %33, i64 4
%35 = load i8, i8* %34
%36 = load i8*, i8** %13
%37 = getelementptr inbounds i8, i8* %36, i64 5
%38 = load i8, i8* %37
%39 = load i8**, i8*** %8
%40 = getelementptr inbounds i8*, i8** %39, i64 0
%41 = load i8*, i8** %40
%42 = getelementptr inbounds i8, i8* %41, i64 6
%43 = load i8, i8* %42
%44 = zext i8 %43 to i32
%45 = load i8**, i8*** %8
%46 = getelementptr inbounds i8*, i8** %45, i64 0
%47 = load i8*, i8** %46
%48 = getelementptr inbounds i8, i8* %47, i64 7
%49 = load i8, i8* %48
%50 = zext i8 %49 to i32
%51 = load i8**, i8*** %8
%52 = getelementptr inbounds i8*, i8** %51, i64 0
%53 = load i8*, i8** %52
%54 = getelementptr inbounds i8, i8* %53, i64 8
%55 = call i64 @uint8(i8* %54)
%56 = call i32 @sprintf(i8* %20, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i8 zeroext %23, i8 zeroext %26, i8 zeroext %29, i8 zeroext %32, i8 zeroext %35, i8 zeroext %38, i32 %44, i32 %50, i64 %55)
br label %57
57: ; preds = %16, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [72 x i8] c"Sec0=%c%c%c%c reserved 0x%.2x%.2x Discipline=%d Grib_Edition=%d len=%lu\00"
define i32 @f_Sec0(i32 %0, i8** nocapture %1, float* nocapture readnone %2, i32 %3, i8* nocapture writeonly %4, i8** nocapture readnone %5) {
%7 = icmp sgt i32 %0, -1
br i1 %7, label %8, label %30
8: ; preds = %6
%9 = load i8*, i8** %1
%10 = load i8, i8* %9
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %9, i64 2
%14 = load i8, i8* %13
%15 = getelementptr inbounds i8, i8* %9, i64 3
%16 = load i8, i8* %15
%17 = getelementptr inbounds i8, i8* %9, i64 4
%18 = load i8, i8* %17
%19 = getelementptr inbounds i8, i8* %9, i64 5
%20 = load i8, i8* %19
%21 = getelementptr inbounds i8, i8* %9, i64 6
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = getelementptr inbounds i8, i8* %9, i64 7
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = getelementptr inbounds i8, i8* %9, i64 8
%28 = tail call i64 @uint8(i8* %27)
%29 = tail call i32 @sprintf(i8* dereferenceable(1) %4, i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i8 zeroext %10, i8 zeroext %12, i8 zeroext %14, i8 zeroext %16, i8 zeroext %18, i8 zeroext %20, i32 %23, i32 %26, i64 %28)
br label %30
30: ; preds = %8, %6
ret i32 0
}