#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*/ printf(char *);
int /*<<< orphan*/ test_str_interleave(char *, char *);
int main(int argc, const char *argv[]) {
  printf("\nEqual 1\n");
  test_str_interleave("abcdefghijklmnopqrstuvwxyz",
                      "12345678901234567890123456");
  printf("\nEqual 2\n");
  test_str_interleave("abcdefg", "1234567");
  printf("\nShorter s2\n");
  test_str_interleave("abcdefg", "1234");
  printf("\nShorter s1\n");
  test_str_interleave("abcd", "1234567");
  printf("\nEmpty s2\n");
  test_str_interleave("abcdefg", "");
  printf("\nEmpty s1\n");
  test_str_interleave("", "1234567");
  printf("\n1 char s2\n");
  test_str_interleave("abcdefg", "1");
  printf("\n1 char s1\n");
  test_str_interleave("a", "1234567");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
lea    0xedc(%rip),%rsi
call   1040 <test_str_interleave@plt>
lea    0xeeb(%rip),%rdi
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
lea    0xeea(%rip),%rsi
call   1040 <test_str_interleave@plt>
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
lea    0xee0(%rip),%rsi
call   1040 <test_str_interleave@plt>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    0xeac(%rip),%rsi
call   1040 <test_str_interleave@plt>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
lea    0xe8c(%rip),%rdi
lea    0xe44(%rip),%rsi
call   1040 <test_str_interleave@plt>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
lea    0xe2c(%rip),%rdi
lea    0xe6e(%rip),%rsi
call   1040 <test_str_interleave@plt>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
lea    0xe4e(%rip),%rdi
lea    0xe9d(%rip),%rsi
call   1040 <test_str_interleave@plt>
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
lea    0xe93(%rip),%rdi
lea    0xe30(%rip),%rsi
call   1040 <test_str_interleave@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
lea    0xf26(%rip),%rdi
call   1030 <puts@plt>
lea    0xec8(%rip),%rdi
lea    0xedc(%rip),%rsi
call   1040 <test_str_interleave@plt>
lea    0xf10(%rip),%rdi
call   1030 <puts@plt>
lea    0xedf(%rip),%r15
lea    0xee0(%rip),%r14
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <test_str_interleave@plt>
lea    0xef4(%rip),%rdi
call   1030 <puts@plt>
lea    0xeca(%rip),%rsi
mov    %r15,%rdi
call   1040 <test_str_interleave@plt>
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb4(%rip),%rdi
mov    %r14,%rsi
call   1040 <test_str_interleave@plt>
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
lea    0xea8(%rip),%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <test_str_interleave@plt>
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <test_str_interleave@plt>
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
lea    0xe72(%rip),%rsi
mov    %r15,%rdi
call   1040 <test_str_interleave@plt>
lea    0xea5(%rip),%rdi
call   1030 <puts@plt>
lea    0xe4e(%rip),%rdi
mov    %r14,%rsi
call   1040 <test_str_interleave@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [10 x i8] c"\0AEqual 1\0A\00"
@.str.1 = [27 x i8] c"abcdefghijklmnopqrstuvwxyz\00"
@.str.2 = [27 x i8] c"12345678901234567890123456\00"
@.str.3 = [10 x i8] c"\0AEqual 2\0A\00"
@.str.4 = [8 x i8] c"abcdefg\00"
@.str.5 = [8 x i8] c"1234567\00"
@.str.6 = [13 x i8] c"\0AShorter s2\0A\00"
@.str.7 = [5 x i8] c"1234\00"
@.str.8 = [13 x i8] c"\0AShorter s1\0A\00"
@.str.9 = [5 x i8] c"abcd\00"
@.str.10 = [11 x i8] c"\0AEmpty s2\0A\00"
@.str.11 = [1 x i8] zeroinitializer
@.str.12 = [11 x i8] c"\0AEmpty s1\0A\00"
@.str.13 = [12 x i8] c"\0A1 char s2\0A\00"
@.str.14 = [2 x i8] c"1\00"
@.str.15 = [12 x i8] c"\0A1 char s1\0A\00"
@.str.16 = [2 x i8] c"a\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @test_str_interleave(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @test_str_interleave(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%10 = call i32 @test_str_interleave(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
%12 = call i32 @test_str_interleave(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0))
%14 = call i32 @test_str_interleave(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.11, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0))
%16 = call i32 @test_str_interleave(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0))
%18 = call i32 @test_str_interleave(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
%19 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.15, i64 0, i64 0))
%20 = call i32 @test_str_interleave(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [27 x i8] c"abcdefghijklmnopqrstuvwxyz\00"
@.str.2 = [27 x i8] c"12345678901234567890123456\00"
@.str.4 = [8 x i8] c"abcdefg\00"
@.str.5 = [8 x i8] c"1234567\00"
@.str.7 = [5 x i8] c"1234\00"
@.str.9 = [5 x i8] c"abcd\00"
@.str.11 = [1 x i8] zeroinitializer
@.str.14 = [2 x i8] c"1\00"
@.str.16 = [2 x i8] c"a\00"
@str = [9 x i8] c"\0AEqual 1\00"
@str.17 = [9 x i8] c"\0AEqual 2\00"
@str.18 = [12 x i8] c"\0AShorter s2\00"
@str.19 = [12 x i8] c"\0AShorter s1\00"
@str.20 = [10 x i8] c"\0AEmpty s2\00"
@str.21 = [10 x i8] c"\0AEmpty s1\00"
@str.22 = [11 x i8] c"\0A1 char s2\00"
@str.23 = [11 x i8] c"\0A1 char s1\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @test_str_interleave(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.17, i64 0, i64 0))
%6 = tail call i32 @test_str_interleave(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.18, i64 0, i64 0))
%8 = tail call i32 @test_str_interleave(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.19, i64 0, i64 0))
%10 = tail call i32 @test_str_interleave(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.20, i64 0, i64 0))
%12 = tail call i32 @test_str_interleave(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.11, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.21, i64 0, i64 0))
%14 = tail call i32 @test_str_interleave(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.22, i64 0, i64 0))
%16 = tail call i32 @test_str_interleave(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.23, i64 0, i64 0))
%18 = tail call i32 @test_str_interleave(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}