#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 exit_status();
int /*<<< orphan*/ plan(unsigned int);
int /*<<< orphan*/ test_ptr();
int /*<<< orphan*/ test_str(char *, int, char *, int, char *);
int /*<<< orphan*/ todo(char *, unsigned int);
int main(void) {
  ;
  plan(7u);
  test_ptr();
  test_str("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/fperrad/tap4embedded/refs/heads/master/"
           "example/t.windows/11-strncpy.c",
           62, "", 2, "");
  test_str("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/fperrad/tap4embedded/refs/heads/master/"
           "example/t.windows/11-strncpy.c",
           63, "bar", 4, "bar");
  todo("strncpy does not add a final \\0.", 4u);
  test_str("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/fperrad/tap4embedded/refs/heads/master/"
           "example/t.windows/11-strncpy.c",
           65, "bar", 3, "bar");
  test_str("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/fperrad/tap4embedded/refs/heads/master/"
           "example/t.windows/11-strncpy.c",
           66, "bar", 2, "ba");
  test_str("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/fperrad/tap4embedded/refs/heads/master/"
           "example/t.windows/11-strncpy.c",
           67, "bar", 1, "b");
  test_str("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/fperrad/tap4embedded/refs/heads/master/"
           "example/t.windows/11-strncpy.c",
           68, "bar", 0, "");
  return exit_status();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x7,%edi
call   1070 <plan@plt>
mov    $0x0,%al
call   1050 <test_ptr@plt>
lea    0xe89(%rip),%rdi
mov    $0x3e,%esi
lea    0xf41(%rip),%r8
mov    $0x2,%ecx
mov    %r8,%rdx
call   1030 <test_str@plt>
lea    0xe69(%rip),%rdi
mov    $0x3f,%esi
lea    0xefd(%rip),%r8
mov    $0x4,%ecx
mov    %r8,%rdx
call   1030 <test_str@plt>
lea    0xeed(%rip),%rdi
mov    $0x4,%esi
call   1060 <todo@plt>
lea    0xe38(%rip),%rdi
mov    $0x41,%esi
lea    0xecc(%rip),%r8
mov    $0x3,%ecx
mov    %r8,%rdx
call   1030 <test_str@plt>
lea    0xe18(%rip),%rdi
mov    $0x42,%esi
lea    0xeac(%rip),%rdx
mov    $0x2,%ecx
lea    0xec5(%rip),%r8
call   1030 <test_str@plt>
lea    0xdf4(%rip),%rdi
mov    $0x43,%esi
lea    0xe88(%rip),%rdx
mov    $0x1,%ecx
lea    0xea4(%rip),%r8
call   1030 <test_str@plt>
lea    0xdd0(%rip),%rdi
mov    $0x44,%esi
lea    0xe64(%rip),%rdx
xor    %ecx,%ecx
lea    0xe7f(%rip),%r8
call   1030 <test_str@plt>
mov    $0x0,%al
call   1040 <exit_status@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x7,%edi
call   1070 <plan@plt>
xor    %eax,%eax
call   1050 <test_ptr@plt>
lea    0xe93(%rip),%r15
lea    0xf50(%rip),%r14
mov    %r15,%rdi
mov    $0x3e,%esi
mov    %r14,%rdx
mov    $0x2,%ecx
mov    %r14,%r8
call   1030 <test_str@plt>
lea    0xf0d(%rip),%rbx
mov    %r15,%rdi
mov    $0x3f,%esi
mov    %rbx,%rdx
mov    $0x4,%ecx
mov    %rbx,%r8
call   1030 <test_str@plt>
lea    0xef2(%rip),%rdi
mov    $0x4,%esi
call   1060 <todo@plt>
mov    %r15,%rdi
mov    $0x41,%esi
mov    %rbx,%rdx
mov    $0x3,%ecx
mov    %rbx,%r8
call   1030 <test_str@plt>
lea    0xeea(%rip),%r8
mov    %r15,%rdi
mov    $0x42,%esi
mov    %rbx,%rdx
mov    $0x2,%ecx
call   1030 <test_str@plt>
lea    0xed1(%rip),%r8
mov    %r15,%rdi
mov    $0x43,%esi
mov    %rbx,%rdx
mov    $0x1,%ecx
call   1030 <test_str@plt>
mov    %r15,%rdi
mov    $0x44,%esi
mov    %rbx,%rdx
xor    %ecx,%ecx
mov    %r14,%r8
call   1030 <test_str@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <exit_status@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fperrad/tap4embedded/refs/heads/master/example/t.windows/11-strncpy.c\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [4 x i8] c"bar\00"
@.str.3 = [33 x i8] c"strncpy does not add a final \\0.\00"
@.str.4 = [3 x i8] c"ba\00"
@.str.5 = [2 x i8] c"b\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @plan(i32 7)
%3 = call i32 (...) @test_ptr()
%4 = call i32 @test_str(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 62, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @test_str(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 63, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @todo(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i32 4)
%7 = call i32 @test_str(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 65, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @test_str(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 66, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 @test_str(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 67, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%10 = call i32 @test_str(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 68, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 (...) @exit_status()
ret i32 %11
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fperrad/tap4embedded/refs/heads/master/example/t.windows/11-strncpy.c\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [4 x i8] c"bar\00"
@.str.3 = [33 x i8] c"strncpy does not add a final \\0.\00"
@.str.4 = [3 x i8] c"ba\00"
@.str.5 = [2 x i8] c"b\00"
define i32 @main() {
%1 = tail call i32 @plan(i32 7)
%2 = tail call i32 (...) @test_ptr()
%3 = tail call i32 @test_str(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 62, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @test_str(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 63, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @todo(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i32 4)
%6 = tail call i32 @test_str(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 65, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @test_str(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 66, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%8 = tail call i32 @test_str(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 67, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%9 = tail call i32 @test_str(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 68, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i32 (...) @exit_status()
ret i32 %10
}