#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
char *alloca(size_t);
unsigned char checksum(unsigned char *);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, ...);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int fread(unsigned char *, int, int, int /*<<< orphan*/ *);
scalar_t__ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/, int /*<<< orphan*/);
int fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
int parse_size(char *);
int /*<<< orphan*/ printf(char *, ...);
int read24(unsigned char *);
int /*<<< orphan*/ snprintf(char *, size_t, char *, char const *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
int strlen(char const *);
int /*<<< orphan*/ write24(unsigned char *, int);
int main(int argc, char **argv) {
  int status;
  if (argc == 3) {
    int size = parse_size(argv[2]);
    if (size > 0) {
      const char *fn = argv[1];
      size_t len = strlen(fn) + 5;
      char *dat_fn = alloca(len);
      snprintf(dat_fn, len, "%s.dat", fn);
      FILE *dat_fp = fopen(dat_fn, "rb+");
      if (dat_fp) {
        unsigned char fsmap[512];
        if (fread(fsmap, sizeof fsmap, 1, dat_fp) == 1) {
          if (fsmap[0x1FE] <= 3) {
            status = 0;
            char *dsc_fn = alloca(len);
            snprintf(dsc_fn, len, "%s.dsc", fn);
            FILE *dsc_fp = fopen(dsc_fn, "rb+");
            if (dsc_fp) {
              unsigned char geom[22];
              if (fread(geom, sizeof geom, 1, dsc_fp) == 1) {
                int new_sects = size / 256;
                int old_sects = read24(fsmap + 0x0FC);
                printf("hdresize: old sectors=%d, new_sects=%d\n", old_sects,
                       new_sects);
                if (new_sects > old_sects) {
                  write24(fsmap + 0x0FC, new_sects);
                  fsmap[0x0FF] = checksum(fsmap);
                  unsigned char *ptr = fsmap + 0x100;
                  write24(ptr, read24(ptr) + (new_sects - old_sects));
                  fsmap[0x1ff] = checksum(ptr);
                  int cyl = 1 + ((new_sects - 1) / (33 * 255));
                  geom[13] = cyl % 256;
                  geom[14] = cyl / 256;
                  geom[15] = 255;
                  if (fseek(dsc_fp, 0, SEEK_SET) == 0 &&
                      fwrite(geom, sizeof geom, 1, dsc_fp) == 1) {
                    if (fseek(dat_fp, 0, SEEK_SET) == 0 &&
                        fwrite(fsmap, sizeof fsmap, 1, dat_fp) == 1) {
                      status = 0;
                      printf("hdresize: %s grown\n", fn);
                    } else {
                      fprintf(stderr,
                              "hdresize: unable to write fsmap to %s: %s\n",
                              dat_fn, strerror(errno));
                      status = 8;
                    }
                  } else {
                    fprintf(stderr,
                            "hdresize: unable to write geometry to %s: %s\n",
                            dsc_fn, strerror(errno));
                    status = 7;
                  }
                } else {
                  fputs("hdresize: shrinking not implemented\n", stderr);
                  status = 6;
                }
              } else {
                fprintf(stderr,
                        "hdresize: unable to read geometry from %s: %s\n",
                        dsc_fn, strerror(errno));
                status = 5;
              }
            } else {
              fprintf(stderr, "hdresize: unable to open dsc file %s: %s\n",
                      dsc_fn, strerror(errno));
              status = 2;
            }
          } else {
            fprintf(stderr,
                    "hdresize: %s has more than one free entry, compact before "
                    "resizing\n",
                    fn);
            status = 4;
          }
        } else {
          fprintf(stderr, "hdresize: unable to read fsmap from %s: %s\n",
                  dat_fn, strerror(errno));
          status = 3;
        }
        fclose(dat_fp);
      } else {
        fprintf(stderr, "hdresize: unable to open data file %s: %s\n", dat_fn,
                strerror(errno));
        status = 2;
      }
    } else {
      fprintf(stderr, "hdresize: %s is not a valid size\n", argv[2]);
      status = 1;
    }
  } else {
    fputs("usage: hdresize <dat-file> <size>\n", stderr);
    status = 1;
  }
  return status;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2f0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    178b <main+0x58b>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10d0 <parse_size@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jle    1760 <main+0x560>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <strlen@plt>
add    $0x5,%eax
cltq
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   10c0 <alloca@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rcx
lea    0xd85(%rip),%rdx
call   1070 <snprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xd7c(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     170e <main+0x50e>
lea    -0x240(%rbp),%rdi
mov    -0x38(%rbp),%rcx
mov    $0x200,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
jne    16b3 <main+0x4b3>
movzbl -0x42(%rbp),%eax
cmp    $0x3,%eax
jg     168c <main+0x48c>
movl   $0x0,-0x14(%rbp)
mov    -0x28(%rbp),%rdi
call   10c0 <alloca@plt>
mov    %rax,-0x248(%rbp)
mov    -0x248(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rcx
lea    0xd0f(%rip),%rdx
call   1070 <snprintf@plt>
mov    -0x248(%rbp),%rdi
lea    0xcf8(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x250(%rbp)
cmpq   $0x0,-0x250(%rbp)
je     1637 <main+0x437>
lea    -0x270(%rbp),%rdi
mov    -0x250(%rbp),%rcx
mov    $0x16,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
jne    15e2 <main+0x3e2>
mov    -0x18(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %eax,-0x274(%rbp)
lea    -0x240(%rbp),%rdi
add    $0xfc,%rdi
call   1110 <read24@plt>
mov    %eax,-0x278(%rbp)
mov    -0x278(%rbp),%esi
mov    -0x274(%rbp),%edx
lea    0xc86(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x274(%rbp),%eax
cmp    -0x278(%rbp),%eax
jle    15c1 <main+0x3c1>
lea    -0x240(%rbp),%rdi
add    $0xfc,%rdi
mov    -0x274(%rbp),%esi
call   10a0 <write24@plt>
lea    -0x240(%rbp),%rdi
call   1080 <checksum@plt>
mov    %al,-0x141(%rbp)
lea    -0x240(%rbp),%rax
add    $0x100,%rax
mov    %rax,-0x280(%rbp)
mov    -0x280(%rbp),%rax
mov    %rax,-0x290(%rbp)
mov    -0x280(%rbp),%rdi
call   1110 <read24@plt>
mov    -0x290(%rbp),%rdi
mov    %eax,%esi
mov    -0x274(%rbp),%eax
sub    -0x278(%rbp),%eax
add    %eax,%esi
call   10a0 <write24@plt>
mov    -0x280(%rbp),%rdi
call   1080 <checksum@plt>
mov    %al,-0x41(%rbp)
mov    -0x274(%rbp),%eax
sub    $0x1,%eax
mov    $0x20df,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
mov    %eax,-0x284(%rbp)
mov    -0x284(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,-0x263(%rbp)
mov    -0x284(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %al,-0x262(%rbp)
movb   $0xff,-0x261(%rbp)
mov    -0x250(%rbp),%rdi
mov    0x2b4e(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10e0 <fseek@plt>
cmp    $0x0,%rax
jne    156c <main+0x36c>
lea    -0x270(%rbp),%rdi
mov    -0x250(%rbp),%rcx
mov    $0x16,%esi
mov    $0x1,%edx
call   1100 <fwrite@plt>
cmp    $0x1,%eax
jne    156c <main+0x36c>
mov    -0x38(%rbp),%rdi
mov    0x2b0a(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10e0 <fseek@plt>
cmp    $0x0,%rax
jne    151a <main+0x31a>
lea    -0x240(%rbp),%rdi
mov    -0x38(%rbp),%rcx
mov    $0x200,%esi
mov    $0x1,%edx
call   1100 <fwrite@plt>
cmp    $0x1,%eax
jne    151a <main+0x31a>
movl   $0x0,-0x14(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xb2c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1567 <main+0x367>
mov    0x2abf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x29c(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x298(%rbp)
mov    0x2a9d(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
mov    -0x29c(%rbp),%edi
mov    -0x298(%rbp),%rdx
mov    %rax,%rcx
lea    0xaf5(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x8,-0x14(%rbp)
jmp    15bc <main+0x3bc>
mov    0x2a6d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2ac(%rbp)
mov    -0x248(%rbp),%rax
mov    %rax,-0x2a8(%rbp)
mov    0x2a48(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
mov    -0x2ac(%rbp),%edi
mov    -0x2a8(%rbp),%rdx
mov    %rax,%rcx
lea    0xacb(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x7,-0x14(%rbp)
jmp    15dd <main+0x3dd>
mov    0x2a18(%rip),%rax
mov    (%rax),%esi
lea    0xad6(%rip),%rdi
call   1090 <fputs@plt>
movl   $0x6,-0x14(%rbp)
jmp    1632 <main+0x432>
mov    0x29f7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2bc(%rbp)
mov    -0x248(%rbp),%rax
mov    %rax,-0x2b8(%rbp)
mov    0x29d2(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
mov    -0x2bc(%rbp),%edi
mov    -0x2b8(%rbp),%rdx
mov    %rax,%rcx
lea    0xaa8(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x5,-0x14(%rbp)
jmp    1687 <main+0x487>
mov    0x29a2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2cc(%rbp)
mov    -0x248(%rbp),%rax
mov    %rax,-0x2c8(%rbp)
mov    0x297d(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
mov    -0x2cc(%rbp),%edi
mov    -0x2c8(%rbp),%rdx
mov    %rax,%rcx
lea    0xa82(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x2,-0x14(%rbp)
jmp    16ae <main+0x4ae>
mov    0x294d(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
lea    0xa85(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x4,-0x14(%rbp)
jmp    1700 <main+0x500>
mov    0x2926(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2dc(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x2d8(%rbp)
mov    0x2904(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
mov    -0x2dc(%rbp),%edi
mov    -0x2d8(%rbp),%rdx
mov    %rax,%rcx
lea    0xa77(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x3,-0x14(%rbp)
mov    -0x38(%rbp),%rdi
call   1040 <fclose@plt>
jmp    175b <main+0x55b>
mov    0x28cb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2ec(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x2e8(%rbp)
mov    0x28a9(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
mov    -0x2ec(%rbp),%edi
mov    -0x2e8(%rbp),%rdx
mov    %rax,%rcx
lea    0xa48(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x2,-0x14(%rbp)
jmp    1786 <main+0x586>
mov    0x2879(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0xa48(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x1,-0x14(%rbp)
jmp    17a7 <main+0x5a7>
mov    0x284e(%rip),%rax
mov    (%rax),%esi
lea    0xa47(%rip),%rdi
call   1090 <fputs@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x2f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x238,%rsp
cmp    $0x3,%edi
jne    1442 <main+0x242>
mov    %rsi,%rbx
mov    0x10(%rsi),%rdi
call   10d0 <parse_size@plt>
test   %eax,%eax
jle    1459 <main+0x259>
mov    %eax,%ebp
mov    0x8(%rbx),%r15
mov    %r15,%rdi
call   1050 <strlen@plt>
add    $0x5,%eax
movslq %eax,%rbx
mov    %rbx,%rdi
call   10c0 <alloca@plt>
mov    %rax,%r12
lea    0xdac(%rip),%rdx
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r15,%rcx
call   1070 <snprintf@plt>
lea    0xd9e(%rip),%rsi
mov    %r12,%rdi
call   10f0 <fopen@plt>
test   %rax,%rax
je     147e <main+0x27e>
mov    %rax,%r14
lea    0x30(%rsp),%rdi
mov    $0x200,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1030 <fread@plt>
cmp    $0x1,%eax
jne    14b5 <main+0x2b5>
cmpb   $0x3,0x22e(%rsp)
03
ja     14ec <main+0x2ec>
mov    %rbx,%rdi
call   10c0 <alloca@plt>
mov    %rax,%r13
lea    0xd4e(%rip),%rdx
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r15,%rcx
call   1070 <snprintf@plt>
lea    0xd35(%rip),%rsi
mov    %r13,%rdi
call   10f0 <fopen@plt>
test   %rax,%rax
je     1510 <main+0x310>
mov    %rax,%rbx
lea    0x10(%rsp),%rdi
mov    $0x16,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1030 <fread@plt>
cmp    $0x1,%eax
jne    1547 <main+0x347>
mov    %rbx,0x8(%rsp)
mov    %r13,(%rsp)
shr    $0x8,%ebp
lea    0x12c(%rsp),%rdi
call   1110 <read24@plt>
mov    %eax,%r13d
lea    0xce9(%rip),%rdi
mov    %eax,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1060 <printf@plt>
mov    %ebp,%ebx
sub    %r13d,%ebx
jle    157b <main+0x37b>
lea    0x12c(%rsp),%rdi
mov    %ebp,%esi
call   10a0 <write24@plt>
lea    0x30(%rsp),%rdi
call   1080 <checksum@plt>
mov    %al,0x12f(%rsp)
lea    0x130(%rsp),%r13
mov    %r13,%rdi
call   1110 <read24@plt>
add    %eax,%ebx
mov    %r13,%rdi
mov    %ebx,%esi
call   10a0 <write24@plt>
mov    %r13,%rdi
call   1080 <checksum@plt>
mov    %al,0x22f(%rsp)
add    $0xffffffff,%ebp
movslq %ebp,%rax
imul   $0x3e4dd1b3,%rax,%rax
mov    %rax,%rcx
sar    $0x2b,%rcx
shr    $0x3f,%rax
add    %ecx,%eax
add    $0x1,%eax
mov    %al,0x1d(%rsp)
mov    %ah,0x1e(%rsp)
movb   $0xff,0x1f(%rsp)
mov    0x2c15(%rip),%rbx
mov    (%rbx),%edx
mov    0x8(%rsp),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
call   10e0 <fseek@plt>
test   %rax,%rax
jne    1597 <main+0x397>
lea    0x10(%rsp),%rdi
mov    $0x16,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
call   1100 <fwrite@plt>
cmp    $0x1,%eax
jne    1597 <main+0x397>
mov    (%rbx),%edx
mov    %r14,%rdi
xor    %esi,%esi
call   10e0 <fseek@plt>
test   %rax,%rax
jne    15e6 <main+0x3e6>
lea    0x30(%rsp),%rdi
mov    $0x200,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1100 <fwrite@plt>
cmp    $0x1,%eax
jne    15e6 <main+0x3e6>
lea    0xc09(%rip),%rdi
xor    %ebx,%ebx
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    15ca <main+0x3ca>
mov    0x2b97(%rip),%rax
mov    (%rax),%esi
lea    0xd90(%rip),%rdi
call   1090 <fputs@plt>
jmp    1474 <main+0x274>
mov    0x2b80(%rip),%rax
mov    (%rax),%edi
mov    0x10(%rbx),%rdx
lea    0xd53(%rip),%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    $0x1,%ebx
jmp    15d2 <main+0x3d2>
mov    0x2b5b(%rip),%rax
mov    (%rax),%ebx
mov    0x2b4a(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
lea    0xcf9(%rip),%rsi
mov    %ebx,%edi
mov    %r12,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    $0x2,%ebx
jmp    15d2 <main+0x3d2>
mov    0x2b24(%rip),%rax
mov    (%rax),%ebx
mov    0x2b13(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
lea    0xc96(%rip),%rsi
mov    %ebx,%edi
mov    %r12,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    $0x3,%ebx
jmp    15ca <main+0x3ca>
mov    0x2aed(%rip),%rax
mov    (%rax),%edi
lea    0xc29(%rip),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    $0x4,%ebx
jmp    15ca <main+0x3ca>
mov    0x2ac9(%rip),%rax
mov    (%rax),%ebx
mov    0x2ab8(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
lea    0xbcd(%rip),%rsi
mov    %ebx,%edi
mov    %r13,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    $0x2,%ebx
jmp    15ca <main+0x3ca>
mov    0x2a92(%rip),%rax
mov    (%rax),%ebx
mov    0x2a81(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
lea    0xb67(%rip),%rsi
mov    %ebx,%edi
mov    %r13,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    $0x5,%ebx
jmp    15ca <main+0x3ca>
mov    0x2a5e(%rip),%rax
mov    (%rax),%esi
lea    0xb1c(%rip),%rdi
call   1090 <fputs@plt>
mov    $0x6,%ebx
jmp    15ca <main+0x3ca>
mov    0x2a42(%rip),%rax
mov    (%rax),%ebx
mov    0x2a31(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
lea    0xac4(%rip),%rsi
mov    %ebx,%edi
mov    (%rsp),%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    $0x7,%ebx
mov    %r14,%rdi
call   1040 <fclose@plt>
mov    %ebx,%eax
add    $0x238,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x29f3(%rip),%rax
mov    (%rax),%ebx
mov    0x29e2(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
lea    0xa4a(%rip),%rsi
mov    %ebx,%edi
mov    %r12,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    $0x8,%ebx
jmp    15ca <main+0x3ca>

LLVM IR (-O0):
@.str = [7 x i8] c"%s.dat\00"
@.str.1 = [4 x i8] c"rb+\00"
@.str.2 = [7 x i8] c"%s.dsc\00"
@.str.3 = [40 x i8] c"hdresize: old sectors=%d, new_sects=%d\0A\00"
@SEEK_SET = global i32 0
@.str.4 = [20 x i8] c"hdresize: %s grown\0A\00"
@stderr = global i32 0
@.str.5 = [43 x i8] c"hdresize: unable to write fsmap to %s: %s\0A\00"
@errno = global i32 0
@.str.6 = [46 x i8] c"hdresize: unable to write geometry to %s: %s\0A\00"
@.str.7 = [37 x i8] c"hdresize: shrinking not implemented\0A\00"
@.str.8 = [47 x i8] c"hdresize: unable to read geometry from %s: %s\0A\00"
@.str.9 = [42 x i8] c"hdresize: unable to open dsc file %s: %s\0A\00"
@.str.10 = [68 x i8] c"hdresize: %s has more than one free entry, compact before resizing\0A\00"
@.str.11 = [44 x i8] c"hdresize: unable to read fsmap from %s: %s\0A\00"
@.str.12 = [43 x i8] c"hdresize: unable to open data file %s: %s\0A\00"
@.str.13 = [34 x i8] c"hdresize: %s is not a valid size\0A\00"
@.str.14 = [35 x i8] c"usage: hdresize <dat-file> <size>\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i8*
%11 = alloca i32*
%12 = alloca [512 x i8]
%13 = alloca i8*
%14 = alloca i32*
%15 = alloca [22 x i8]
%16 = alloca i32
%17 = alloca i32
%18 = alloca i8*
%19 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%20 = load i32, i32* %4
%21 = icmp eq i32 %20, 3
br i1 %21, label %22, label %201
22: ; preds = %2
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 2
%25 = load i8*, i8** %24
%26 = call i32 @parse_size(i8* %25)
store i32 %26, i32* %7
%27 = load i32, i32* %7
%28 = icmp sgt i32 %27, 0
br i1 %28, label %29, label %194
29: ; preds = %22
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
store i8* %32, i8** %8
%33 = load i8*, i8** %8
%34 = call i32 @strlen(i8* %33)
%35 = add nsw i32 %34, 5
%36 = sext i32 %35 to i64
store i64 %36, i64* %9
%37 = load i64, i64* %9
%38 = call i8* @alloca(i64 %37)
store i8* %38, i8** %10
%39 = load i8*, i8** %10
%40 = load i64, i64* %9
%41 = load i8*, i8** %8
%42 = call i32 @snprintf(i8* %39, i64 %40, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %41)
%43 = load i8*, i8** %10
%44 = call i32* @fopen(i8* %43, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i32* %44, i32** %11
%45 = load i32*, i32** %11
%46 = icmp ne i32* %45, null
br i1 %46, label %47, label %187
47: ; preds = %29
%48 = getelementptr inbounds [512 x i8], [512 x i8]* %12, i64 0, i64 0
%49 = load i32*, i32** %11
%50 = call i32 @fread(i8* %48, i32 512, i32 1, i32* %49)
%51 = icmp eq i32 %50, 1
br i1 %51, label %52, label %178
52: ; preds = %47
%53 = getelementptr inbounds [512 x i8], [512 x i8]* %12, i64 0, i64 510
%54 = load i8, i8* %53
%55 = zext i8 %54 to i32
%56 = icmp sle i32 %55, 3
br i1 %56, label %57, label %173
57: ; preds = %52
store i32 0, i32* %6
%58 = load i64, i64* %9
%59 = call i8* @alloca(i64 %58)
store i8* %59, i8** %13
%60 = load i8*, i8** %13
%61 = load i64, i64* %9
%62 = load i8*, i8** %8
%63 = call i32 @snprintf(i8* %60, i64 %61, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %62)
%64 = load i8*, i8** %13
%65 = call i32* @fopen(i8* %64, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i32* %65, i32** %14
%66 = load i32*, i32** %14
%67 = icmp ne i32* %66, null
br i1 %67, label %68, label %166
68: ; preds = %57
%69 = getelementptr inbounds [22 x i8], [22 x i8]* %15, i64 0, i64 0
%70 = load i32*, i32** %14
%71 = call i32 @fread(i8* %69, i32 22, i32 1, i32* %70)
%72 = icmp eq i32 %71, 1
br i1 %72, label %73, label %159
73: ; preds = %68
%74 = load i32, i32* %7
%75 = sdiv i32 %74, 256
store i32 %75, i32* %16
%76 = getelementptr inbounds [512 x i8], [512 x i8]* %12, i64 0, i64 0
%77 = getelementptr inbounds i8, i8* %76, i64 252
%78 = call i32 @read24(i8* %77)
store i32 %78, i32* %17
%79 = load i32, i32* %17
%80 = load i32, i32* %16
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i32 %79, i32 %80)
%82 = load i32, i32* %16
%83 = load i32, i32* %17
%84 = icmp sgt i32 %82, %83
br i1 %84, label %85, label %155
85: ; preds = %73
%86 = getelementptr inbounds [512 x i8], [512 x i8]* %12, i64 0, i64 0
%87 = getelementptr inbounds i8, i8* %86, i64 252
%88 = load i32, i32* %16
%89 = call i32 @write24(i8* %87, i32 %88)
%90 = getelementptr inbounds [512 x i8], [512 x i8]* %12, i64 0, i64 0
%91 = call zeroext i8 @checksum(i8* %90)
%92 = getelementptr inbounds [512 x i8], [512 x i8]* %12, i64 0, i64 255
store i8 %91, i8* %92
%93 = getelementptr inbounds [512 x i8], [512 x i8]* %12, i64 0, i64 0
%94 = getelementptr inbounds i8, i8* %93, i64 256
store i8* %94, i8** %18
%95 = load i8*, i8** %18
%96 = load i8*, i8** %18
%97 = call i32 @read24(i8* %96)
%98 = load i32, i32* %16
%99 = load i32, i32* %17
%100 = sub nsw i32 %98, %99
%101 = add nsw i32 %97, %100
%102 = call i32 @write24(i8* %95, i32 %101)
%103 = load i8*, i8** %18
%104 = call zeroext i8 @checksum(i8* %103)
%105 = getelementptr inbounds [512 x i8], [512 x i8]* %12, i64 0, i64 511
store i8 %104, i8* %105
%106 = load i32, i32* %16
%107 = sub nsw i32 %106, 1
%108 = sdiv i32 %107, 8415
%109 = add nsw i32 1, %108
store i32 %109, i32* %19
%110 = load i32, i32* %19
%111 = srem i32 %110, 256
%112 = trunc i32 %111 to i8
%113 = getelementptr inbounds [22 x i8], [22 x i8]* %15, i64 0, i64 13
store i8 %112, i8* %113
%114 = load i32, i32* %19
%115 = sdiv i32 %114, 256
%116 = trunc i32 %115 to i8
%117 = getelementptr inbounds [22 x i8], [22 x i8]* %15, i64 0, i64 14
store i8 %116, i8* %117
%118 = getelementptr inbounds [22 x i8], [22 x i8]* %15, i64 0, i64 15
store i8 -1, i8* %118
%119 = load i32*, i32** %14
%120 = load i32, i32* @SEEK_SET
%121 = call i64 @fseek(i32* %119, i32 0, i32 %120)
%122 = icmp eq i64 %121, 0
br i1 %122, label %123, label %148
123: ; preds = %85
%124 = getelementptr inbounds [22 x i8], [22 x i8]* %15, i64 0, i64 0
%125 = load i32*, i32** %14
%126 = call i32 @fwrite(i8* %124, i32 22, i32 1, i32* %125)
%127 = icmp eq i32 %126, 1
br i1 %127, label %128, label %148
128: ; preds = %123
%129 = load i32*, i32** %11
%130 = load i32, i32* @SEEK_SET
%131 = call i64 @fseek(i32* %129, i32 0, i32 %130)
%132 = icmp eq i64 %131, 0
br i1 %132, label %133, label %141
133: ; preds = %128
%134 = getelementptr inbounds [512 x i8], [512 x i8]* %12, i64 0, i64 0
%135 = load i32*, i32** %11
%136 = call i32 @fwrite(i8* %134, i32 512, i32 1, i32* %135)
%137 = icmp eq i32 %136, 1
br i1 %137, label %138, label %141
138: ; preds = %133
store i32 0, i32* %6
%139 = load i8*, i8** %8
%140 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i8* %139)
br label %147
141: ; preds = %133, %128
%142 = load i32, i32* @stderr
%143 = load i8*, i8** %10
%144 = load i32, i32* @errno
%145 = call i8* @strerror(i32 %144)
%146 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %142, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), i8* %143, i8* %145)
store i32 8, i32* %6
br label %147
147: ; preds = %141, %138
br label %154
148: ; preds = %123, %85
%149 = load i32, i32* @stderr
%150 = load i8*, i8** %13
%151 = load i32, i32* @errno
%152 = call i8* @strerror(i32 %151)
%153 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %149, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.6, i64 0, i64 0), i8* %150, i8* %152)
store i32 7, i32* %6
br label %154
154: ; preds = %148, %147
br label %158
155: ; preds = %73
%156 = load i32, i32* @stderr
%157 = call i32 @fputs(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0), i32 %156)
store i32 6, i32* %6
br label %158
158: ; preds = %155, %154
br label %165
159: ; preds = %68
%160 = load i32, i32* @stderr
%161 = load i8*, i8** %13
%162 = load i32, i32* @errno
%163 = call i8* @strerror(i32 %162)
%164 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %160, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.8, i64 0, i64 0), i8* %161, i8* %163)
store i32 5, i32* %6
br label %165
165: ; preds = %159, %158
br label %172
166: ; preds = %57
%167 = load i32, i32* @stderr
%168 = load i8*, i8** %13
%169 = load i32, i32* @errno
%170 = call i8* @strerror(i32 %169)
%171 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %167, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.9, i64 0, i64 0), i8* %168, i8* %170)
store i32 2, i32* %6
br label %172
172: ; preds = %166, %165
br label %177
173: ; preds = %52
%174 = load i32, i32* @stderr
%175 = load i8*, i8** %8
%176 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %174, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.10, i64 0, i64 0), i8* %175)
store i32 4, i32* %6
br label %177
177: ; preds = %173, %172
br label %184
178: ; preds = %47
%179 = load i32, i32* @stderr
%180 = load i8*, i8** %10
%181 = load i32, i32* @errno
%182 = call i8* @strerror(i32 %181)
%183 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %179, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.11, i64 0, i64 0), i8* %180, i8* %182)
store i32 3, i32* %6
br label %184
184: ; preds = %178, %177
%185 = load i32*, i32** %11
%186 = call i32 @fclose(i32* %185)
br label %193
187: ; preds = %29
%188 = load i32, i32* @stderr
%189 = load i8*, i8** %10
%190 = load i32, i32* @errno
%191 = call i8* @strerror(i32 %190)
%192 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %188, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.12, i64 0, i64 0), i8* %189, i8* %191)
store i32 2, i32* %6
br label %193
193: ; preds = %187, %184
br label %200
194: ; preds = %22
%195 = load i32, i32* @stderr
%196 = load i8**, i8*** %5
%197 = getelementptr inbounds i8*, i8** %196, i64 2
%198 = load i8*, i8** %197
%199 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %195, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.13, i64 0, i64 0), i8* %198)
store i32 1, i32* %6
br label %200
200: ; preds = %194, %193
br label %204
201: ; preds = %2
%202 = load i32, i32* @stderr
%203 = call i32 @fputs(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.14, i64 0, i64 0), i32 %202)
store i32 1, i32* %6
br label %204
204: ; preds = %201, %200
%205 = load i32, i32* %6
ret i32 %205
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s.dat\00"
@.str.1 = [4 x i8] c"rb+\00"
@.str.2 = [7 x i8] c"%s.dsc\00"
@.str.3 = [40 x i8] c"hdresize: old sectors=%d, new_sects=%d\0A\00"
@SEEK_SET = global i32 0
@.str.4 = [20 x i8] c"hdresize: %s grown\0A\00"
@stderr = global i32 0
@.str.5 = [43 x i8] c"hdresize: unable to write fsmap to %s: %s\0A\00"
@errno = global i32 0
@.str.6 = [46 x i8] c"hdresize: unable to write geometry to %s: %s\0A\00"
@.str.7 = [37 x i8] c"hdresize: shrinking not implemented\0A\00"
@.str.8 = [47 x i8] c"hdresize: unable to read geometry from %s: %s\0A\00"
@.str.9 = [42 x i8] c"hdresize: unable to open dsc file %s: %s\0A\00"
@.str.10 = [68 x i8] c"hdresize: %s has more than one free entry, compact before resizing\0A\00"
@.str.11 = [44 x i8] c"hdresize: unable to read fsmap from %s: %s\0A\00"
@.str.12 = [43 x i8] c"hdresize: unable to open data file %s: %s\0A\00"
@.str.13 = [34 x i8] c"hdresize: %s is not a valid size\0A\00"
@.str.14 = [35 x i8] c"usage: hdresize <dat-file> <size>\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [512 x i8]
%4 = alloca [22 x i8]
%5 = icmp eq i32 %0, 3
br i1 %5, label %6, label %124
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = tail call i32 @parse_size(i8* %8)
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %120
11: ; preds = %6
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = tail call i32 @strlen(i8* %13)
%15 = add nsw i32 %14, 5
%16 = sext i32 %15 to i64
%17 = tail call i8* @alloca(i64 %16)
%18 = tail call i32 @snprintf(i8* %17, i64 %16, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %13)
%19 = tail call i32* @fopen(i8* %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%20 = icmp eq i32* %19, null
br i1 %20, label %115, label %21
21: ; preds = %11
%22 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%23 = call i32 @fread(i8* %22, i32 512, i32 1, i32* %19)
%24 = icmp eq i32 %23, 1
br i1 %24, label %25, label %107
25: ; preds = %21
%26 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 510
%27 = load i8, i8* %26
%28 = icmp ult i8 %27, 4
br i1 %28, label %29, label %104
29: ; preds = %25
%30 = tail call i8* @alloca(i64 %16)
%31 = tail call i32 @snprintf(i8* %30, i64 %16, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %13)
%32 = tail call i32* @fopen(i8* %30, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%33 = icmp eq i32* %32, null
br i1 %33, label %99, label %34
34: ; preds = %29
%35 = getelementptr inbounds [22 x i8], [22 x i8]* %4, i64 0, i64 0
%36 = call i32 @fread(i8* %35, i32 22, i32 1, i32* %32)
%37 = icmp eq i32 %36, 1
br i1 %37, label %38, label %92
38: ; preds = %34
%39 = lshr i32 %9, 8
%40 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 252
%41 = call i32 @read24(i8* %40)
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i32 %41, i32 %39)
%43 = icmp sgt i32 %39, %41
br i1 %43, label %44, label %89
44: ; preds = %38
%45 = call i32 @write24(i8* %40, i32 %39)
%46 = call zeroext i8 @checksum(i8* %22)
%47 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 255
store i8 %46, i8* %47
%48 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 256
%49 = call i32 @read24(i8* %48)
%50 = sub i32 %39, %41
%51 = add nsw i32 %50, %49
%52 = call i32 @write24(i8* %48, i32 %51)
%53 = call zeroext i8 @checksum(i8* %48)
%54 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 511
store i8 %53, i8* %54
%55 = add nsw i32 %39, -1
%56 = sdiv i32 %55, 8415
%57 = add nuw nsw i32 %56, 1
%58 = trunc i32 %57 to i8
%59 = getelementptr inbounds [22 x i8], [22 x i8]* %4, i64 0, i64 13
store i8 %58, i8* %59
%60 = lshr i32 %57, 8
%61 = trunc i32 %60 to i8
%62 = getelementptr inbounds [22 x i8], [22 x i8]* %4, i64 0, i64 14
store i8 %61, i8* %62
%63 = getelementptr inbounds [22 x i8], [22 x i8]* %4, i64 0, i64 15
store i8 -1, i8* %63
%64 = load i32, i32* @SEEK_SET
%65 = call i64 @fseek(i32* %32, i32 0, i32 %64)
%66 = icmp eq i64 %65, 0
br i1 %66, label %67, label %84
67: ; preds = %44
%68 = call i32 @fwrite(i8* %35, i32 22, i32 1, i32* %32)
%69 = icmp eq i32 %68, 1
br i1 %69, label %70, label %84
70: ; preds = %67
%71 = load i32, i32* @SEEK_SET
%72 = call i64 @fseek(i32* %19, i32 0, i32 %71)
%73 = icmp eq i64 %72, 0
br i1 %73, label %74, label %79
74: ; preds = %70
%75 = call i32 @fwrite(i8* %22, i32 512, i32 1, i32* %19)
%76 = icmp eq i32 %75, 1
br i1 %76, label %77, label %79
77: ; preds = %74
%78 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i8* %13)
br label %97
79: ; preds = %74, %70
%80 = load i32, i32* @stderr
%81 = load i32, i32* @errno
%82 = call i8* @strerror(i32 %81)
%83 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %80, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), i8* %17, i8* %82)
br label %97
84: ; preds = %67, %44
%85 = load i32, i32* @stderr
%86 = load i32, i32* @errno
%87 = call i8* @strerror(i32 %86)
%88 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %85, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.6, i64 0, i64 0), i8* %30, i8* %87)
br label %97
89: ; preds = %38
%90 = load i32, i32* @stderr
%91 = call i32 @fputs(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0), i32 %90)
br label %97
92: ; preds = %34
%93 = load i32, i32* @stderr
%94 = load i32, i32* @errno
%95 = tail call i8* @strerror(i32 %94)
%96 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %93, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.8, i64 0, i64 0), i8* %30, i8* %95)
br label %97
97: ; preds = %89, %77, %79, %84, %92
%98 = phi i32 [ 5, %92 ], [ 6, %89 ], [ 0, %77 ], [ 8, %79 ], [ 7, %84 ]
br label %112
99: ; preds = %29
%100 = load i32, i32* @stderr
%101 = load i32, i32* @errno
%102 = tail call i8* @strerror(i32 %101)
%103 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %100, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.9, i64 0, i64 0), i8* %30, i8* %102)
br label %112
104: ; preds = %25
%105 = load i32, i32* @stderr
%106 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %105, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.10, i64 0, i64 0), i8* %13)
br label %112
107: ; preds = %21
%108 = load i32, i32* @stderr
%109 = load i32, i32* @errno
%110 = tail call i8* @strerror(i32 %109)
%111 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %108, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.11, i64 0, i64 0), i8* %17, i8* %110)
br label %112
112: ; preds = %97, %99, %104, %107
%113 = phi i32 [ 4, %104 ], [ 3, %107 ], [ %98, %97 ], [ 2, %99 ]
%114 = call i32 @fclose(i32* %19)
br label %127
115: ; preds = %11
%116 = load i32, i32* @stderr
%117 = load i32, i32* @errno
%118 = tail call i8* @strerror(i32 %117)
%119 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %116, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.12, i64 0, i64 0), i8* %17, i8* %118)
br label %127
120: ; preds = %6
%121 = load i32, i32* @stderr
%122 = load i8*, i8** %7
%123 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %121, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.13, i64 0, i64 0), i8* %122)
br label %127
124: ; preds = %2
%125 = load i32, i32* @stderr
%126 = tail call i32 @fputs(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.14, i64 0, i64 0), i32 %125)
br label %127
127: ; preds = %120, %115, %112, %124
%128 = phi i32 [ 1, %124 ], [ 1, %120 ], [ %113, %112 ], [ 2, %115 ]
ret i32 %128
}