#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 */
struct region_info_user {
  int offset;
  int numblocks;
  int regionindex;
  int /*<<< orphan*/ erasesize;
};
struct mtd_info_user {
  int type;
  int flags;
  int /*<<< orphan*/ oobsize;
  int /*<<< orphan*/ writesize;
  int /*<<< orphan*/ erasesize;
  int /*<<< orphan*/ size;
};

/* Variables and functions */
#define MTD_ABSENT 138
#define MTD_BIT_WRITEABLE 137
int MTD_CAP_NANDFLASH;
int MTD_CAP_NORFLASH;
int MTD_CAP_RAM;
int MTD_CAP_ROM;
#define MTD_DATAFLASH 136
#define MTD_NANDFLASH 135
#define MTD_NORFLASH 134
#define MTD_NO_ERASE 133
#define MTD_POWERUP_LOCK 132
#define MTD_RAM 131
#define MTD_ROM 130
#define MTD_UBIVOLUME 129
#define MTD_WRITEABLE 128
int getmeminfo(int, struct mtd_info_user *);
int getregions(int, struct region_info_user *, int *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ printsize(int /*<<< orphan*/);
int showinfo(int fd) {
  int i, err, n;
  struct mtd_info_user mtd;
  static struct region_info_user region[1024];
  err = getmeminfo(fd, &mtd);
  if (err < 0) {
    perror("MEMGETINFO");
    return (1);
  }
  err = getregions(fd, region, &n);
  if (err < 0) {
    perror("MEMGETREGIONCOUNT");
    return (1);
  }
  printf("mtd.type = ");
  switch (mtd.type) {
  case MTD_ABSENT:
    printf("MTD_ABSENT");
    break;
  case MTD_RAM:
    printf("MTD_RAM");
    break;
  case MTD_ROM:
    printf("MTD_ROM");
    break;
  case MTD_NORFLASH:
    printf("MTD_NORFLASH");
    break;
  case MTD_NANDFLASH:
    printf("MTD_NANDFLASH");
    break;
  case MTD_DATAFLASH:
    printf("MTD_DATAFLASH");
    break;
  case MTD_UBIVOLUME:
    printf("MTD_UBIVOLUME");
  default:
    printf("(unknown type - new MTD API maybe?)");
  }
  printf("\nmtd.flags = ");
  if (mtd.flags == MTD_CAP_ROM)
    printf("MTD_CAP_ROM");
  else if (mtd.flags == MTD_CAP_RAM)
    printf("MTD_CAP_RAM");
  else if (mtd.flags == MTD_CAP_NORFLASH)
    printf("MTD_CAP_NORFLASH");
  else if (mtd.flags == MTD_CAP_NANDFLASH)
    printf("MTD_CAP_NANDFLASH");
  else if (mtd.flags == MTD_WRITEABLE)
    printf("MTD_WRITEABLE");
  else {
    int first = 1;
    static struct {
      const char *name;
      int value;
    } flags[] = {{"MTD_WRITEABLE", MTD_WRITEABLE},
                 {"MTD_BIT_WRITEABLE", MTD_BIT_WRITEABLE},
                 {"MTD_NO_ERASE", MTD_NO_ERASE},
                 {"MTD_POWERUP_LOCK", MTD_POWERUP_LOCK},
                 {NULL, -1}};
    for (i = 0; flags[i].name != NULL; i++)
      if (mtd.flags & flags[i].value) {
        if (first) {
          printf("%s", flags[i].name);
          first = 0;
        } else
          printf(" | %s", flags[i].name);
      }
  }
  printf("\nmtd.size = ");
  printsize(mtd.size);
  printf("\nmtd.erasesize = ");
  printsize(mtd.erasesize);
  printf("\nmtd.writesize = ");
  printsize(mtd.writesize);
  printf("\nmtd.oobsize = ");
  printsize(mtd.oobsize);
  printf("\n"
         "regions = %d\n"
         "\n",
         n);
  for (i = 0; i < n; i++) {
    printf("region[%d].offset = 0x%.8x\n"
           "region[%d].erasesize = ",
           i, region[i].offset, i);
    printsize(region[i].erasesize);
    printf("\nregion[%d].numblocks = %d\n"
           "region[%d].regionindex = %d\n",
           i, region[i].numblocks, i, region[i].regionindex);
  }
  return (0);
}


x86 assembly (clang, -O0):
<showinfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x30(%rbp),%rsi
call   1050 <getmeminfo@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    118c <showinfo+0x3c>
lea    0xead(%rip),%rdi
call   1060 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1537 <showinfo+0x3e7>
mov    -0x8(%rbp),%edi
lea    0x2f1a(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <getregions@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    11c4 <showinfo+0x74>
lea    0xe80(%rip),%rdi
call   1060 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1537 <showinfo+0x3e7>
lea    0xe7a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x30(%rbp),%eax
add    $0xffffff7f,%eax
mov    %eax,%ecx
mov    %rcx,-0x40(%rbp)
sub    $0x9,%eax
ja     127d <showinfo+0x12d>
mov    -0x40(%rbp),%rax
lea    0xe0c(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    128b <showinfo+0x13b>
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    128b <showinfo+0x13b>
lea    0xe3a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    128b <showinfo+0x13b>
lea    0xe2f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    128b <showinfo+0x13b>
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    128b <showinfo+0x13b>
lea    0xe24(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    128b <showinfo+0x13b>
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe35(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x2c(%rbp),%eax
mov    0x2d25(%rip),%rcx
cmp    (%rcx),%eax
jne    12be <showinfo+0x16e>
lea    0xe23(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1425 <showinfo+0x2d5>
mov    -0x2c(%rbp),%eax
mov    0x2d18(%rip),%rcx
cmp    (%rcx),%eax
jne    12e3 <showinfo+0x193>
lea    0xe0a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1420 <showinfo+0x2d0>
mov    -0x2c(%rbp),%eax
mov    0x2ceb(%rip),%rcx
cmp    (%rcx),%eax
jne    1308 <showinfo+0x1b8>
lea    0xdf1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    141b <showinfo+0x2cb>
mov    -0x2c(%rbp),%eax
mov    0x2cd6(%rip),%rcx
cmp    (%rcx),%eax
jne    132d <showinfo+0x1dd>
lea    0xddd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1416 <showinfo+0x2c6>
cmpl   $0x80,-0x2c(%rbp)
jne    134d <showinfo+0x1fd>
lea    0xdcf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1411 <showinfo+0x2c1>
movl   $0x1,-0x34(%rbp)
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rcx
lea    0x2cea(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
cmpq   $0x0,(%rax)
je     140c <showinfo+0x2bc>
mov    -0x2c(%rbp),%eax
movslq -0xc(%rbp),%rdx
lea    0x2ccb(%rip),%rcx
shl    $0x4,%rdx
add    %rdx,%rcx
and    0x8(%rcx),%eax
cmp    $0x0,%eax
je     13f9 <showinfo+0x2a9>
cmpl   $0x0,-0x34(%rbp)
je     13d1 <showinfo+0x281>
movslq -0xc(%rbp),%rcx
lea    0x2ca3(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%rsi
lea    0xd93(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x34(%rbp)
jmp    13f4 <showinfo+0x2a4>
movslq -0xc(%rbp),%rcx
lea    0x2c74(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%rsi
lea    0xd61(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13f9 <showinfo+0x2a9>
jmp    13fe <showinfo+0x2ae>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    135b <showinfo+0x20b>
jmp    1411 <showinfo+0x2c1>
jmp    1416 <showinfo+0x2c6>
jmp    141b <showinfo+0x2cb>
jmp    1420 <showinfo+0x2d0>
jmp    1425 <showinfo+0x2d5>
lea    0xd28(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%edi
call   1070 <printsize@plt>
lea    0xd1f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%edi
call   1070 <printsize@plt>
lea    0xd1b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x24(%rbp),%edi
call   1070 <printsize@plt>
lea    0xd17(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%edi
call   1070 <printsize@plt>
mov    -0x14(%rbp),%esi
lea    0xd0e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1530 <showinfo+0x3e0>
mov    -0xc(%rbp),%esi
movslq -0xc(%rbp),%rcx
lea    0x2c01(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%edx
mov    -0xc(%rbp),%ecx
lea    0xce3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movslq -0xc(%rbp),%rcx
lea    0x2bdc(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0xc(%rax),%edi
call   1070 <printsize@plt>
mov    -0xc(%rbp),%esi
movslq -0xc(%rbp),%rcx
lea    0x2bbf(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x4(%rax),%edx
mov    -0xc(%rbp),%ecx
movslq -0xc(%rbp),%rdi
lea    0x2ba7(%rip),%rax
shl    $0x4,%rdi
add    %rdi,%rax
mov    0x8(%rax),%r8d
lea    0xcbd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1495 <showinfo+0x345>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showinfo>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x20,%rsp
mov    %edi,%ebx
lea    0x8(%rsp),%rsi
call   1050 <getmeminfo@plt>
test   %eax,%eax
js     126a <showinfo+0x11a>
lea    0x2ee8(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    %ebx,%edi
call   1030 <getregions@plt>
test   %eax,%eax
js     1273 <showinfo+0x123>
lea    0xeb2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xffffff7f,%eax
add    0x8(%rsp),%eax
cmp    $0x9,%eax
ja     11cd <showinfo+0x7d>
lea    0xea2(%rip),%rdi
lea    0xe4a(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xecf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecf(%rip),%rdi
jmp    1201 <showinfo+0xb1>
lea    0xe87(%rip),%rdi
jmp    1201 <showinfo+0xb1>
lea    0xe76(%rip),%rdi
jmp    1201 <showinfo+0xb1>
lea    0xe7d(%rip),%rdi
jmp    1201 <showinfo+0xb1>
lea    0xe81(%rip),%rdi
jmp    1201 <showinfo+0xb1>
lea    0xe86(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%eax
mov    0x2da7(%rip),%rcx
cmp    (%rcx),%eax
jne    122e <showinfo+0xde>
lea    0xea9(%rip),%rdi
jmp    129c <showinfo+0x14c>
mov    0x2dab(%rip),%rcx
cmp    (%rcx),%eax
jne    1242 <showinfo+0xf2>
lea    0xea1(%rip),%rdi
jmp    129c <showinfo+0x14c>
mov    0x2d8f(%rip),%rcx
cmp    (%rcx),%eax
jne    1256 <showinfo+0x106>
lea    0xe99(%rip),%rdi
jmp    129c <showinfo+0x14c>
mov    0x2d8b(%rip),%rcx
cmp    (%rcx),%eax
jne    128a <showinfo+0x13a>
lea    0xe96(%rip),%rdi
jmp    129c <showinfo+0x14c>
lea    0xdb7(%rip),%rdi
jmp    127a <showinfo+0x12a>
lea    0xdb9(%rip),%rdi
call   1060 <perror@plt>
mov    $0x1,%r14d
jmp    1383 <showinfo+0x233>
cmp    $0x80,%eax
jne    1394 <showinfo+0x244>
lea    0xe74(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeaa(%rip),%rdi
xor    %r14d,%r14d
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%rsp),%edi
call   1070 <printsize@plt>
lea    0xe9d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rsp),%edi
call   1070 <printsize@plt>
lea    0xe98(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp),%edi
call   1070 <printsize@plt>
lea    0xe93(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%edi
call   1070 <printsize@plt>
mov    0x4(%rsp),%esi
lea    0xe88(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x0,0x4(%rsp)
jle    1383 <showinfo+0x233>
lea    0x2d4a(%rip),%r13
xor    %r14d,%r14d
lea    0xe79(%rip),%r15
lea    0xea5(%rip),%r12
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    -0xc(%r13),%edx
mov    %r15,%rdi
mov    %ebx,%esi
mov    %ebx,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x0(%r13),%edi
call   1070 <printsize@plt>
mov    -0x8(%r13),%edx
mov    -0x4(%r13),%r8d
mov    %r12,%rdi
mov    %ebx,%esi
mov    %ebx,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
movslq 0x4(%rsp),%rax
add    $0x10,%r13
cmp    %rax,%rbx
jl     1340 <showinfo+0x1f0>
mov    %r14d,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
test   $0x80,%al
jne    13a5 <showinfo+0x255>
test   $0x89,%al
je     1417 <showinfo+0x2c7>
lea    0xdae(%rip),%rdi
jmp    13c8 <showinfo+0x278>
lea    0xda5(%rip),%rdi
lea    0xd5d(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
testb  $0x89,0xc(%rsp)
je     13d6 <showinfo+0x286>
lea    0xd86(%rip),%rdi
lea    0xd4f(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
testb  $0x85,0xc(%rsp)
je     13f2 <showinfo+0x2a2>
lea    0xd6a(%rip),%rdi
lea    0xd45(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
testb  $0x84,0xc(%rsp)
je     12a3 <showinfo+0x153>
lea    0xd4a(%rip),%rdi
lea    0xd32(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    12a3 <showinfo+0x153>
testb  $0x85,0xc(%rsp)
je     1427 <showinfo+0x2d7>
lea    0xd2c(%rip),%rdi
jmp    13e4 <showinfo+0x294>
testb  $0x84,0xc(%rsp)
je     12a3 <showinfo+0x153>
lea    0xd18(%rip),%rdi
jmp    1404 <showinfo+0x2b4>

LLVM IR (-O0):
%struct.region_info_user = type { i32, i32, i32, i32 }
%struct.anon = type { i8*, i32 }
%struct.mtd_info_user = type { i32, i32, i32, i32, i32, i32 }
@showinfo.region = internal global [1024 x %struct.region_info_user] zeroinitializer
@.str = [11 x i8] c"MEMGETINFO\00"
@.str.1 = [18 x i8] c"MEMGETREGIONCOUNT\00"
@.str.2 = [12 x i8] c"mtd.type = \00"
@.str.3 = [11 x i8] c"MTD_ABSENT\00"
@.str.4 = [8 x i8] c"MTD_RAM\00"
@.str.5 = [8 x i8] c"MTD_ROM\00"
@.str.6 = [13 x i8] c"MTD_NORFLASH\00"
@.str.7 = [14 x i8] c"MTD_NANDFLASH\00"
@.str.8 = [14 x i8] c"MTD_DATAFLASH\00"
@.str.9 = [14 x i8] c"MTD_UBIVOLUME\00"
@.str.10 = [36 x i8] c"(unknown type - new MTD API maybe?)\00"
@.str.11 = [14 x i8] c"\0Amtd.flags = \00"
@MTD_CAP_ROM = global i32 0
@.str.12 = [12 x i8] c"MTD_CAP_ROM\00"
@MTD_CAP_RAM = global i32 0
@.str.13 = [12 x i8] c"MTD_CAP_RAM\00"
@MTD_CAP_NORFLASH = global i32 0
@.str.14 = [17 x i8] c"MTD_CAP_NORFLASH\00"
@MTD_CAP_NANDFLASH = global i32 0
@.str.15 = [18 x i8] c"MTD_CAP_NANDFLASH\00"
@.str.16 = [14 x i8] c"MTD_WRITEABLE\00"
@showinfo.flags = internal global [5 x %struct.anon] [%struct.anon { i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.16, i32 0, i32 0), i32 128 }, %struct.anon { i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.17, i32 0, i32 0), i32 137 }, %struct.anon { i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.18, i32 0, i32 0), i32 133 }, %struct.anon { i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.19, i32 0, i32 0), i32 132 }, %struct.anon { i8* null, i32 -1 }]
@.str.17 = [18 x i8] c"MTD_BIT_WRITEABLE\00"
@.str.18 = [13 x i8] c"MTD_NO_ERASE\00"
@.str.19 = [17 x i8] c"MTD_POWERUP_LOCK\00"
@.str.20 = [3 x i8] c"%s\00"
@.str.21 = [6 x i8] c" | %s\00"
@.str.22 = [13 x i8] c"\0Amtd.size = \00"
@.str.23 = [18 x i8] c"\0Amtd.erasesize = \00"
@.str.24 = [18 x i8] c"\0Amtd.writesize = \00"
@.str.25 = [16 x i8] c"\0Amtd.oobsize = \00"
@.str.26 = [16 x i8] c"\0Aregions = %d\0A\0A\00"
@.str.27 = [51 x i8] c"region[%d].offset = 0x%.8x\0Aregion[%d].erasesize = \00"
@.str.28 = [56 x i8] c"\0Aregion[%d].numblocks = %d\0Aregion[%d].regionindex = %d\0A\00"
define i32 @showinfo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.mtd_info_user
%8 = alloca i32
store i32 %0, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @getmeminfo(i32 %9, %struct.mtd_info_user* %7)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %2
br label %177
15: ; preds = %1
%16 = load i32, i32* %3
%17 = call i32 @getregions(i32 %16, %struct.region_info_user* getelementptr inbounds ([1024 x %struct.region_info_user], [1024 x %struct.region_info_user]* @showinfo.region, i64 0, i64 0), i32* %6)
store i32 %17, i32* %5
%18 = load i32, i32* %5
%19 = icmp slt i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %15
%21 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %2
br label %177
22: ; preds = %15
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%24 = getelementptr inbounds %struct.mtd_info_user, %struct.mtd_info_user* %7, i32 0, i32 0
%25 = load i32, i32* %24
switch i32 %25, label %40 [
i32 138, label %26
i32 131, label %28
i32 130, label %30
i32 134, label %32
i32 135, label %34
i32 136, label %36
i32 129, label %38
]
26: ; preds = %22
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
br label %42
28: ; preds = %22
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
br label %42
30: ; preds = %22
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
br label %42
32: ; preds = %22
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
br label %42
34: ; preds = %22
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0))
br label %42
36: ; preds = %22
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
br label %42
38: ; preds = %22
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
br label %40
40: ; preds = %22, %38
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.10, i64 0, i64 0))
br label %42
42: ; preds = %40, %36, %34, %32, %30, %28, %26
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.11, i64 0, i64 0))
%44 = getelementptr inbounds %struct.mtd_info_user, %struct.mtd_info_user* %7, i32 0, i32 1
%45 = load i32, i32* %44
%46 = load i32, i32* @MTD_CAP_ROM
%47 = icmp eq i32 %45, %46
br i1 %47, label %48, label %50
48: ; preds = %42
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0))
br label %122
50: ; preds = %42
%51 = getelementptr inbounds %struct.mtd_info_user, %struct.mtd_info_user* %7, i32 0, i32 1
%52 = load i32, i32* %51
%53 = load i32, i32* @MTD_CAP_RAM
%54 = icmp eq i32 %52, %53
br i1 %54, label %55, label %57
55: ; preds = %50
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0))
br label %121
57: ; preds = %50
%58 = getelementptr inbounds %struct.mtd_info_user, %struct.mtd_info_user* %7, i32 0, i32 1
%59 = load i32, i32* %58
%60 = load i32, i32* @MTD_CAP_NORFLASH
%61 = icmp eq i32 %59, %60
br i1 %61, label %62, label %64
62: ; preds = %57
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0))
br label %120
64: ; preds = %57
%65 = getelementptr inbounds %struct.mtd_info_user, %struct.mtd_info_user* %7, i32 0, i32 1
%66 = load i32, i32* %65
%67 = load i32, i32* @MTD_CAP_NANDFLASH
%68 = icmp eq i32 %66, %67
br i1 %68, label %69, label %71
69: ; preds = %64
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.15, i64 0, i64 0))
br label %119
71: ; preds = %64
%72 = getelementptr inbounds %struct.mtd_info_user, %struct.mtd_info_user* %7, i32 0, i32 1
%73 = load i32, i32* %72
%74 = icmp eq i32 %73, 128
br i1 %74, label %75, label %77
75: ; preds = %71
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.16, i64 0, i64 0))
br label %118
77: ; preds = %71
store i32 1, i32* %8
store i32 0, i32* %4
br label %78
78: ; preds = %114, %77
%79 = load i32, i32* %4
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds [5 x %struct.anon], [5 x %struct.anon]* @showinfo.flags, i64 0, i64 %80
%82 = getelementptr inbounds %struct.anon, %struct.anon* %81, i32 0, i32 0
%83 = load i8*, i8** %82
%84 = icmp ne i8* %83, null
br i1 %84, label %85, label %117
85: ; preds = %78
%86 = getelementptr inbounds %struct.mtd_info_user, %struct.mtd_info_user* %7, i32 0, i32 1
%87 = load i32, i32* %86
%88 = load i32, i32* %4
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [5 x %struct.anon], [5 x %struct.anon]* @showinfo.flags, i64 0, i64 %89
%91 = getelementptr inbounds %struct.anon, %struct.anon* %90, i32 0, i32 1
%92 = load i32, i32* %91
%93 = and i32 %87, %92
%94 = icmp ne i32 %93, 0
br i1 %94, label %95, label %113
95: ; preds = %85
%96 = load i32, i32* %8
%97 = icmp ne i32 %96, 0
br i1 %97, label %98, label %105
98: ; preds = %95
%99 = load i32, i32* %4
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds [5 x %struct.anon], [5 x %struct.anon]* @showinfo.flags, i64 0, i64 %100
%102 = getelementptr inbounds %struct.anon, %struct.anon* %101, i32 0, i32 0
%103 = load i8*, i8** %102
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), i8* %103)
store i32 0, i32* %8
br label %112
105: ; preds = %95
%106 = load i32, i32* %4
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds [5 x %struct.anon], [5 x %struct.anon]* @showinfo.flags, i64 0, i64 %107
%109 = getelementptr inbounds %struct.anon, %struct.anon* %108, i32 0, i32 0
%110 = load i8*, i8** %109
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.21, i64 0, i64 0), i8* %110)
br label %112
112: ; preds = %105, %98
br label %113
113: ; preds = %112, %85
br label %114
114: ; preds = %113
%115 = load i32, i32* %4
%116 = add nsw i32 %115, 1
store i32 %116, i32* %4
br label %78
117: ; preds = %78
br label %118
118: ; preds = %117, %75
br label %119
119: ; preds = %118, %69
br label %120
120: ; preds = %119, %62
br label %121
121: ; preds = %120, %55
br label %122
122: ; preds = %121, %48
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.22, i64 0, i64 0))
%124 = getelementptr inbounds %struct.mtd_info_user, %struct.mtd_info_user* %7, i32 0, i32 5
%125 = load i32, i32* %124
%126 = call i32 @printsize(i32 %125)
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.23, i64 0, i64 0))
%128 = getelementptr inbounds %struct.mtd_info_user, %struct.mtd_info_user* %7, i32 0, i32 4
%129 = load i32, i32* %128
%130 = call i32 @printsize(i32 %129)
%131 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.24, i64 0, i64 0))
%132 = getelementptr inbounds %struct.mtd_info_user, %struct.mtd_info_user* %7, i32 0, i32 3
%133 = load i32, i32* %132
%134 = call i32 @printsize(i32 %133)
%135 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.25, i64 0, i64 0))
%136 = getelementptr inbounds %struct.mtd_info_user, %struct.mtd_info_user* %7, i32 0, i32 2
%137 = load i32, i32* %136
%138 = call i32 @printsize(i32 %137)
%139 = load i32, i32* %6
%140 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.26, i64 0, i64 0), i32 %139)
store i32 0, i32* %4
br label %141
141: ; preds = %173, %122
%142 = load i32, i32* %4
%143 = load i32, i32* %6
%144 = icmp slt i32 %142, %143
br i1 %144, label %145, label %176
145: ; preds = %141
%146 = load i32, i32* %4
%147 = load i32, i32* %4
%148 = sext i32 %147 to i64
%149 = getelementptr inbounds [1024 x %struct.region_info_user], [1024 x %struct.region_info_user]* @showinfo.region, i64 0, i64 %148
%150 = getelementptr inbounds %struct.region_info_user, %struct.region_info_user* %149, i32 0, i32 0
%151 = load i32, i32* %150
%152 = load i32, i32* %4
%153 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.27, i64 0, i64 0), i32 %146, i32 %151, i32 %152)
%154 = load i32, i32* %4
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds [1024 x %struct.region_info_user], [1024 x %struct.region_info_user]* @showinfo.region, i64 0, i64 %155
%157 = getelementptr inbounds %struct.region_info_user, %struct.region_info_user* %156, i32 0, i32 3
%158 = load i32, i32* %157
%159 = call i32 @printsize(i32 %158)
%160 = load i32, i32* %4
%161 = load i32, i32* %4
%162 = sext i32 %161 to i64
%163 = getelementptr inbounds [1024 x %struct.region_info_user], [1024 x %struct.region_info_user]* @showinfo.region, i64 0, i64 %162
%164 = getelementptr inbounds %struct.region_info_user, %struct.region_info_user* %163, i32 0, i32 1
%165 = load i32, i32* %164
%166 = load i32, i32* %4
%167 = load i32, i32* %4
%168 = sext i32 %167 to i64
%169 = getelementptr inbounds [1024 x %struct.region_info_user], [1024 x %struct.region_info_user]* @showinfo.region, i64 0, i64 %168
%170 = getelementptr inbounds %struct.region_info_user, %struct.region_info_user* %169, i32 0, i32 2
%171 = load i32, i32* %170
%172 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.28, i64 0, i64 0), i32 %160, i32 %165, i32 %166, i32 %171)
br label %173
173: ; preds = %145
%174 = load i32, i32* %4
%175 = add nsw i32 %174, 1
store i32 %175, i32* %4
br label %141
176: ; preds = %141
store i32 0, i32* %2
br label %177
177: ; preds = %176, %20, %13
%178 = load i32, i32* %2
ret i32 %178
}

LLVM IR (-O2):
%struct.region_info_user = type { i32, i32, i32, i32 }
%struct.mtd_info_user = type { i32, i32, i32, i32, i32, i32 }
@showinfo.region = internal global [1024 x %struct.region_info_user] zeroinitializer
@.str = [11 x i8] c"MEMGETINFO\00"
@.str.1 = [18 x i8] c"MEMGETREGIONCOUNT\00"
@.str.2 = [12 x i8] c"mtd.type = \00"
@.str.3 = [11 x i8] c"MTD_ABSENT\00"
@.str.4 = [8 x i8] c"MTD_RAM\00"
@.str.5 = [8 x i8] c"MTD_ROM\00"
@.str.6 = [13 x i8] c"MTD_NORFLASH\00"
@.str.7 = [14 x i8] c"MTD_NANDFLASH\00"
@.str.8 = [14 x i8] c"MTD_DATAFLASH\00"
@.str.9 = [14 x i8] c"MTD_UBIVOLUME\00"
@.str.10 = [36 x i8] c"(unknown type - new MTD API maybe?)\00"
@.str.11 = [14 x i8] c"\0Amtd.flags = \00"
@MTD_CAP_ROM = global i32 0
@.str.12 = [12 x i8] c"MTD_CAP_ROM\00"
@MTD_CAP_RAM = global i32 0
@.str.13 = [12 x i8] c"MTD_CAP_RAM\00"
@MTD_CAP_NORFLASH = global i32 0
@.str.14 = [17 x i8] c"MTD_CAP_NORFLASH\00"
@MTD_CAP_NANDFLASH = global i32 0
@.str.15 = [18 x i8] c"MTD_CAP_NANDFLASH\00"
@.str.16 = [14 x i8] c"MTD_WRITEABLE\00"
@.str.17 = [18 x i8] c"MTD_BIT_WRITEABLE\00"
@.str.18 = [13 x i8] c"MTD_NO_ERASE\00"
@.str.19 = [17 x i8] c"MTD_POWERUP_LOCK\00"
@.str.20 = [3 x i8] c"%s\00"
@.str.21 = [6 x i8] c" | %s\00"
@.str.22 = [13 x i8] c"\0Amtd.size = \00"
@.str.23 = [18 x i8] c"\0Amtd.erasesize = \00"
@.str.24 = [18 x i8] c"\0Amtd.writesize = \00"
@.str.25 = [16 x i8] c"\0Amtd.oobsize = \00"
@.str.26 = [16 x i8] c"\0Aregions = %d\0A\0A\00"
@.str.27 = [51 x i8] c"region[%d].offset = 0x%.8x\0Aregion[%d].erasesize = \00"
@.str.28 = [56 x i8] c"\0Aregion[%d].numblocks = %d\0Aregion[%d].regionindex = %d\0A\00"
define i32 @showinfo(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.mtd_info_user
%4 = bitcast i32* %2 to i8*
%5 = bitcast %struct.mtd_info_user* %3 to i8*
%6 = call i32 @getmeminfo(i32 %0, %struct.mtd_info_user* %3)
%7 = icmp slt i32 %6, 0
br i1 %7, label %128, label %8
8: ; preds = %1
%9 = call i32 @getregions(i32 %0, %struct.region_info_user* getelementptr inbounds ([1024 x %struct.region_info_user], [1024 x %struct.region_info_user]* @showinfo.region, i64 0, i64 0), i32* %2)
%10 = icmp slt i32 %9, 0
br i1 %10, label %128, label %11
11: ; preds = %8
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%13 = getelementptr inbounds %struct.mtd_info_user, %struct.mtd_info_user* %3, i64 0, i32 0
%14 = load i32, i32* %13
switch i32 %14, label %22 [
i32 138, label %23
i32 131, label %15
i32 130, label %16
i32 134, label %17
i32 135, label %18
i32 136, label %19
i32 129, label %20
]
15: ; preds = %11
br label %23
16: ; preds = %11
br label %23
17: ; preds = %11
br label %23
18: ; preds = %11
br label %23
19: ; preds = %11
br label %23
20: ; preds = %11
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
br label %22
22: ; preds = %11, %20
br label %23
23: ; preds = %11, %22, %19, %18, %17, %16, %15
%24 = phi i8* [ getelementptr inbounds ([36 x i8], [36 x i8]* @.str.10, i64 0, i64 0), %22 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), %19 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), %18 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), %17 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), %16 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), %15 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), %11 ]
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %24)
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.11, i64 0, i64 0))
%27 = getelementptr inbounds %struct.mtd_info_user, %struct.mtd_info_user* %3, i64 0, i32 1
%28 = load i32, i32* %27
%29 = load i32, i32* @MTD_CAP_ROM
%30 = icmp eq i32 %28, %29
br i1 %30, label %31, label %33
31: ; preds = %23
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0))
br label %89
33: ; preds = %23
%34 = load i32, i32* @MTD_CAP_RAM
%35 = icmp eq i32 %28, %34
br i1 %35, label %36, label %38
36: ; preds = %33
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0))
br label %89
38: ; preds = %33
%39 = load i32, i32* @MTD_CAP_NORFLASH
%40 = icmp eq i32 %28, %39
br i1 %40, label %41, label %43
41: ; preds = %38
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0))
br label %89
43: ; preds = %38
%44 = load i32, i32* @MTD_CAP_NANDFLASH
%45 = icmp eq i32 %28, %44
br i1 %45, label %46, label %48
46: ; preds = %43
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.15, i64 0, i64 0))
br label %89
48: ; preds = %43
%49 = icmp eq i32 %28, 128
br i1 %49, label %53, label %50
50: ; preds = %48
%51 = and i32 %28, 128
%52 = icmp eq i32 %51, 0
br i1 %52, label %60, label %55
53: ; preds = %48
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.16, i64 0, i64 0))
br label %89
55: ; preds = %50
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.16, i64 0, i64 0))
%57 = load i32, i32* %27
%58 = and i32 %57, 137
%59 = icmp eq i32 %58, 0
br i1 %59, label %66, label %63
60: ; preds = %50
%61 = and i32 %28, 137
%62 = icmp eq i32 %61, 0
br i1 %62, label %70, label %63
63: ; preds = %55, %60
%64 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), %60 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.21, i64 0, i64 0), %55 ]
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %64, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.17, i64 0, i64 0))
br label %66
66: ; preds = %63, %55
%67 = load i32, i32* %27
%68 = and i32 %67, 133
%69 = icmp eq i32 %68, 0
br i1 %69, label %77, label %74
70: ; preds = %60
%71 = load i32, i32* %27
%72 = and i32 %71, 133
%73 = icmp eq i32 %72, 0
br i1 %73, label %81, label %74
74: ; preds = %66, %70
%75 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), %70 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.21, i64 0, i64 0), %66 ]
%76 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %75, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.18, i64 0, i64 0))
br label %77
77: ; preds = %74, %66
%78 = load i32, i32* %27
%79 = and i32 %78, 132
%80 = icmp eq i32 %79, 0
br i1 %80, label %89, label %87
81: ; preds = %70
%82 = load i32, i32* %27
%83 = and i32 %82, 132
%84 = icmp eq i32 %83, 0
br i1 %84, label %89, label %85
85: ; preds = %81
%86 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.19, i64 0, i64 0))
br label %89
87: ; preds = %77
%88 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.21, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.19, i64 0, i64 0))
br label %89
89: ; preds = %77, %85, %87, %81, %36, %46, %53, %41, %31
%90 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.22, i64 0, i64 0))
%91 = getelementptr inbounds %struct.mtd_info_user, %struct.mtd_info_user* %3, i64 0, i32 5
%92 = load i32, i32* %91
%93 = call i32 @printsize(i32 %92)
%94 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.23, i64 0, i64 0))
%95 = getelementptr inbounds %struct.mtd_info_user, %struct.mtd_info_user* %3, i64 0, i32 4
%96 = load i32, i32* %95
%97 = call i32 @printsize(i32 %96)
%98 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.24, i64 0, i64 0))
%99 = getelementptr inbounds %struct.mtd_info_user, %struct.mtd_info_user* %3, i64 0, i32 3
%100 = load i32, i32* %99
%101 = call i32 @printsize(i32 %100)
%102 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.25, i64 0, i64 0))
%103 = getelementptr inbounds %struct.mtd_info_user, %struct.mtd_info_user* %3, i64 0, i32 2
%104 = load i32, i32* %103
%105 = call i32 @printsize(i32 %104)
%106 = load i32, i32* %2
%107 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.26, i64 0, i64 0), i32 %106)
%108 = load i32, i32* %2
%109 = icmp sgt i32 %108, 0
br i1 %109, label %110, label %131
110: ; preds = %89, %110
%111 = phi i64 [ %124, %110 ], [ 0, %89 ]
%112 = getelementptr inbounds [1024 x %struct.region_info_user], [1024 x %struct.region_info_user]* @showinfo.region, i64 0, i64 %111, i32 0
%113 = load i32, i32* %112
%114 = trunc i64 %111 to i32
%115 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.27, i64 0, i64 0), i32 %114, i32 %113, i32 %114)
%116 = getelementptr inbounds [1024 x %struct.region_info_user], [1024 x %struct.region_info_user]* @showinfo.region, i64 0, i64 %111, i32 3
%117 = load i32, i32* %116
%118 = call i32 @printsize(i32 %117)
%119 = getelementptr inbounds [1024 x %struct.region_info_user], [1024 x %struct.region_info_user]* @showinfo.region, i64 0, i64 %111, i32 1
%120 = load i32, i32* %119
%121 = getelementptr inbounds [1024 x %struct.region_info_user], [1024 x %struct.region_info_user]* @showinfo.region, i64 0, i64 %111, i32 2
%122 = load i32, i32* %121
%123 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.28, i64 0, i64 0), i32 %114, i32 %120, i32 %114, i32 %122)
%124 = add nuw nsw i64 %111, 1
%125 = load i32, i32* %2
%126 = sext i32 %125 to i64
%127 = icmp slt i64 %124, %126
br i1 %127, label %110, label %131
128: ; preds = %8, %1
%129 = phi i8* [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), %8 ]
%130 = call i32 @perror(i8* %129)
br label %131
131: ; preds = %110, %128, %89
%132 = phi i32 [ 0, %89 ], [ 1, %128 ], [ 0, %110 ]
ret i32 %132
}