#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ _make_log(char *, char *, int, char *, ...);
char *strchr(char *, char);
int strlen(char *);
int strncmp(char *, char *, size_t);
unsigned long strtoul(char *, char **, int);
int make_version_cmp(bool *err, __attribute__((unused)) char const *nm,
                     __attribute__((unused)) unsigned int argc, char **argv) {
  char *a = argv[0];
  char *b = argv[1];
  char *a_end = a + strlen(a), *b_end = b + strlen(b);
  char *a_q;
  char *b_q;
  *err = false;
  while ((a < a_end) && (b < b_end)) {
    unsigned long a_num, b_num;
    size_t a_len = 0, b_len;
    int ret;
    bool a_str = false;
    a_num = strtoul(a, &a_q, 10);
    if (a == a_q) {
      do {
        a_q = strchr(a, '.');
        if (!a_q)
          a_q = strchr(a, '-');
        if (!a_q)
          a_q = strchr(a, '_');
        if (!a_q)
          a_q = a + strlen(a);
      } while (0);
      ;
      a_len = a_q - a;
      a_str = true;
    }
    b_num = strtoul(a, &b_q, 10);
    if (b == b_q) {
      if (!a_str) {
        _make_log("error",
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/alandekok/"
                  "freeradius-server/refs/heads/master/scripts/build/version.c",
                  101,
                  "Can't compare string component to numeric component"
                  "\n");
      error:
        *err = true;
        return 0;
      }
      do {
        b_q = strchr(b, '.');
        if (!b_q)
          b_q = strchr(b, '-');
        if (!b_q)
          b_q = strchr(b, '_');
        if (!b_q)
          b_q = b + strlen(b);
      } while (0);
      ;
      b_len = b_q - b;
      if (a_len != b_len) {
        _make_log("error",
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/alandekok/"
                  "freeradius-server/refs/heads/master/scripts/build/version.c",
                  111,
                  "Version component length doesn't match "
                  "\"%s\" (%zu) vs \"%s\" (%zu)"
                  "\n",
                  a, a_len, b, b_len);
        goto error;
      }
      ret = strncmp(a, b, b_len);
      if (ret != 0)
        return ret;
      a = a_q;
      b = b_q;
    } else if (a_str) {
      _make_log("error",
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/alandekok/freeradius-server/"
                "refs/heads/master/scripts/build/version.c",
                130,
                "Can't compare numeric component to string component"
                "\n");
      goto error;
    } else {
      ret = (a_num > b_num) - (a_num < b_num);
      if (ret != 0)
        return ret;
    }
    if (!((*a == '.') || (*a == '-') || (*a == '_') || (*a == '\0'))) {
      _make_log("error",
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/alandekok/freeradius-server/"
                "refs/heads/master/scripts/build/version.c",
                142,
                "Missing version component separator \"%s\""
                "\n",
                a);
      goto error;
    }
    if (!((*b == '.') || (*b == '-') || (*b == '_') || (*b == '\0'))) {
      _make_log("error",
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/alandekok/freeradius-server/"
                "refs/heads/master/scripts/build/version.c",
                147,
                "Missing version component separator \"%s\""
                "\n",
                b);
      goto error;
    }
    a++;
    b++;
  }
  if ((a < a_end) || (b < b_end)) {
    _make_log("error",
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/alandekok/freeradius-server/refs/"
              "heads/master/scripts/build/version.c",
              156,
              "Mismatched version string length"
              "\n");
    goto error;
  }
  return 0;
}


x86 assembly (clang, -O0):
<make_version_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    -0x30(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x90(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x38(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x88(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x30(%rbp),%rcx
xor    %eax,%eax
cmp    -0x40(%rbp),%rcx
mov    %al,-0x91(%rbp)
jae    1200 <make_version_cmp+0xb0>
mov    -0x38(%rbp),%rax
cmp    -0x48(%rbp),%rax
setb   %al
mov    %al,-0x91(%rbp)
mov    -0x91(%rbp),%al
test   $0x1,%al
jne    1213 <make_version_cmp+0xc3>
jmp    15d1 <make_version_cmp+0x481>
movq   $0x0,-0x70(%rbp)
movl   $0x0,-0x80(%rbp)
mov    -0x30(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    $0xa,%edx
call   1070 <strtoul@plt>
mov    %rax,-0x60(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x50(%rbp),%rax
jne    12e4 <make_version_cmp+0x194>
jmp    124b <make_version_cmp+0xfb>
mov    -0x30(%rbp),%rdi
mov    $0x2e,%esi
call   1060 <strchr@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    127a <make_version_cmp+0x12a>
mov    -0x30(%rbp),%rdi
mov    $0x2d,%esi
call   1060 <strchr@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    1297 <make_version_cmp+0x147>
mov    -0x30(%rbp),%rdi
mov    $0x5f,%esi
call   1060 <strchr@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    12c9 <make_version_cmp+0x179>
mov    -0x30(%rbp),%rax
mov    %rax,-0xa0(%rbp)
mov    -0x30(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0xa0(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
jmp    12ce <make_version_cmp+0x17e>
mov    -0x50(%rbp),%rax
mov    -0x30(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x70(%rbp)
movl   $0x1,-0x80(%rbp)
mov    -0x30(%rbp),%rdi
lea    -0x58(%rbp),%rsi
mov    $0xa,%edx
call   1070 <strtoul@plt>
mov    %rax,-0x68(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x58(%rbp),%rax
jne    146b <make_version_cmp+0x31b>
cmpl   $0x0,-0x80(%rbp)
jne    1349 <make_version_cmp+0x1f9>
lea    0xce7(%rip),%rdi
lea    0xce6(%rip),%rsi
mov    $0x65,%edx
lea    0xd7a(%rip),%rcx
mov    $0x0,%al
call   1040 <_make_log@plt>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    161a <make_version_cmp+0x4ca>
jmp    134e <make_version_cmp+0x1fe>
mov    -0x38(%rbp),%rdi
mov    $0x2e,%esi
call   1060 <strchr@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
jne    137d <make_version_cmp+0x22d>
mov    -0x38(%rbp),%rdi
mov    $0x2d,%esi
call   1060 <strchr@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
jne    139a <make_version_cmp+0x24a>
mov    -0x38(%rbp),%rdi
mov    $0x5f,%esi
call   1060 <strchr@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
jne    13cc <make_version_cmp+0x27c>
mov    -0x38(%rbp),%rax
mov    %rax,-0xa8(%rbp)
mov    -0x38(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0xa8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
jmp    13d1 <make_version_cmp+0x281>
mov    -0x58(%rbp),%rax
mov    -0x38(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x78(%rbp)
mov    -0x70(%rbp),%rax
cmp    -0x78(%rbp),%rax
je     142d <make_version_cmp+0x2dd>
mov    -0x30(%rbp),%r8
mov    -0x70(%rbp),%r9
mov    -0x38(%rbp),%r10
mov    -0x78(%rbp),%rax
lea    0xbfb(%rip),%rdi
lea    0xbfa(%rip),%rsi
mov    $0x6f,%edx
lea    0xcc3(%rip),%rcx
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   1040 <_make_log@plt>
jmp    1333 <make_version_cmp+0x1e3>
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x78(%rbp),%rdx
call   1030 <strncmp@plt>
mov    %eax,-0x7c(%rbp)
cmpl   $0x0,-0x7c(%rbp)
je     1456 <make_version_cmp+0x306>
mov    -0x7c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    161a <make_version_cmp+0x4ca>
mov    -0x50(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0x38(%rbp)
jmp    14e0 <make_version_cmp+0x390>
cmpl   $0x0,-0x80(%rbp)
je     149b <make_version_cmp+0x34b>
lea    0xb84(%rip),%rdi
lea    0xb83(%rip),%rsi
mov    $0x82,%edx
lea    0xc8d(%rip),%rcx
mov    $0x0,%al
call   1040 <_make_log@plt>
jmp    1333 <make_version_cmp+0x1e3>
mov    -0x60(%rbp),%rax
cmp    -0x68(%rbp),%rax
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x60(%rbp),%rcx
cmp    -0x68(%rbp),%rcx
setb   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
mov    %eax,-0x7c(%rbp)
cmpl   $0x0,-0x7c(%rbp)
je     14d6 <make_version_cmp+0x386>
mov    -0x7c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    161a <make_version_cmp+0x4ca>
jmp    14db <make_version_cmp+0x38b>
jmp    14e0 <make_version_cmp+0x390>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
je     154a <make_version_cmp+0x3fa>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     154a <make_version_cmp+0x3fa>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5f,%eax
je     154a <make_version_cmp+0x3fa>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     154a <make_version_cmp+0x3fa>
mov    -0x30(%rbp),%r8
lea    0xad5(%rip),%rdi
lea    0xad4(%rip),%rsi
mov    $0x8e,%edx
lea    0xc13(%rip),%rcx
mov    $0x0,%al
call   1040 <_make_log@plt>
jmp    1333 <make_version_cmp+0x1e3>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
je     15b4 <make_version_cmp+0x464>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     15b4 <make_version_cmp+0x464>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5f,%eax
je     15b4 <make_version_cmp+0x464>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     15b4 <make_version_cmp+0x464>
mov    -0x38(%rbp),%r8
lea    0xa6b(%rip),%rdi
lea    0xa6a(%rip),%rsi
mov    $0x93,%edx
lea    0xba9(%rip),%rcx
mov    $0x0,%al
call   1040 <_make_log@plt>
jmp    1333 <make_version_cmp+0x1e3>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    11d9 <make_version_cmp+0x89>
mov    -0x30(%rbp),%rax
cmp    -0x40(%rbp),%rax
jb     15ed <make_version_cmp+0x49d>
mov    -0x38(%rbp),%rax
cmp    -0x48(%rbp),%rax
jae    1613 <make_version_cmp+0x4c3>
lea    0xa0c(%rip),%rdi
lea    0xa0b(%rip),%rsi
mov    $0x9c,%edx
lea    0xb74(%rip),%rcx
mov    $0x0,%al
call   1040 <_make_log@plt>
jmp    1333 <make_version_cmp+0x1e3>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_version_cmp>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rdi,%rbx
mov    (%rcx),%r12
mov    0x8(%rcx),%r14
mov    %r12,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1050 <strlen@plt>
mov    %rbx,0x8(%rsp)
movl   $0x0,(%rbx)
test   %eax,%eax
setg   %cl
test   %ebp,%ebp
setg   %dl
jle    13bd <make_version_cmp+0x26d>
test   %eax,%eax
jle    13bd <make_version_cmp+0x26d>
movslq %ebp,%r15
add    %r12,%r15
movslq %eax,%rbx
add    %r14,%rbx
mov    %r15,0x20(%rsp)
mov    %rbx,0x18(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r12,%rdi
lea    0x10(%rsp),%rsi
mov    $0xa,%edx
call   1070 <strtoul@plt>
cmp    0x10(%rsp),%r12
je     1220 <make_version_cmp+0xd0>
mov    %rax,%rbp
mov    %r12,%rdi
mov    %rsp,%rsi
mov    $0xa,%edx
call   1070 <strtoul@plt>
cmp    (%rsp),%r14
je     13e3 <make_version_cmp+0x293>
mov    %rax,%rcx
xor    %eax,%eax
xor    %edx,%edx
cmp    %rcx,%rbp
seta   %al
setb   %dl
mov    %r14,%r13
mov    %r12,%rbp
sub    %edx,%eax
je     133f <make_version_cmp+0x1ef>
jmp    142d <make_version_cmp+0x2dd>
nopl   0x0(%rax)
mov    %r12,%rdi
mov    $0x2e,%esi
call   1060 <strchr@plt>
mov    %rax,%rbp
mov    %rax,0x10(%rsp)
test   %rax,%rax
jne    1290 <make_version_cmp+0x140>
mov    %r12,%rdi
mov    $0x2d,%esi
call   1060 <strchr@plt>
mov    %rax,%rbp
mov    %rax,0x10(%rsp)
test   %rax,%rax
jne    1290 <make_version_cmp+0x140>
mov    %r12,%rdi
mov    $0x5f,%esi
call   1060 <strchr@plt>
mov    %rax,%rbp
mov    %rax,0x10(%rsp)
test   %rax,%rax
jne    1290 <make_version_cmp+0x140>
mov    %r12,%rdi
call   1050 <strlen@plt>
movslq %eax,%rbp
add    %r12,%rbp
mov    %rbp,0x10(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %rsp,%rsi
mov    $0xa,%edx
call   1070 <strtoul@plt>
cmp    (%rsp),%r14
jne    13ff <make_version_cmp+0x2af>
mov    %rbp,%r15
sub    %r12,%r15
mov    %r14,%rdi
mov    $0x2e,%esi
call   1060 <strchr@plt>
mov    %rax,%r13
mov    %rax,(%rsp)
test   %rax,%rax
jne    1310 <make_version_cmp+0x1c0>
mov    %r14,%rdi
mov    $0x2d,%esi
call   1060 <strchr@plt>
mov    %rax,%r13
mov    %rax,(%rsp)
test   %rax,%rax
jne    1310 <make_version_cmp+0x1c0>
mov    %r14,%rdi
mov    $0x5f,%esi
call   1060 <strchr@plt>
mov    %rax,%r13
mov    %rax,(%rsp)
test   %rax,%rax
jne    1310 <make_version_cmp+0x1c0>
mov    %r14,%rdi
call   1050 <strlen@plt>
movslq %eax,%r13
add    %r14,%r13
mov    %r13,(%rsp)
nopl   (%rax)
mov    %r13,%rbx
sub    %r14,%rbx
cmp    %rbx,%r15
jne    143c <make_version_cmp+0x2ec>
mov    %r12,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <strncmp@plt>
test   %eax,%eax
mov    0x20(%rsp),%r15
mov    0x18(%rsp),%rbx
jne    142d <make_version_cmp+0x2dd>
movzbl 0x0(%rbp),%eax
lea    -0x2d(%rax),%ecx
cmp    $0x32,%cl
ja     1360 <make_version_cmp+0x210>
movzbl %cl,%ecx
movabs $0x4000000000003,%rdx
bt     %rcx,%rdx
jb     1368 <make_version_cmp+0x218>
xchg   %ax,%ax
test   %al,%al
jne    146c <make_version_cmp+0x31c>
movzbl 0x0(%r13),%eax
lea    -0x2d(%rax),%ecx
cmp    $0x32,%cl
ja     1390 <make_version_cmp+0x240>
movzbl %cl,%ecx
movabs $0x4000000000003,%rdx
bt     %rcx,%rdx
jb     1398 <make_version_cmp+0x248>
nopl   0x0(%rax,%rax,1)
test   %al,%al
jne    148b <make_version_cmp+0x33b>
add    $0x1,%rbp
add    $0x1,%r13
cmp    %rbx,%r13
setb   %cl
cmp    %r15,%rbp
setb   %dl
jae    13bd <make_version_cmp+0x26d>
mov    %rbp,%r12
mov    %r13,%r14
cmp    %rbx,%r13
jb     11c0 <make_version_cmp+0x70>
test   %dl,%dl
jne    13c7 <make_version_cmp+0x277>
xor    %eax,%eax
test   %cl,%cl
je     142d <make_version_cmp+0x2dd>
lea    0xc32(%rip),%rdi
lea    0xc31(%rip),%rsi
lea    0xd9f(%rip),%rcx
mov    $0x9c,%edx
jmp    1419 <make_version_cmp+0x2c9>
lea    0xc16(%rip),%rdi
lea    0xc15(%rip),%rsi
lea    0xcae(%rip),%rcx
mov    $0x65,%edx
jmp    1419 <make_version_cmp+0x2c9>
lea    0xbfa(%rip),%rdi
lea    0xbf9(%rip),%rsi
lea    0xd08(%rip),%rcx
mov    $0x82,%edx
xor    %eax,%eax
call   1040 <_make_log@plt>
mov    0x8(%rsp),%rax
movl   $0x1,(%rax)
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xbbd(%rip),%rdi
lea    0xbbc(%rip),%rsi
lea    0xc8a(%rip),%rcx
mov    $0x6f,%edx
mov    %r12,%r8
mov    %r15,%r9
xor    %eax,%eax
push   %rbx
push   %r14
call   1040 <_make_log@plt>
add    $0x10,%rsp
jmp    1420 <make_version_cmp+0x2d0>
lea    0xb8d(%rip),%rdi
lea    0xb8c(%rip),%rsi
lea    0xcd0(%rip),%rcx
mov    $0x8e,%edx
mov    %rbp,%r8
jmp    14a8 <make_version_cmp+0x358>
lea    0xb6e(%rip),%rdi
lea    0xb6d(%rip),%rsi
lea    0xcb1(%rip),%rcx
mov    $0x93,%edx
mov    %r13,%r8
xor    %eax,%eax
call   1040 <_make_log@plt>
jmp    1420 <make_version_cmp+0x2d0>

LLVM IR (-O0):
@.str = [6 x i8] c"error\00"
@.str.1 = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/alandekok/freeradius-server/refs/heads/master/scripts/build/version.c\00"
@.str.2 = [53 x i8] c"Can't compare string component to numeric component\0A\00"
@.str.3 = [65 x i8] c"Version component length doesn't match \22%s\22 (%zu) vs \22%s\22 (%zu)\0A\00"
@.str.4 = [53 x i8] c"Can't compare numeric component to string component\0A\00"
@.str.5 = [42 x i8] c"Missing version component separator \22%s\22\0A\00"
@.str.6 = [34 x i8] c"Mismatched version string length\0A\00"
define i32 @make_version_cmp(i32* %0, i8* %1, i32 %2, i8** %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8**
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i64
%17 = alloca i64
%18 = alloca i64
%19 = alloca i64
%20 = alloca i32
%21 = alloca i32
store i32* %0, i32** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i8** %3, i8*** %9
%22 = load i8**, i8*** %9
%23 = getelementptr inbounds i8*, i8** %22, i64 0
%24 = load i8*, i8** %23
store i8* %24, i8** %10
%25 = load i8**, i8*** %9
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
store i8* %27, i8** %11
%28 = load i8*, i8** %10
%29 = load i8*, i8** %10
%30 = call i32 @strlen(i8* %29)
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8, i8* %28, i64 %31
store i8* %32, i8** %12
%33 = load i8*, i8** %11
%34 = load i8*, i8** %11
%35 = call i32 @strlen(i8* %34)
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8, i8* %33, i64 %36
store i8* %37, i8** %13
%38 = load i32*, i32** %6
store i32 0, i32* %38
br label %39
39: ; preds = %218, %4
%40 = load i8*, i8** %10
%41 = load i8*, i8** %12
%42 = icmp ult i8* %40, %41
br i1 %42, label %43, label %47
43: ; preds = %39
%44 = load i8*, i8** %11
%45 = load i8*, i8** %13
%46 = icmp ult i8* %44, %45
br label %47
47: ; preds = %43, %39
%48 = phi i1 [ false, %39 ], [ %46, %43 ]
br i1 %48, label %49, label %223
49: ; preds = %47
store i64 0, i64* %18
store i32 0, i32* %21
%50 = load i8*, i8** %10
%51 = call i64 @strtoul(i8* %50, i8** %14, i32 10)
store i64 %51, i64* %16
%52 = load i8*, i8** %10
%53 = load i8*, i8** %14
%54 = icmp eq i8* %52, %53
br i1 %54, label %55, label %86
55: ; preds = %49
br label %56
56: ; preds = %55
%57 = load i8*, i8** %10
%58 = call i8* @strchr(i8* %57, i8 signext 46)
store i8* %58, i8** %14
%59 = load i8*, i8** %14
%60 = icmp ne i8* %59, null
br i1 %60, label %64, label %61
61: ; preds = %56
%62 = load i8*, i8** %10
%63 = call i8* @strchr(i8* %62, i8 signext 45)
store i8* %63, i8** %14
br label %64
64: ; preds = %61, %56
%65 = load i8*, i8** %14
%66 = icmp ne i8* %65, null
br i1 %66, label %70, label %67
67: ; preds = %64
%68 = load i8*, i8** %10
%69 = call i8* @strchr(i8* %68, i8 signext 95)
store i8* %69, i8** %14
br label %70
70: ; preds = %67, %64
%71 = load i8*, i8** %14
%72 = icmp ne i8* %71, null
br i1 %72, label %79, label %73
73: ; preds = %70
%74 = load i8*, i8** %10
%75 = load i8*, i8** %10
%76 = call i32 @strlen(i8* %75)
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds i8, i8* %74, i64 %77
store i8* %78, i8** %14
br label %79
79: ; preds = %73, %70
br label %80
80: ; preds = %79
%81 = load i8*, i8** %14
%82 = load i8*, i8** %10
%83 = ptrtoint i8* %81 to i64
%84 = ptrtoint i8* %82 to i64
%85 = sub i64 %83, %84
store i64 %85, i64* %18
store i32 1, i32* %21
br label %86
86: ; preds = %80, %49
%87 = load i8*, i8** %10
%88 = call i64 @strtoul(i8* %87, i8** %15, i32 10)
store i64 %88, i64* %17
%89 = load i8*, i8** %11
%90 = load i8*, i8** %15
%91 = icmp eq i8* %89, %90
br i1 %91, label %92, label %151
92: ; preds = %86
%93 = load i32, i32* %21
%94 = icmp ne i32 %93, 0
br i1 %94, label %99, label %95
95: ; preds = %92
%96 = call i32 (i8*, i8*, i32, i8*, ...) @_make_log(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str.1, i64 0, i64 0), i32 101, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
br label %97
97: ; preds = %231, %215, %192, %154, %133, %95
%98 = load i32*, i32** %6
store i32 1, i32* %98
store i32 0, i32* %5
br label %234
99: ; preds = %92
br label %100
100: ; preds = %99
%101 = load i8*, i8** %11
%102 = call i8* @strchr(i8* %101, i8 signext 46)
store i8* %102, i8** %15
%103 = load i8*, i8** %15
%104 = icmp ne i8* %103, null
br i1 %104, label %108, label %105
105: ; preds = %100
%106 = load i8*, i8** %11
%107 = call i8* @strchr(i8* %106, i8 signext 45)
store i8* %107, i8** %15
br label %108
108: ; preds = %105, %100
%109 = load i8*, i8** %15
%110 = icmp ne i8* %109, null
br i1 %110, label %114, label %111
111: ; preds = %108
%112 = load i8*, i8** %11
%113 = call i8* @strchr(i8* %112, i8 signext 95)
store i8* %113, i8** %15
br label %114
114: ; preds = %111, %108
%115 = load i8*, i8** %15
%116 = icmp ne i8* %115, null
br i1 %116, label %123, label %117
117: ; preds = %114
%118 = load i8*, i8** %11
%119 = load i8*, i8** %11
%120 = call i32 @strlen(i8* %119)
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds i8, i8* %118, i64 %121
store i8* %122, i8** %15
br label %123
123: ; preds = %117, %114
br label %124
124: ; preds = %123
%125 = load i8*, i8** %15
%126 = load i8*, i8** %11
%127 = ptrtoint i8* %125 to i64
%128 = ptrtoint i8* %126 to i64
%129 = sub i64 %127, %128
store i64 %129, i64* %19
%130 = load i64, i64* %18
%131 = load i64, i64* %19
%132 = icmp ne i64 %130, %131
br i1 %132, label %133, label %139
133: ; preds = %124
%134 = load i8*, i8** %10
%135 = load i64, i64* %18
%136 = load i8*, i8** %11
%137 = load i64, i64* %19
%138 = call i32 (i8*, i8*, i32, i8*, ...) @_make_log(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str.1, i64 0, i64 0), i32 111, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.3, i64 0, i64 0), i8* %134, i64 %135, i8* %136, i64 %137)
br label %97
139: ; preds = %124
%140 = load i8*, i8** %10
%141 = load i8*, i8** %11
%142 = load i64, i64* %19
%143 = call i32 @strncmp(i8* %140, i8* %141, i64 %142)
store i32 %143, i32* %20
%144 = load i32, i32* %20
%145 = icmp ne i32 %144, 0
br i1 %145, label %146, label %148
146: ; preds = %139
%147 = load i32, i32* %20
store i32 %147, i32* %5
br label %234
148: ; preds = %139
%149 = load i8*, i8** %14
store i8* %149, i8** %10
%150 = load i8*, i8** %15
store i8* %150, i8** %11
br label %172
151: ; preds = %86
%152 = load i32, i32* %21
%153 = icmp ne i32 %152, 0
br i1 %153, label %154, label %156
154: ; preds = %151
%155 = call i32 (i8*, i8*, i32, i8*, ...) @_make_log(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str.1, i64 0, i64 0), i32 130, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0))
br label %97
156: ; preds = %151
%157 = load i64, i64* %16
%158 = load i64, i64* %17
%159 = icmp ugt i64 %157, %158
%160 = zext i1 %159 to i32
%161 = load i64, i64* %16
%162 = load i64, i64* %17
%163 = icmp ult i64 %161, %162
%164 = zext i1 %163 to i32
%165 = sub nsw i32 %160, %164
store i32 %165, i32* %20
%166 = load i32, i32* %20
%167 = icmp ne i32 %166, 0
br i1 %167, label %168, label %170
168: ; preds = %156
%169 = load i32, i32* %20
store i32 %169, i32* %5
br label %234
170: ; preds = %156
br label %171
171: ; preds = %170
br label %172
172: ; preds = %171, %148
%173 = load i8*, i8** %10
%174 = load i8, i8* %173
%175 = sext i8 %174 to i32
%176 = icmp eq i32 %175, 46
br i1 %176, label %195, label %177
177: ; preds = %172
%178 = load i8*, i8** %10
%179 = load i8, i8* %178
%180 = sext i8 %179 to i32
%181 = icmp eq i32 %180, 45
br i1 %181, label %195, label %182
182: ; preds = %177
%183 = load i8*, i8** %10
%184 = load i8, i8* %183
%185 = sext i8 %184 to i32
%186 = icmp eq i32 %185, 95
br i1 %186, label %195, label %187
187: ; preds = %182
%188 = load i8*, i8** %10
%189 = load i8, i8* %188
%190 = sext i8 %189 to i32
%191 = icmp eq i32 %190, 0
br i1 %191, label %195, label %192
192: ; preds = %187
%193 = load i8*, i8** %10
%194 = call i32 (i8*, i8*, i32, i8*, ...) @_make_log(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str.1, i64 0, i64 0), i32 142, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i8* %193)
br label %97
195: ; preds = %187, %182, %177, %172
%196 = load i8*, i8** %11
%197 = load i8, i8* %196
%198 = sext i8 %197 to i32
%199 = icmp eq i32 %198, 46
br i1 %199, label %218, label %200
200: ; preds = %195
%201 = load i8*, i8** %11
%202 = load i8, i8* %201
%203 = sext i8 %202 to i32
%204 = icmp eq i32 %203, 45
br i1 %204, label %218, label %205
205: ; preds = %200
%206 = load i8*, i8** %11
%207 = load i8, i8* %206
%208 = sext i8 %207 to i32
%209 = icmp eq i32 %208, 95
br i1 %209, label %218, label %210
210: ; preds = %205
%211 = load i8*, i8** %11
%212 = load i8, i8* %211
%213 = sext i8 %212 to i32
%214 = icmp eq i32 %213, 0
br i1 %214, label %218, label %215
215: ; preds = %210
%216 = load i8*, i8** %11
%217 = call i32 (i8*, i8*, i32, i8*, ...) @_make_log(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str.1, i64 0, i64 0), i32 147, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i8* %216)
br label %97
218: ; preds = %210, %205, %200, %195
%219 = load i8*, i8** %10
%220 = getelementptr inbounds i8, i8* %219, i32 1
store i8* %220, i8** %10
%221 = load i8*, i8** %11
%222 = getelementptr inbounds i8, i8* %221, i32 1
store i8* %222, i8** %11
br label %39
223: ; preds = %47
%224 = load i8*, i8** %10
%225 = load i8*, i8** %12
%226 = icmp ult i8* %224, %225
br i1 %226, label %231, label %227
227: ; preds = %223
%228 = load i8*, i8** %11
%229 = load i8*, i8** %13
%230 = icmp ult i8* %228, %229
br i1 %230, label %231, label %233
231: ; preds = %227, %223
%232 = call i32 (i8*, i8*, i32, i8*, ...) @_make_log(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str.1, i64 0, i64 0), i32 156, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0))
br label %97
233: ; preds = %227
store i32 0, i32* %5
br label %234
234: ; preds = %233, %168, %146, %97
%235 = load i32, i32* %5
ret i32 %235
}

LLVM IR (-O2):
@.str = [6 x i8] c"error\00"
@.str.1 = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/alandekok/freeradius-server/refs/heads/master/scripts/build/version.c\00"
@.str.2 = [53 x i8] c"Can't compare string component to numeric component\0A\00"
@.str.3 = [65 x i8] c"Version component length doesn't match \22%s\22 (%zu) vs \22%s\22 (%zu)\0A\00"
@.str.4 = [53 x i8] c"Can't compare numeric component to string component\0A\00"
@.str.5 = [42 x i8] c"Missing version component separator \22%s\22\0A\00"
@.str.6 = [34 x i8] c"Mismatched version string length\0A\00"
define i32 @make_version_cmp(i32* nocapture writeonly %0, i8* nocapture readnone %1, i32 %2, i8** nocapture %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8*, i8** %3, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @strlen(i8* %7)
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %7, i64 %11
%13 = tail call i32 @strlen(i8* %9)
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %9, i64 %14
%16 = bitcast i8** %5 to i8*
%17 = bitcast i8** %6 to i8*
store i32 0, i32* %0
%18 = icmp sgt i32 %10, 0
%19 = icmp sgt i32 %13, 0
%20 = select i1 %18, i1 %19, i1 false
br i1 %20, label %21, label %104
21: ; preds = %4, %98
%22 = phi i8* [ %99, %98 ], [ %7, %4 ]
%23 = phi i8* [ %100, %98 ], [ %9, %4 ]
%24 = call i64 @strtoul(i8* %22, i8** %5, i32 10)
%25 = load i8*, i8** %5
%26 = icmp eq i8* %22, %25
br i1 %26, label %27, label %48
27: ; preds = %21
%28 = tail call i8* @strchr(i8* dereferenceable(1) %22, i8 signext 46)
store i8* %28, i8** %5
%29 = icmp eq i8* %28, null
br i1 %29, label %30, label %40
30: ; preds = %27
%31 = tail call i8* @strchr(i8* dereferenceable(1) %22, i8 signext 45)
store i8* %31, i8** %5
%32 = icmp eq i8* %31, null
br i1 %32, label %33, label %40
33: ; preds = %30
%34 = tail call i8* @strchr(i8* dereferenceable(1) %22, i8 signext 95)
store i8* %34, i8** %5
%35 = icmp eq i8* %34, null
br i1 %35, label %36, label %40
36: ; preds = %33
%37 = tail call i32 @strlen(i8* %22)
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8, i8* %22, i64 %38
store i8* %39, i8** %5
br label %40
40: ; preds = %33, %36, %30, %27
%41 = phi i8* [ %34, %33 ], [ %39, %36 ], [ %31, %30 ], [ %28, %27 ]
%42 = ptrtoint i8* %41 to i64
%43 = ptrtoint i8* %22 to i64
%44 = sub i64 %42, %43
%45 = call i64 @strtoul(i8* %22, i8** %6, i32 10)
%46 = load i8*, i8** %6
%47 = icmp eq i8* %23, %46
br i1 %47, label %55, label %79
48: ; preds = %21
%49 = call i64 @strtoul(i8* %22, i8** %6, i32 10)
%50 = load i8*, i8** %6
%51 = icmp eq i8* %23, %50
br i1 %51, label %52, label %81
52: ; preds = %48
%53 = tail call i32 (i8*, i8*, i32, i8*, ...) @_make_log(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str.1, i64 0, i64 0), i32 101, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
br label %54
54: ; preds = %108, %96, %92, %79, %74, %52
store i32 1, i32* %0
br label %110
55: ; preds = %40
%56 = tail call i8* @strchr(i8* dereferenceable(1) %23, i8 signext 46)
store i8* %56, i8** %6
%57 = icmp eq i8* %56, null
br i1 %57, label %58, label %68
58: ; preds = %55
%59 = tail call i8* @strchr(i8* dereferenceable(1) %23, i8 signext 45)
store i8* %59, i8** %6
%60 = icmp eq i8* %59, null
br i1 %60, label %61, label %68
61: ; preds = %58
%62 = tail call i8* @strchr(i8* dereferenceable(1) %23, i8 signext 95)
store i8* %62, i8** %6
%63 = icmp eq i8* %62, null
br i1 %63, label %64, label %68
64: ; preds = %61
%65 = tail call i32 @strlen(i8* %23)
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds i8, i8* %23, i64 %66
store i8* %67, i8** %6
br label %68
68: ; preds = %55, %58, %64, %61
%69 = phi i8* [ %56, %55 ], [ %59, %58 ], [ %67, %64 ], [ %62, %61 ]
%70 = ptrtoint i8* %69 to i64
%71 = ptrtoint i8* %23 to i64
%72 = sub i64 %70, %71
%73 = icmp eq i64 %44, %72
br i1 %73, label %76, label %74
74: ; preds = %68
%75 = tail call i32 (i8*, i8*, i32, i8*, ...) @_make_log(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str.1, i64 0, i64 0), i32 111, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.3, i64 0, i64 0), i8* %22, i64 %44, i8* %23, i64 %72)
br label %54
76: ; preds = %68
%77 = tail call i32 @strncmp(i8* %22, i8* %23, i64 %44)
%78 = icmp eq i32 %77, 0
br i1 %78, label %88, label %110
79: ; preds = %40
%80 = tail call i32 (i8*, i8*, i32, i8*, ...) @_make_log(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str.1, i64 0, i64 0), i32 130, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0))
br label %54
81: ; preds = %48
%82 = icmp ugt i64 %24, %49
%83 = zext i1 %82 to i32
%84 = icmp ult i64 %24, %49
%85 = sext i1 %84 to i32
%86 = add nsw i32 %85, %83
%87 = icmp eq i32 %86, 0
br i1 %87, label %88, label %110
88: ; preds = %76, %81
%89 = phi i8* [ %23, %81 ], [ %69, %76 ]
%90 = phi i8* [ %22, %81 ], [ %41, %76 ]
%91 = load i8, i8* %90
switch i8 %91, label %92 [
i8 46, label %94
i8 45, label %94
i8 95, label %94
i8 0, label %94
]
92: ; preds = %88
%93 = tail call i32 (i8*, i8*, i32, i8*, ...) @_make_log(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str.1, i64 0, i64 0), i32 142, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i8* %90)
br label %54
94: ; preds = %88, %88, %88, %88
%95 = load i8, i8* %89
switch i8 %95, label %96 [
i8 46, label %98
i8 45, label %98
i8 95, label %98
i8 0, label %98
]
96: ; preds = %94
%97 = tail call i32 (i8*, i8*, i32, i8*, ...) @_make_log(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str.1, i64 0, i64 0), i32 147, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i8* %89)
br label %54
98: ; preds = %94, %94, %94, %94
%99 = getelementptr inbounds i8, i8* %90, i64 1
%100 = getelementptr inbounds i8, i8* %89, i64 1
%101 = icmp ult i8* %99, %12
%102 = icmp ult i8* %100, %15
%103 = select i1 %101, i1 %102, i1 false
br i1 %103, label %21, label %104
104: ; preds = %98, %4
%105 = phi i1 [ %18, %4 ], [ %101, %98 ]
%106 = phi i1 [ %19, %4 ], [ %102, %98 ]
%107 = select i1 %105, i1 true, i1 %106
br i1 %107, label %108, label %110
108: ; preds = %104
%109 = tail call i32 (i8*, i8*, i32, i8*, ...) @_make_log(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str.1, i64 0, i64 0), i32 156, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0))
br label %54
110: ; preds = %81, %76, %104, %54
%111 = phi i32 [ 0, %54 ], [ 0, %104 ], [ %86, %81 ], [ %77, %76 ]
ret i32 %111
}