#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 atoi(char const *);
int /*<<< orphan*/ fatal_error_i(char *, int);
int /*<<< orphan*/ sprintf(char *, char *, ...);
int /*<<< orphan*/ strlen(char *);
unsigned int uint4(unsigned char *);
int f_0xSec(int mode, unsigned char **sec, float *data, unsigned int ndata,
            char *inv_out, void **local, const char *arg1) {
  int i, sec_no;
  unsigned int j, len;
  double tot;
  unsigned char *s;
  if (mode >= 0) {
    sec_no = i = atoi(arg1);
    if (sec_no < 0 || sec_no > 8)
      fatal_error_i("0xSec: bad section number %d", sec_no);
    if ((s = sec[sec_no]) == NULL) {
      sprintf(inv_out, "sec%d is missing", sec_no);
      return 0;
    }
    if (sec_no == 0) {
      len = 16;
    } else if (sec_no == 8) {
      len = 4;
    } else {
      len = uint4(&(sec[sec_no][0]));
    }
    if (mode == 0)
      tot = 2.0 * len;
    else if (mode == 1)
      tot = 3.0 * len;
    else {
      j = len;
      i = 0;
      while (j) {
        j /= 10;
        i++;
      }
      tot = len * i + 4 * len + 4 * (len % 15);
    }
    if (tot >= 30000 - 1000) {
      sprintf(inv_out, "Sec%d=too long to print", sec_no);
      return 0;
    }
    if (mode == 0)
      sprintf(inv_out, "Sec%d(1..%u)=0x", sec_no, len);
    else
      sprintf(inv_out, "Sec%d(1..%u)=", sec_no, len);
    inv_out += strlen(inv_out);
    if (mode == 0) {
      while (len--) {
        sprintf(inv_out, "%.2x", *s++);
        inv_out += strlen(inv_out);
      }
    } else if (mode == 1) {
      for (j = 1; j <= len; j++) {
        sprintf(inv_out, " %.2x", *s++);
        inv_out += strlen(inv_out);
      }
    } else if (mode >= 2) {
      for (j = 1; j <= len; j++) {
        sprintf(inv_out, "%u:%.2x", j, *s++);
        inv_out += strlen(inv_out);
        sprintf(inv_out, j % 15 == 0 ? "\n  " : " ");
        inv_out += strlen(inv_out);
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<f_0xSec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x10(%rbp),%rax
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     1522 <f_0xSec+0x3d2>
mov    0x10(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x34(%rbp)
mov    %eax,-0x38(%rbp)
cmpl   $0x0,-0x38(%rbp)
jl     119f <f_0xSec+0x4f>
cmpl   $0x8,-0x38(%rbp)
jle    11ae <f_0xSec+0x5e>
mov    -0x38(%rbp),%esi
lea    0xe6f(%rip),%rdi
call   1030 <fatal_error_i@plt>
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x50(%rbp)
cmp    $0x0,%rax
jne    11e9 <f_0xSec+0x99>
mov    -0x28(%rbp),%rdi
mov    -0x38(%rbp),%edx
lea    0xe5f(%rip),%rsi
mov    $0x0,%al
call   1070 <sprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1529 <f_0xSec+0x3d9>
cmpl   $0x0,-0x38(%rbp)
jne    11ff <f_0xSec+0xaf>
movl   $0x10,-0x40(%rbp)
jmp    122e <f_0xSec+0xde>
cmpl   $0x8,-0x38(%rbp)
jne    1215 <f_0xSec+0xc5>
movl   $0x4,-0x40(%rbp)
jmp    1229 <f_0xSec+0xd9>
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <uint4@plt>
mov    %eax,-0x40(%rbp)
jmp    122e <f_0xSec+0xde>
cmpl   $0x0,-0x8(%rbp)
jne    1256 <f_0xSec+0x106>
mov    -0x40(%rbp),%eax
cvtsi2sd %rax,%xmm1
movsd  0xdc0(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    12f7 <f_0xSec+0x1a7>
cmpl   $0x1,-0x8(%rbp)
jne    127e <f_0xSec+0x12e>
mov    -0x40(%rbp),%eax
cvtsi2sd %rax,%xmm1
movsd  0xd90(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    12f2 <f_0xSec+0x1a2>
mov    -0x40(%rbp),%eax
mov    %eax,-0x3c(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x0,-0x3c(%rbp)
je     12b2 <f_0xSec+0x162>
mov    -0x3c(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x3c(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    128b <f_0xSec+0x13b>
mov    -0x40(%rbp),%eax
mov    %eax,%edx
mov    -0x34(%rbp),%ecx
mov    %edx,%edi
imul   %ecx,%edi
mov    %edx,%esi
mov    %edi,%ecx
lea    (%rcx,%rsi,4),%ecx
mov    $0x88888889,%esi
imul   %rsi,%rax
shr    $0x23,%rax
mov    %eax,%esi
mov    %esi,%eax
lea    (%rax,%rax,4),%esi
mov    %esi,%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%edx
mov    %ecx,%eax
mov    %edx,%ecx
lea    (%rax,%rcx,4),%eax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    12f7 <f_0xSec+0x1a7>
movsd  -0x48(%rbp),%xmm0
movsd  0xd0c(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     132f <f_0xSec+0x1df>
mov    -0x28(%rbp),%rdi
mov    -0x38(%rbp),%edx
lea    0xd2a(%rip),%rsi
mov    $0x0,%al
call   1070 <sprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1529 <f_0xSec+0x3d9>
cmpl   $0x0,-0x8(%rbp)
jne    1356 <f_0xSec+0x206>
mov    -0x28(%rbp),%rdi
mov    -0x38(%rbp),%edx
mov    -0x40(%rbp),%ecx
lea    0xd14(%rip),%rsi
mov    $0x0,%al
call   1070 <sprintf@plt>
jmp    136e <f_0xSec+0x21e>
mov    -0x28(%rbp),%rdi
mov    -0x38(%rbp),%edx
mov    -0x40(%rbp),%ecx
lea    0xd07(%rip),%rsi
mov    $0x0,%al
call   1070 <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)
cmpl   $0x0,-0x8(%rbp)
jne    13f1 <f_0xSec+0x2a1>
jmp    1396 <f_0xSec+0x246>
mov    -0x40(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x40(%rbp)
cmp    $0x0,%eax
je     13ec <f_0xSec+0x29c>
mov    -0x28(%rbp),%rdi
mov    -0x50(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x50(%rbp)
movzbl (%rax),%edx
lea    0xcb6(%rip),%rsi
mov    $0x0,%al
call   1070 <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)
jmp    1396 <f_0xSec+0x246>
jmp    151d <f_0xSec+0x3cd>
cmpl   $0x1,-0x8(%rbp)
jne    145e <f_0xSec+0x30e>
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x40(%rbp),%eax
ja     1459 <f_0xSec+0x309>
mov    -0x28(%rbp),%rdi
mov    -0x50(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x50(%rbp)
movzbl (%rax),%edx
lea    0xc51(%rip),%rsi
mov    $0x0,%al
call   1070 <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    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1402 <f_0xSec+0x2b2>
jmp    1518 <f_0xSec+0x3c8>
cmpl   $0x2,-0x8(%rbp)
jl     1513 <f_0xSec+0x3c3>
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x40(%rbp),%eax
ja     150e <f_0xSec+0x3be>
mov    -0x28(%rbp),%rdi
mov    -0x3c(%rbp),%edx
mov    -0x50(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x50(%rbp)
movzbl (%rax),%ecx
lea    0xbe7(%rip),%rsi
mov    $0x0,%al
call   1070 <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    -0x28(%rbp),%rdi
mov    -0x3c(%rbp),%eax
mov    $0xf,%ecx
xor    %edx,%edx
div    %ecx
lea    0xbba(%rip),%rsi
lea    0xbb1(%rip),%rax
cmp    $0x0,%edx
cmove  %rax,%rsi
mov    $0x0,%al
call   1070 <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    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    146f <f_0xSec+0x31f>
jmp    1513 <f_0xSec+0x3c3>
jmp    1518 <f_0xSec+0x3c8>
jmp    151d <f_0xSec+0x3cd>
jmp    1522 <f_0xSec+0x3d2>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_0xSec>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
js     1294 <f_0xSec+0x144>
mov    %r8,%rbp
mov    %rsi,%rbx
mov    %edi,%r12d
mov    0x40(%rsp),%rdi
call   1060 <atoi@plt>
mov    %eax,%r13d
cmp    $0x9,%eax
jb     118d <f_0xSec+0x3d>
lea    0xe7b(%rip),%rdi
mov    %r13d,%esi
call   1030 <fatal_error_i@plt>
movslq %r13d,%rax
mov    (%rbx,%rax,8),%r15
test   %r15,%r15
je     123a <f_0xSec+0xea>
test   %r13d,%r13d
je     1243 <f_0xSec+0xf3>
cmp    $0x8,%r13d
jne    1253 <f_0xSec+0x103>
mov    $0x4,%r14d
test   %r12d,%r12d
jne    1267 <f_0xSec+0x117>
cmp    $0x38a4,%r14d
jae    1280 <f_0xSec+0x130>
lea    0xe73(%rip),%rsi
mov    %rbp,%rdi
mov    %r13d,%edx
mov    %r14d,%ecx
xor    %eax,%eax
call   1070 <sprintf@plt>
mov    %rbp,%rdi
call   1050 <strlen@plt>
test   %r14d,%r14d
je     1294 <f_0xSec+0x144>
cltq
add    %rax,%rbp
mov    %r14d,%r12d
lea    0xe62(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%r15,%rbx,1),%edx
mov    %rbp,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <sprintf@plt>
mov    %rbp,%rdi
call   1050 <strlen@plt>
cltq
add    %rax,%rbp
add    $0x1,%rbx
cmp    %ebx,%r12d
jne    1210 <f_0xSec+0xc0>
jmp    1294 <f_0xSec+0x144>
lea    0xddc(%rip),%rsi
jmp    1287 <f_0xSec+0x137>
mov    $0x10,%r14d
test   %r12d,%r12d
jne    1267 <f_0xSec+0x117>
jmp    11bf <f_0xSec+0x6f>
mov    %r15,%rdi
call   1040 <uint4@plt>
mov    %eax,%r14d
test   %r12d,%r12d
je     11bf <f_0xSec+0x6f>
cmp    $0x1,%r12d
jne    12a5 <f_0xSec+0x155>
mov    %r14d,%eax
lea    (%rax,%rax,2),%rax
cmp    $0x7148,%rax
jb     1301 <f_0xSec+0x1b1>
lea    0xda7(%rip),%rsi
mov    %rbp,%rdi
mov    %r13d,%edx
xor    %eax,%eax
call   1070 <sprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x4,%eax
test   %r14d,%r14d
je     12d4 <f_0xSec+0x184>
mov    $0xcccccccd,%ecx
mov    %r14d,%edx
nopw   0x0(%rax,%rax,1)
mov    %edx,%esi
imul   %rcx,%rsi
shr    $0x23,%rsi
add    $0x1,%eax
cmp    $0x9,%edx
mov    %esi,%edx
ja     12c0 <f_0xSec+0x170>
imul   %r14d,%eax
mov    %r14d,%ecx
mov    $0x88888889,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,4),%ecx
lea    (%rcx,%rcx,2),%ecx
mov    %r14d,%edx
sub    %ecx,%edx
lea    (%rax,%rdx,4),%eax
cmp    $0x7148,%eax
jae    1280 <f_0xSec+0x130>
lea    0xd4e(%rip),%rsi
mov    %rbp,%rdi
mov    %r13d,%edx
mov    %r14d,%ecx
xor    %eax,%eax
call   1070 <sprintf@plt>
mov    %rbp,%rdi
call   1050 <strlen@plt>
movslq %eax,%rbx
add    %rbp,%rbx
cmp    $0x1,%r12d
jne    1380 <f_0xSec+0x230>
test   %r14d,%r14d
je     1294 <f_0xSec+0x144>
mov    %r14d,%r12d
lea    0xd25(%rip),%r14
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%r15,%rbp,1),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <sprintf@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
cltq
add    %rax,%rbx
add    $0x1,%rbp
lea    0x1(%rbp),%eax
cmp    %r12d,%eax
jbe    1350 <f_0xSec+0x200>
jmp    1294 <f_0xSec+0x144>
test   %r14d,%r14d
je     1294 <f_0xSec+0x144>
mov    $0x1,%r12d
xor    %r13d,%r13d
mov    %r14d,(%rsp)
cs nopw 0x0(%rax,%rax,1)
lea    0x1(%r13),%r14
mov    %r12d,%eax
mov    $0x88888889,%ecx
imul   %rcx,%rax
shr    $0x23,%rax
lea    (%rax,%rax,4),%eax
lea    (%rax,%rax,2),%eax
add    $0xffffffff,%eax
mov    %eax,0x4(%rsp)
movzbl (%r15,%r13,1),%ecx
mov    %rbx,%rdi
lea    0xc9a(%rip),%rsi
mov    %r14d,%edx
xor    %eax,%eax
call   1070 <sprintf@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
movslq %eax,%rbp
add    %rbx,%rbp
cmp    %r13d,0x4(%rsp)
lea    0xc80(%rip),%rsi
lea    0xc77(%rip),%rax
cmove  %rax,%rsi
mov    %rbp,%rdi
xor    %eax,%eax
call   1070 <sprintf@plt>
mov    %rbp,%rdi
call   1050 <strlen@plt>
movslq %eax,%rbx
add    %rbp,%rbx
add    $0x1,%r12d
lea    0x1(%r14),%eax
mov    %r14,%r13
mov    (%rsp),%r14d
cmp    %r14d,%eax
jbe    13a0 <f_0xSec+0x250>
jmp    1294 <f_0xSec+0x144>

LLVM IR (-O0):
@.str = [29 x i8] c"0xSec: bad section number %d\00"
@.str.1 = [17 x i8] c"sec%d is missing\00"
@.str.2 = [24 x i8] c"Sec%d=too long to print\00"
@.str.3 = [16 x i8] c"Sec%d(1..%u)=0x\00"
@.str.4 = [14 x i8] c"Sec%d(1..%u)=\00"
@.str.5 = [5 x i8] c"%.2x\00"
@.str.6 = [6 x i8] c" %.2x\00"
@.str.7 = [8 x i8] c"%u:%.2x\00"
@.str.8 = [4 x i8] c"\0A \00"
@.str.9 = [2 x i8] c" \00"
define i32 @f_0xSec(i32 %0, i8** %1, float* %2, i32 %3, i8* %4, i8** %5, i8* %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8**
%11 = alloca float*
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i8**
%15 = alloca i8*
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca double
%21 = alloca i8*
store i32 %0, i32* %9
store i8** %1, i8*** %10
store float* %2, float** %11
store i32 %3, i32* %12
store i8* %4, i8** %13
store i8** %5, i8*** %14
store i8* %6, i8** %15
%22 = load i32, i32* %9
%23 = icmp sge i32 %22, 0
br i1 %23, label %24, label %210
24: ; preds = %7
%25 = load i8*, i8** %15
%26 = call i32 @atoi(i8* %25)
store i32 %26, i32* %16
store i32 %26, i32* %17
%27 = load i32, i32* %17
%28 = icmp slt i32 %27, 0
br i1 %28, label %32, label %29
29: ; preds = %24
%30 = load i32, i32* %17
%31 = icmp sgt i32 %30, 8
br i1 %31, label %32, label %35
32: ; preds = %29, %24
%33 = load i32, i32* %17
%34 = call i32 @fatal_error_i(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %33)
br label %35
35: ; preds = %32, %29
%36 = load i8**, i8*** %10
%37 = load i32, i32* %17
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8*, i8** %36, i64 %38
%40 = load i8*, i8** %39
store i8* %40, i8** %21
%41 = icmp eq i8* %40, null
br i1 %41, label %42, label %46
42: ; preds = %35
%43 = load i8*, i8** %13
%44 = load i32, i32* %17
%45 = call i32 (i8*, i8*, ...) @sprintf(i8* %43, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %44)
store i32 0, i32* %8
br label %211
46: ; preds = %35
%47 = load i32, i32* %17
%48 = icmp eq i32 %47, 0
br i1 %48, label %49, label %50
49: ; preds = %46
store i32 16, i32* %19
br label %63
50: ; preds = %46
%51 = load i32, i32* %17
%52 = icmp eq i32 %51, 8
br i1 %52, label %53, label %54
53: ; preds = %50
store i32 4, i32* %19
br label %62
54: ; preds = %50
%55 = load i8**, i8*** %10
%56 = load i32, i32* %17
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i8*, i8** %55, i64 %57
%59 = load i8*, i8** %58
%60 = getelementptr inbounds i8, i8* %59, i64 0
%61 = call i32 @uint4(i8* %60)
store i32 %61, i32* %19
br label %62
62: ; preds = %54, %53
br label %63
63: ; preds = %62, %49
%64 = load i32, i32* %9
%65 = icmp eq i32 %64, 0
br i1 %65, label %66, label %70
66: ; preds = %63
%67 = load i32, i32* %19
%68 = uitofp i32 %67 to double
%69 = fmul double 2.000000e+00, %68
store double %69, double* %20
br label %100
70: ; preds = %63
%71 = load i32, i32* %9
%72 = icmp eq i32 %71, 1
br i1 %72, label %73, label %77
73: ; preds = %70
%74 = load i32, i32* %19
%75 = uitofp i32 %74 to double
%76 = fmul double 3.000000e+00, %75
store double %76, double* %20
br label %99
77: ; preds = %70
%78 = load i32, i32* %19
store i32 %78, i32* %18
store i32 0, i32* %16
br label %79
79: ; preds = %82, %77
%80 = load i32, i32* %18
%81 = icmp ne i32 %80, 0
br i1 %81, label %82, label %87
82: ; preds = %79
%83 = load i32, i32* %18
%84 = udiv i32 %83, 10
store i32 %84, i32* %18
%85 = load i32, i32* %16
%86 = add nsw i32 %85, 1
store i32 %86, i32* %16
br label %79
87: ; preds = %79
%88 = load i32, i32* %19
%89 = load i32, i32* %16
%90 = mul i32 %88, %89
%91 = load i32, i32* %19
%92 = mul i32 4, %91
%93 = add i32 %90, %92
%94 = load i32, i32* %19
%95 = urem i32 %94, 15
%96 = mul i32 4, %95
%97 = add i32 %93, %96
%98 = uitofp i32 %97 to double
store double %98, double* %20
br label %99
99: ; preds = %87, %73
br label %100
100: ; preds = %99, %66
%101 = load double, double* %20
%102 = fcmp oge double %101, 2.900000e+04
br i1 %102, label %103, label %107
103: ; preds = %100
%104 = load i8*, i8** %13
%105 = load i32, i32* %17
%106 = call i32 (i8*, i8*, ...) @sprintf(i8* %104, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %105)
store i32 0, i32* %8
br label %211
107: ; preds = %100
%108 = load i32, i32* %9
%109 = icmp eq i32 %108, 0
br i1 %109, label %110, label %115
110: ; preds = %107
%111 = load i8*, i8** %13
%112 = load i32, i32* %17
%113 = load i32, i32* %19
%114 = call i32 (i8*, i8*, ...) @sprintf(i8* %111, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %112, i32 %113)
br label %120
115: ; preds = %107
%116 = load i8*, i8** %13
%117 = load i32, i32* %17
%118 = load i32, i32* %19
%119 = call i32 (i8*, i8*, ...) @sprintf(i8* %116, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %117, i32 %118)
br label %120
120: ; preds = %115, %110
%121 = load i8*, i8** %13
%122 = call i32 @strlen(i8* %121)
%123 = load i8*, i8** %13
%124 = sext i32 %122 to i64
%125 = getelementptr inbounds i8, i8* %123, i64 %124
store i8* %125, i8** %13
%126 = load i32, i32* %9
%127 = icmp eq i32 %126, 0
br i1 %127, label %128, label %146
128: ; preds = %120
br label %129
129: ; preds = %133, %128
%130 = load i32, i32* %19
%131 = add i32 %130, -1
store i32 %131, i32* %19
%132 = icmp ne i32 %130, 0
br i1 %132, label %133, label %145
133: ; preds = %129
%134 = load i8*, i8** %13
%135 = load i8*, i8** %21
%136 = getelementptr inbounds i8, i8* %135, i32 1
store i8* %136, i8** %21
%137 = load i8, i8* %135
%138 = zext i8 %137 to i32
%139 = call i32 (i8*, i8*, ...) @sprintf(i8* %134, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 %138)
%140 = load i8*, i8** %13
%141 = call i32 @strlen(i8* %140)
%142 = load i8*, i8** %13
%143 = sext i32 %141 to i64
%144 = getelementptr inbounds i8, i8* %142, i64 %143
store i8* %144, i8** %13
br label %129
145: ; preds = %129
br label %209
146: ; preds = %120
%147 = load i32, i32* %9
%148 = icmp eq i32 %147, 1
br i1 %148, label %149, label %170
149: ; preds = %146
store i32 1, i32* %18
br label %150
150: ; preds = %166, %149
%151 = load i32, i32* %18
%152 = load i32, i32* %19
%153 = icmp ule i32 %151, %152
br i1 %153, label %154, label %169
154: ; preds = %150
%155 = load i8*, i8** %13
%156 = load i8*, i8** %21
%157 = getelementptr inbounds i8, i8* %156, i32 1
store i8* %157, i8** %21
%158 = load i8, i8* %156
%159 = zext i8 %158 to i32
%160 = call i32 (i8*, i8*, ...) @sprintf(i8* %155, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 %159)
%161 = load i8*, i8** %13
%162 = call i32 @strlen(i8* %161)
%163 = load i8*, i8** %13
%164 = sext i32 %162 to i64
%165 = getelementptr inbounds i8, i8* %163, i64 %164
store i8* %165, i8** %13
br label %166
166: ; preds = %154
%167 = load i32, i32* %18
%168 = add i32 %167, 1
store i32 %168, i32* %18
br label %150
169: ; preds = %150
br label %208
170: ; preds = %146
%171 = load i32, i32* %9
%172 = icmp sge i32 %171, 2
br i1 %172, label %173, label %207
173: ; preds = %170
store i32 1, i32* %18
br label %174
174: ; preds = %203, %173
%175 = load i32, i32* %18
%176 = load i32, i32* %19
%177 = icmp ule i32 %175, %176
br i1 %177, label %178, label %206
178: ; preds = %174
%179 = load i8*, i8** %13
%180 = load i32, i32* %18
%181 = load i8*, i8** %21
%182 = getelementptr inbounds i8, i8* %181, i32 1
store i8* %182, i8** %21
%183 = load i8, i8* %181
%184 = zext i8 %183 to i32
%185 = call i32 (i8*, i8*, ...) @sprintf(i8* %179, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i32 %180, i32 %184)
%186 = load i8*, i8** %13
%187 = call i32 @strlen(i8* %186)
%188 = load i8*, i8** %13
%189 = sext i32 %187 to i64
%190 = getelementptr inbounds i8, i8* %188, i64 %189
store i8* %190, i8** %13
%191 = load i8*, i8** %13
%192 = load i32, i32* %18
%193 = urem i32 %192, 15
%194 = icmp eq i32 %193, 0
%195 = zext i1 %194 to i64
%196 = select i1 %194, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0)
%197 = call i32 (i8*, i8*, ...) @sprintf(i8* %191, i8* %196)
%198 = load i8*, i8** %13
%199 = call i32 @strlen(i8* %198)
%200 = load i8*, i8** %13
%201 = sext i32 %199 to i64
%202 = getelementptr inbounds i8, i8* %200, i64 %201
store i8* %202, i8** %13
br label %203
203: ; preds = %178
%204 = load i32, i32* %18
%205 = add i32 %204, 1
store i32 %205, i32* %18
br label %174
206: ; preds = %174
br label %207
207: ; preds = %206, %170
br label %208
208: ; preds = %207, %169
br label %209
209: ; preds = %208, %145
br label %210
210: ; preds = %209, %7
store i32 0, i32* %8
br label %211
211: ; preds = %210, %103, %42
%212 = load i32, i32* %8
ret i32 %212
}

LLVM IR (-O2):
@.str = [29 x i8] c"0xSec: bad section number %d\00"
@.str.1 = [17 x i8] c"sec%d is missing\00"
@.str.2 = [24 x i8] c"Sec%d=too long to print\00"
@.str.3 = [16 x i8] c"Sec%d(1..%u)=0x\00"
@.str.4 = [14 x i8] c"Sec%d(1..%u)=\00"
@.str.5 = [5 x i8] c"%.2x\00"
@.str.6 = [6 x i8] c" %.2x\00"
@.str.7 = [8 x i8] c"%u:%.2x\00"
@.str.8 = [4 x i8] c"\0A \00"
@.str.9 = [2 x i8] c" \00"
define i32 @f_0xSec(i32 %0, i8** nocapture %1, float* nocapture readnone %2, i32 %3, i8* %4, i8** nocapture readnone %5, i8* nocapture %6) {
%8 = icmp sgt i32 %0, -1
br i1 %8, label %9, label %115
9: ; preds = %7
%10 = tail call i32 @atoi(i8* %6)
%11 = icmp ugt i32 %10, 8
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = tail call i32 @fatal_error_i(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %14
14: ; preds = %9, %12
%15 = sext i32 %10 to i64
%16 = getelementptr inbounds i8*, i8** %1, i64 %15
%17 = load i8*, i8** %16
%18 = icmp eq i8* %17, null
br i1 %18, label %112, label %19
19: ; preds = %14
switch i32 %10, label %21 [
i32 0, label %23
i32 8, label %20
]
20: ; preds = %19
br label %23
21: ; preds = %19
%22 = tail call i32 @uint4(i8* %17)
br label %23
23: ; preds = %19, %20, %21
%24 = phi i32 [ 4, %20 ], [ %22, %21 ], [ 16, %19 ]
%25 = icmp eq i32 %0, 0
br i1 %25, label %45, label %26
26: ; preds = %23
%27 = icmp eq i32 %0, 1
br i1 %27, label %47, label %28
28: ; preds = %26
%29 = icmp eq i32 %24, 0
br i1 %29, label %38, label %30
30: ; preds = %28, %30
%31 = phi i32 [ %33, %30 ], [ %24, %28 ]
%32 = phi i32 [ %34, %30 ], [ 0, %28 ]
%33 = udiv i32 %31, 10
%34 = add nuw nsw i32 %32, 1
%35 = icmp ult i32 %31, 10
br i1 %35, label %36, label %30
36: ; preds = %30
%37 = add nuw i32 %32, 5
br label %38
38: ; preds = %36, %28
%39 = phi i32 [ 4, %28 ], [ %37, %36 ]
%40 = mul i32 %39, %24
%41 = urem i32 %24, 15
%42 = shl nuw nsw i32 %41, 2
%43 = add i32 %40, %42
%44 = icmp ult i32 %43, 29000
br i1 %44, label %71, label %112
45: ; preds = %23
%46 = icmp ult i32 %24, 14500
br i1 %46, label %51, label %112
47: ; preds = %26
%48 = zext i32 %24 to i64
%49 = mul nuw nsw i64 %48, 3
%50 = icmp ult i64 %49, 29000
br i1 %50, label %71, label %112
51: ; preds = %45
%52 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %4, i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %10, i32 %24)
%53 = tail call i32 @strlen(i8* %4)
%54 = icmp eq i32 %24, 0
br i1 %54, label %115, label %55
55: ; preds = %51
%56 = sext i32 %53 to i64
%57 = getelementptr inbounds i8, i8* %4, i64 %56
br label %58
58: ; preds = %55, %58
%59 = phi i8* [ %63, %58 ], [ %17, %55 ]
%60 = phi i32 [ %62, %58 ], [ %24, %55 ]
%61 = phi i8* [ %69, %58 ], [ %57, %55 ]
%62 = add i32 %60, -1
%63 = getelementptr inbounds i8, i8* %59, i64 1
%64 = load i8, i8* %59
%65 = zext i8 %64 to i32
%66 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %61, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 %65)
%67 = tail call i32 @strlen(i8* %61)
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds i8, i8* %61, i64 %68
%70 = icmp eq i32 %62, 0
br i1 %70, label %115, label %58
71: ; preds = %38, %47
%72 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %4, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %10, i32 %24)
%73 = tail call i32 @strlen(i8* %4)
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds i8, i8* %4, i64 %74
%76 = icmp eq i32 %24, 0
br i1 %27, label %78, label %77
77: ; preds = %71
br i1 %76, label %115, label %92
78: ; preds = %71
br i1 %76, label %115, label %79
79: ; preds = %78, %79
%80 = phi i8* [ %83, %79 ], [ %17, %78 ]
%81 = phi i32 [ %90, %79 ], [ 1, %78 ]
%82 = phi i8* [ %89, %79 ], [ %75, %78 ]
%83 = getelementptr inbounds i8, i8* %80, i64 1
%84 = load i8, i8* %80
%85 = zext i8 %84 to i32
%86 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %82, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 %85)
%87 = tail call i32 @strlen(i8* %82)
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds i8, i8* %82, i64 %88
%90 = add i32 %81, 1
%91 = icmp ugt i32 %90, %24
br i1 %91, label %115, label %79
92: ; preds = %77, %92
%93 = phi i8* [ %96, %92 ], [ %17, %77 ]
%94 = phi i32 [ %110, %92 ], [ 1, %77 ]
%95 = phi i8* [ %109, %92 ], [ %75, %77 ]
%96 = getelementptr inbounds i8, i8* %93, i64 1
%97 = load i8, i8* %93
%98 = zext i8 %97 to i32
%99 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %95, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i32 %94, i32 %98)
%100 = tail call i32 @strlen(i8* %95)
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds i8, i8* %95, i64 %101
%103 = urem i32 %94, 15
%104 = icmp eq i32 %103, 0
%105 = select i1 %104, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0)
%106 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %102, i8* dereferenceable(1) %105)
%107 = tail call i32 @strlen(i8* %102)
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds i8, i8* %102, i64 %108
%110 = add i32 %94, 1
%111 = icmp ugt i32 %110, %24
br i1 %111, label %115, label %92
112: ; preds = %38, %47, %45, %14
%113 = phi i8* [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), %14 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), %45 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), %47 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), %38 ]
%114 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %4, i8* dereferenceable(1) %113, i32 %10)
br label %115
115: ; preds = %92, %79, %58, %112, %77, %78, %51, %7
ret i32 0
}