#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 stat {
  int st_size;
};
typedef scalar_t__ caddr_t;

/* Variables and functions */
scalar_t__ MAP_FAILED;
int /*<<< orphan*/ MAP_SHARED;
int /*<<< orphan*/ O_RDWR;
int PROT_READ;
int PROT_WRITE;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
scalar_t__ fstat(int, struct stat *);
scalar_t__ get_file_sectors(char *, unsigned int *, int *);
scalar_t__ mmap(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/, int,
                int /*<<< orphan*/);
int /*<<< orphan*/ munmap(scalar_t__, int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int fd;
  char *first_filename = argv[1];
  char *second_filename = argv[2];
  unsigned int blks[1024];
  int filesize;
  int i;
  caddr_t file_buf;
  unsigned int *ptr;
  struct stat statbuf;
  int read_only = 0;
  int n_sectors;
  if ((argc < 3) || (argc > 4)) {
    printf("Usage: update_first_second  first_b_filename second_b_filename \n");
    exit(1);
  }
  if (argc == 4) {
    read_only = 1;
  }
  n_sectors = 1024;
  if (get_file_sectors(second_filename, blks, &n_sectors) < 0) {
    fprintf(stderr, "ERROR: get_file_sectors() failed \n");
    exit(1);
  }
  if (read_only) {
    printf("%s : sector numbers: \n", second_filename);
    for (i = 0; i < n_sectors; i++) {
      printf("%d -> 0x%x \n", i, blks[i]);
    }
  }
  fd = open(second_filename, O_RDWR);
  if (fd < 0) {
    fprintf(stderr, "ERROR: Couldn't open file \"%s\". error string \"%s\" \n",
            second_filename, strerror(errno));
    exit(1);
  }
  if (fstat(fd, &statbuf) < 0) {
    fprintf(stderr,
            "ERROR: fstat failed on file \"%s\". error string \"%s\" \n",
            second_filename, strerror(errno));
    exit(1);
  }
  filesize = statbuf.st_size;
  file_buf = mmap(NULL, filesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
  if (file_buf == (caddr_t)MAP_FAILED) {
    fprintf(stderr, "ERROR: mmap failed on file \"%s\". error string \"%s\" \n",
            second_filename, strerror(errno));
    exit(1);
  }
  ptr = (unsigned int *)file_buf;
  if (read_only) {
    printf("%s: current sector numbers: \n", second_filename);
    for (i = 0; i < n_sectors; i++) {
      printf("%d -> 0x%x \n", i, ptr[i]);
    }
  } else {
    printf("%s: overwriting current sector numbers \n", second_filename);
    for (i = 0; i < n_sectors; i++) {
      ptr[i] = blks[i];
    }
  }
  munmap(file_buf, filesize);
  close(fd);
  fd = open(first_filename, O_RDWR);
  if (fd < 0) {
    fprintf(stderr, "ERROR: Couldn't open file \"%s\". error string \"%s\" \n",
            first_filename, strerror(errno));
    exit(1);
  }
  if (fstat(fd, &statbuf) < 0) {
    fprintf(stderr,
            "ERROR: fstat failed on file \"%s\". error string \"%s\" \n",
            first_filename, strerror(errno));
    exit(1);
  }
  filesize = statbuf.st_size;
  file_buf = mmap(NULL, filesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
  if (file_buf == (caddr_t)MAP_FAILED) {
    fprintf(stderr, "ERROR: mmap failed on file \"%s\". error string \"%s\" \n",
            first_filename, strerror(errno));
    exit(1);
  }
  ptr = (unsigned int *)(file_buf + 0x1fc);
  if (read_only) {
    printf("%s: second sector number: 0x%x 0x%p 0x%p \n", first_filename, *ptr,
           file_buf, ptr);
  } else {
    printf("%s: overwriting second sector number with 0x%x \n", first_filename,
           blks[0]);
    *ptr = blks[0];
  }
  munmap(file_buf, filesize);
  close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10c0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x1054(%rbp)
cmpl   $0x3,-0x8(%rbp)
jl     11ef <main+0x4f>
cmpl   $0x4,-0x8(%rbp)
jle    1207 <main+0x67>
lea    0xe0a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
cmpl   $0x4,-0x8(%rbp)
jne    121b <main+0x7b>
movl   $0x1,-0x1054(%rbp)
movl   $0x400,-0x1058(%rbp)
mov    -0x28(%rbp),%rdi
lea    -0x1030(%rbp),%rsi
lea    -0x1058(%rbp),%rdx
call   10a0 <get_file_sectors@plt>
cmp    $0x0,%rax
jge    1267 <main+0xc7>
mov    0x2d7b(%rip),%rax
mov    (%rax),%edi
lea    0xdeb(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
cmpl   $0x0,-0x1054(%rbp)
je     12dd <main+0x13d>
mov    -0x28(%rbp),%rsi
lea    0xde5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x1038(%rbp)
mov    -0x1038(%rbp),%eax
cmp    -0x1058(%rbp),%eax
jge    12d8 <main+0x138>
mov    -0x1038(%rbp),%esi
movslq -0x1038(%rbp),%rax
mov    -0x1030(%rbp,%rax,4),%edx
lea    0xdbe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1038(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1038(%rbp)
jmp    1290 <main+0xf0>
jmp    12dd <main+0x13d>
mov    -0x28(%rbp),%rdi
mov    0x2cf0(%rip),%rax
mov    (%rax),%esi
call   1080 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    134c <main+0x1ac>
mov    0x2cc5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1064(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x1060(%rbp)
mov    0x2ca3(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
mov    -0x1064(%rbp),%edi
mov    -0x1060(%rbp),%rdx
mov    %rax,%rcx
lea    0xd4d(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x14(%rbp),%edi
lea    -0x1050(%rbp),%rsi
call   10c0 <fstat@plt>
cmp    $0x0,%rax
jge    13b5 <main+0x215>
mov    0x2c5c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1074(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x1070(%rbp)
mov    0x2c3a(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
mov    -0x1074(%rbp),%edi
mov    -0x1070(%rbp),%rdx
mov    %rax,%rcx
lea    0xd18(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x1050(%rbp),%eax
mov    %eax,-0x1034(%rbp)
mov    -0x1034(%rbp),%esi
mov    0x2c2a(%rip),%rax
mov    (%rax),%edx
mov    0x2be1(%rip),%rax
or     (%rax),%edx
mov    0x2c08(%rip),%rax
mov    (%rax),%ecx
mov    -0x14(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
xor    %r9d,%r9d
call   1030 <mmap@plt>
mov    %rax,-0x1040(%rbp)
mov    -0x1040(%rbp),%rax
mov    0x2ba9(%rip),%rcx
cmp    (%rcx),%rax
jne    1460 <main+0x2c0>
mov    0x2bb1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1084(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x1080(%rbp)
mov    0x2b8f(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
mov    -0x1084(%rbp),%edi
mov    -0x1080(%rbp),%rdx
mov    %rax,%rcx
lea    0xca3(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x1040(%rbp),%rax
mov    %rax,-0x1048(%rbp)
cmpl   $0x0,-0x1054(%rbp)
je     14e7 <main+0x347>
mov    -0x28(%rbp),%rsi
lea    0xca1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x1038(%rbp)
mov    -0x1038(%rbp),%eax
cmp    -0x1058(%rbp),%eax
jge    14e2 <main+0x342>
mov    -0x1038(%rbp),%esi
mov    -0x1048(%rbp),%rax
movslq -0x1038(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xbb4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1038(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1038(%rbp)
jmp    1497 <main+0x2f7>
jmp    154d <main+0x3ad>
mov    -0x28(%rbp),%rsi
lea    0xc53(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x1038(%rbp)
mov    -0x1038(%rbp),%eax
cmp    -0x1058(%rbp),%eax
jge    1548 <main+0x3a8>
movslq -0x1038(%rbp),%rax
mov    -0x1030(%rbp,%rax,4),%edx
mov    -0x1048(%rbp),%rax
movslq -0x1038(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1038(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1038(%rbp)
jmp    1503 <main+0x363>
jmp    154d <main+0x3ad>
mov    -0x1040(%rbp),%rdi
mov    -0x1034(%rbp),%esi
call   1070 <munmap@plt>
mov    -0x14(%rbp),%edi
call   1050 <close@plt>
mov    -0x20(%rbp),%rdi
mov    0x2a66(%rip),%rax
mov    (%rax),%esi
call   1080 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    15d6 <main+0x436>
mov    0x2a3b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1094(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x1090(%rbp)
mov    0x2a19(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
mov    -0x1094(%rbp),%edi
mov    -0x1090(%rbp),%rdx
mov    %rax,%rcx
lea    0xac3(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x14(%rbp),%edi
lea    -0x1050(%rbp),%rsi
call   10c0 <fstat@plt>
cmp    $0x0,%rax
jge    163f <main+0x49f>
mov    0x29d2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10a4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x10a0(%rbp)
mov    0x29b0(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
mov    -0x10a4(%rbp),%edi
mov    -0x10a0(%rbp),%rdx
mov    %rax,%rcx
lea    0xa8e(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x1050(%rbp),%eax
mov    %eax,-0x1034(%rbp)
mov    -0x1034(%rbp),%esi
mov    0x29a0(%rip),%rax
mov    (%rax),%edx
mov    0x2957(%rip),%rax
or     (%rax),%edx
mov    0x297e(%rip),%rax
mov    (%rax),%ecx
mov    -0x14(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
xor    %r9d,%r9d
call   1030 <mmap@plt>
mov    %rax,-0x1040(%rbp)
mov    -0x1040(%rbp),%rax
mov    0x291f(%rip),%rcx
cmp    (%rcx),%rax
jne    16ea <main+0x54a>
mov    0x2927(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10b4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x10b0(%rbp)
mov    0x2905(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
mov    -0x10b4(%rbp),%edi
mov    -0x10b0(%rbp),%rdx
mov    %rax,%rcx
lea    0xa19(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x1040(%rbp),%rax
add    $0x1fc,%rax
mov    %rax,-0x1048(%rbp)
cmpl   $0x0,-0x1054(%rbp)
je     1739 <main+0x599>
mov    -0x20(%rbp),%rsi
mov    -0x1048(%rbp),%rax
mov    (%rax),%edx
mov    -0x1040(%rbp),%rcx
mov    -0x1048(%rbp),%r8
lea    0xa41(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1760 <main+0x5c0>
mov    -0x20(%rbp),%rsi
mov    -0x1030(%rbp),%edx
lea    0xa4f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1030(%rbp),%ecx
mov    -0x1048(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1040(%rbp),%rdi
mov    -0x1034(%rbp),%esi
call   1070 <munmap@plt>
mov    -0x14(%rbp),%edi
call   1050 <close@plt>
xor    %eax,%eax
add    $0x10c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1028,%rsp
mov    %edi,%r15d
lea    -0x5(%r15),%eax
cmp    $0xfffffffd,%eax
jbe    1443 <main+0x293>
mov    0x8(%rsi),%rbx
mov    0x10(%rsi),%r12
movl   $0x400,0xc(%rsp)
lea    0x20(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    %r12,%rdi
call   10b0 <get_file_sectors@plt>
test   %rax,%rax
js     1459 <main+0x2a9>
mov    %rbx,0x18(%rsp)
cmp    $0x4,%r15d
jne    124e <main+0x9e>
lea    0xe15(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,0xc(%rsp)
jle    124e <main+0x9e>
lea    0xe14(%rip),%rbx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    0x20(%rsp,%rbp,4),%edx
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbp
movslq 0xc(%rsp),%rax
cmp    %rax,%rbp
jl     1230 <main+0x80>
mov    0x2d83(%rip),%rax
mov    (%rax),%esi
mov    %r12,%rdi
call   1090 <open@plt>
test   %eax,%eax
js     147a <main+0x2ca>
mov    %eax,%r14d
lea    0x10(%rsp),%rsi
mov    %eax,%edi
call   10d0 <fstat@plt>
test   %rax,%rax
js     149a <main+0x2ea>
mov    0x10(%rsp),%r13d
mov    0x2d6d(%rip),%rax
mov    0x2d26(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    0x2d4b(%rip),%rax
mov    (%rax),%ecx
xor    %edi,%edi
mov    %r13d,%esi
mov    %r14d,%r8d
xor    %r9d,%r9d
call   1040 <mmap@plt>
mov    %rax,%rbx
mov    0x2cf7(%rip),%rax
cmp    (%rax),%rbx
je     14ba <main+0x30a>
cmp    $0x4,%r15d
jne    130f <main+0x15f>
lea    0xe17(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,0xc(%rsp)
jle    1345 <main+0x195>
lea    0xd53(%rip),%r12
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    (%rbx,%rbp,4),%edx
mov    %r12,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbp
movslq 0xc(%rsp),%rax
cmp    %rax,%rbp
jl     12f0 <main+0x140>
jmp    1345 <main+0x195>
lea    0xdee(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,0xc(%rsp)
jle    1345 <main+0x195>
xor    %eax,%eax
nopl   0x0(%rax)
mov    0x20(%rsp,%rax,4),%ecx
mov    %ecx,(%rbx,%rax,4)
add    $0x1,%rax
movslq 0xc(%rsp),%rcx
cmp    %rcx,%rax
jl     1330 <main+0x180>
mov    %rbx,%rdi
mov    %r13d,%esi
call   1080 <munmap@plt>
mov    %r14d,%edi
call   1060 <close@plt>
mov    0x2c79(%rip),%rax
mov    (%rax),%esi
mov    0x18(%rsp),%r14
mov    %r14,%rdi
call   1090 <open@plt>
test   %eax,%eax
js     14df <main+0x32f>
mov    %eax,%r13d
lea    0x10(%rsp),%rsi
mov    %eax,%edi
call   10d0 <fstat@plt>
test   %rax,%rax
js     14ff <main+0x34f>
mov    0x10(%rsp),%r12d
mov    0x2c1e(%rip),%rax
mov    (%rax),%edx
mov    0x2c55(%rip),%rax
or     (%rax),%edx
mov    0x2c3c(%rip),%rax
mov    (%rax),%ecx
xor    %edi,%edi
mov    %r12d,%esi
mov    %r13d,%r8d
xor    %r9d,%r9d
call   1040 <mmap@plt>
mov    %rax,%rbx
mov    0x2be8(%rip),%rax
cmp    (%rax),%rbx
je     151f <main+0x36f>
mov    %rbx,%rbp
add    $0x1fc,%rbp
cmp    $0x4,%r15d
jne    1400 <main+0x250>
mov    0x1fc(%rbx),%edx
lea    0xd3f(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rcx
mov    %rbp,%r8
xor    %eax,%eax
call   1050 <printf@plt>
jmp    141c <main+0x26c>
mov    0x20(%rsp),%edx
lea    0xd4d(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x20(%rsp),%eax
mov    %eax,0x0(%rbp)
mov    %rbx,%rdi
mov    %r12d,%esi
call   1080 <munmap@plt>
mov    %r13d,%edi
call   1060 <close@plt>
xor    %eax,%eax
add    $0x1028,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd3f(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    0x2b68(%rip),%rax
mov    (%rax),%edi
lea    0xb97(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    0x2b47(%rip),%rax
mov    (%rax),%ebx
mov    0x2b36(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
lea    0xbaf(%rip),%rsi
jmp    14d8 <main+0x328>
mov    0x2b27(%rip),%rax
mov    (%rax),%ebx
mov    0x2b16(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
lea    0xbc3(%rip),%rsi
jmp    14d8 <main+0x328>
mov    0x2b07(%rip),%rax
mov    (%rax),%ebx
mov    0x2af6(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
lea    0xbd9(%rip),%rsi
mov    %ebx,%edi
mov    %r12,%rdx
jmp    1542 <main+0x392>
mov    0x2ae2(%rip),%rax
mov    (%rax),%ebx
mov    0x2ad1(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
lea    0xb4a(%rip),%rsi
jmp    153d <main+0x38d>
mov    0x2ac2(%rip),%rax
mov    (%rax),%ebx
mov    0x2ab1(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
lea    0xb5e(%rip),%rsi
jmp    153d <main+0x38d>
mov    0x2aa2(%rip),%rax
mov    (%rax),%ebx
mov    0x2a91(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
lea    0xb74(%rip),%rsi
mov    %ebx,%edi
mov    %r14,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [65 x i8] c"Usage: update_first_second first_b_filename second_b_filename \0A\00"
@stderr = global i32 0
@.str.1 = [35 x i8] c"ERROR: get_file_sectors() failed \0A\00"
@.str.2 = [23 x i8] c"%s : sector numbers: \0A\00"
@.str.3 = [13 x i8] c"%d -> 0x%x \0A\00"
@O_RDWR = global i32 0
@.str.4 = [52 x i8] c"ERROR: Couldn't open file \22%s\22. error string \22%s\22 \0A\00"
@errno = global i32 0
@.str.5 = [54 x i8] c"ERROR: fstat failed on file \22%s\22. error string \22%s\22 \0A\00"
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
@MAP_FAILED = global i64 0
@.str.6 = [53 x i8] c"ERROR: mmap failed on file \22%s\22. error string \22%s\22 \0A\00"
@.str.7 = [30 x i8] c"%s: current sector numbers: \0A\00"
@.str.8 = [41 x i8] c"%s: overwriting current sector numbers \0A\00"
@.str.9 = [43 x i8] c"%s: second sector number: 0x%x 0x%p 0x%p \0A\00"
@.str.10 = [49 x i8] c"%s: overwriting second sector number with 0x%x \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca [1024 x i32]
%10 = alloca i32
%11 = alloca i32
%12 = alloca i64
%13 = alloca i32*
%14 = alloca %struct.stat
%15 = alloca i32
%16 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
store i8* %19, i8** %7
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 2
%22 = load i8*, i8** %21
store i8* %22, i8** %8
store i32 0, i32* %15
%23 = load i32, i32* %4
%24 = icmp slt i32 %23, 3
br i1 %24, label %28, label %25
25: ; preds = %2
%26 = load i32, i32* %4
%27 = icmp sgt i32 %26, 4
br i1 %27, label %28, label %31
28: ; preds = %25, %2
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%30 = call i32 @exit(i32 1)
unreachable
31: ; preds = %25
%32 = load i32, i32* %4
%33 = icmp eq i32 %32, 4
br i1 %33, label %34, label %35
34: ; preds = %31
store i32 1, i32* %15
br label %35
35: ; preds = %34, %31
store i32 1024, i32* %16
%36 = load i8*, i8** %8
%37 = getelementptr inbounds [1024 x i32], [1024 x i32]* %9, i64 0, i64 0
%38 = call i64 @get_file_sectors(i8* %36, i32* %37, i32* %16)
%39 = icmp slt i64 %38, 0
br i1 %39, label %40, label %44
40: ; preds = %35
%41 = load i32, i32* @stderr
%42 = call i32 (i32, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%43 = call i32 @exit(i32 1)
unreachable
44: ; preds = %35
%45 = load i32, i32* %15
%46 = icmp ne i32 %45, 0
br i1 %46, label %47, label %65
47: ; preds = %44
%48 = load i8*, i8** %8
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %48)
store i32 0, i32* %11
br label %50
50: ; preds = %61, %47
%51 = load i32, i32* %11
%52 = load i32, i32* %16
%53 = icmp slt i32 %51, %52
br i1 %53, label %54, label %64
54: ; preds = %50
%55 = load i32, i32* %11
%56 = load i32, i32* %11
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [1024 x i32], [1024 x i32]* %9, i64 0, i64 %57
%59 = load i32, i32* %58
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %55, i32 %59)
br label %61
61: ; preds = %54
%62 = load i32, i32* %11
%63 = add nsw i32 %62, 1
store i32 %63, i32* %11
br label %50
64: ; preds = %50
br label %65
65: ; preds = %64, %44
%66 = load i8*, i8** %8
%67 = load i32, i32* @O_RDWR
%68 = call i32 @open(i8* %66, i32 %67)
store i32 %68, i32* %6
%69 = load i32, i32* %6
%70 = icmp slt i32 %69, 0
br i1 %70, label %71, label %78
71: ; preds = %65
%72 = load i32, i32* @stderr
%73 = load i8*, i8** %8
%74 = load i32, i32* @errno
%75 = call i8* @strerror(i32 %74)
%76 = call i32 (i32, i8*, ...) @fprintf(i32 %72, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.4, i64 0, i64 0), i8* %73, i8* %75)
%77 = call i32 @exit(i32 1)
unreachable
78: ; preds = %65
%79 = load i32, i32* %6
%80 = call i64 @fstat(i32 %79, %struct.stat* %14)
%81 = icmp slt i64 %80, 0
br i1 %81, label %82, label %89
82: ; preds = %78
%83 = load i32, i32* @stderr
%84 = load i8*, i8** %8
%85 = load i32, i32* @errno
%86 = call i8* @strerror(i32 %85)
%87 = call i32 (i32, i8*, ...) @fprintf(i32 %83, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.5, i64 0, i64 0), i8* %84, i8* %86)
%88 = call i32 @exit(i32 1)
unreachable
89: ; preds = %78
%90 = getelementptr inbounds %struct.stat, %struct.stat* %14, i32 0, i32 0
%91 = load i32, i32* %90
store i32 %91, i32* %10
%92 = load i32, i32* %10
%93 = load i32, i32* @PROT_READ
%94 = load i32, i32* @PROT_WRITE
%95 = or i32 %93, %94
%96 = load i32, i32* @MAP_SHARED
%97 = load i32, i32* %6
%98 = call i64 @mmap(i32* null, i32 %92, i32 %95, i32 %96, i32 %97, i32 0)
store i64 %98, i64* %12
%99 = load i64, i64* %12
%100 = load i64, i64* @MAP_FAILED
%101 = icmp eq i64 %99, %100
br i1 %101, label %102, label %109
102: ; preds = %89
%103 = load i32, i32* @stderr
%104 = load i8*, i8** %8
%105 = load i32, i32* @errno
%106 = call i8* @strerror(i32 %105)
%107 = call i32 (i32, i8*, ...) @fprintf(i32 %103, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.6, i64 0, i64 0), i8* %104, i8* %106)
%108 = call i32 @exit(i32 1)
unreachable
109: ; preds = %89
%110 = load i64, i64* %12
%111 = inttoptr i64 %110 to i32*
store i32* %111, i32** %13
%112 = load i32, i32* %15
%113 = icmp ne i32 %112, 0
br i1 %113, label %114, label %133
114: ; preds = %109
%115 = load i8*, i8** %8
%116 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), i8* %115)
store i32 0, i32* %11
br label %117
117: ; preds = %129, %114
%118 = load i32, i32* %11
%119 = load i32, i32* %16
%120 = icmp slt i32 %118, %119
br i1 %120, label %121, label %132
121: ; preds = %117
%122 = load i32, i32* %11
%123 = load i32*, i32** %13
%124 = load i32, i32* %11
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds i32, i32* %123, i64 %125
%127 = load i32, i32* %126
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %122, i32 %127)
br label %129
129: ; preds = %121
%130 = load i32, i32* %11
%131 = add nsw i32 %130, 1
store i32 %131, i32* %11
br label %117
132: ; preds = %117
br label %153
133: ; preds = %109
%134 = load i8*, i8** %8
%135 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0), i8* %134)
store i32 0, i32* %11
br label %136
136: ; preds = %149, %133
%137 = load i32, i32* %11
%138 = load i32, i32* %16
%139 = icmp slt i32 %137, %138
br i1 %139, label %140, label %152
140: ; preds = %136
%141 = load i32, i32* %11
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds [1024 x i32], [1024 x i32]* %9, i64 0, i64 %142
%144 = load i32, i32* %143
%145 = load i32*, i32** %13
%146 = load i32, i32* %11
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds i32, i32* %145, i64 %147
store i32 %144, i32* %148
br label %149
149: ; preds = %140
%150 = load i32, i32* %11
%151 = add nsw i32 %150, 1
store i32 %151, i32* %11
br label %136
152: ; preds = %136
br label %153
153: ; preds = %152, %132
%154 = load i64, i64* %12
%155 = load i32, i32* %10
%156 = call i32 @munmap(i64 %154, i32 %155)
%157 = load i32, i32* %6
%158 = call i32 @close(i32 %157)
%159 = load i8*, i8** %7
%160 = load i32, i32* @O_RDWR
%161 = call i32 @open(i8* %159, i32 %160)
store i32 %161, i32* %6
%162 = load i32, i32* %6
%163 = icmp slt i32 %162, 0
br i1 %163, label %164, label %171
164: ; preds = %153
%165 = load i32, i32* @stderr
%166 = load i8*, i8** %7
%167 = load i32, i32* @errno
%168 = call i8* @strerror(i32 %167)
%169 = call i32 (i32, i8*, ...) @fprintf(i32 %165, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.4, i64 0, i64 0), i8* %166, i8* %168)
%170 = call i32 @exit(i32 1)
unreachable
171: ; preds = %153
%172 = load i32, i32* %6
%173 = call i64 @fstat(i32 %172, %struct.stat* %14)
%174 = icmp slt i64 %173, 0
br i1 %174, label %175, label %182
175: ; preds = %171
%176 = load i32, i32* @stderr
%177 = load i8*, i8** %7
%178 = load i32, i32* @errno
%179 = call i8* @strerror(i32 %178)
%180 = call i32 (i32, i8*, ...) @fprintf(i32 %176, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.5, i64 0, i64 0), i8* %177, i8* %179)
%181 = call i32 @exit(i32 1)
unreachable
182: ; preds = %171
%183 = getelementptr inbounds %struct.stat, %struct.stat* %14, i32 0, i32 0
%184 = load i32, i32* %183
store i32 %184, i32* %10
%185 = load i32, i32* %10
%186 = load i32, i32* @PROT_READ
%187 = load i32, i32* @PROT_WRITE
%188 = or i32 %186, %187
%189 = load i32, i32* @MAP_SHARED
%190 = load i32, i32* %6
%191 = call i64 @mmap(i32* null, i32 %185, i32 %188, i32 %189, i32 %190, i32 0)
store i64 %191, i64* %12
%192 = load i64, i64* %12
%193 = load i64, i64* @MAP_FAILED
%194 = icmp eq i64 %192, %193
br i1 %194, label %195, label %202
195: ; preds = %182
%196 = load i32, i32* @stderr
%197 = load i8*, i8** %7
%198 = load i32, i32* @errno
%199 = call i8* @strerror(i32 %198)
%200 = call i32 (i32, i8*, ...) @fprintf(i32 %196, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.6, i64 0, i64 0), i8* %197, i8* %199)
%201 = call i32 @exit(i32 1)
unreachable
202: ; preds = %182
%203 = load i64, i64* %12
%204 = add nsw i64 %203, 508
%205 = inttoptr i64 %204 to i32*
store i32* %205, i32** %13
%206 = load i32, i32* %15
%207 = icmp ne i32 %206, 0
br i1 %207, label %208, label %215
208: ; preds = %202
%209 = load i8*, i8** %7
%210 = load i32*, i32** %13
%211 = load i32, i32* %210
%212 = load i64, i64* %12
%213 = load i32*, i32** %13
%214 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.9, i64 0, i64 0), i8* %209, i32 %211, i64 %212, i32* %213)
br label %223
215: ; preds = %202
%216 = load i8*, i8** %7
%217 = getelementptr inbounds [1024 x i32], [1024 x i32]* %9, i64 0, i64 0
%218 = load i32, i32* %217
%219 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.10, i64 0, i64 0), i8* %216, i32 %218)
%220 = getelementptr inbounds [1024 x i32], [1024 x i32]* %9, i64 0, i64 0
%221 = load i32, i32* %220
%222 = load i32*, i32** %13
store i32 %221, i32* %222
br label %223
223: ; preds = %215, %208
%224 = load i64, i64* %12
%225 = load i32, i32* %10
%226 = call i32 @munmap(i64 %224, i32 %225)
%227 = load i32, i32* %6
%228 = call i32 @close(i32 %227)
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@stderr = global i32 0
@.str.1 = [35 x i8] c"ERROR: get_file_sectors() failed \0A\00"
@.str.2 = [23 x i8] c"%s : sector numbers: \0A\00"
@.str.3 = [13 x i8] c"%d -> 0x%x \0A\00"
@O_RDWR = global i32 0
@.str.4 = [52 x i8] c"ERROR: Couldn't open file \22%s\22. error string \22%s\22 \0A\00"
@errno = global i32 0
@.str.5 = [54 x i8] c"ERROR: fstat failed on file \22%s\22. error string \22%s\22 \0A\00"
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
@MAP_FAILED = global i64 0
@.str.6 = [53 x i8] c"ERROR: mmap failed on file \22%s\22. error string \22%s\22 \0A\00"
@.str.7 = [30 x i8] c"%s: current sector numbers: \0A\00"
@.str.8 = [41 x i8] c"%s: overwriting current sector numbers \0A\00"
@.str.9 = [43 x i8] c"%s: second sector number: 0x%x 0x%p 0x%p \0A\00"
@.str.10 = [49 x i8] c"%s: overwriting second sector number with 0x%x \0A\00"
@str = [64 x i8] c"Usage: update_first_second first_b_filename second_b_filename \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1024 x i32]
%4 = alloca %struct.stat
%5 = alloca i32
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = getelementptr inbounds i8*, i8** %1, i64 2
%9 = load i8*, i8** %8
%10 = bitcast [1024 x i32]* %3 to i8*
%11 = bitcast %struct.stat* %4 to i8*
%12 = bitcast i32* %5 to i8*
%13 = add i32 %0, -5
%14 = icmp ult i32 %13, -2
br i1 %14, label %15, label %18
15: ; preds = %2
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str, i64 0, i64 0))
%17 = tail call i32 @exit(i32 1)
unreachable
18: ; preds = %2
%19 = icmp eq i32 %0, 4
store i32 1024, i32* %5
%20 = getelementptr inbounds [1024 x i32], [1024 x i32]* %3, i64 0, i64 0
%21 = call i64 @get_file_sectors(i8* %9, i32* %20, i32* %5)
%22 = icmp slt i64 %21, 0
br i1 %22, label %23, label %27
23: ; preds = %18
%24 = load i32, i32* @stderr
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%26 = call i32 @exit(i32 1)
unreachable
27: ; preds = %18
br i1 %19, label %28, label %42
28: ; preds = %27
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %9)
%30 = load i32, i32* %5
%31 = icmp sgt i32 %30, 0
br i1 %31, label %32, label %42
32: ; preds = %28, %32
%33 = phi i64 [ %38, %32 ], [ 0, %28 ]
%34 = getelementptr inbounds [1024 x i32], [1024 x i32]* %3, i64 0, i64 %33
%35 = load i32, i32* %34
%36 = trunc i64 %33 to i32
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %36, i32 %35)
%38 = add nuw nsw i64 %33, 1
%39 = load i32, i32* %5
%40 = sext i32 %39 to i64
%41 = icmp slt i64 %38, %40
br i1 %41, label %32, label %42
42: ; preds = %32, %28, %27
%43 = load i32, i32* @O_RDWR
%44 = call i32 @open(i8* %9, i32 %43)
%45 = icmp slt i32 %44, 0
br i1 %45, label %46, label %52
46: ; preds = %42
%47 = load i32, i32* @stderr
%48 = load i32, i32* @errno
%49 = call i8* @strerror(i32 %48)
%50 = call i32 (i32, i8*, ...) @fprintf(i32 %47, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.4, i64 0, i64 0), i8* %9, i8* %49)
%51 = call i32 @exit(i32 1)
unreachable
52: ; preds = %42
%53 = call i64 @fstat(i32 %44, %struct.stat* %4)
%54 = icmp slt i64 %53, 0
br i1 %54, label %55, label %61
55: ; preds = %52
%56 = load i32, i32* @stderr
%57 = load i32, i32* @errno
%58 = call i8* @strerror(i32 %57)
%59 = call i32 (i32, i8*, ...) @fprintf(i32 %56, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.5, i64 0, i64 0), i8* %9, i8* %58)
%60 = call i32 @exit(i32 1)
unreachable
61: ; preds = %52
%62 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 0
%63 = load i32, i32* %62
%64 = load i32, i32* @PROT_READ
%65 = load i32, i32* @PROT_WRITE
%66 = or i32 %65, %64
%67 = load i32, i32* @MAP_SHARED
%68 = call i64 @mmap(i32* null, i32 %63, i32 %66, i32 %67, i32 %44, i32 0)
%69 = load i64, i64* @MAP_FAILED
%70 = icmp eq i64 %68, %69
br i1 %70, label %71, label %77
71: ; preds = %61
%72 = load i32, i32* @stderr
%73 = load i32, i32* @errno
%74 = call i8* @strerror(i32 %73)
%75 = call i32 (i32, i8*, ...) @fprintf(i32 %72, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.6, i64 0, i64 0), i8* %9, i8* %74)
%76 = call i32 @exit(i32 1)
unreachable
77: ; preds = %61
%78 = inttoptr i64 %68 to i32*
br i1 %19, label %79, label %93
79: ; preds = %77
%80 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), i8* %9)
%81 = load i32, i32* %5
%82 = icmp sgt i32 %81, 0
br i1 %82, label %83, label %106
83: ; preds = %79, %83
%84 = phi i64 [ %89, %83 ], [ 0, %79 ]
%85 = getelementptr inbounds i32, i32* %78, i64 %84
%86 = load i32, i32* %85
%87 = trunc i64 %84 to i32
%88 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %87, i32 %86)
%89 = add nuw nsw i64 %84, 1
%90 = load i32, i32* %5
%91 = sext i32 %90 to i64
%92 = icmp slt i64 %89, %91
br i1 %92, label %83, label %106
93: ; preds = %77
%94 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0), i8* %9)
%95 = load i32, i32* %5
%96 = icmp sgt i32 %95, 0
br i1 %96, label %97, label %106
97: ; preds = %93, %97
%98 = phi i64 [ %102, %97 ], [ 0, %93 ]
%99 = getelementptr inbounds [1024 x i32], [1024 x i32]* %3, i64 0, i64 %98
%100 = load i32, i32* %99
%101 = getelementptr inbounds i32, i32* %78, i64 %98
store i32 %100, i32* %101
%102 = add nuw nsw i64 %98, 1
%103 = load i32, i32* %5
%104 = sext i32 %103 to i64
%105 = icmp slt i64 %102, %104
br i1 %105, label %97, label %106
106: ; preds = %97, %83, %93, %79
%107 = call i32 @munmap(i64 %68, i32 %63)
%108 = call i32 @close(i32 %44)
%109 = load i32, i32* @O_RDWR
%110 = call i32 @open(i8* %7, i32 %109)
%111 = icmp slt i32 %110, 0
br i1 %111, label %112, label %118
112: ; preds = %106
%113 = load i32, i32* @stderr
%114 = load i32, i32* @errno
%115 = call i8* @strerror(i32 %114)
%116 = call i32 (i32, i8*, ...) @fprintf(i32 %113, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.4, i64 0, i64 0), i8* %7, i8* %115)
%117 = call i32 @exit(i32 1)
unreachable
118: ; preds = %106
%119 = call i64 @fstat(i32 %110, %struct.stat* %4)
%120 = icmp slt i64 %119, 0
br i1 %120, label %121, label %127
121: ; preds = %118
%122 = load i32, i32* @stderr
%123 = load i32, i32* @errno
%124 = call i8* @strerror(i32 %123)
%125 = call i32 (i32, i8*, ...) @fprintf(i32 %122, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.5, i64 0, i64 0), i8* %7, i8* %124)
%126 = call i32 @exit(i32 1)
unreachable
127: ; preds = %118
%128 = load i32, i32* %62
%129 = load i32, i32* @PROT_READ
%130 = load i32, i32* @PROT_WRITE
%131 = or i32 %130, %129
%132 = load i32, i32* @MAP_SHARED
%133 = call i64 @mmap(i32* null, i32 %128, i32 %131, i32 %132, i32 %110, i32 0)
%134 = load i64, i64* @MAP_FAILED
%135 = icmp eq i64 %133, %134
br i1 %135, label %136, label %142
136: ; preds = %127
%137 = load i32, i32* @stderr
%138 = load i32, i32* @errno
%139 = call i8* @strerror(i32 %138)
%140 = call i32 (i32, i8*, ...) @fprintf(i32 %137, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.6, i64 0, i64 0), i8* %7, i8* %139)
%141 = call i32 @exit(i32 1)
unreachable
142: ; preds = %127
%143 = add nsw i64 %133, 508
%144 = inttoptr i64 %143 to i32*
br i1 %19, label %145, label %148
145: ; preds = %142
%146 = load i32, i32* %144
%147 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.9, i64 0, i64 0), i8* %7, i32 %146, i64 %133, i32* %144)
br label %152
148: ; preds = %142
%149 = load i32, i32* %20
%150 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.10, i64 0, i64 0), i8* %7, i32 %149)
%151 = load i32, i32* %20
store i32 %151, i32* %144
br label %152
152: ; preds = %148, %145
%153 = call i32 @munmap(i64 %133, i32 %128)
%154 = call i32 @close(i32 %110)
ret i32 0
}