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

/* Variables and functions */
int errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fcopy(char *, char *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ getuid();
scalar_t__ grub_remove_nouveau_nomodeset();
int remove(char *);
scalar_t__ rename(char *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int);
int system(char *);
int main(int argc, char **argv) {
  FILE *fp;
  int ret, clean = 0;
  uid_t uid;
  int i;
  int is_xorg_free;
  int have_to_zap = 0;
  int do_not_blacklist_nouveau = 0;
  int touch_grub = 0;
  if ((uid = getuid()) != 0) {
    fprintf(stderr, "Warning: you must run this command as root!\n\n");
    clean++;
  }
  for (i = 1; i < argc; i++) {
    if (*argv[i] == '-') {
      char opt = argv[i][1];
      if (opt != '\0') {
        switch (opt) {
        case 'b':
        case 'B':
          if (argv[i][2] == '\0') {
            do_not_blacklist_nouveau = 1;
          }
          break;
        case 'z':
        case 'Z':
          if (argv[i][2] == '\0') {
            have_to_zap = 1;
          }
          break;
        case 'g':
        case 'G':
          if (argv[i][2] == '\0') {
            touch_grub = 1;
          }
          break;
        default:
          break;
        }
      }
    }
  }
  if ((fp = fopen("/etc/X11/xorg.conf.nvidiaprime", "r")) == NULL) {
    fprintf(stderr, "Error: It seems Mageia-Prime was not configured.\nYou "
                    "have to invoke mageia-prime-install before.\n");
    exit(1);
  }
  if ((fp = fopen("/etc/X11/xorg.conf.nvidiaprime.xorgfree", "r")) != NULL) {
    fprintf(stderr, "You were running an X11 system without a xorg.conf.\n");
    is_xorg_free = 1;
    fclose(fp);
  } else {
    is_xorg_free = 0;
  }
  if ((fcopy("/etc/X11/xorg.conf",
             "/etc/X11/xorg.conf.nvidiaprime.preserve")) != 0) {
    fprintf(stderr,
            "Can't copy /etc/X11/xorg.conf to "
            "/etc/X11/xorg.conf.nvidiaprime.preserve: %s (error %d)\n",
            strerror(errno), errno);
    exit(1);
  }
  if (!is_xorg_free) {
    if ((fp = fopen("/etc/X11/xorg.conf.bak.beforenvidiaprime", "r")) == NULL) {
      fprintf(stderr, "Error: It seems Mageia-Prime was never configured, "
                      "can't restore previous configuration!\n");
      fprintf(stderr, "You have to invoke mageia-prime-install before.\n");
      exit(1);
    } else {
      fclose(fp);
    }
    if ((rename("/etc/X11/xorg.conf.bak.beforenvidiaprime",
                "/etc/X11/xorg.conf")) != 0) {
      fprintf(stderr,
              "Warning: Can't restore file /etc/X11/xorg.conf: %s (%d)\n",
              strerror(errno), errno);
      fprintf(stderr,
              "Warning: You have to manually reconfigure X11 using XFdrake\n");
      clean++;
    }
  }
  if (is_xorg_free) {
    if ((ret = remove("/etc/X11/xorg.conf")) != 0) {
      fprintf(stderr,
              "Warning: Can't remove file /etc/X11/xorg.conf: %s (%d)\n",
              strerror(errno), errno);
      clean++;
    }
  }
  if ((ret = remove("/etc/X11/xorg.conf.nvidiaprime")) != 0) {
    fprintf(stderr,
            "Warning: Can't remove file /etc/X11/xorg.conf.nvidiaprime: %s "
            "(error %d)\n",
            strerror(errno), errno);
    clean++;
  }
  if ((ret = remove("/etc/X11/xsetup.d/000mageia-prime.xsetup")) != 0) {
    fprintf(stderr,
            "Warning: Can't remove file "
            "/etc/X11/xsetup.d/000mageia-prime.xsetup: %s (error %d)\n",
            strerror(errno), errno);
    clean++;
  }
  if ((ret = remove("/etc/modules-load.d/nvidia-prime-drm.conf")) != 0) {
    fprintf(stderr,
            "Warning: Can't remove file "
            "/etc/modules-load.d/nvidia-prime-drm.conf: %s (error %d)\n",
            strerror(errno), errno);
    clean++;
  }
  fprintf(stderr, "Switching to Intel GL libraries...");
  if ((ret = system("/usr/sbin/update-alternatives --set gl_conf "
                    "/etc/ld.so.conf.d/GL/standard.conf")) != 0) {
    fprintf(stderr,
            "Warning: failed to run update-alternatives --set gl_conf...\n");
    clean++;
  } else {
    fprintf(stderr, "ok.\n");
  }
  if ((ret = system("/usr/sbin/ldconfig")) != 0) {
    fprintf(stderr, "Warning: failed to run ldconfig\n");
    clean++;
  }
  if ((fp = fopen("/etc/modprobe.d/00_mageia-prime.conf", "r")) != NULL) {
    fclose(fp);
    if (!do_not_blacklist_nouveau) {
      if ((ret = remove("/etc/modprobe.d/00_mageia-prime.conf")) != 0) {
        fprintf(stderr,
                "Warning: Can't remove file "
                "/etc/modprobe.d/00_mageia-prime.conf: %s (error %d)\n",
                strerror(errno), errno);
        clean++;
      }
      fprintf(stderr, "Regenerating kernel initrd images...");
      if ((ret = system("/sbin/bootloader-config --action rebuild-initrds")) !=
          0) {
        fprintf(stderr, "failed!\n");
        clean++;
      } else {
        fprintf(stderr, "done.\n");
      }
    }
  }
  if (touch_grub) {
    fprintf(stderr, "Removing \"nouveau.modeset=0\" to grub2...");
    if (grub_remove_nouveau_nomodeset() != 0) {
      fprintf(stderr, "failed!\n");
      clean++;
    } else
      fprintf(stderr, "done.\n");
    fprintf(stderr, "Updating grub.cfg...");
    if ((ret = system("/usr/bin/update-grub")) != 0) {
      fprintf(stderr, "failed!\n");
      clean++;
    } else
      fprintf(stderr, "done.\n");
  }
  if (clean > 0) {
    fprintf(stderr,
            "There were %d warnings or errors. Probably you have to "
            "unconfigure manually.\n",
            clean);
  } else {
    fprintf(stderr, "Mageia-Prime uninstalled and old configuration restored. "
                    "Please restart X11 or reboot.\n");
  }
  if (have_to_zap) {
    fprintf(stderr, "Zapping X11.\n");
    system("systemctl restart prefdm.service");
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
mov    $0x0,%al
call   1050 <getuid@plt>
mov    %eax,-0x24(%rbp)
cmp    $0x0,%eax
je     1215 <main+0x65>
mov    0x2de4(%rip),%rax
mov    (%rax),%edi
lea    0xdfb(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
movl   $0x1,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    135a <main+0x1aa>
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1347 <main+0x197>
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x1(%rax),%al
mov    %al,-0x39(%rbp)
movsbl -0x39(%rbp),%eax
cmp    $0x0,%eax
je     1342 <main+0x192>
movsbl -0x39(%rbp),%eax
mov    %eax,-0x40(%rbp)
sub    $0x42,%eax
je     12c9 <main+0x119>
jmp    1274 <main+0xc4>
mov    -0x40(%rbp),%eax
sub    $0x47,%eax
je     1313 <main+0x163>
jmp    1285 <main+0xd5>
mov    -0x40(%rbp),%eax
sub    $0x5a,%eax
je     12ee <main+0x13e>
jmp    1296 <main+0xe6>
mov    -0x40(%rbp),%eax
sub    $0x62,%eax
je     12c9 <main+0x119>
jmp    12a7 <main+0xf7>
mov    -0x40(%rbp),%eax
sub    $0x67,%eax
je     1313 <main+0x163>
jmp    12b8 <main+0x108>
mov    -0x40(%rbp),%eax
sub    $0x7a,%eax
je     12ee <main+0x13e>
jmp    1338 <main+0x188>
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl 0x2(%rax),%eax
cmp    $0x0,%eax
jne    12e9 <main+0x139>
movl   $0x1,-0x34(%rbp)
jmp    133d <main+0x18d>
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl 0x2(%rax),%eax
cmp    $0x0,%eax
jne    130e <main+0x15e>
movl   $0x1,-0x30(%rbp)
jmp    133d <main+0x18d>
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl 0x2(%rax),%eax
cmp    $0x0,%eax
jne    1333 <main+0x183>
movl   $0x1,-0x38(%rbp)
jmp    133d <main+0x18d>
jmp    133d <main+0x18d>
jmp    1342 <main+0x192>
jmp    1347 <main+0x197>
jmp    134c <main+0x19c>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    121c <main+0x6c>
lea    0xccd(%rip),%rdi
lea    0xce5(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    139c <main+0x1ec>
mov    0x2c5e(%rip),%rax
mov    (%rax),%edi
lea    0xcc4(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
lea    0xd0e(%rip),%rdi
lea    0xca3(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     13e9 <main+0x239>
mov    0x2c1c(%rip),%rax
mov    (%rax),%edi
lea    0xd0c(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x1,-0x2c(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
jmp    13f0 <main+0x240>
movl   $0x0,-0x2c(%rbp)
lea    0xd17(%rip),%rdi
lea    0xd23(%rip),%rsi
call   1080 <fcopy@plt>
cmp    $0x0,%rax
je     144e <main+0x29e>
mov    0x2bcc(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x44(%rbp)
mov    0x2bb8(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x44(%rbp),%edi
mov    %rax,%rdx
mov    0x2ba4(%rip),%rax
mov    (%rax),%ecx
lea    0xd0c(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
cmpl   $0x0,-0x2c(%rbp)
jne    1533 <main+0x383>
lea    0xd43(%rip),%rdi
lea    0xbe7(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    14b1 <main+0x301>
mov    0x2b60(%rip),%rax
mov    (%rax),%edi
lea    0xd42(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x2b49(%rip),%rax
mov    (%rax),%edi
lea    0xbe0(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
lea    0xce1(%rip),%rdi
lea    0xc46(%rip),%rsi
call   10b0 <rename@plt>
cmp    $0x0,%rax
je     152e <main+0x37e>
mov    0x2b02(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x48(%rbp)
mov    0x2aee(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x48(%rbp),%edi
mov    %rax,%rdx
mov    0x2ada(%rip),%rax
mov    (%rax),%ecx
lea    0xd1e(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x2acb(%rip),%rax
mov    (%rax),%edi
lea    0xd40(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1533 <main+0x383>
cmpl   $0x0,-0x2c(%rbp)
je     159a <main+0x3ea>
lea    0xbca(%rip),%rdi
call   1030 <remove@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     1595 <main+0x3e5>
mov    0x2a84(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
mov    0x2a70(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x4c(%rbp),%edi
mov    %rax,%rdx
mov    0x2a5c(%rip),%rax
mov    (%rax),%ecx
lea    0xd16(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    159a <main+0x3ea>
lea    0xa8d(%rip),%rdi
call   1030 <remove@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     15f2 <main+0x442>
mov    0x2a27(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x50(%rbp)
mov    0x2a13(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x50(%rbp),%edi
mov    %rax,%rdx
mov    0x29ff(%rip),%rax
mov    (%rax),%ecx
lea    0xcf1(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
lea    0xd24(%rip),%rdi
call   1030 <remove@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     164a <main+0x49a>
mov    0x29cf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x54(%rbp)
mov    0x29bb(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x54(%rbp),%edi
mov    %rax,%rdx
mov    0x29a7(%rip),%rax
mov    (%rax),%ecx
lea    0xd0c(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
lea    0xd49(%rip),%rdi
call   1030 <remove@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     16a2 <main+0x4f2>
mov    0x2977(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x58(%rbp)
mov    0x2963(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x58(%rbp),%edi
mov    %rax,%rdx
mov    0x294f(%rip),%rax
mov    (%rax),%ecx
lea    0xd32(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    0x2937(%rip),%rax
mov    (%rax),%edi
lea    0xd67(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
lea    0xd7c(%rip),%rdi
call   1060 <system@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     16f6 <main+0x546>
mov    0x2908(%rip),%rax
mov    (%rax),%edi
lea    0xdaa(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    170d <main+0x55d>
mov    0x28e3(%rip),%rax
mov    (%rax),%edi
lea    0xdc2(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
lea    0xdb9(%rip),%rdi
call   1060 <system@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     1745 <main+0x595>
mov    0x28b4(%rip),%rax
mov    (%rax),%edi
lea    0xdab(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
lea    0xdb5(%rip),%rdi
lea    0x8fa(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1846 <main+0x696>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
cmpl   $0x0,-0x34(%rbp)
jne    1841 <main+0x691>
lea    0xd81(%rip),%rdi
call   1030 <remove@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     17d1 <main+0x621>
mov    0x2848(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x5c(%rbp)
mov    0x2834(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x5c(%rbp),%edi
mov    %rax,%rdx
mov    0x2820(%rip),%rax
mov    (%rax),%ecx
lea    0xd65(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    0x2808(%rip),%rax
mov    (%rax),%edi
lea    0xd95(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
lea    0xdac(%rip),%rdi
call   1060 <system@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     1825 <main+0x675>
mov    0x27d9(%rip),%rax
mov    (%rax),%edi
lea    0xdbc(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    183c <main+0x68c>
mov    0x27b4(%rip),%rax
mov    (%rax),%edi
lea    0xda0(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    1841 <main+0x691>
jmp    1846 <main+0x696>
cmpl   $0x0,-0x38(%rbp)
je     1924 <main+0x774>
mov    0x2789(%rip),%rax
mov    (%rax),%edi
lea    0xd7c(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0x0,%al
call   1090 <grub_remove_nouveau_nomodeset@plt>
cmp    $0x0,%rax
je     189d <main+0x6ed>
mov    0x2761(%rip),%rax
mov    (%rax),%edi
lea    0xd44(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    18b4 <main+0x704>
mov    0x273c(%rip),%rax
mov    (%rax),%edi
lea    0xd28(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x2725(%rip),%rax
mov    (%rax),%edi
lea    0xd41(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
lea    0xd48(%rip),%rdi
call   1060 <system@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     1908 <main+0x758>
mov    0x26f6(%rip),%rax
mov    (%rax),%edi
lea    0xcd9(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    191f <main+0x76f>
mov    0x26d1(%rip),%rax
mov    (%rax),%edi
lea    0xcbd(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    1924 <main+0x774>
cmpl   $0x0,-0x20(%rbp)
jle    194d <main+0x79d>
mov    0x26ab(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%edx
lea    0xcee(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    1964 <main+0x7b4>
mov    0x268c(%rip),%rax
mov    (%rax),%edi
lea    0xd20(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
cmpl   $0x0,-0x30(%rbp)
je     1991 <main+0x7e1>
mov    0x266b(%rip),%rax
mov    (%rax),%edi
lea    0xd57(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
lea    0xd57(%rip),%rdi
call   1060 <system@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %r15d,%r15d
xor    %eax,%eax
call   1050 <getuid@plt>
mov    $0x0,%r14d
test   %eax,%eax
je     11f1 <main+0x41>
mov    0x2e05(%rip),%rax
mov    (%rax),%edi
lea    0xe1c(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0x1,%r14d
mov    $0x0,%r13d
mov    $0x0,%r12d
cmp    $0x2,%ebp
jl     1299 <main+0xe9>
mov    %ebp,%eax
xor    %r12d,%r12d
mov    $0x1,%ecx
movabs $0x100000001,%rdx
mov    $0x1,%esi
movabs $0x2000000020,%r9
movabs $0x100000001000000,%r8
xor    %r13d,%r13d
xor    %r15d,%r15d
jmp    1259 <main+0xa9>
cmpb   $0x0,0x2(%rbp)
cmove  %esi,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rcx
cmp    %rcx,%rax
je     1299 <main+0xe9>
mov    (%rbx,%rcx,8),%rbp
cmpb   $0x2d,0x0(%rbp)
jne    1250 <main+0xa0>
movsbl 0x1(%rbp),%edi
test   %edi,%edi
je     1250 <main+0xa0>
add    $0xffffffbe,%edi
cmp    $0x38,%edi
ja     1250 <main+0xa0>
bt     %rdi,%rdx
jb     128f <main+0xdf>
bt     %rdi,%r9
jb     123b <main+0x8b>
bt     %rdi,%r8
jae    1250 <main+0xa0>
cmpb   $0x0,0x2(%rbp)
cmove  %esi,%r15d
jmp    1250 <main+0xa0>
cmpb   $0x0,0x2(%rbp)
cmove  %esi,%r13d
jmp    1250 <main+0xa0>
lea    0xd8e(%rip),%rdi
lea    0xda6(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     16dc <main+0x52c>
lea    0xdf5(%rip),%rdi
lea    0xd8a(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1351 <main+0x1a1>
mov    %rax,%rbx
mov    0x2d05(%rip),%rbp
mov    0x0(%rbp),%edi
lea    0xdf4(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
lea    0xe13(%rip),%rdi
lea    0xe1f(%rip),%rsi
call   1080 <fcopy@plt>
test   %rax,%rax
jne    16ee <main+0x53e>
lea    0xdf7(%rip),%rdi
call   1030 <remove@plt>
test   %eax,%eax
je     13f2 <main+0x242>
mov    0x0(%rbp),%ebx
mov    0x2caa(%rip),%rbp
mov    0x0(%rbp),%edi
call   10d0 <strerror@plt>
mov    0x0(%rbp),%ecx
lea    0xf5b(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    13ee <main+0x23e>
lea    0xdb6(%rip),%rdi
lea    0xdc2(%rip),%rsi
call   1080 <fcopy@plt>
test   %rax,%rax
jne    16ee <main+0x53e>
lea    0xe2e(%rip),%rdi
lea    0xcd2(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1726 <main+0x576>
mov    %rax,%rdi
call   1040 <fclose@plt>
lea    0xe0a(%rip),%rdi
lea    0xd6f(%rip),%rsi
call   10b0 <rename@plt>
test   %rax,%rax
je     13f2 <main+0x242>
mov    0x2c30(%rip),%rax
mov    (%rax),%ebx
mov    0x2c1f(%rip),%rbp
mov    0x0(%rbp),%edi
call   10d0 <strerror@plt>
mov    0x0(%rbp),%ecx
lea    0xe5a(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    0x2c02(%rip),%rax
mov    (%rax),%edi
lea    0xe77(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
add    $0x1,%r14d
lea    0xc35(%rip),%rdi
call   1030 <remove@plt>
test   %eax,%eax
je     1434 <main+0x284>
mov    0x2bd7(%rip),%rax
mov    (%rax),%ebx
mov    0x2bc6(%rip),%rbp
mov    0x0(%rbp),%edi
call   10d0 <strerror@plt>
mov    0x0(%rbp),%ecx
lea    0xeaf(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
add    $0x1,%r14d
lea    0xee2(%rip),%rdi
call   1030 <remove@plt>
test   %eax,%eax
je     1476 <main+0x2c6>
mov    0x2b95(%rip),%rax
mov    (%rax),%ebx
mov    0x2b84(%rip),%rbp
mov    0x0(%rbp),%edi
call   10d0 <strerror@plt>
mov    0x0(%rbp),%ecx
lea    0xee0(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
add    $0x1,%r14d
lea    0xf1d(%rip),%rdi
call   1030 <remove@plt>
test   %eax,%eax
je     14b8 <main+0x308>
mov    0x2b53(%rip),%rax
mov    (%rax),%ebx
mov    0x2b42(%rip),%rbp
mov    0x0(%rbp),%edi
call   10d0 <strerror@plt>
mov    0x0(%rbp),%ecx
lea    0xf1c(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
add    $0x1,%r14d
mov    0x2b21(%rip),%rbp
mov    0x0(%rbp),%edi
lea    0xf50(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0xf65(%rip),%rdi
call   1060 <system@plt>
mov    0x0(%rbp),%edi
test   %eax,%eax
je     14f7 <main+0x347>
lea    0xfa1(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
add    $0x1,%r14d
jmp    1505 <main+0x355>
lea    0xfca(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0xfc1(%rip),%rdi
call   1060 <system@plt>
test   %eax,%eax
je     152a <main+0x37a>
mov    0x0(%rbp),%edi
lea    0xfc1(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
add    $0x1,%r14d
lea    0xfd0(%rip),%rdi
lea    0xb15(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     15d1 <main+0x421>
mov    %rax,%rdi
call   1040 <fclose@plt>
test   %r13d,%r13d
jne    15d1 <main+0x421>
lea    0xfa7(%rip),%rdi
call   1030 <remove@plt>
test   %eax,%eax
je     1597 <main+0x3e7>
mov    0x0(%rbp),%r13d
mov    %r15d,%ebx
mov    0x2a67(%rip),%r15
mov    (%r15),%edi
call   10d0 <strerror@plt>
mov    (%r15),%ecx
mov    %ebx,%r15d
lea    0xfa0(%rip),%rsi
mov    %r13d,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
add    $0x1,%r14d
mov    0x0(%rbp),%edi
lea    0xfd5(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0xfec(%rip),%rdi
call   1060 <system@plt>
mov    0x0(%rbp),%edi
test   %eax,%eax
je     16c3 <main+0x513>
lea    0x1006(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
add    $0x1,%r14d
test   %r12d,%r12d
je     1662 <main+0x4b2>
mov    0x0(%rbp),%edi
lea    0xff8(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
xor    %eax,%eax
call   1090 <grub_remove_nouveau_nomodeset@plt>
mov    0x0(%rbp),%edi
test   %rax,%rax
je     160e <main+0x45e>
lea    0xfcb(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
add    $0x1,%r14d
jmp    161c <main+0x46c>
lea    0xfc0(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0xfdf(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0xfe6(%rip),%rdi
call   1060 <system@plt>
mov    0x0(%rbp),%edi
test   %eax,%eax
je     1654 <main+0x4a4>
lea    0xf85(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
add    $0x1,%r14d
jmp    1662 <main+0x4b2>
lea    0xf7a(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    0x0(%rbp),%edi
test   %r14d,%r14d
jle    16ae <main+0x4fe>
lea    0xfbe(%rip),%rsi
mov    %r14d,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
test   %r15d,%r15d
je     169d <main+0x4ed>
mov    0x0(%rbp),%edi
lea    0x104b(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0x104b(%rip),%rdi
call   1060 <system@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xfc8(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
test   %r15d,%r15d
jne    1680 <main+0x4d0>
jmp    169d <main+0x4ed>
lea    0xf0b(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
test   %r12d,%r12d
jne    15da <main+0x42a>
jmp    1662 <main+0x4b2>
mov    0x28fd(%rip),%rax
mov    (%rax),%edi
lea    0x963(%rip),%rsi
jmp    1746 <main+0x596>
mov    0x28eb(%rip),%rax
mov    (%rax),%ebx
mov    0x28da(%rip),%rbp
mov    0x0(%rbp),%edi
call   10d0 <strerror@plt>
mov    0x0(%rbp),%ecx
lea    0xa39(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    0x28b3(%rip),%rbx
mov    (%rbx),%edi
lea    0xa95(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    (%rbx),%edi
lea    0x93a(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [46 x i8] c"Warning: you must run this command as root!\0A\0A\00"
@.str.1 = [31 x i8] c"/etc/X11/xorg.conf.nvidiaprime\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [98 x i8] c"Error: It seems Mageia-Prime was not configured.\0AYou have to invoke mageia-prime-install before.\0A\00"
@.str.4 = [40 x i8] c"/etc/X11/xorg.conf.nvidiaprime.xorgfree\00"
@.str.5 = [53 x i8] c"You were running an X11 system without a xorg.conf.\0A\00"
@.str.6 = [19 x i8] c"/etc/X11/xorg.conf\00"
@.str.7 = [40 x i8] c"/etc/X11/xorg.conf.nvidiaprime.preserve\00"
@.str.8 = [89 x i8] c"Can't copy /etc/X11/xorg.conf to /etc/X11/xorg.conf.nvidiaprime.preserve: %s (error %d)\0A\00"
@errno = global i32 0
@.str.9 = [41 x i8] c"/etc/X11/xorg.conf.bak.beforenvidiaprime\00"
@.str.10 = [90 x i8] c"Error: It seems Mageia-Prime was never configured, can't restore previous configuration!\0A\00"
@.str.11 = [49 x i8] c"You have to invoke mageia-prime-install before.\0A\00"
@.str.12 = [57 x i8] c"Warning: Can't restore file /etc/X11/xorg.conf: %s (%d)\0A\00"
@.str.13 = [61 x i8] c"Warning: You have to manually reconfigure X11 using XFdrake\0A\00"
@.str.14 = [56 x i8] c"Warning: Can't remove file /etc/X11/xorg.conf: %s (%d)\0A\00"
@.str.15 = [74 x i8] c"Warning: Can't remove file /etc/X11/xorg.conf.nvidiaprime: %s (error %d)\0A\00"
@.str.16 = [41 x i8] c"/etc/X11/xsetup.d/000mageia-prime.xsetup\00"
@.str.17 = [84 x i8] c"Warning: Can't remove file /etc/X11/xsetup.d/000mageia-prime.xsetup: %s (error %d)\0A\00"
@.str.18 = [42 x i8] c"/etc/modules-load.d/nvidia-prime-drm.conf\00"
@.str.19 = [85 x i8] c"Warning: Can't remove file /etc/modules-load.d/nvidia-prime-drm.conf: %s (error %d)\0A\00"
@.str.20 = [35 x i8] c"Switching to Intel GL libraries...\00"
@.str.21 = [79 x i8] c"/usr/sbin/update-alternatives --set gl_conf /etc/ld.so.conf.d/GL/standard.conf\00"
@.str.22 = [61 x i8] c"Warning: failed to run update-alternatives --set gl_conf...\0A\00"
@.str.23 = [5 x i8] c"ok.\0A\00"
@.str.24 = [19 x i8] c"/usr/sbin/ldconfig\00"
@.str.25 = [33 x i8] c"Warning: failed to run ldconfig\0A\00"
@.str.26 = [37 x i8] c"/etc/modprobe.d/00_mageia-prime.conf\00"
@.str.27 = [80 x i8] c"Warning: Can't remove file /etc/modprobe.d/00_mageia-prime.conf: %s (error %d)\0A\00"
@.str.28 = [37 x i8] c"Regenerating kernel initrd images...\00"
@.str.29 = [49 x i8] c"/sbin/bootloader-config --action rebuild-initrds\00"
@.str.30 = [9 x i8] c"failed!\0A\00"
@.str.31 = [7 x i8] c"done.\0A\00"
@.str.32 = [41 x i8] c"Removing \22nouveau.modeset=0\22 to grub2...\00"
@.str.33 = [21 x i8] c"Updating grub.cfg...\00"
@.str.34 = [21 x i8] c"/usr/bin/update-grub\00"
@.str.35 = [78 x i8] c"There were %d warnings or errors. Probably you have to unconfigure manually.\0A\00"
@.str.36 = [88 x i8] c"Mageia-Prime uninstalled and old configuration restored. Please restart X11 or reboot.\0A\00"
@.str.37 = [14 x i8] c"Zapping X11.\0A\00"
@.str.38 = [33 x i8] c"systemctl restart prefdm.service\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 i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %8
store i32 0, i32* %12
store i32 0, i32* %13
store i32 0, i32* %14
%16 = call i32 (...) @getuid()
store i32 %16, i32* %9
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %2
%19 = load i32, i32* @stderr
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%21 = load i32, i32* %8
%22 = add nsw i32 %21, 1
store i32 %22, i32* %8
br label %23
23: ; preds = %18, %2
store i32 1, i32* %10
br label %24
24: ; preds = %91, %23
%25 = load i32, i32* %10
%26 = load i32, i32* %4
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %94
28: ; preds = %24
%29 = load i8**, i8*** %5
%30 = load i32, i32* %10
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8*, i8** %29, i64 %31
%33 = load i8*, i8** %32
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 45
br i1 %36, label %37, label %90
37: ; preds = %28
%38 = load i8**, i8*** %5
%39 = load i32, i32* %10
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8*, i8** %38, i64 %40
%42 = load i8*, i8** %41
%43 = getelementptr inbounds i8, i8* %42, i64 1
%44 = load i8, i8* %43
store i8 %44, i8* %15
%45 = load i8, i8* %15
%46 = sext i8 %45 to i32
%47 = icmp ne i32 %46, 0
br i1 %47, label %48, label %89
48: ; preds = %37
%49 = load i8, i8* %15
%50 = sext i8 %49 to i32
switch i32 %50, label %87 [
i32 98, label %51
i32 66, label %51
i32 122, label %63
i32 90, label %63
i32 103, label %75
i32 71, label %75
]
51: ; preds = %48, %48
%52 = load i8**, i8*** %5
%53 = load i32, i32* %10
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i8*, i8** %52, i64 %54
%56 = load i8*, i8** %55
%57 = getelementptr inbounds i8, i8* %56, i64 2
%58 = load i8, i8* %57
%59 = sext i8 %58 to i32
%60 = icmp eq i32 %59, 0
br i1 %60, label %61, label %62
61: ; preds = %51
store i32 1, i32* %13
br label %62
62: ; preds = %61, %51
br label %88
63: ; preds = %48, %48
%64 = load i8**, i8*** %5
%65 = load i32, i32* %10
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds i8*, i8** %64, i64 %66
%68 = load i8*, i8** %67
%69 = getelementptr inbounds i8, i8* %68, i64 2
%70 = load i8, i8* %69
%71 = sext i8 %70 to i32
%72 = icmp eq i32 %71, 0
br i1 %72, label %73, label %74
73: ; preds = %63
store i32 1, i32* %12
br label %74
74: ; preds = %73, %63
br label %88
75: ; preds = %48, %48
%76 = load i8**, i8*** %5
%77 = load i32, i32* %10
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds i8*, i8** %76, i64 %78
%80 = load i8*, i8** %79
%81 = getelementptr inbounds i8, i8* %80, i64 2
%82 = load i8, i8* %81
%83 = sext i8 %82 to i32
%84 = icmp eq i32 %83, 0
br i1 %84, label %85, label %86
85: ; preds = %75
store i32 1, i32* %14
br label %86
86: ; preds = %85, %75
br label %88
87: ; preds = %48
br label %88
88: ; preds = %87, %86, %74, %62
br label %89
89: ; preds = %88, %37
br label %90
90: ; preds = %89, %28
br label %91
91: ; preds = %90
%92 = load i32, i32* %10
%93 = add nsw i32 %92, 1
store i32 %93, i32* %10
br label %24
94: ; preds = %24
%95 = call i32* @fopen(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %95, i32** %6
%96 = icmp eq i32* %95, null
br i1 %96, label %97, label %101
97: ; preds = %94
%98 = load i32, i32* @stderr
%99 = call i32 (i32, i8*, ...) @fprintf(i32 %98, i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str.3, i64 0, i64 0))
%100 = call i32 @exit(i32 1)
unreachable
101: ; preds = %94
%102 = call i32* @fopen(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %102, i32** %6
%103 = icmp ne i32* %102, null
br i1 %103, label %104, label %109
104: ; preds = %101
%105 = load i32, i32* @stderr
%106 = call i32 (i32, i8*, ...) @fprintf(i32 %105, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %11
%107 = load i32*, i32** %6
%108 = call i32 @fclose(i32* %107)
br label %110
109: ; preds = %101
store i32 0, i32* %11
br label %110
110: ; preds = %109, %104
%111 = call i64 @fcopy(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.7, i64 0, i64 0))
%112 = icmp ne i64 %111, 0
br i1 %112, label %113, label %120
113: ; preds = %110
%114 = load i32, i32* @stderr
%115 = load i32, i32* @errno
%116 = call i8* @strerror(i32 %115)
%117 = load i32, i32* @errno
%118 = call i32 (i32, i8*, ...) @fprintf(i32 %114, i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str.8, i64 0, i64 0), i8* %116, i32 %117)
%119 = call i32 @exit(i32 1)
unreachable
120: ; preds = %110
%121 = load i32, i32* %11
%122 = icmp ne i32 %121, 0
br i1 %122, label %149, label %123
123: ; preds = %120
%124 = call i32* @fopen(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %124, i32** %6
%125 = icmp eq i32* %124, null
br i1 %125, label %126, label %132
126: ; preds = %123
%127 = load i32, i32* @stderr
%128 = call i32 (i32, i8*, ...) @fprintf(i32 %127, i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str.10, i64 0, i64 0))
%129 = load i32, i32* @stderr
%130 = call i32 (i32, i8*, ...) @fprintf(i32 %129, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.11, i64 0, i64 0))
%131 = call i32 @exit(i32 1)
unreachable
132: ; preds = %123
%133 = load i32*, i32** %6
%134 = call i32 @fclose(i32* %133)
br label %135
135: ; preds = %132
%136 = call i64 @rename(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%137 = icmp ne i64 %136, 0
br i1 %137, label %138, label %148
138: ; preds = %135
%139 = load i32, i32* @stderr
%140 = load i32, i32* @errno
%141 = call i8* @strerror(i32 %140)
%142 = load i32, i32* @errno
%143 = call i32 (i32, i8*, ...) @fprintf(i32 %139, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.12, i64 0, i64 0), i8* %141, i32 %142)
%144 = load i32, i32* @stderr
%145 = call i32 (i32, i8*, ...) @fprintf(i32 %144, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.13, i64 0, i64 0))
%146 = load i32, i32* %8
%147 = add nsw i32 %146, 1
store i32 %147, i32* %8
br label %148
148: ; preds = %138, %135
br label %149
149: ; preds = %148, %120
%150 = load i32, i32* %11
%151 = icmp ne i32 %150, 0
br i1 %151, label %152, label %164
152: ; preds = %149
%153 = call i32 @remove(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
store i32 %153, i32* %7
%154 = icmp ne i32 %153, 0
br i1 %154, label %155, label %163
155: ; preds = %152
%156 = load i32, i32* @stderr
%157 = load i32, i32* @errno
%158 = call i8* @strerror(i32 %157)
%159 = load i32, i32* @errno
%160 = call i32 (i32, i8*, ...) @fprintf(i32 %156, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.14, i64 0, i64 0), i8* %158, i32 %159)
%161 = load i32, i32* %8
%162 = add nsw i32 %161, 1
store i32 %162, i32* %8
br label %163
163: ; preds = %155, %152
br label %164
164: ; preds = %163, %149
%165 = call i32 @remove(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
store i32 %165, i32* %7
%166 = icmp ne i32 %165, 0
br i1 %166, label %167, label %175
167: ; preds = %164
%168 = load i32, i32* @stderr
%169 = load i32, i32* @errno
%170 = call i8* @strerror(i32 %169)
%171 = load i32, i32* @errno
%172 = call i32 (i32, i8*, ...) @fprintf(i32 %168, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.15, i64 0, i64 0), i8* %170, i32 %171)
%173 = load i32, i32* %8
%174 = add nsw i32 %173, 1
store i32 %174, i32* %8
br label %175
175: ; preds = %167, %164
%176 = call i32 @remove(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.16, i64 0, i64 0))
store i32 %176, i32* %7
%177 = icmp ne i32 %176, 0
br i1 %177, label %178, label %186
178: ; preds = %175
%179 = load i32, i32* @stderr
%180 = load i32, i32* @errno
%181 = call i8* @strerror(i32 %180)
%182 = load i32, i32* @errno
%183 = call i32 (i32, i8*, ...) @fprintf(i32 %179, i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str.17, i64 0, i64 0), i8* %181, i32 %182)
%184 = load i32, i32* %8
%185 = add nsw i32 %184, 1
store i32 %185, i32* %8
br label %186
186: ; preds = %178, %175
%187 = call i32 @remove(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.18, i64 0, i64 0))
store i32 %187, i32* %7
%188 = icmp ne i32 %187, 0
br i1 %188, label %189, label %197
189: ; preds = %186
%190 = load i32, i32* @stderr
%191 = load i32, i32* @errno
%192 = call i8* @strerror(i32 %191)
%193 = load i32, i32* @errno
%194 = call i32 (i32, i8*, ...) @fprintf(i32 %190, i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str.19, i64 0, i64 0), i8* %192, i32 %193)
%195 = load i32, i32* %8
%196 = add nsw i32 %195, 1
store i32 %196, i32* %8
br label %197
197: ; preds = %189, %186
%198 = load i32, i32* @stderr
%199 = call i32 (i32, i8*, ...) @fprintf(i32 %198, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.20, i64 0, i64 0))
%200 = call i32 @system(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.21, i64 0, i64 0))
store i32 %200, i32* %7
%201 = icmp ne i32 %200, 0
br i1 %201, label %202, label %207
202: ; preds = %197
%203 = load i32, i32* @stderr
%204 = call i32 (i32, i8*, ...) @fprintf(i32 %203, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.22, i64 0, i64 0))
%205 = load i32, i32* %8
%206 = add nsw i32 %205, 1
store i32 %206, i32* %8
br label %210
207: ; preds = %197
%208 = load i32, i32* @stderr
%209 = call i32 (i32, i8*, ...) @fprintf(i32 %208, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.23, i64 0, i64 0))
br label %210
210: ; preds = %207, %202
%211 = call i32 @system(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.24, i64 0, i64 0))
store i32 %211, i32* %7
%212 = icmp ne i32 %211, 0
br i1 %212, label %213, label %218
213: ; preds = %210
%214 = load i32, i32* @stderr
%215 = call i32 (i32, i8*, ...) @fprintf(i32 %214, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.25, i64 0, i64 0))
%216 = load i32, i32* %8
%217 = add nsw i32 %216, 1
store i32 %217, i32* %8
br label %218
218: ; preds = %213, %210
%219 = call i32* @fopen(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.26, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %219, i32** %6
%220 = icmp ne i32* %219, null
br i1 %220, label %221, label %252
221: ; preds = %218
%222 = load i32*, i32** %6
%223 = call i32 @fclose(i32* %222)
%224 = load i32, i32* %13
%225 = icmp ne i32 %224, 0
br i1 %225, label %251, label %226
226: ; preds = %221
%227 = call i32 @remove(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.26, i64 0, i64 0))
store i32 %227, i32* %7
%228 = icmp ne i32 %227, 0
br i1 %228, label %229, label %237
229: ; preds = %226
%230 = load i32, i32* @stderr
%231 = load i32, i32* @errno
%232 = call i8* @strerror(i32 %231)
%233 = load i32, i32* @errno
%234 = call i32 (i32, i8*, ...) @fprintf(i32 %230, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.27, i64 0, i64 0), i8* %232, i32 %233)
%235 = load i32, i32* %8
%236 = add nsw i32 %235, 1
store i32 %236, i32* %8
br label %237
237: ; preds = %229, %226
%238 = load i32, i32* @stderr
%239 = call i32 (i32, i8*, ...) @fprintf(i32 %238, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.28, i64 0, i64 0))
%240 = call i32 @system(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.29, i64 0, i64 0))
store i32 %240, i32* %7
%241 = icmp ne i32 %240, 0
br i1 %241, label %242, label %247
242: ; preds = %237
%243 = load i32, i32* @stderr
%244 = call i32 (i32, i8*, ...) @fprintf(i32 %243, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.30, i64 0, i64 0))
%245 = load i32, i32* %8
%246 = add nsw i32 %245, 1
store i32 %246, i32* %8
br label %250
247: ; preds = %237
%248 = load i32, i32* @stderr
%249 = call i32 (i32, i8*, ...) @fprintf(i32 %248, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.31, i64 0, i64 0))
br label %250
250: ; preds = %247, %242
br label %251
251: ; preds = %250, %221
br label %252
252: ; preds = %251, %218
%253 = load i32, i32* %14
%254 = icmp ne i32 %253, 0
br i1 %254, label %255, label %282
255: ; preds = %252
%256 = load i32, i32* @stderr
%257 = call i32 (i32, i8*, ...) @fprintf(i32 %256, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.32, i64 0, i64 0))
%258 = call i64 (...) @grub_remove_nouveau_nomodeset()
%259 = icmp ne i64 %258, 0
br i1 %259, label %260, label %265
260: ; preds = %255
%261 = load i32, i32* @stderr
%262 = call i32 (i32, i8*, ...) @fprintf(i32 %261, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.30, i64 0, i64 0))
%263 = load i32, i32* %8
%264 = add nsw i32 %263, 1
store i32 %264, i32* %8
br label %268
265: ; preds = %255
%266 = load i32, i32* @stderr
%267 = call i32 (i32, i8*, ...) @fprintf(i32 %266, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.31, i64 0, i64 0))
br label %268
268: ; preds = %265, %260
%269 = load i32, i32* @stderr
%270 = call i32 (i32, i8*, ...) @fprintf(i32 %269, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.33, i64 0, i64 0))
%271 = call i32 @system(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.34, i64 0, i64 0))
store i32 %271, i32* %7
%272 = icmp ne i32 %271, 0
br i1 %272, label %273, label %278
273: ; preds = %268
%274 = load i32, i32* @stderr
%275 = call i32 (i32, i8*, ...) @fprintf(i32 %274, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.30, i64 0, i64 0))
%276 = load i32, i32* %8
%277 = add nsw i32 %276, 1
store i32 %277, i32* %8
br label %281
278: ; preds = %268
%279 = load i32, i32* @stderr
%280 = call i32 (i32, i8*, ...) @fprintf(i32 %279, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.31, i64 0, i64 0))
br label %281
281: ; preds = %278, %273
br label %282
282: ; preds = %281, %252
%283 = load i32, i32* %8
%284 = icmp sgt i32 %283, 0
br i1 %284, label %285, label %289
285: ; preds = %282
%286 = load i32, i32* @stderr
%287 = load i32, i32* %8
%288 = call i32 (i32, i8*, ...) @fprintf(i32 %286, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.35, i64 0, i64 0), i32 %287)
br label %292
289: ; preds = %282
%290 = load i32, i32* @stderr
%291 = call i32 (i32, i8*, ...) @fprintf(i32 %290, i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str.36, i64 0, i64 0))
br label %292
292: ; preds = %289, %285
%293 = load i32, i32* %12
%294 = icmp ne i32 %293, 0
br i1 %294, label %295, label %299
295: ; preds = %292
%296 = load i32, i32* @stderr
%297 = call i32 (i32, i8*, ...) @fprintf(i32 %296, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.37, i64 0, i64 0))
%298 = call i32 @system(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.38, i64 0, i64 0))
br label %299
299: ; preds = %295, %292
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"Warning: you must run this command as root!\0A\0A\00"
@.str.1 = [31 x i8] c"/etc/X11/xorg.conf.nvidiaprime\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [98 x i8] c"Error: It seems Mageia-Prime was not configured.\0AYou have to invoke mageia-prime-install before.\0A\00"
@.str.4 = [40 x i8] c"/etc/X11/xorg.conf.nvidiaprime.xorgfree\00"
@.str.5 = [53 x i8] c"You were running an X11 system without a xorg.conf.\0A\00"
@.str.6 = [19 x i8] c"/etc/X11/xorg.conf\00"
@.str.7 = [40 x i8] c"/etc/X11/xorg.conf.nvidiaprime.preserve\00"
@.str.8 = [89 x i8] c"Can't copy /etc/X11/xorg.conf to /etc/X11/xorg.conf.nvidiaprime.preserve: %s (error %d)\0A\00"
@errno = global i32 0
@.str.9 = [41 x i8] c"/etc/X11/xorg.conf.bak.beforenvidiaprime\00"
@.str.10 = [90 x i8] c"Error: It seems Mageia-Prime was never configured, can't restore previous configuration!\0A\00"
@.str.11 = [49 x i8] c"You have to invoke mageia-prime-install before.\0A\00"
@.str.12 = [57 x i8] c"Warning: Can't restore file /etc/X11/xorg.conf: %s (%d)\0A\00"
@.str.13 = [61 x i8] c"Warning: You have to manually reconfigure X11 using XFdrake\0A\00"
@.str.14 = [56 x i8] c"Warning: Can't remove file /etc/X11/xorg.conf: %s (%d)\0A\00"
@.str.15 = [74 x i8] c"Warning: Can't remove file /etc/X11/xorg.conf.nvidiaprime: %s (error %d)\0A\00"
@.str.16 = [41 x i8] c"/etc/X11/xsetup.d/000mageia-prime.xsetup\00"
@.str.17 = [84 x i8] c"Warning: Can't remove file /etc/X11/xsetup.d/000mageia-prime.xsetup: %s (error %d)\0A\00"
@.str.18 = [42 x i8] c"/etc/modules-load.d/nvidia-prime-drm.conf\00"
@.str.19 = [85 x i8] c"Warning: Can't remove file /etc/modules-load.d/nvidia-prime-drm.conf: %s (error %d)\0A\00"
@.str.20 = [35 x i8] c"Switching to Intel GL libraries...\00"
@.str.21 = [79 x i8] c"/usr/sbin/update-alternatives --set gl_conf /etc/ld.so.conf.d/GL/standard.conf\00"
@.str.22 = [61 x i8] c"Warning: failed to run update-alternatives --set gl_conf...\0A\00"
@.str.23 = [5 x i8] c"ok.\0A\00"
@.str.24 = [19 x i8] c"/usr/sbin/ldconfig\00"
@.str.25 = [33 x i8] c"Warning: failed to run ldconfig\0A\00"
@.str.26 = [37 x i8] c"/etc/modprobe.d/00_mageia-prime.conf\00"
@.str.27 = [80 x i8] c"Warning: Can't remove file /etc/modprobe.d/00_mageia-prime.conf: %s (error %d)\0A\00"
@.str.28 = [37 x i8] c"Regenerating kernel initrd images...\00"
@.str.29 = [49 x i8] c"/sbin/bootloader-config --action rebuild-initrds\00"
@.str.30 = [9 x i8] c"failed!\0A\00"
@.str.31 = [7 x i8] c"done.\0A\00"
@.str.32 = [41 x i8] c"Removing \22nouveau.modeset=0\22 to grub2...\00"
@.str.33 = [21 x i8] c"Updating grub.cfg...\00"
@.str.34 = [21 x i8] c"/usr/bin/update-grub\00"
@.str.35 = [78 x i8] c"There were %d warnings or errors. Probably you have to unconfigure manually.\0A\00"
@.str.36 = [88 x i8] c"Mageia-Prime uninstalled and old configuration restored. Please restart X11 or reboot.\0A\00"
@.str.37 = [14 x i8] c"Zapping X11.\0A\00"
@.str.38 = [33 x i8] c"systemctl restart prefdm.service\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @getuid()
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %5, %2
%9 = phi i32 [ 1, %5 ], [ 0, %2 ]
%10 = icmp sgt i32 %0, 1
br i1 %10, label %11, label %49
11: ; preds = %8
%12 = zext i32 %0 to i64
br label %13
13: ; preds = %11, %43
%14 = phi i64 [ 1, %11 ], [ %47, %43 ]
%15 = phi i32 [ 0, %11 ], [ %46, %43 ]
%16 = phi i32 [ 0, %11 ], [ %45, %43 ]
%17 = phi i32 [ 0, %11 ], [ %44, %43 ]
%18 = getelementptr inbounds i8*, i8** %1, i64 %14
%19 = load i8*, i8** %18
%20 = load i8, i8* %19
%21 = icmp eq i8 %20, 45
br i1 %21, label %22, label %43
22: ; preds = %13
%23 = getelementptr inbounds i8, i8* %19, i64 1
%24 = load i8, i8* %23
%25 = icmp eq i8 %24, 0
br i1 %25, label %43, label %26
26: ; preds = %22
%27 = sext i8 %24 to i32
switch i32 %27, label %43 [
i32 98, label %28
i32 66, label %28
i32 122, label %33
i32 90, label %33
i32 103, label %38
i32 71, label %38
]
28: ; preds = %26, %26
%29 = getelementptr inbounds i8, i8* %19, i64 2
%30 = load i8, i8* %29
%31 = icmp eq i8 %30, 0
%32 = select i1 %31, i32 1, i32 %16
br label %43
33: ; preds = %26, %26
%34 = getelementptr inbounds i8, i8* %19, i64 2
%35 = load i8, i8* %34
%36 = icmp eq i8 %35, 0
%37 = select i1 %36, i32 1, i32 %17
br label %43
38: ; preds = %26, %26
%39 = getelementptr inbounds i8, i8* %19, i64 2
%40 = load i8, i8* %39
%41 = icmp eq i8 %40, 0
%42 = select i1 %41, i32 1, i32 %15
br label %43
43: ; preds = %38, %33, %28, %22, %26, %13
%44 = phi i32 [ %17, %13 ], [ %17, %26 ], [ %17, %22 ], [ %17, %28 ], [ %37, %33 ], [ %17, %38 ]
%45 = phi i32 [ %16, %13 ], [ %16, %26 ], [ %16, %22 ], [ %32, %28 ], [ %16, %33 ], [ %16, %38 ]
%46 = phi i32 [ %15, %13 ], [ %15, %26 ], [ %15, %22 ], [ %15, %28 ], [ %15, %33 ], [ %42, %38 ]
%47 = add nuw nsw i64 %14, 1
%48 = icmp eq i64 %47, %12
br i1 %48, label %49, label %13
49: ; preds = %43, %8
%50 = phi i32 [ 0, %8 ], [ %44, %43 ]
%51 = phi i32 [ 0, %8 ], [ %45, %43 ]
%52 = phi i32 [ 0, %8 ], [ %46, %43 ]
%53 = tail call i32* @fopen(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%54 = icmp eq i32* %53, null
br i1 %54, label %55, label %59
55: ; preds = %49
%56 = load i32, i32* @stderr
%57 = tail call i32 (i32, i8*, ...) @fprintf(i32 %56, i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str.3, i64 0, i64 0))
%58 = tail call i32 @exit(i32 1)
unreachable
59: ; preds = %49
%60 = tail call i32* @fopen(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%61 = icmp eq i32* %60, null
br i1 %61, label %62, label %65
62: ; preds = %59
%63 = tail call i64 @fcopy(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.7, i64 0, i64 0))
%64 = icmp eq i64 %63, 0
br i1 %64, label %78, label %71
65: ; preds = %59
%66 = load i32, i32* @stderr
%67 = tail call i32 (i32, i8*, ...) @fprintf(i32 %66, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.5, i64 0, i64 0))
%68 = tail call i32 @fclose(i32* %60)
%69 = tail call i64 @fcopy(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.7, i64 0, i64 0))
%70 = icmp eq i64 %69, 0
br i1 %70, label %100, label %71
71: ; preds = %65, %62
%72 = load i32, i32* @stderr
%73 = load i32, i32* @errno
%74 = tail call i8* @strerror(i32 %73)
%75 = load i32, i32* @errno
%76 = tail call i32 (i32, i8*, ...) @fprintf(i32 %72, i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str.8, i64 0, i64 0), i8* %74, i32 %75)
%77 = tail call i32 @exit(i32 1)
unreachable
78: ; preds = %62
%79 = tail call i32* @fopen(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%80 = icmp eq i32* %79, null
br i1 %80, label %81, label %87
81: ; preds = %78
%82 = load i32, i32* @stderr
%83 = tail call i32 (i32, i8*, ...) @fprintf(i32 %82, i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str.10, i64 0, i64 0))
%84 = load i32, i32* @stderr
%85 = tail call i32 (i32, i8*, ...) @fprintf(i32 %84, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.11, i64 0, i64 0))
%86 = tail call i32 @exit(i32 1)
unreachable
87: ; preds = %78
%88 = tail call i32 @fclose(i32* %79)
%89 = tail call i64 @rename(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%90 = icmp eq i64 %89, 0
br i1 %90, label %110, label %91
91: ; preds = %87
%92 = load i32, i32* @stderr
%93 = load i32, i32* @errno
%94 = tail call i8* @strerror(i32 %93)
%95 = load i32, i32* @errno
%96 = tail call i32 (i32, i8*, ...) @fprintf(i32 %92, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.12, i64 0, i64 0), i8* %94, i32 %95)
%97 = load i32, i32* @stderr
%98 = tail call i32 (i32, i8*, ...) @fprintf(i32 %97, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.13, i64 0, i64 0))
%99 = add nuw nsw i32 %9, 1
br label %110
100: ; preds = %65
%101 = tail call i32 @remove(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%102 = icmp eq i32 %101, 0
br i1 %102, label %110, label %103
103: ; preds = %100
%104 = load i32, i32* @stderr
%105 = load i32, i32* @errno
%106 = tail call i8* @strerror(i32 %105)
%107 = load i32, i32* @errno
%108 = tail call i32 (i32, i8*, ...) @fprintf(i32 %104, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.14, i64 0, i64 0), i8* %106, i32 %107)
%109 = add nuw nsw i32 %9, 1
br label %110
110: ; preds = %91, %87, %100, %103
%111 = phi i32 [ %109, %103 ], [ %9, %100 ], [ %99, %91 ], [ %9, %87 ]
%112 = tail call i32 @remove(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%113 = icmp eq i32 %112, 0
br i1 %113, label %121, label %114
114: ; preds = %110
%115 = load i32, i32* @stderr
%116 = load i32, i32* @errno
%117 = tail call i8* @strerror(i32 %116)
%118 = load i32, i32* @errno
%119 = tail call i32 (i32, i8*, ...) @fprintf(i32 %115, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.15, i64 0, i64 0), i8* %117, i32 %118)
%120 = add nsw i32 %111, 1
br label %121
121: ; preds = %114, %110
%122 = phi i32 [ %120, %114 ], [ %111, %110 ]
%123 = tail call i32 @remove(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.16, i64 0, i64 0))
%124 = icmp eq i32 %123, 0
br i1 %124, label %132, label %125
125: ; preds = %121
%126 = load i32, i32* @stderr
%127 = load i32, i32* @errno
%128 = tail call i8* @strerror(i32 %127)
%129 = load i32, i32* @errno
%130 = tail call i32 (i32, i8*, ...) @fprintf(i32 %126, i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str.17, i64 0, i64 0), i8* %128, i32 %129)
%131 = add nsw i32 %122, 1
br label %132
132: ; preds = %125, %121
%133 = phi i32 [ %131, %125 ], [ %122, %121 ]
%134 = tail call i32 @remove(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.18, i64 0, i64 0))
%135 = icmp eq i32 %134, 0
br i1 %135, label %143, label %136
136: ; preds = %132
%137 = load i32, i32* @stderr
%138 = load i32, i32* @errno
%139 = tail call i8* @strerror(i32 %138)
%140 = load i32, i32* @errno
%141 = tail call i32 (i32, i8*, ...) @fprintf(i32 %137, i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str.19, i64 0, i64 0), i8* %139, i32 %140)
%142 = add nsw i32 %133, 1
br label %143
143: ; preds = %136, %132
%144 = phi i32 [ %142, %136 ], [ %133, %132 ]
%145 = load i32, i32* @stderr
%146 = tail call i32 (i32, i8*, ...) @fprintf(i32 %145, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.20, i64 0, i64 0))
%147 = tail call i32 @system(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.21, i64 0, i64 0))
%148 = icmp eq i32 %147, 0
%149 = load i32, i32* @stderr
br i1 %148, label %153, label %150
150: ; preds = %143
%151 = tail call i32 (i32, i8*, ...) @fprintf(i32 %149, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.22, i64 0, i64 0))
%152 = add nsw i32 %144, 1
br label %155
153: ; preds = %143
%154 = tail call i32 (i32, i8*, ...) @fprintf(i32 %149, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.23, i64 0, i64 0))
br label %155
155: ; preds = %153, %150
%156 = phi i32 [ %152, %150 ], [ %144, %153 ]
%157 = tail call i32 @system(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.24, i64 0, i64 0))
%158 = icmp eq i32 %157, 0
br i1 %158, label %163, label %159
159: ; preds = %155
%160 = load i32, i32* @stderr
%161 = tail call i32 (i32, i8*, ...) @fprintf(i32 %160, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.25, i64 0, i64 0))
%162 = add nsw i32 %156, 1
br label %163
163: ; preds = %159, %155
%164 = phi i32 [ %162, %159 ], [ %156, %155 ]
%165 = tail call i32* @fopen(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.26, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%166 = icmp eq i32* %165, null
br i1 %166, label %192, label %167
167: ; preds = %163
%168 = tail call i32 @fclose(i32* %165)
%169 = icmp eq i32 %51, 0
br i1 %169, label %170, label %192
170: ; preds = %167
%171 = tail call i32 @remove(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.26, i64 0, i64 0))
%172 = icmp eq i32 %171, 0
br i1 %172, label %180, label %173
173: ; preds = %170
%174 = load i32, i32* @stderr
%175 = load i32, i32* @errno
%176 = tail call i8* @strerror(i32 %175)
%177 = load i32, i32* @errno
%178 = tail call i32 (i32, i8*, ...) @fprintf(i32 %174, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.27, i64 0, i64 0), i8* %176, i32 %177)
%179 = add nsw i32 %164, 1
br label %180
180: ; preds = %173, %170
%181 = phi i32 [ %179, %173 ], [ %164, %170 ]
%182 = load i32, i32* @stderr
%183 = tail call i32 (i32, i8*, ...) @fprintf(i32 %182, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.28, i64 0, i64 0))
%184 = tail call i32 @system(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.29, i64 0, i64 0))
%185 = icmp eq i32 %184, 0
%186 = load i32, i32* @stderr
br i1 %185, label %190, label %187
187: ; preds = %180
%188 = tail call i32 (i32, i8*, ...) @fprintf(i32 %186, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.30, i64 0, i64 0))
%189 = add nsw i32 %181, 1
br label %192
190: ; preds = %180
%191 = tail call i32 (i32, i8*, ...) @fprintf(i32 %186, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.31, i64 0, i64 0))
br label %192
192: ; preds = %167, %190, %187, %163
%193 = phi i32 [ %164, %167 ], [ %189, %187 ], [ %181, %190 ], [ %164, %163 ]
%194 = icmp eq i32 %52, 0
br i1 %194, label %218, label %195
195: ; preds = %192
%196 = load i32, i32* @stderr
%197 = tail call i32 (i32, i8*, ...) @fprintf(i32 %196, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.32, i64 0, i64 0))
%198 = tail call i64 (...) @grub_remove_nouveau_nomodeset()
%199 = icmp eq i64 %198, 0
%200 = load i32, i32* @stderr
br i1 %199, label %204, label %201
201: ; preds = %195
%202 = tail call i32 (i32, i8*, ...) @fprintf(i32 %200, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.30, i64 0, i64 0))
%203 = add nsw i32 %193, 1
br label %206
204: ; preds = %195
%205 = tail call i32 (i32, i8*, ...) @fprintf(i32 %200, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.31, i64 0, i64 0))
br label %206
206: ; preds = %204, %201
%207 = phi i32 [ %203, %201 ], [ %193, %204 ]
%208 = load i32, i32* @stderr
%209 = tail call i32 (i32, i8*, ...) @fprintf(i32 %208, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.33, i64 0, i64 0))
%210 = tail call i32 @system(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.34, i64 0, i64 0))
%211 = icmp eq i32 %210, 0
%212 = load i32, i32* @stderr
br i1 %211, label %216, label %213
213: ; preds = %206
%214 = tail call i32 (i32, i8*, ...) @fprintf(i32 %212, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.30, i64 0, i64 0))
%215 = add nsw i32 %207, 1
br label %218
216: ; preds = %206
%217 = tail call i32 (i32, i8*, ...) @fprintf(i32 %212, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.31, i64 0, i64 0))
br label %218
218: ; preds = %213, %216, %192
%219 = phi i32 [ %215, %213 ], [ %207, %216 ], [ %193, %192 ]
%220 = icmp sgt i32 %219, 0
%221 = load i32, i32* @stderr
br i1 %220, label %222, label %224
222: ; preds = %218
%223 = tail call i32 (i32, i8*, ...) @fprintf(i32 %221, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.35, i64 0, i64 0), i32 %219)
br label %226
224: ; preds = %218
%225 = tail call i32 (i32, i8*, ...) @fprintf(i32 %221, i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str.36, i64 0, i64 0))
br label %226
226: ; preds = %224, %222
%227 = icmp eq i32 %50, 0
br i1 %227, label %232, label %228
228: ; preds = %226
%229 = load i32, i32* @stderr
%230 = tail call i32 (i32, i8*, ...) @fprintf(i32 %229, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.37, i64 0, i64 0))
%231 = tail call i32 @system(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.38, i64 0, i64 0))
br label %232
232: ; preds = %228, %226
ret i32 0
}