#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 */
char *G_double_to_basename_format(double, size_t, size_t);
char *G_generate_basename(char const *, double, size_t, size_t);
char *G_get_basename_separator();
int /*<<< orphan*/ G_get_num_decimals(char const *);
char *G_join_basename_strings(char const **, int);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char const *, ...);
int main() {
  int i, j, n;
  const char *decimals_strings[4] = {"12345.6789", "12345.67", "12345.",
                                     "12345"};
  const char *strings[4] = {"basename", "12345.6", "12345.", "12345"};
  int len_decimals_strings = 4;
  size_t ndigits[] = {0, 2, 3, 4};
  int len_ndigits = 4;
  size_t ndecimals[] = {0, 1, 2, 3, 4};
  int len_ndecimals = 5;
  const char basename[] = "basename";
  const char SEP[] = "====================================================\n";
  double numbers[] = {12.34567890, 0.987654321};
  int len_numbers = 2;
  char *result;
  printf(SEP);
  printf("\n\nTest G_get_num_decimals\n");
  for (i = 0; i < len_decimals_strings; i++) {
    printf("Number of decimals in %s => %zu\n", decimals_strings[i],
           G_get_num_decimals(decimals_strings[i]));
  }
  printf(SEP);
  printf("\n\nTest G_double_to_basename_format\n");
  for (i = 0; i < len_ndigits; i++) {
    for (j = 0; j < len_ndecimals; j++) {
      for (n = 0; n < len_numbers; n++) {
        result =
            G_double_to_basename_format(numbers[n], ndigits[i], ndecimals[j]);
        printf("number: %10f, ndigits: %zu, ndecimals: %zu result => %s\n",
               numbers[n], ndigits[i], ndecimals[j], result);
        free(result);
      }
      printf("\n");
    }
  }
  printf(SEP);
  printf("\n\nTest G_get_basename_separator\n");
  printf("The basename separator is: %s\n", G_get_basename_separator());
  printf(SEP);
  printf("\n\nG_join_basename_strings\n");
  printf("result join strings: %s\n**", G_join_basename_strings(strings, 4));
  printf(SEP);
  printf("\n\nTest G_get_format_name\n");
  for (i = 0; i < len_ndigits; i++) {
    for (j = 0; j < len_ndecimals; j++) {
      for (n = 0; n < len_numbers; n++) {
        result =
            G_generate_basename(basename, numbers[n], ndigits[i], ndecimals[j]);
        printf("basename: %s, number: %10f, ndigits: %zu, decimals: %zu result "
               "=> %s\n",
               basename, numbers[n], ndigits[i], ndecimals[j], result);
        free(result);
      }
      printf("=======================================================\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2c37(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0x2c34(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0x2c31(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2c2e(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2c2b(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0x2c28(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0x2c25(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0x2c22(%rip),%rax
mov    %rax,-0x38(%rbp)
movl   $0x4,-0x54(%rbp)
mov    0xfd8(%rip),%rax
mov    %rax,-0x80(%rbp)
mov    0xfd5(%rip),%rax
mov    %rax,-0x78(%rbp)
mov    0xfd2(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xfcf(%rip),%rax
mov    %rax,-0x68(%rbp)
movl   $0x4,-0x84(%rbp)
lea    -0xb0(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1070 <memset@plt>
movq   $0x1,-0xa8(%rbp)
movq   $0x2,-0xa0(%rbp)
movq   $0x3,-0x98(%rbp)
movq   $0x4,-0x90(%rbp)
movl   $0x5,-0xb4(%rbp)
mov    0xd9a(%rip),%rax
mov    %rax,-0xbd(%rbp)
mov    0xd95(%rip),%al
mov    %al,-0xb5(%rbp)
lea    -0x100(%rbp),%rdi
lea    0xf58(%rip),%rsi
mov    $0x36,%edx
call   1080 <memcpy@plt>
mov    0xf87(%rip),%rax
mov    %rax,-0x110(%rbp)
mov    0xf81(%rip),%rax
mov    %rax,-0x108(%rbp)
movl   $0x2,-0x114(%rbp)
lea    -0x100(%rbp),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd45(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x54(%rbp),%eax
jge    134a <main+0x1ba>
movslq -0x8(%rbp),%rax
mov    -0x30(%rbp,%rax,8),%rax
mov    %rax,-0x128(%rbp)
movslq -0x8(%rbp),%rax
mov    -0x30(%rbp,%rax,8),%rdi
call   1040 <G_get_num_decimals@plt>
mov    -0x128(%rbp),%rsi
mov    %eax,%edx
lea    0xd18(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12fb <main+0x16b>
lea    -0x100(%rbp),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd0f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x84(%rbp),%eax
jge    1456 <main+0x2c6>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0xb4(%rbp),%eax
jge    1443 <main+0x2b3>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x114(%rbp),%eax
jge    1427 <main+0x297>
movslq -0x10(%rbp),%rax
movsd  -0x110(%rbp,%rax,8),%xmm0
ff ff
movslq -0x8(%rbp),%rax
mov    -0x80(%rbp,%rax,8),%rdi
movslq -0xc(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rsi
ff
call   10b0 <G_double_to_basename_format@plt>
mov    %rax,-0x120(%rbp)
movslq -0x10(%rbp),%rax
movsd  -0x110(%rbp,%rax,8),%xmm0
ff ff
movslq -0x8(%rbp),%rax
mov    -0x80(%rbp,%rax,8),%rsi
movslq -0xc(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rdx
ff
mov    -0x120(%rbp),%rcx
lea    0xc8c(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    -0x120(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1399 <main+0x209>
lea    0xdaa(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1383 <main+0x1f3>
jmp    1448 <main+0x2b8>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    136d <main+0x1dd>
lea    -0x100(%rbp),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xc60(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   1050 <G_get_basename_separator@plt>
mov    %rax,%rsi
lea    0xc69(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x100(%rbp),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xc6c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x50(%rbp),%rdi
mov    $0x4,%esi
call   1090 <G_join_basename_strings@plt>
mov    %rax,%rsi
lea    0xc68(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x100(%rbp),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xc67(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x84(%rbp),%eax
jge    15df <main+0x44f>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0xb4(%rbp),%eax
jge    15cc <main+0x43c>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x114(%rbp),%eax
jge    15b0 <main+0x420>
lea    -0xbd(%rbp),%rdi
movslq -0x10(%rbp),%rax
movsd  -0x110(%rbp,%rax,8),%xmm0
ff ff
movslq -0x8(%rbp),%rax
mov    -0x80(%rbp,%rax,8),%rsi
movslq -0xc(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rdx
ff
call   10a0 <G_generate_basename@plt>
mov    %rax,-0x120(%rbp)
lea    -0xbd(%rbp),%rsi
movslq -0x10(%rbp),%rax
movsd  -0x110(%rbp,%rax,8),%xmm0
ff ff
movslq -0x8(%rbp),%rax
mov    -0x80(%rbp,%rax,8),%rdx
movslq -0xc(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rcx
ff
mov    -0x120(%rbp),%r8
lea    0xbcc(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    -0x120(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1514 <main+0x384>
lea    0xbea(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    14fe <main+0x36e>
jmp    15d1 <main+0x441>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    14e8 <main+0x358>
xor    %eax,%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
movaps 0x2c6b(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0x2c4f(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movabs $0x656d616e65736162,%rax
61 6d 65
mov    %rax,(%rsp)
movb   $0x0,0x8(%rsp)
movaps 0x1060(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0x1044(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0x1028(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movabs $0xa3d3d3d3d3d3d,%rax
mov    %rax,0x3e(%rsp)
xor    %ebp,%ebp
lea    0x10(%rsp),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xf08(%rip),%rdi
call   1050 <puts@plt>
lea    0xdf0(%rip),%rbx
mov    %rbx,%rdi
call   1060 <G_get_num_decimals@plt>
lea    0xe13(%rip),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xdd6(%rip),%rbx
mov    %rbx,%rdi
call   1060 <G_get_num_decimals@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xdc1(%rip),%rbx
mov    %rbx,%rdi
call   1060 <G_get_num_decimals@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xdaa(%rip),%rbx
mov    %rbx,%rdi
call   1060 <G_get_num_decimals@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xe8d(%rip),%rdi
call   1050 <puts@plt>
lea    0xf3b(%rip),%r13
lea    0xda7(%rip),%r14
nopl   0x0(%rax)
mov    0x0(%rbp,%r13,1),%rbx
movsd  0xd33(%rip),%xmm0
mov    %rbx,%rdi
xor    %esi,%esi
call   10b0 <G_double_to_basename_format@plt>
mov    %rax,%r15
mov    %r14,%rdi
movsd  0xd1b(%rip),%xmm0
mov    %rbx,%rsi
xor    %edx,%edx
mov    %rax,%rcx
mov    $0x1,%al
call   1080 <printf@plt>
mov    %r15,%rdi
call   1030 <free@plt>
movsd  0xd04(%rip),%xmm0
mov    %rbx,%rdi
xor    %esi,%esi
call   10b0 <G_double_to_basename_format@plt>
mov    %rax,%r15
mov    %r14,%rdi
movsd  0xcec(%rip),%xmm0
mov    %rbx,%rsi
xor    %edx,%edx
mov    %rax,%rcx
mov    $0x1,%al
call   1080 <printf@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    $0x1,%esi
movsd  0xcb6(%rip),%xmm0
mov    %rbx,%rdi
call   10b0 <G_double_to_basename_format@plt>
mov    %rax,%r15
mov    $0x1,%edx
mov    %r14,%rdi
movsd  0xc9b(%rip),%xmm0
mov    %rbx,%rsi
mov    %rax,%rcx
mov    $0x1,%al
call   1080 <printf@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    $0x1,%esi
movsd  0xc81(%rip),%xmm0
mov    %rbx,%rdi
call   10b0 <G_double_to_basename_format@plt>
mov    %rax,%r15
mov    $0x1,%edx
mov    %r14,%rdi
movsd  0xc66(%rip),%xmm0
mov    %rbx,%rsi
mov    %rax,%rcx
mov    $0x1,%al
call   1080 <printf@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    $0x2,%esi
movsd  0xc32(%rip),%xmm0
mov    %rbx,%rdi
call   10b0 <G_double_to_basename_format@plt>
mov    %rax,%r15
mov    $0x2,%edx
mov    %r14,%rdi
movsd  0xc17(%rip),%xmm0
mov    %rbx,%rsi
mov    %rax,%rcx
mov    $0x1,%al
call   1080 <printf@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    $0x2,%esi
movsd  0xbfd(%rip),%xmm0
mov    %rbx,%rdi
call   10b0 <G_double_to_basename_format@plt>
mov    %rax,%r15
mov    $0x2,%edx
mov    %r14,%rdi
movsd  0xbe2(%rip),%xmm0
mov    %rbx,%rsi
mov    %rax,%rcx
mov    $0x1,%al
call   1080 <printf@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    $0x3,%esi
movsd  0xbae(%rip),%xmm0
mov    %rbx,%rdi
call   10b0 <G_double_to_basename_format@plt>
mov    %rax,%r15
mov    $0x3,%edx
mov    %r14,%rdi
movsd  0xb93(%rip),%xmm0
mov    %rbx,%rsi
mov    %rax,%rcx
mov    $0x1,%al
call   1080 <printf@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    $0x3,%esi
movsd  0xb79(%rip),%xmm0
mov    %rbx,%rdi
call   10b0 <G_double_to_basename_format@plt>
mov    %rax,%r15
mov    $0x3,%edx
mov    %r14,%rdi
movsd  0xb5e(%rip),%xmm0
mov    %rbx,%rsi
mov    %rax,%rcx
mov    $0x1,%al
call   1080 <printf@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    $0x4,%esi
movsd  0xb2a(%rip),%xmm0
mov    %rbx,%rdi
call   10b0 <G_double_to_basename_format@plt>
mov    %rax,%r15
mov    $0x4,%edx
mov    %r14,%rdi
movsd  0xb0f(%rip),%xmm0
mov    %rbx,%rsi
mov    %rax,%rcx
mov    $0x1,%al
call   1080 <printf@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    $0x4,%esi
movsd  0xaf5(%rip),%xmm0
mov    %rbx,%rdi
call   10b0 <G_double_to_basename_format@plt>
mov    %rax,%r15
mov    $0x4,%edx
mov    %r14,%rdi
movsd  0xada(%rip),%xmm0
mov    %rbx,%rsi
mov    %rax,%rcx
mov    $0x1,%al
call   1080 <printf@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
add    $0x8,%rbp
cmp    $0x20,%rbp
jne    12c0 <main+0x130>
xor    %ebp,%ebp
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xbe6(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1070 <G_get_basename_separator@plt>
lea    0xb16(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xbd8(%rip),%rdi
call   1050 <puts@plt>
lea    0x50(%rsp),%rdi
mov    $0x4,%esi
call   1090 <G_join_basename_strings@plt>
lea    0xaff(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xbbc(%rip),%rdi
call   1050 <puts@plt>
mov    %rsp,%r12
lea    0xaf0(%rip),%r14
lea    0xbbf(%rip),%r15
nopl   (%rax)
mov    0x0(%rbp,%r13,1),%rbx
mov    %r12,%rdi
movsd  0xa00(%rip),%xmm0
mov    %rbx,%rsi
xor    %edx,%edx
call   10a0 <G_generate_basename@plt>
mov    %rax,%r13
mov    %r14,%rdi
mov    %r12,%rsi
movsd  0x9e5(%rip),%xmm0
mov    %rbx,%rdx
xor    %ecx,%ecx
mov    %rax,%r8
mov    $0x1,%al
call   1080 <printf@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
movsd  0x9cb(%rip),%xmm0
mov    %rbx,%rsi
xor    %edx,%edx
call   10a0 <G_generate_basename@plt>
mov    %rax,%r13
mov    %r14,%rdi
mov    %r12,%rsi
movsd  0x9b0(%rip),%xmm0
mov    %rbx,%rdx
xor    %ecx,%ecx
mov    %rax,%r8
mov    $0x1,%al
call   1080 <printf@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1050 <puts@plt>
mov    $0x1,%edx
mov    %r12,%rdi
movsd  0x979(%rip),%xmm0
mov    %rbx,%rsi
call   10a0 <G_generate_basename@plt>
mov    %rax,%r13
mov    $0x1,%ecx
mov    %r14,%rdi
mov    %r12,%rsi
movsd  0x95b(%rip),%xmm0
mov    %rbx,%rdx
mov    %rax,%r8
mov    $0x1,%al
call   1080 <printf@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    $0x1,%edx
mov    %r12,%rdi
movsd  0x93e(%rip),%xmm0
mov    %rbx,%rsi
call   10a0 <G_generate_basename@plt>
mov    %rax,%r13
mov    $0x1,%ecx
mov    %r14,%rdi
mov    %r12,%rsi
movsd  0x920(%rip),%xmm0
mov    %rbx,%rdx
mov    %rax,%r8
mov    $0x1,%al
call   1080 <printf@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1050 <puts@plt>
mov    $0x2,%edx
mov    %r12,%rdi
movsd  0x8eb(%rip),%xmm0
mov    %rbx,%rsi
call   10a0 <G_generate_basename@plt>
mov    %rax,%r13
mov    $0x2,%ecx
mov    %r14,%rdi
mov    %r12,%rsi
movsd  0x8cd(%rip),%xmm0
mov    %rbx,%rdx
mov    %rax,%r8
mov    $0x1,%al
call   1080 <printf@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    $0x2,%edx
mov    %r12,%rdi
movsd  0x8b0(%rip),%xmm0
mov    %rbx,%rsi
call   10a0 <G_generate_basename@plt>
mov    %rax,%r13
mov    $0x2,%ecx
mov    %r14,%rdi
mov    %r12,%rsi
movsd  0x892(%rip),%xmm0
mov    %rbx,%rdx
mov    %rax,%r8
mov    $0x1,%al
call   1080 <printf@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1050 <puts@plt>
mov    $0x3,%edx
mov    %r12,%rdi
movsd  0x85d(%rip),%xmm0
mov    %rbx,%rsi
call   10a0 <G_generate_basename@plt>
mov    %rax,%r13
mov    $0x3,%ecx
mov    %r14,%rdi
mov    %r12,%rsi
movsd  0x83f(%rip),%xmm0
mov    %rbx,%rdx
mov    %rax,%r8
mov    $0x1,%al
call   1080 <printf@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    $0x3,%edx
mov    %r12,%rdi
movsd  0x822(%rip),%xmm0
mov    %rbx,%rsi
call   10a0 <G_generate_basename@plt>
mov    %rax,%r13
mov    $0x3,%ecx
mov    %r14,%rdi
mov    %r12,%rsi
movsd  0x804(%rip),%xmm0
mov    %rbx,%rdx
mov    %rax,%r8
mov    $0x1,%al
call   1080 <printf@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1050 <puts@plt>
mov    $0x4,%edx
mov    %r12,%rdi
movsd  0x7cf(%rip),%xmm0
mov    %rbx,%rsi
call   10a0 <G_generate_basename@plt>
mov    %rax,%r13
mov    $0x4,%ecx
mov    %r14,%rdi
mov    %r12,%rsi
movsd  0x7b1(%rip),%xmm0
mov    %rbx,%rdx
mov    %rax,%r8
mov    $0x1,%al
call   1080 <printf@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    $0x4,%edx
mov    %r12,%rdi
movsd  0x794(%rip),%xmm0
mov    %rbx,%rsi
call   10a0 <G_generate_basename@plt>
mov    %rax,%r13
mov    $0x4,%ecx
mov    %r14,%rdi
mov    %r12,%rsi
movsd  0x776(%rip),%xmm0
mov    %rbx,%rdx
mov    %rax,%r8
mov    $0x1,%al
call   1080 <printf@plt>
mov    %r13,%rdi
lea    0x947(%rip),%r13
call   1030 <free@plt>
mov    %r15,%rdi
call   1050 <puts@plt>
add    $0x8,%rbp
cmp    $0x20,%rbp
jne    15f0 <main+0x460>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"12345.6789\00"
@.str.1 = [9 x i8] c"12345.67\00"
@.str.2 = [7 x i8] c"12345.\00"
@.str.3 = [6 x i8] c"12345\00"
@__const.main.decimals_strings = [4 x i8*] [i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0)]
@.str.4 = [9 x i8] c"basename\00"
@.str.5 = [8 x i8] c"12345.6\00"
@__const.main.strings = [4 x i8*] [i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0)]
@__const.main.ndigits = [4 x i64] [i64 0, i64 2, i64 3, i64 4]
@__const.main.basename = [9 x i8] c"basename\00"
@__const.main.SEP = [54 x i8] c"====================================================\0A\00"
@__const.main.numbers = [2 x double] [double 0x4028B0FCD324D5A2, double 0x3FEF9ADD3C0E56B8]
@.str.6 = [27 x i8] c"\0A\0ATest G_get_num_decimals\0A\00"
@.str.7 = [33 x i8] c"Number of decimals in %s => %zu\0A\00"
@.str.8 = [36 x i8] c"\0A\0ATest G_double_to_basename_format\0A\00"
@.str.9 = [57 x i8] c"number: %10f, ndigits: %zu, ndecimals: %zu result => %s\0A\00"
@.str.10 = [2 x i8] c"\0A\00"
@.str.11 = [33 x i8] c"\0A\0ATest G_get_basename_separator\0A\00"
@.str.12 = [31 x i8] c"The basename separator is: %s\0A\00"
@.str.13 = [27 x i8] c"\0A\0AG_join_basename_strings\0A\00"
@.str.14 = [27 x i8] c"result join strings: %s\0A**\00"
@.str.15 = [26 x i8] c"\0A\0ATest G_get_format_name\0A\00"
@.str.16 = [70 x i8] c"basename: %s, number: %10f, ndigits: %zu, decimals: %zu result => %s\0A\00"
@.str.17 = [57 x i8] c"=======================================================\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [4 x i8*]
%6 = alloca [4 x i8*]
%7 = alloca i32
%8 = alloca [4 x i64]
%9 = alloca i32
%10 = alloca [5 x i64]
%11 = alloca i32
%12 = alloca [9 x i8]
%13 = alloca [54 x i8]
%14 = alloca [2 x double]
%15 = alloca i32
%16 = alloca i8*
store i32 0, i32* %1
%17 = bitcast [4 x i8*]* %5 to i8*
%18 = bitcast [4 x i8*]* %6 to i8*
store i32 4, i32* %7
%19 = bitcast [4 x i64]* %8 to i8*
store i32 4, i32* %9
%20 = bitcast [5 x i64]* %10 to i8*
%21 = bitcast i8* %20 to [5 x i64]*
%22 = getelementptr inbounds [5 x i64], [5 x i64]* %21, i32 0, i32 1
store i64 1, i64* %22
%23 = getelementptr inbounds [5 x i64], [5 x i64]* %21, i32 0, i32 2
store i64 2, i64* %23
%24 = getelementptr inbounds [5 x i64], [5 x i64]* %21, i32 0, i32 3
store i64 3, i64* %24
%25 = getelementptr inbounds [5 x i64], [5 x i64]* %21, i32 0, i32 4
store i64 4, i64* %25
store i32 5, i32* %11
%26 = bitcast [9 x i8]* %12 to i8*
%27 = bitcast [54 x i8]* %13 to i8*
%28 = bitcast [2 x double]* %14 to i8*
store i32 2, i32* %15
%29 = getelementptr inbounds [54 x i8], [54 x i8]* %13, i64 0, i64 0
%30 = call i32 (i8*, ...) @printf(i8* %29)
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %2
br label %32
32: ; preds = %47, %0
%33 = load i32, i32* %2
%34 = load i32, i32* %7
%35 = icmp slt i32 %33, %34
br i1 %35, label %36, label %50
36: ; preds = %32
%37 = load i32, i32* %2
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [4 x i8*], [4 x i8*]* %5, i64 0, i64 %38
%40 = load i8*, i8** %39
%41 = load i32, i32* %2
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [4 x i8*], [4 x i8*]* %5, i64 0, i64 %42
%44 = load i8*, i8** %43
%45 = call i32 @G_get_num_decimals(i8* %44)
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0), i8* %40, i32 %45)
br label %47
47: ; preds = %36
%48 = load i32, i32* %2
%49 = add nsw i32 %48, 1
store i32 %49, i32* %2
br label %32
50: ; preds = %32
%51 = getelementptr inbounds [54 x i8], [54 x i8]* %13, i64 0, i64 0
%52 = call i32 (i8*, ...) @printf(i8* %51)
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %2
br label %54
54: ; preds = %107, %50
%55 = load i32, i32* %2
%56 = load i32, i32* %9
%57 = icmp slt i32 %55, %56
br i1 %57, label %58, label %110
58: ; preds = %54
store i32 0, i32* %3
br label %59
59: ; preds = %103, %58
%60 = load i32, i32* %3
%61 = load i32, i32* %11
%62 = icmp slt i32 %60, %61
br i1 %62, label %63, label %106
63: ; preds = %59
store i32 0, i32* %4
br label %64
64: ; preds = %98, %63
%65 = load i32, i32* %4
%66 = load i32, i32* %15
%67 = icmp slt i32 %65, %66
br i1 %67, label %68, label %101
68: ; preds = %64
%69 = load i32, i32* %4
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [2 x double], [2 x double]* %14, i64 0, i64 %70
%72 = load double, double* %71
%73 = load i32, i32* %2
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [4 x i64], [4 x i64]* %8, i64 0, i64 %74
%76 = load i64, i64* %75
%77 = load i32, i32* %3
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds [5 x i64], [5 x i64]* %10, i64 0, i64 %78
%80 = load i64, i64* %79
%81 = call i8* @G_double_to_basename_format(double %72, i64 %76, i64 %80)
store i8* %81, i8** %16
%82 = load i32, i32* %4
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds [2 x double], [2 x double]* %14, i64 0, i64 %83
%85 = load double, double* %84
%86 = load i32, i32* %2
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds [4 x i64], [4 x i64]* %8, i64 0, i64 %87
%89 = load i64, i64* %88
%90 = load i32, i32* %3
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds [5 x i64], [5 x i64]* %10, i64 0, i64 %91
%93 = load i64, i64* %92
%94 = load i8*, i8** %16
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.9, i64 0, i64 0), double %85, i64 %89, i64 %93, i8* %94)
%96 = load i8*, i8** %16
%97 = call i32 @free(i8* %96)
br label %98
98: ; preds = %68
%99 = load i32, i32* %4
%100 = add nsw i32 %99, 1
store i32 %100, i32* %4
br label %64
101: ; preds = %64
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
br label %103
103: ; preds = %101
%104 = load i32, i32* %3
%105 = add nsw i32 %104, 1
store i32 %105, i32* %3
br label %59
106: ; preds = %59
br label %107
107: ; preds = %106
%108 = load i32, i32* %2
%109 = add nsw i32 %108, 1
store i32 %109, i32* %2
br label %54
110: ; preds = %54
%111 = getelementptr inbounds [54 x i8], [54 x i8]* %13, i64 0, i64 0
%112 = call i32 (i8*, ...) @printf(i8* %111)
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.11, i64 0, i64 0))
%114 = call i8* (...) @G_get_basename_separator()
%115 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.12, i64 0, i64 0), i8* %114)
%116 = getelementptr inbounds [54 x i8], [54 x i8]* %13, i64 0, i64 0
%117 = call i32 (i8*, ...) @printf(i8* %116)
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.13, i64 0, i64 0))
%119 = getelementptr inbounds [4 x i8*], [4 x i8*]* %6, i64 0, i64 0
%120 = call i8* @G_join_basename_strings(i8** %119, i32 4)
%121 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.14, i64 0, i64 0), i8* %120)
%122 = getelementptr inbounds [54 x i8], [54 x i8]* %13, i64 0, i64 0
%123 = call i32 (i8*, ...) @printf(i8* %122)
%124 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.15, i64 0, i64 0))
store i32 0, i32* %2
br label %125
125: ; preds = %180, %110
%126 = load i32, i32* %2
%127 = load i32, i32* %9
%128 = icmp slt i32 %126, %127
br i1 %128, label %129, label %183
129: ; preds = %125
store i32 0, i32* %3
br label %130
130: ; preds = %176, %129
%131 = load i32, i32* %3
%132 = load i32, i32* %11
%133 = icmp slt i32 %131, %132
br i1 %133, label %134, label %179
134: ; preds = %130
store i32 0, i32* %4
br label %135
135: ; preds = %171, %134
%136 = load i32, i32* %4
%137 = load i32, i32* %15
%138 = icmp slt i32 %136, %137
br i1 %138, label %139, label %174
139: ; preds = %135
%140 = getelementptr inbounds [9 x i8], [9 x i8]* %12, i64 0, i64 0
%141 = load i32, i32* %4
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds [2 x double], [2 x double]* %14, i64 0, i64 %142
%144 = load double, double* %143
%145 = load i32, i32* %2
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds [4 x i64], [4 x i64]* %8, i64 0, i64 %146
%148 = load i64, i64* %147
%149 = load i32, i32* %3
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds [5 x i64], [5 x i64]* %10, i64 0, i64 %150
%152 = load i64, i64* %151
%153 = call i8* @G_generate_basename(i8* %140, double %144, i64 %148, i64 %152)
store i8* %153, i8** %16
%154 = getelementptr inbounds [9 x i8], [9 x i8]* %12, i64 0, i64 0
%155 = load i32, i32* %4
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds [2 x double], [2 x double]* %14, i64 0, i64 %156
%158 = load double, double* %157
%159 = load i32, i32* %2
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds [4 x i64], [4 x i64]* %8, i64 0, i64 %160
%162 = load i64, i64* %161
%163 = load i32, i32* %3
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds [5 x i64], [5 x i64]* %10, i64 0, i64 %164
%166 = load i64, i64* %165
%167 = load i8*, i8** %16
%168 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.16, i64 0, i64 0), i8* %154, double %158, i64 %162, i64 %166, i8* %167)
%169 = load i8*, i8** %16
%170 = call i32 @free(i8* %169)
br label %171
171: ; preds = %139
%172 = load i32, i32* %4
%173 = add nsw i32 %172, 1
store i32 %173, i32* %4
br label %135
174: ; preds = %135
%175 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.17, i64 0, i64 0))
br label %176
176: ; preds = %174
%177 = load i32, i32* %3
%178 = add nsw i32 %177, 1
store i32 %178, i32* %3
br label %130
179: ; preds = %130
br label %180
180: ; preds = %179
%181 = load i32, i32* %2
%182 = add nsw i32 %181, 1
store i32 %182, i32* %2
br label %125
183: ; preds = %125
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"12345.6789\00"
@.str.1 = [9 x i8] c"12345.67\00"
@.str.2 = [7 x i8] c"12345.\00"
@.str.3 = [6 x i8] c"12345\00"
@.str.5 = [8 x i8] c"12345.6\00"
@__const.main.strings = [4 x i8*] [i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__const.main.basename, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0)]
@__const.main.ndigits = [4 x i64] [i64 0, i64 2, i64 3, i64 4]
@__const.main.basename = [9 x i8] c"basename\00"
@__const.main.SEP = [54 x i8] c"====================================================\0A\00"
@.str.7 = [33 x i8] c"Number of decimals in %s => %zu\0A\00"
@.str.9 = [57 x i8] c"number: %10f, ndigits: %zu, ndecimals: %zu result => %s\0A\00"
@.str.12 = [31 x i8] c"The basename separator is: %s\0A\00"
@.str.14 = [27 x i8] c"result join strings: %s\0A**\00"
@.str.16 = [70 x i8] c"basename: %s, number: %10f, ndigits: %zu, decimals: %zu result => %s\0A\00"
@str = [26 x i8] c"\0A\0ATest G_get_num_decimals\00"
@str.18 = [35 x i8] c"\0A\0ATest G_double_to_basename_format\00"
@str.19 = [32 x i8] c"\0A\0ATest G_get_basename_separator\00"
@str.20 = [26 x i8] c"\0A\0AG_join_basename_strings\00"
@str.21 = [25 x i8] c"\0A\0ATest G_get_format_name\00"
@str.22 = [56 x i8] c"=======================================================\00"
define i32 @main() {
%1 = alloca [4 x i8*]
%2 = alloca [9 x i8]
%3 = alloca [54 x i8]
%4 = bitcast [4 x i8*]* %1 to i8*
%5 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [54 x i8], [54 x i8]* %3, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* %6)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @G_get_num_decimals(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = tail call i32 @G_get_num_decimals(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = tail call i32 @G_get_num_decimals(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %13)
%15 = tail call i32 @G_get_num_decimals(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %15)
%17 = call i32 (i8*, ...) @printf(i8* %6)
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.18, i64 0, i64 0))
br label %19
19: ; preds = %0, %19
%20 = phi i64 [ 0, %0 ], [ %58, %19 ]
%21 = getelementptr inbounds [4 x i64], [4 x i64]* @__const.main.ndigits, i64 0, i64 %20
%22 = load i64, i64* %21
%23 = tail call i8* @G_double_to_basename_format(double 0x4028B0FCD324D5A2, i64 %22, i64 0)
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.9, i64 0, i64 0), double 0x4028B0FCD324D5A2, i64 %22, i64 0, i8* %23)
%25 = tail call i32 @free(i8* %23)
%26 = tail call i8* @G_double_to_basename_format(double 0x3FEF9ADD3C0E56B8, i64 %22, i64 0)
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.9, i64 0, i64 0), double 0x3FEF9ADD3C0E56B8, i64 %22, i64 0, i8* %26)
%28 = tail call i32 @free(i8* %26)
%29 = tail call i32 @putchar(i32 10)
%30 = tail call i8* @G_double_to_basename_format(double 0x4028B0FCD324D5A2, i64 %22, i64 1)
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.9, i64 0, i64 0), double 0x4028B0FCD324D5A2, i64 %22, i64 1, i8* %30)
%32 = tail call i32 @free(i8* %30)
%33 = tail call i8* @G_double_to_basename_format(double 0x3FEF9ADD3C0E56B8, i64 %22, i64 1)
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.9, i64 0, i64 0), double 0x3FEF9ADD3C0E56B8, i64 %22, i64 1, i8* %33)
%35 = tail call i32 @free(i8* %33)
%36 = tail call i32 @putchar(i32 10)
%37 = tail call i8* @G_double_to_basename_format(double 0x4028B0FCD324D5A2, i64 %22, i64 2)
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.9, i64 0, i64 0), double 0x4028B0FCD324D5A2, i64 %22, i64 2, i8* %37)
%39 = tail call i32 @free(i8* %37)
%40 = tail call i8* @G_double_to_basename_format(double 0x3FEF9ADD3C0E56B8, i64 %22, i64 2)
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.9, i64 0, i64 0), double 0x3FEF9ADD3C0E56B8, i64 %22, i64 2, i8* %40)
%42 = tail call i32 @free(i8* %40)
%43 = tail call i32 @putchar(i32 10)
%44 = tail call i8* @G_double_to_basename_format(double 0x4028B0FCD324D5A2, i64 %22, i64 3)
%45 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.9, i64 0, i64 0), double 0x4028B0FCD324D5A2, i64 %22, i64 3, i8* %44)
%46 = tail call i32 @free(i8* %44)
%47 = tail call i8* @G_double_to_basename_format(double 0x3FEF9ADD3C0E56B8, i64 %22, i64 3)
%48 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.9, i64 0, i64 0), double 0x3FEF9ADD3C0E56B8, i64 %22, i64 3, i8* %47)
%49 = tail call i32 @free(i8* %47)
%50 = tail call i32 @putchar(i32 10)
%51 = tail call i8* @G_double_to_basename_format(double 0x4028B0FCD324D5A2, i64 %22, i64 4)
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.9, i64 0, i64 0), double 0x4028B0FCD324D5A2, i64 %22, i64 4, i8* %51)
%53 = tail call i32 @free(i8* %51)
%54 = tail call i8* @G_double_to_basename_format(double 0x3FEF9ADD3C0E56B8, i64 %22, i64 4)
%55 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.9, i64 0, i64 0), double 0x3FEF9ADD3C0E56B8, i64 %22, i64 4, i8* %54)
%56 = tail call i32 @free(i8* %54)
%57 = tail call i32 @putchar(i32 10)
%58 = add nuw nsw i64 %20, 1
%59 = icmp eq i64 %58, 4
br i1 %59, label %60, label %19
60: ; preds = %19
%61 = call i32 (i8*, ...) @printf(i8* %6)
%62 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.19, i64 0, i64 0))
%63 = tail call i8* (...) @G_get_basename_separator()
%64 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.12, i64 0, i64 0), i8* %63)
%65 = call i32 (i8*, ...) @printf(i8* %6)
%66 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.20, i64 0, i64 0))
%67 = getelementptr inbounds [4 x i8*], [4 x i8*]* %1, i64 0, i64 0
%68 = call i8* @G_join_basename_strings(i8** %67, i32 4)
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.14, i64 0, i64 0), i8* %68)
%70 = call i32 (i8*, ...) @printf(i8* %6)
%71 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.21, i64 0, i64 0))
br label %72
72: ; preds = %60, %72
%73 = phi i64 [ 0, %60 ], [ %111, %72 ]
%74 = getelementptr inbounds [4 x i64], [4 x i64]* @__const.main.ndigits, i64 0, i64 %73
%75 = load i64, i64* %74
%76 = call i8* @G_generate_basename(i8* %5, double 0x4028B0FCD324D5A2, i64 %75, i64 0)
%77 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str.16, i64 0, i64 0), i8* %5, double 0x4028B0FCD324D5A2, i64 %75, i64 0, i8* %76)
%78 = call i32 @free(i8* %76)
%79 = call i8* @G_generate_basename(i8* %5, double 0x3FEF9ADD3C0E56B8, i64 %75, i64 0)
%80 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str.16, i64 0, i64 0), i8* %5, double 0x3FEF9ADD3C0E56B8, i64 %75, i64 0, i8* %79)
%81 = call i32 @free(i8* %79)
%82 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.22, i64 0, i64 0))
%83 = call i8* @G_generate_basename(i8* %5, double 0x4028B0FCD324D5A2, i64 %75, i64 1)
%84 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str.16, i64 0, i64 0), i8* %5, double 0x4028B0FCD324D5A2, i64 %75, i64 1, i8* %83)
%85 = call i32 @free(i8* %83)
%86 = call i8* @G_generate_basename(i8* %5, double 0x3FEF9ADD3C0E56B8, i64 %75, i64 1)
%87 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str.16, i64 0, i64 0), i8* %5, double 0x3FEF9ADD3C0E56B8, i64 %75, i64 1, i8* %86)
%88 = call i32 @free(i8* %86)
%89 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.22, i64 0, i64 0))
%90 = call i8* @G_generate_basename(i8* %5, double 0x4028B0FCD324D5A2, i64 %75, i64 2)
%91 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str.16, i64 0, i64 0), i8* %5, double 0x4028B0FCD324D5A2, i64 %75, i64 2, i8* %90)
%92 = call i32 @free(i8* %90)
%93 = call i8* @G_generate_basename(i8* %5, double 0x3FEF9ADD3C0E56B8, i64 %75, i64 2)
%94 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str.16, i64 0, i64 0), i8* %5, double 0x3FEF9ADD3C0E56B8, i64 %75, i64 2, i8* %93)
%95 = call i32 @free(i8* %93)
%96 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.22, i64 0, i64 0))
%97 = call i8* @G_generate_basename(i8* %5, double 0x4028B0FCD324D5A2, i64 %75, i64 3)
%98 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str.16, i64 0, i64 0), i8* %5, double 0x4028B0FCD324D5A2, i64 %75, i64 3, i8* %97)
%99 = call i32 @free(i8* %97)
%100 = call i8* @G_generate_basename(i8* %5, double 0x3FEF9ADD3C0E56B8, i64 %75, i64 3)
%101 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str.16, i64 0, i64 0), i8* %5, double 0x3FEF9ADD3C0E56B8, i64 %75, i64 3, i8* %100)
%102 = call i32 @free(i8* %100)
%103 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.22, i64 0, i64 0))
%104 = call i8* @G_generate_basename(i8* %5, double 0x4028B0FCD324D5A2, i64 %75, i64 4)
%105 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str.16, i64 0, i64 0), i8* %5, double 0x4028B0FCD324D5A2, i64 %75, i64 4, i8* %104)
%106 = call i32 @free(i8* %104)
%107 = call i8* @G_generate_basename(i8* %5, double 0x3FEF9ADD3C0E56B8, i64 %75, i64 4)
%108 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str.16, i64 0, i64 0), i8* %5, double 0x3FEF9ADD3C0E56B8, i64 %75, i64 4, i8* %107)
%109 = call i32 @free(i8* %107)
%110 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.22, i64 0, i64 0))
%111 = add nuw nsw i64 %73, 1
%112 = icmp eq i64 %111, 4
br i1 %112, label %113, label %72
113: ; preds = %72
ret i32 0
}