#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*/ s9;
typedef int /*<<< orphan*/ s8;
typedef int /*<<< orphan*/ s7;
typedef int /*<<< orphan*/ s6;
typedef int /*<<< orphan*/ s5;
typedef int /*<<< orphan*/ s4;
typedef int /*<<< orphan*/ s3;
typedef int /*<<< orphan*/ s2;
typedef int /*<<< orphan*/ s1;
typedef int /*<<< orphan*/ s0;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ kmr_scan_argv_strings(int /*<<< orphan*/, char *, int, int,
                                         int *, char **, int, char *);
char *printablestring(char *, int);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
int check_string_scan(int argc, char *argv[]) {
  {
    int argsc;
    char *argsv[128];
    printf("CHECK kmr_scan_argv_strings...\n");
    char s0[] = "";
    printf("s=(%s)\n", s0);
    kmr_scan_argv_strings(0, s0, sizeof(s0), 128, &argsc, argsv, 1, "s0");
    assert(argsc == 0);
    char s1[] = "abc bad cab";
    printf("s=(%s)\n", s1);
    kmr_scan_argv_strings(0, s1, sizeof(s1), 128, &argsc, argsv, 1, "s1");
    assert(argsc == 3);
    assert(strcmp(argsv[0], "abc") == 0 && strcmp(argsv[1], "bad") == 0 &&
           strcmp(argsv[2], "cab") == 0);
    char s2[] = "  abc   bad   cab  ";
    printf("s=(%s)\n", s2);
    kmr_scan_argv_strings(0, s2, sizeof(s2), 128, &argsc, argsv, 1, "s2");
    assert(argsc == 3);
    assert(strcmp(argsv[0], "abc") == 0 && strcmp(argsv[1], "bad") == 0 &&
           strcmp(argsv[2], "cab") == 0);
    char s3[] = "abc";
    printf("s=(%s)\n", s3);
    kmr_scan_argv_strings(0, s3, sizeof(s3), 128, &argsc, argsv, 1, "s3");
    assert(argsc == 1);
    assert(strcmp(argsv[0], "abc") == 0);
    char s4[] = "   abc   ";
    printf("s=(%s)\n", s4);
    kmr_scan_argv_strings(0, s4, sizeof(s4), 128, &argsc, argsv, 1, "s4");
    assert(argsc == 1);
    assert(strcmp(argsv[0], "abc") == 0);
    char s5[] = "";
    printf("s=(%s)\n", s5);
    kmr_scan_argv_strings(0, s5, sizeof(s5), 128, &argsc, argsv, 0, "s5");
    assert(argsc == 0);
    char s6[] = "abc\0bad\0cab";
    printf("s=(%s)\n", printablestring(s6, sizeof(s6)));
    kmr_scan_argv_strings(0, s6, sizeof(s6), 128, &argsc, argsv, 0, "s6");
    assert(argsc == 3);
    assert(strcmp(argsv[0], "abc") == 0 && strcmp(argsv[1], "bad") == 0 &&
           strcmp(argsv[2], "cab") == 0);
    char s7[] = "  abc  bad  \0\0  cab  ";
    printf("s=(%s)\n", printablestring(s7, sizeof(s7)));
    kmr_scan_argv_strings(0, s7, sizeof(s7), 128, &argsc, argsv, 0, "s7");
    assert(argsc == 3);
    assert(strcmp(argsv[0], "  abc  bad  ") == 0 && strcmp(argsv[1], "") == 0 &&
           strcmp(argsv[2], "  cab  ") == 0);
    char s8[] = "abc";
    printf("s=(%s)\n", s8);
    kmr_scan_argv_strings(0, s8, sizeof(s8), 128, &argsc, argsv, 0, "s8");
    assert(argsc == 1);
    assert(strcmp(argsv[0], "abc") == 0);
    char s9[] = "  abc  ";
    printf("s=(%s)\n", s9);
    kmr_scan_argv_strings(0, s9, sizeof(s9), 128, &argsc, argsv, 0, "s9");
    assert(argsc == 1);
    assert(strcmp(argsv[0], "  abc  ") == 0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_string_scan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4b0,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x421(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1050 <memset@plt>
lea    -0x421(%rbp),%rsi
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x421(%rbp),%rsi
lea    -0x420(%rbp),%r9
xor    %edi,%edi
mov    $0x1,%edx
mov    $0x80,%ecx
lea    -0x14(%rbp),%r8
lea    0xe5b(%rip),%rax
movl   $0x1,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <kmr_scan_argv_strings@plt>
cmpl   $0x0,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    0xe35(%rip),%rax
mov    %rax,-0x42d(%rbp)
mov    0xe30(%rip),%eax
mov    %eax,-0x425(%rbp)
lea    -0x42d(%rbp),%rsi
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x42d(%rbp),%rsi
lea    -0x420(%rbp),%r9
xor    %edi,%edi
mov    $0xc,%edx
mov    $0x80,%ecx
lea    -0x14(%rbp),%r8
lea    0xdf4(%rip),%rax
movl   $0x1,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <kmr_scan_argv_strings@plt>
cmpl   $0x3,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    -0x420(%rbp),%rdi
lea    0xdc7(%rip),%rsi
call   1070 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x49d(%rbp)
jne    12d5 <check_string_scan+0x175>
mov    -0x418(%rbp),%rdi
lea    0xda3(%rip),%rsi
call   1070 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x49d(%rbp)
jne    12d5 <check_string_scan+0x175>
mov    -0x410(%rbp),%rdi
lea    0xd70(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x49d(%rbp)
mov    -0x49d(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    0xda4(%rip),%rax
mov    %rax,-0x450(%rbp)
mov    0xd9e(%rip),%rax
mov    %rax,-0x448(%rbp)
mov    0xd99(%rip),%eax
mov    %eax,-0x440(%rbp)
lea    -0x450(%rbp),%rsi
lea    0xd05(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x450(%rbp),%rsi
lea    -0x420(%rbp),%r9
xor    %edi,%edi
mov    $0x14,%edx
mov    $0x80,%ecx
lea    -0x14(%rbp),%r8
lea    0xcfb(%rip),%rax
movl   $0x1,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <kmr_scan_argv_strings@plt>
cmpl   $0x3,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    -0x420(%rbp),%rdi
lea    0xcc3(%rip),%rsi
call   1070 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x49e(%rbp)
jne    13d9 <check_string_scan+0x279>
mov    -0x418(%rbp),%rdi
lea    0xc9f(%rip),%rsi
call   1070 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x49e(%rbp)
jne    13d9 <check_string_scan+0x279>
mov    -0x410(%rbp),%rdi
lea    0xc6c(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x49e(%rbp)
mov    -0x49e(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    0xc4b(%rip),%eax
mov    %eax,-0x454(%rbp)
lea    -0x454(%rbp),%rsi
lea    0xc1d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x454(%rbp),%rsi
lea    -0x420(%rbp),%r9
xor    %edi,%edi
mov    $0x4,%edx
mov    $0x80,%ecx
lea    -0x14(%rbp),%r8
lea    0xc16(%rip),%rax
movl   $0x1,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <kmr_scan_argv_strings@plt>
cmpl   $0x1,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    -0x420(%rbp),%rdi
lea    0xbdb(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    0xbcc(%rip),%rax
mov    %rax,-0x45e(%rbp)
mov    0xbc6(%rip),%ax
mov    %ax,-0x456(%rbp)
lea    -0x45e(%rbp),%rsi
lea    0xb81(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x45e(%rbp),%rsi
lea    -0x420(%rbp),%r9
xor    %edi,%edi
mov    $0xa,%edx
mov    $0x80,%ecx
lea    -0x14(%rbp),%r8
lea    0xb87(%rip),%rax
movl   $0x1,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <kmr_scan_argv_strings@plt>
cmpl   $0x1,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    -0x420(%rbp),%rdi
lea    0xb3f(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
lea    -0x45f(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1050 <memset@plt>
lea    -0x45f(%rbp),%rsi
lea    0xaee(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x45f(%rbp),%rsi
lea    -0x420(%rbp),%r9
xor    %edi,%edi
mov    $0x1,%edx
mov    $0x80,%ecx
lea    -0x14(%rbp),%r8
lea    0xaf7(%rip),%rax
movl   $0x0,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <kmr_scan_argv_strings@plt>
cmpl   $0x0,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    0xb29(%rip),%rax
mov    %rax,-0x46b(%rbp)
mov    0xb24(%rip),%eax
mov    %eax,-0x463(%rbp)
lea    -0x46b(%rbp),%rdi
mov    $0xc,%esi
call   1060 <printablestring@plt>
mov    %rax,%rsi
lea    0xa6b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x46b(%rbp),%rsi
lea    -0x420(%rbp),%r9
xor    %edi,%edi
mov    $0xc,%edx
mov    $0x80,%ecx
lea    -0x14(%rbp),%r8
lea    0xa77(%rip),%rax
movl   $0x0,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <kmr_scan_argv_strings@plt>
cmpl   $0x3,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    -0x420(%rbp),%rdi
lea    0xa29(%rip),%rsi
call   1070 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x49f(%rbp)
jne    1673 <check_string_scan+0x513>
mov    -0x418(%rbp),%rdi
lea    0xa05(%rip),%rsi
call   1070 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x49f(%rbp)
jne    1673 <check_string_scan+0x513>
mov    -0x410(%rbp),%rdi
lea    0x9d2(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x49f(%rbp)
mov    -0x49f(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    0xa36(%rip),%rax
mov    %rax,-0x490(%rbp)
mov    0xa30(%rip),%rax
mov    %rax,-0x488(%rbp)
mov    0xa2b(%rip),%eax
mov    %eax,-0x480(%rbp)
mov    0xa22(%rip),%ax
mov    %ax,-0x47c(%rbp)
lea    -0x490(%rbp),%rdi
mov    $0x16,%esi
call   1060 <printablestring@plt>
mov    %rax,%rsi
lea    0x94c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x490(%rbp),%rsi
lea    -0x420(%rbp),%r9
xor    %edi,%edi
mov    $0x16,%edx
mov    $0x80,%ecx
lea    -0x14(%rbp),%r8
lea    0x95b(%rip),%rax
movl   $0x0,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <kmr_scan_argv_strings@plt>
cmpl   $0x3,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    -0x420(%rbp),%rdi
lea    0x92e(%rip),%rsi
call   1070 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x4a0(%rbp)
jne    1792 <check_string_scan+0x632>
mov    -0x418(%rbp),%rdi
lea    0x8cf(%rip),%rsi
call   1070 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x4a0(%rbp)
jne    1792 <check_string_scan+0x632>
mov    -0x410(%rbp),%rdi
lea    0x8eb(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x4a0(%rbp)
mov    -0x4a0(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    0x892(%rip),%eax
mov    %eax,-0x494(%rbp)
lea    -0x494(%rbp),%rsi
lea    0x864(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x494(%rbp),%rsi
lea    -0x420(%rbp),%r9
xor    %edi,%edi
mov    $0x4,%edx
mov    $0x80,%ecx
lea    -0x14(%rbp),%r8
lea    0x88b(%rip),%rax
movl   $0x0,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <kmr_scan_argv_strings@plt>
cmpl   $0x1,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    -0x420(%rbp),%rdi
lea    0x822(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    0x841(%rip),%rax
mov    %rax,-0x49c(%rbp)
lea    -0x49c(%rbp),%rsi
lea    0x7d6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x49c(%rbp),%rsi
lea    -0x420(%rbp),%r9
xor    %edi,%edi
mov    $0x8,%edx
mov    $0x80,%ecx
lea    -0x14(%rbp),%r8
lea    0x808(%rip),%rax
movl   $0x0,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <kmr_scan_argv_strings@plt>
cmpl   $0x1,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    -0x420(%rbp),%rdi
lea    0x7d0(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
xor    %eax,%eax
add    $0x4b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_string_scan>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x498,%rsp
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
movb   $0x0,0xf(%rsp)
lea    0xe77(%rip),%r15
xor    %r14d,%r14d
lea    0xf(%rsp),%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe63(%rip),%rax
lea    0x8(%rsp),%r12
lea    0x90(%rsp),%rbp
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
mov    $0x80,%ecx
mov    %r12,%r8
mov    %rbp,%r9
push   %rax
push   $0x1
call   1040 <kmr_scan_argv_strings@plt>
add    $0x10,%rsp
xor    %edi,%edi
cmpl   $0x0,0x8(%rsp)
sete   %dil
call   1080 <assert@plt>
movabs $0x2064616220636261,%rax
61 64 20
mov    %rax,0x40(%rsp)
movl   $0x626163,0x48(%rsp)
lea    0x40(%rsp),%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe04(%rip),%rax
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0xc,%edx
mov    $0x80,%ecx
mov    %r12,%r8
mov    %rbp,%r9
push   %rax
push   $0x1
call   1040 <kmr_scan_argv_strings@plt>
add    $0x10,%rsp
xor    %edi,%edi
cmpl   $0x3,0x8(%rsp)
sete   %dil
call   1080 <assert@plt>
mov    0x90(%rsp),%rdi
lea    0xdc7(%rip),%rsi
call   1070 <strcmp@plt>
mov    $0x0,%edi
test   %rax,%rax
jne    129d <check_string_scan+0x13d>
mov    0x98(%rsp),%rdi
lea    0xdad(%rip),%rsi
call   1070 <strcmp@plt>
mov    $0x0,%edi
test   %rax,%rax
jne    129d <check_string_scan+0x13d>
mov    0xa0(%rsp),%rdi
lea    0xd84(%rip),%rsi
call   1070 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1080 <assert@plt>
movaps 0xdd7(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movl   $0x202062,0x60(%rsp)
lea    0xd43(%rip),%rdi
lea    0x50(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd4f(%rip),%rax
lea    0x8(%rsp),%r8
lea    0x90(%rsp),%r9
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x14,%edx
mov    $0x80,%ecx
push   %rax
push   $0x1
call   1040 <kmr_scan_argv_strings@plt>
add    $0x10,%rsp
xor    %edi,%edi
cmpl   $0x3,0x8(%rsp)
sete   %dil
call   1080 <assert@plt>
mov    0x90(%rsp),%rdi
lea    0xd00(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    135b <check_string_scan+0x1fb>
mov    0x98(%rsp),%rdi
lea    0xceb(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    135b <check_string_scan+0x1fb>
mov    0xa0(%rsp),%rdi
lea    0xcc7(%rip),%rsi
call   1070 <strcmp@plt>
xor    %r14d,%r14d
test   %rax,%rax
sete   %r14b
mov    %r14d,%edi
call   1080 <assert@plt>
movl   $0x636261,0x14(%rsp)
lea    0xc8e(%rip),%r15
xor    %r14d,%r14d
lea    0x14(%rsp),%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xc97(%rip),%rax
lea    0x8(%rsp),%rbp
lea    0x90(%rsp),%r13
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x4,%edx
mov    $0x80,%ecx
mov    %rbp,%r8
mov    %r13,%r9
push   %rax
push   $0x1
call   1040 <kmr_scan_argv_strings@plt>
add    $0x10,%rsp
xor    %edi,%edi
cmpl   $0x1,0x8(%rsp)
sete   %dil
call   1080 <assert@plt>
mov    0x90(%rsp),%rdi
lea    0xc3f(%rip),%r12
mov    %r12,%rsi
call   1070 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1080 <assert@plt>
movabs $0x2020636261202020,%rax
63 20 20
mov    %rax,0x18(%rsp)
movw   $0x20,0x20(%rsp)
lea    0x18(%rsp),%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xc12(%rip),%rax
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0xa,%edx
mov    $0x80,%ecx
mov    %rbp,%r8
mov    %r13,%r9
push   %rax
push   $0x1
call   1040 <kmr_scan_argv_strings@plt>
add    $0x10,%rsp
xor    %edi,%edi
cmpl   $0x1,0x8(%rsp)
sete   %dil
call   1080 <assert@plt>
mov    0x90(%rsp),%rdi
mov    %r12,%rsi
call   1070 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1080 <assert@plt>
movb   $0x0,0xe(%rsp)
lea    0xe(%rsp),%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xba8(%rip),%rax
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
mov    $0x80,%ecx
mov    %rbp,%r8
mov    %r13,%r9
push   %rax
push   $0x0
call   1040 <kmr_scan_argv_strings@plt>
add    $0x10,%rsp
xor    %edi,%edi
cmpl   $0x0,0x8(%rsp)
sete   %dil
call   1080 <assert@plt>
movabs $0x64616200636261,%rax
mov    %rax,0x30(%rsp)
movl   $0x626163,0x38(%rsp)
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xc,%esi
call   1060 <printablestring@plt>
mov    %r15,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xb3d(%rip),%rax
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0xc,%edx
mov    $0x80,%ecx
mov    %rbp,%r8
mov    %r13,%r9
push   %rax
push   $0x0
call   1040 <kmr_scan_argv_strings@plt>
add    $0x10,%rsp
xor    %edi,%edi
cmpl   $0x3,0x8(%rsp)
sete   %dil
call   1080 <assert@plt>
mov    0x90(%rsp),%rdi
mov    %r12,%rsi
call   1070 <strcmp@plt>
mov    $0x0,%edi
test   %rax,%rax
jne    1581 <check_string_scan+0x421>
mov    0x98(%rsp),%rdi
lea    0xac9(%rip),%rsi
call   1070 <strcmp@plt>
mov    $0x0,%edi
test   %rax,%rax
jne    1581 <check_string_scan+0x421>
mov    0xa0(%rsp),%rdi
lea    0xaa0(%rip),%rsi
call   1070 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1080 <assert@plt>
movaps 0xb23(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movabs $0x20206261632020,%rax
mov    %rax,0x7e(%rsp)
lea    0x70(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x16,%esi
call   1060 <printablestring@plt>
lea    0xa46(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xa70(%rip),%rax
lea    0x8(%rsp),%r8
lea    0x90(%rsp),%r9
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x16,%edx
mov    $0x80,%ecx
push   %rax
push   $0x0
call   1040 <kmr_scan_argv_strings@plt>
add    $0x10,%rsp
xor    %edi,%edi
cmpl   $0x3,0x8(%rsp)
sete   %dil
call   1080 <assert@plt>
mov    0x90(%rsp),%rdi
lea    0xa2c(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    1653 <check_string_scan+0x4f3>
mov    0x98(%rsp),%rdi
lea    0x9dc(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    1653 <check_string_scan+0x4f3>
mov    0xa0(%rsp),%rdi
lea    0xa07(%rip),%rsi
call   1070 <strcmp@plt>
xor    %r14d,%r14d
test   %rax,%rax
sete   %r14b
mov    %r14d,%edi
call   1080 <assert@plt>
movl   $0x636261,0x10(%rsp)
lea    0x996(%rip),%r14
lea    0x10(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x9d0(%rip),%rax
lea    0x8(%rsp),%rbp
lea    0x90(%rsp),%r15
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x4,%edx
mov    $0x80,%ecx
mov    %rbp,%r8
mov    %r15,%r9
push   %rax
push   $0x0
call   1040 <kmr_scan_argv_strings@plt>
add    $0x10,%rsp
xor    %edi,%edi
cmpl   $0x1,0x8(%rsp)
sete   %dil
call   1080 <assert@plt>
mov    0x90(%rsp),%rdi
lea    0x94a(%rip),%rsi
call   1070 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1080 <assert@plt>
movabs $0x20206362612020,%rax
mov    %rax,0x28(%rsp)
lea    0x28(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x94b(%rip),%rax
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x8,%edx
mov    $0x80,%ecx
mov    %rbp,%r8
mov    %r15,%r9
push   %rax
push   $0x0
call   1040 <kmr_scan_argv_strings@plt>
add    $0x10,%rsp
xor    %edi,%edi
cmpl   $0x1,0x8(%rsp)
sete   %dil
call   1080 <assert@plt>
mov    0x90(%rsp),%rdi
lea    0x90e(%rip),%rsi
call   1070 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1080 <assert@plt>
xor    %eax,%eax
add    $0x498,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"CHECK kmr_scan_argv_strings...\0A\00"
@.str.1 = [8 x i8] c"s=(%s)\0A\00"
@.str.2 = [3 x i8] c"s0\00"
@__const.check_string_scan.s1 = [12 x i8] c"abc bad cab\00"
@.str.3 = [3 x i8] c"s1\00"
@.str.4 = [4 x i8] c"abc\00"
@.str.5 = [4 x i8] c"bad\00"
@.str.6 = [4 x i8] c"cab\00"
@__const.check_string_scan.s2 = [20 x i8] c" abc bad cab \00"
@.str.7 = [3 x i8] c"s2\00"
@__const.check_string_scan.s3 = [4 x i8] c"abc\00"
@.str.8 = [3 x i8] c"s3\00"
@__const.check_string_scan.s4 = [10 x i8] c" abc \00"
@.str.9 = [3 x i8] c"s4\00"
@.str.10 = [3 x i8] c"s5\00"
@__const.check_string_scan.s6 = [12 x i8] c"abc\00bad\00cab\00"
@.str.11 = [3 x i8] c"s6\00"
@__const.check_string_scan.s7 = [22 x i8] c" abc bad \00\00 cab \00"
@.str.12 = [3 x i8] c"s7\00"
@.str.13 = [13 x i8] c" abc bad \00"
@.str.14 = [1 x i8] zeroinitializer
@.str.15 = [8 x i8] c" cab \00"
@__const.check_string_scan.s8 = [4 x i8] c"abc\00"
@.str.16 = [3 x i8] c"s8\00"
@__const.check_string_scan.s9 = [8 x i8] c" abc \00"
@.str.17 = [3 x i8] c"s9\00"
@.str.18 = [8 x i8] c" abc \00"
define i32 @check_string_scan(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca [128 x i8*]
%7 = alloca [1 x i8]
%8 = alloca [12 x i8]
%9 = alloca [20 x i8]
%10 = alloca [4 x i8]
%11 = alloca [10 x i8]
%12 = alloca [1 x i8]
%13 = alloca [12 x i8]
%14 = alloca [22 x i8]
%15 = alloca [4 x i8]
%16 = alloca [8 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%18 = bitcast [1 x i8]* %7 to i8*
%19 = getelementptr inbounds [1 x i8], [1 x i8]* %7, i64 0, i64 0
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %19)
%21 = getelementptr inbounds [1 x i8], [1 x i8]* %7, i64 0, i64 0
%22 = getelementptr inbounds [128 x i8*], [128 x i8*]* %6, i64 0, i64 0
%23 = call i32 @kmr_scan_argv_strings(i32 0, i8* %21, i32 1, i32 128, i32* %5, i8** %22, i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%24 = load i32, i32* %5
%25 = icmp eq i32 %24, 0
%26 = zext i1 %25 to i32
%27 = call i32 @assert(i32 %26)
%28 = bitcast [12 x i8]* %8 to i8*
%29 = getelementptr inbounds [12 x i8], [12 x i8]* %8, i64 0, i64 0
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %29)
%31 = getelementptr inbounds [12 x i8], [12 x i8]* %8, i64 0, i64 0
%32 = getelementptr inbounds [128 x i8*], [128 x i8*]* %6, i64 0, i64 0
%33 = call i32 @kmr_scan_argv_strings(i32 0, i8* %31, i32 12, i32 128, i32* %5, i8** %32, i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%34 = load i32, i32* %5
%35 = icmp eq i32 %34, 3
%36 = zext i1 %35 to i32
%37 = call i32 @assert(i32 %36)
%38 = getelementptr inbounds [128 x i8*], [128 x i8*]* %6, i64 0, i64 0
%39 = load i8*, i8** %38
%40 = call i64 @strcmp(i8* %39, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %52
42: ; preds = %2
%43 = getelementptr inbounds [128 x i8*], [128 x i8*]* %6, i64 0, i64 1
%44 = load i8*, i8** %43
%45 = call i64 @strcmp(i8* %44, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%46 = icmp eq i64 %45, 0
br i1 %46, label %47, label %52
47: ; preds = %42
%48 = getelementptr inbounds [128 x i8*], [128 x i8*]* %6, i64 0, i64 2
%49 = load i8*, i8** %48
%50 = call i64 @strcmp(i8* %49, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%51 = icmp eq i64 %50, 0
br label %52
52: ; preds = %47, %42, %2
%53 = phi i1 [ false, %42 ], [ false, %2 ], [ %51, %47 ]
%54 = zext i1 %53 to i32
%55 = call i32 @assert(i32 %54)
%56 = bitcast [20 x i8]* %9 to i8*
%57 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 0
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %57)
%59 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 0
%60 = getelementptr inbounds [128 x i8*], [128 x i8*]* %6, i64 0, i64 0
%61 = call i32 @kmr_scan_argv_strings(i32 0, i8* %59, i32 20, i32 128, i32* %5, i8** %60, i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%62 = load i32, i32* %5
%63 = icmp eq i32 %62, 3
%64 = zext i1 %63 to i32
%65 = call i32 @assert(i32 %64)
%66 = getelementptr inbounds [128 x i8*], [128 x i8*]* %6, i64 0, i64 0
%67 = load i8*, i8** %66
%68 = call i64 @strcmp(i8* %67, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%69 = icmp eq i64 %68, 0
br i1 %69, label %70, label %80
70: ; preds = %52
%71 = getelementptr inbounds [128 x i8*], [128 x i8*]* %6, i64 0, i64 1
%72 = load i8*, i8** %71
%73 = call i64 @strcmp(i8* %72, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%74 = icmp eq i64 %73, 0
br i1 %74, label %75, label %80
75: ; preds = %70
%76 = getelementptr inbounds [128 x i8*], [128 x i8*]* %6, i64 0, i64 2
%77 = load i8*, i8** %76
%78 = call i64 @strcmp(i8* %77, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%79 = icmp eq i64 %78, 0
br label %80
80: ; preds = %75, %70, %52
%81 = phi i1 [ false, %70 ], [ false, %52 ], [ %79, %75 ]
%82 = zext i1 %81 to i32
%83 = call i32 @assert(i32 %82)
%84 = bitcast [4 x i8]* %10 to i8*
%85 = getelementptr inbounds [4 x i8], [4 x i8]* %10, i64 0, i64 0
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %85)
%87 = getelementptr inbounds [4 x i8], [4 x i8]* %10, i64 0, i64 0
%88 = getelementptr inbounds [128 x i8*], [128 x i8*]* %6, i64 0, i64 0
%89 = call i32 @kmr_scan_argv_strings(i32 0, i8* %87, i32 4, i32 128, i32* %5, i8** %88, i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%90 = load i32, i32* %5
%91 = icmp eq i32 %90, 1
%92 = zext i1 %91 to i32
%93 = call i32 @assert(i32 %92)
%94 = getelementptr inbounds [128 x i8*], [128 x i8*]* %6, i64 0, i64 0
%95 = load i8*, i8** %94
%96 = call i64 @strcmp(i8* %95, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%97 = icmp eq i64 %96, 0
%98 = zext i1 %97 to i32
%99 = call i32 @assert(i32 %98)
%100 = bitcast [10 x i8]* %11 to i8*
%101 = getelementptr inbounds [10 x i8], [10 x i8]* %11, i64 0, i64 0
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %101)
%103 = getelementptr inbounds [10 x i8], [10 x i8]* %11, i64 0, i64 0
%104 = getelementptr inbounds [128 x i8*], [128 x i8*]* %6, i64 0, i64 0
%105 = call i32 @kmr_scan_argv_strings(i32 0, i8* %103, i32 10, i32 128, i32* %5, i8** %104, i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%106 = load i32, i32* %5
%107 = icmp eq i32 %106, 1
%108 = zext i1 %107 to i32
%109 = call i32 @assert(i32 %108)
%110 = getelementptr inbounds [128 x i8*], [128 x i8*]* %6, i64 0, i64 0
%111 = load i8*, i8** %110
%112 = call i64 @strcmp(i8* %111, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%113 = icmp eq i64 %112, 0
%114 = zext i1 %113 to i32
%115 = call i32 @assert(i32 %114)
%116 = bitcast [1 x i8]* %12 to i8*
%117 = getelementptr inbounds [1 x i8], [1 x i8]* %12, i64 0, i64 0
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %117)
%119 = getelementptr inbounds [1 x i8], [1 x i8]* %12, i64 0, i64 0
%120 = getelementptr inbounds [128 x i8*], [128 x i8*]* %6, i64 0, i64 0
%121 = call i32 @kmr_scan_argv_strings(i32 0, i8* %119, i32 1, i32 128, i32* %5, i8** %120, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%122 = load i32, i32* %5
%123 = icmp eq i32 %122, 0
%124 = zext i1 %123 to i32
%125 = call i32 @assert(i32 %124)
%126 = bitcast [12 x i8]* %13 to i8*
%127 = getelementptr inbounds [12 x i8], [12 x i8]* %13, i64 0, i64 0
%128 = call i8* @printablestring(i8* %127, i32 12)
%129 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %128)
%130 = getelementptr inbounds [12 x i8], [12 x i8]* %13, i64 0, i64 0
%131 = getelementptr inbounds [128 x i8*], [128 x i8*]* %6, i64 0, i64 0
%132 = call i32 @kmr_scan_argv_strings(i32 0, i8* %130, i32 12, i32 128, i32* %5, i8** %131, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%133 = load i32, i32* %5
%134 = icmp eq i32 %133, 3
%135 = zext i1 %134 to i32
%136 = call i32 @assert(i32 %135)
%137 = getelementptr inbounds [128 x i8*], [128 x i8*]* %6, i64 0, i64 0
%138 = load i8*, i8** %137
%139 = call i64 @strcmp(i8* %138, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%140 = icmp eq i64 %139, 0
br i1 %140, label %141, label %151
141: ; preds = %80
%142 = getelementptr inbounds [128 x i8*], [128 x i8*]* %6, i64 0, i64 1
%143 = load i8*, i8** %142
%144 = call i64 @strcmp(i8* %143, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%145 = icmp eq i64 %144, 0
br i1 %145, label %146, label %151
146: ; preds = %141
%147 = getelementptr inbounds [128 x i8*], [128 x i8*]* %6, i64 0, i64 2
%148 = load i8*, i8** %147
%149 = call i64 @strcmp(i8* %148, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%150 = icmp eq i64 %149, 0
br label %151
151: ; preds = %146, %141, %80
%152 = phi i1 [ false, %141 ], [ false, %80 ], [ %150, %146 ]
%153 = zext i1 %152 to i32
%154 = call i32 @assert(i32 %153)
%155 = bitcast [22 x i8]* %14 to i8*
%156 = getelementptr inbounds [22 x i8], [22 x i8]* %14, i64 0, i64 0
%157 = call i8* @printablestring(i8* %156, i32 22)
%158 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %157)
%159 = getelementptr inbounds [22 x i8], [22 x i8]* %14, i64 0, i64 0
%160 = getelementptr inbounds [128 x i8*], [128 x i8*]* %6, i64 0, i64 0
%161 = call i32 @kmr_scan_argv_strings(i32 0, i8* %159, i32 22, i32 128, i32* %5, i8** %160, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
%162 = load i32, i32* %5
%163 = icmp eq i32 %162, 3
%164 = zext i1 %163 to i32
%165 = call i32 @assert(i32 %164)
%166 = getelementptr inbounds [128 x i8*], [128 x i8*]* %6, i64 0, i64 0
%167 = load i8*, i8** %166
%168 = call i64 @strcmp(i8* %167, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0))
%169 = icmp eq i64 %168, 0
br i1 %169, label %170, label %180
170: ; preds = %151
%171 = getelementptr inbounds [128 x i8*], [128 x i8*]* %6, i64 0, i64 1
%172 = load i8*, i8** %171
%173 = call i64 @strcmp(i8* %172, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.14, i64 0, i64 0))
%174 = icmp eq i64 %173, 0
br i1 %174, label %175, label %180
175: ; preds = %170
%176 = getelementptr inbounds [128 x i8*], [128 x i8*]* %6, i64 0, i64 2
%177 = load i8*, i8** %176
%178 = call i64 @strcmp(i8* %177, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0))
%179 = icmp eq i64 %178, 0
br label %180
180: ; preds = %175, %170, %151
%181 = phi i1 [ false, %170 ], [ false, %151 ], [ %179, %175 ]
%182 = zext i1 %181 to i32
%183 = call i32 @assert(i32 %182)
%184 = bitcast [4 x i8]* %15 to i8*
%185 = getelementptr inbounds [4 x i8], [4 x i8]* %15, i64 0, i64 0
%186 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %185)
%187 = getelementptr inbounds [4 x i8], [4 x i8]* %15, i64 0, i64 0
%188 = getelementptr inbounds [128 x i8*], [128 x i8*]* %6, i64 0, i64 0
%189 = call i32 @kmr_scan_argv_strings(i32 0, i8* %187, i32 4, i32 128, i32* %5, i8** %188, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0))
%190 = load i32, i32* %5
%191 = icmp eq i32 %190, 1
%192 = zext i1 %191 to i32
%193 = call i32 @assert(i32 %192)
%194 = getelementptr inbounds [128 x i8*], [128 x i8*]* %6, i64 0, i64 0
%195 = load i8*, i8** %194
%196 = call i64 @strcmp(i8* %195, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%197 = icmp eq i64 %196, 0
%198 = zext i1 %197 to i32
%199 = call i32 @assert(i32 %198)
%200 = bitcast [8 x i8]* %16 to i8*
%201 = getelementptr inbounds [8 x i8], [8 x i8]* %16, i64 0, i64 0
%202 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %201)
%203 = getelementptr inbounds [8 x i8], [8 x i8]* %16, i64 0, i64 0
%204 = getelementptr inbounds [128 x i8*], [128 x i8*]* %6, i64 0, i64 0
%205 = call i32 @kmr_scan_argv_strings(i32 0, i8* %203, i32 8, i32 128, i32* %5, i8** %204, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0))
%206 = load i32, i32* %5
%207 = icmp eq i32 %206, 1
%208 = zext i1 %207 to i32
%209 = call i32 @assert(i32 %208)
%210 = getelementptr inbounds [128 x i8*], [128 x i8*]* %6, i64 0, i64 0
%211 = load i8*, i8** %210
%212 = call i64 @strcmp(i8* %211, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.18, i64 0, i64 0))
%213 = icmp eq i64 %212, 0
%214 = zext i1 %213 to i32
%215 = call i32 @assert(i32 %214)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"s=(%s)\0A\00"
@.str.2 = [3 x i8] c"s0\00"
@__const.check_string_scan.s1 = [12 x i8] c"abc bad cab\00"
@.str.3 = [3 x i8] c"s1\00"
@.str.4 = [4 x i8] c"abc\00"
@.str.5 = [4 x i8] c"bad\00"
@.str.6 = [4 x i8] c"cab\00"
@__const.check_string_scan.s2 = [20 x i8] c" abc bad cab \00"
@.str.7 = [3 x i8] c"s2\00"
@.str.8 = [3 x i8] c"s3\00"
@__const.check_string_scan.s4 = [10 x i8] c" abc \00"
@.str.9 = [3 x i8] c"s4\00"
@.str.10 = [3 x i8] c"s5\00"
@__const.check_string_scan.s6 = [12 x i8] c"abc\00bad\00cab\00"
@.str.11 = [3 x i8] c"s6\00"
@__const.check_string_scan.s7 = [22 x i8] c" abc bad \00\00 cab \00"
@.str.12 = [3 x i8] c"s7\00"
@.str.13 = [13 x i8] c" abc bad \00"
@.str.14 = [1 x i8] zeroinitializer
@.str.15 = [8 x i8] c" cab \00"
@.str.16 = [3 x i8] c"s8\00"
@.str.17 = [3 x i8] c"s9\00"
@.str.18 = [8 x i8] c" abc \00"
@str = [31 x i8] c"CHECK kmr_scan_argv_strings...\00"
define i32 @check_string_scan(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [128 x i8*]
%5 = alloca [1 x i8]
%6 = alloca [12 x i8]
%7 = alloca [20 x i8]
%8 = alloca i32
%9 = alloca [10 x i8]
%10 = alloca [1 x i8]
%11 = alloca [12 x i8]
%12 = alloca [22 x i8]
%13 = alloca i32
%14 = alloca i64
%15 = bitcast i32* %3 to i8*
%16 = bitcast [128 x i8*]* %4 to i8*
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%18 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
store i8 0, i8* %18
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %18)
%20 = getelementptr inbounds [128 x i8*], [128 x i8*]* %4, i64 0, i64 0
%21 = call i32 @kmr_scan_argv_strings(i32 0, i8* %18, i32 1, i32 128, i32* %3, i8** %20, i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%22 = load i32, i32* %3
%23 = icmp eq i32 %22, 0
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
%26 = getelementptr inbounds [12 x i8], [12 x i8]* %6, i64 0, i64 0
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %26)
%28 = call i32 @kmr_scan_argv_strings(i32 0, i8* %26, i32 12, i32 128, i32* %3, i8** %20, i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%29 = load i32, i32* %3
%30 = icmp eq i32 %29, 3
%31 = zext i1 %30 to i32
%32 = call i32 @assert(i32 %31)
%33 = load i8*, i8** %20
%34 = call i64 @strcmp(i8* %33, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %47
36: ; preds = %2
%37 = getelementptr inbounds [128 x i8*], [128 x i8*]* %4, i64 0, i64 1
%38 = load i8*, i8** %37
%39 = call i64 @strcmp(i8* %38, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %47
41: ; preds = %36
%42 = getelementptr inbounds [128 x i8*], [128 x i8*]* %4, i64 0, i64 2
%43 = load i8*, i8** %42
%44 = call i64 @strcmp(i8* %43, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%45 = icmp eq i64 %44, 0
%46 = zext i1 %45 to i32
br label %47
47: ; preds = %41, %36, %2
%48 = phi i32 [ 0, %36 ], [ 0, %2 ], [ %46, %41 ]
%49 = call i32 @assert(i32 %48)
%50 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %50)
%52 = call i32 @kmr_scan_argv_strings(i32 0, i8* %50, i32 20, i32 128, i32* %3, i8** %20, i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%53 = load i32, i32* %3
%54 = icmp eq i32 %53, 3
%55 = zext i1 %54 to i32
%56 = call i32 @assert(i32 %55)
%57 = load i8*, i8** %20
%58 = call i64 @strcmp(i8* %57, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%59 = icmp eq i64 %58, 0
br i1 %59, label %60, label %71
60: ; preds = %47
%61 = getelementptr inbounds [128 x i8*], [128 x i8*]* %4, i64 0, i64 1
%62 = load i8*, i8** %61
%63 = call i64 @strcmp(i8* %62, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%64 = icmp eq i64 %63, 0
br i1 %64, label %65, label %71
65: ; preds = %60
%66 = getelementptr inbounds [128 x i8*], [128 x i8*]* %4, i64 0, i64 2
%67 = load i8*, i8** %66
%68 = call i64 @strcmp(i8* %67, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%69 = icmp eq i64 %68, 0
%70 = zext i1 %69 to i32
br label %71
71: ; preds = %65, %60, %47
%72 = phi i32 [ 0, %60 ], [ 0, %47 ], [ %70, %65 ]
%73 = call i32 @assert(i32 %72)
%74 = bitcast i32* %8 to i8*
store i32 6513249, i32* %8
%75 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%76 = call i32 @kmr_scan_argv_strings(i32 0, i8* %74, i32 4, i32 128, i32* %3, i8** %20, i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%77 = load i32, i32* %3
%78 = icmp eq i32 %77, 1
%79 = zext i1 %78 to i32
%80 = call i32 @assert(i32 %79)
%81 = load i8*, i8** %20
%82 = call i64 @strcmp(i8* %81, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%83 = icmp eq i64 %82, 0
%84 = zext i1 %83 to i32
%85 = call i32 @assert(i32 %84)
%86 = getelementptr inbounds [10 x i8], [10 x i8]* %9, i64 0, i64 0
%87 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %86)
%88 = call i32 @kmr_scan_argv_strings(i32 0, i8* %86, i32 10, i32 128, i32* %3, i8** %20, i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%89 = load i32, i32* %3
%90 = icmp eq i32 %89, 1
%91 = zext i1 %90 to i32
%92 = call i32 @assert(i32 %91)
%93 = load i8*, i8** %20
%94 = call i64 @strcmp(i8* %93, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%95 = icmp eq i64 %94, 0
%96 = zext i1 %95 to i32
%97 = call i32 @assert(i32 %96)
%98 = getelementptr inbounds [1 x i8], [1 x i8]* %10, i64 0, i64 0
store i8 0, i8* %98
%99 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %98)
%100 = call i32 @kmr_scan_argv_strings(i32 0, i8* %98, i32 1, i32 128, i32* %3, i8** %20, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%101 = load i32, i32* %3
%102 = icmp eq i32 %101, 0
%103 = zext i1 %102 to i32
%104 = call i32 @assert(i32 %103)
%105 = getelementptr inbounds [12 x i8], [12 x i8]* %11, i64 0, i64 0
%106 = call i8* @printablestring(i8* %105, i32 12)
%107 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %106)
%108 = call i32 @kmr_scan_argv_strings(i32 0, i8* %105, i32 12, i32 128, i32* %3, i8** %20, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%109 = load i32, i32* %3
%110 = icmp eq i32 %109, 3
%111 = zext i1 %110 to i32
%112 = call i32 @assert(i32 %111)
%113 = load i8*, i8** %20
%114 = call i64 @strcmp(i8* %113, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%115 = icmp eq i64 %114, 0
br i1 %115, label %116, label %127
116: ; preds = %71
%117 = getelementptr inbounds [128 x i8*], [128 x i8*]* %4, i64 0, i64 1
%118 = load i8*, i8** %117
%119 = call i64 @strcmp(i8* %118, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%120 = icmp eq i64 %119, 0
br i1 %120, label %121, label %127
121: ; preds = %116
%122 = getelementptr inbounds [128 x i8*], [128 x i8*]* %4, i64 0, i64 2
%123 = load i8*, i8** %122
%124 = call i64 @strcmp(i8* %123, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%125 = icmp eq i64 %124, 0
%126 = zext i1 %125 to i32
br label %127
127: ; preds = %121, %116, %71
%128 = phi i32 [ 0, %116 ], [ 0, %71 ], [ %126, %121 ]
%129 = call i32 @assert(i32 %128)
%130 = getelementptr inbounds [22 x i8], [22 x i8]* %12, i64 0, i64 0
%131 = call i8* @printablestring(i8* %130, i32 22)
%132 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %131)
%133 = call i32 @kmr_scan_argv_strings(i32 0, i8* %130, i32 22, i32 128, i32* %3, i8** %20, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
%134 = load i32, i32* %3
%135 = icmp eq i32 %134, 3
%136 = zext i1 %135 to i32
%137 = call i32 @assert(i32 %136)
%138 = load i8*, i8** %20
%139 = call i64 @strcmp(i8* %138, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0))
%140 = icmp eq i64 %139, 0
br i1 %140, label %141, label %152
141: ; preds = %127
%142 = getelementptr inbounds [128 x i8*], [128 x i8*]* %4, i64 0, i64 1
%143 = load i8*, i8** %142
%144 = call i64 @strcmp(i8* %143, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.14, i64 0, i64 0))
%145 = icmp eq i64 %144, 0
br i1 %145, label %146, label %152
146: ; preds = %141
%147 = getelementptr inbounds [128 x i8*], [128 x i8*]* %4, i64 0, i64 2
%148 = load i8*, i8** %147
%149 = call i64 @strcmp(i8* %148, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0))
%150 = icmp eq i64 %149, 0
%151 = zext i1 %150 to i32
br label %152
152: ; preds = %146, %141, %127
%153 = phi i32 [ 0, %141 ], [ 0, %127 ], [ %151, %146 ]
%154 = call i32 @assert(i32 %153)
%155 = bitcast i32* %13 to i8*
store i32 6513249, i32* %13
%156 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32* %13)
%157 = call i32 @kmr_scan_argv_strings(i32 0, i8* %155, i32 4, i32 128, i32* %3, i8** %20, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0))
%158 = load i32, i32* %3
%159 = icmp eq i32 %158, 1
%160 = zext i1 %159 to i32
%161 = call i32 @assert(i32 %160)
%162 = load i8*, i8** %20
%163 = call i64 @strcmp(i8* %162, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%164 = icmp eq i64 %163, 0
%165 = zext i1 %164 to i32
%166 = call i32 @assert(i32 %165)
%167 = bitcast i64* %14 to i8*
store i64 9042810479124512, i64* %14
%168 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64* %14)
%169 = call i32 @kmr_scan_argv_strings(i32 0, i8* %167, i32 8, i32 128, i32* %3, i8** %20, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0))
%170 = load i32, i32* %3
%171 = icmp eq i32 %170, 1
%172 = zext i1 %171 to i32
%173 = call i32 @assert(i32 %172)
%174 = load i8*, i8** %20
%175 = call i64 @strcmp(i8* %174, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.18, i64 0, i64 0))
%176 = icmp eq i64 %175, 0
%177 = zext i1 %176 to i32
%178 = call i32 @assert(i32 %177)
ret i32 0
}