#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 *, char *, int);
int /*<<< orphan*/ strcmp(char *, char *);
char *strncpy(char *, char *, int);
int test_strncpy(void) {
  char dest[10];
  dest[5] = 'x';
  dest[6] = 'x';
  dest[7] = 0;
  do {
    if (!(dest == strncpy(dest, "hello", 5))) {
      printf("expression '%s' untrue at %d\n",
             "dest == strncpy(dest, \"hello\", 5)", 166);
      return 0;
    }
  } while (0);
  do {
    if (!(!strcmp(dest, "helloxx"))) {
      printf("expression '%s' untrue at %d\n", "!strcmp(dest, \"helloxx\")",
             167);
      return 0;
    }
  } while (0);
  do {
    if (!(dest == strncpy(dest, "hello", 6))) {
      printf("expression '%s' untrue at %d\n",
             "dest == strncpy(dest, \"hello\", 6)", 169);
      return 0;
    }
  } while (0);
  do {
    if (!(!strcmp(dest, "hello"))) {
      printf("expression '%s' untrue at %d\n", "!strcmp(dest, \"hello\")", 170);
      return 0;
    }
  } while (0);
  do {
    if (!(dest[6] == 'x')) {
      printf("expression '%s' untrue at %d\n", "dest[6] == 'x'", 171);
      return 0;
    }
  } while (0);
  do {
    if (!(dest == strncpy(dest, "hello", 7))) {
      printf("expression '%s' untrue at %d\n",
             "dest == strncpy(dest, \"hello\", 7)", 173);
      return 0;
    }
  } while (0);
  do {
    if (!(!strcmp(dest, "hello"))) {
      printf("expression '%s' untrue at %d\n", "!strcmp(dest, \"hello\")", 174);
      return 0;
    }
  } while (0);
  do {
    if (!(dest[6] == 0)) {
      printf("expression '%s' untrue at %d\n", "dest[6] == 0", 175);
      return 0;
    }
  } while (0);
  do {
    if (!(dest == strncpy(dest, "", 0))) {
      printf("expression '%s' untrue at %d\n", "dest == strncpy(dest, \"\", 0)",
             177);
      return 0;
    }
  } while (0);
  do {
    if (!(!strcmp(dest, "hello"))) {
      printf("expression '%s' untrue at %d\n", "!strcmp(dest, \"hello\")", 178);
      return 0;
    }
  } while (0);
  do {
    if (!(dest == strncpy(dest, "", 1))) {
      printf("expression '%s' untrue at %d\n", "dest == strncpy(dest, \"\", 1)",
             180);
      return 0;
    }
  } while (0);
  do {
    if (!(!strcmp(dest, ""))) {
      printf("expression '%s' untrue at %d\n", "!strcmp(dest, \"\")", 181);
      return 0;
    }
  } while (0);
  return 1;
}


x86 assembly (clang, -O0):
<test_strncpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movb   $0x78,-0x9(%rbp)
movb   $0x78,-0x8(%rbp)
movb   $0x0,-0x7(%rbp)
lea    -0xe(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xe(%rbp),%rdi
lea    0xea9(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncpy@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1195 <test_strncpy+0x65>
lea    0xe8e(%rip),%rdi
lea    0xea5(%rip),%rsi
mov    $0xa6,%edx
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    14e3 <test_strncpy+0x3b3>
jmp    119a <test_strncpy+0x6a>
jmp    119f <test_strncpy+0x6f>
lea    -0xe(%rbp),%rdi
lea    0xe9c(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
je     11dc <test_strncpy+0xac>
lea    0xe47(%rip),%rdi
lea    0xe88(%rip),%rsi
mov    $0xa7,%edx
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    14e3 <test_strncpy+0x3b3>
jmp    11e1 <test_strncpy+0xb1>
jmp    11e6 <test_strncpy+0xb6>
lea    -0xe(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0xe(%rbp),%rdi
lea    0xe07(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncpy@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
je     1237 <test_strncpy+0x107>
lea    0xdec(%rip),%rdi
lea    0xe46(%rip),%rsi
mov    $0xa9,%edx
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    14e3 <test_strncpy+0x3b3>
jmp    123c <test_strncpy+0x10c>
jmp    1241 <test_strncpy+0x111>
lea    -0xe(%rbp),%rdi
lea    0xdb4(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
je     127e <test_strncpy+0x14e>
lea    0xda5(%rip),%rdi
lea    0xe21(%rip),%rsi
mov    $0xaa,%edx
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    14e3 <test_strncpy+0x3b3>
jmp    1283 <test_strncpy+0x153>
jmp    1288 <test_strncpy+0x158>
movsbl -0x8(%rbp),%eax
cmp    $0x78,%eax
je     12b9 <test_strncpy+0x189>
lea    0xd6a(%rip),%rdi
lea    0xdfd(%rip),%rsi
mov    $0xab,%edx
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    14e3 <test_strncpy+0x3b3>
jmp    12be <test_strncpy+0x18e>
jmp    12c3 <test_strncpy+0x193>
lea    -0xe(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0xe(%rbp),%rdi
lea    0xd2a(%rip),%rsi
mov    $0x7,%edx
call   1030 <strncpy@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
je     1314 <test_strncpy+0x1e4>
lea    0xd0f(%rip),%rdi
lea    0xdb1(%rip),%rsi
mov    $0xad,%edx
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    14e3 <test_strncpy+0x3b3>
jmp    1319 <test_strncpy+0x1e9>
jmp    131e <test_strncpy+0x1ee>
lea    -0xe(%rbp),%rdi
lea    0xcd7(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
je     135b <test_strncpy+0x22b>
lea    0xcc8(%rip),%rdi
lea    0xd44(%rip),%rsi
mov    $0xae,%edx
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    14e3 <test_strncpy+0x3b3>
jmp    1360 <test_strncpy+0x230>
jmp    1365 <test_strncpy+0x235>
movsbl -0x8(%rbp),%eax
cmp    $0x0,%eax
je     1396 <test_strncpy+0x266>
lea    0xc8d(%rip),%rdi
lea    0xd51(%rip),%rsi
mov    $0xaf,%edx
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    14e3 <test_strncpy+0x3b3>
jmp    139b <test_strncpy+0x26b>
jmp    13a0 <test_strncpy+0x270>
lea    -0xe(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    -0xe(%rbp),%rdi
lea    0xc70(%rip),%rsi
xor    %edx,%edx
call   1030 <strncpy@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
cmp    %rcx,%rax
je     13ee <test_strncpy+0x2be>
lea    0xc35(%rip),%rdi
lea    0xd06(%rip),%rsi
mov    $0xb1,%edx
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    14e3 <test_strncpy+0x3b3>
jmp    13f3 <test_strncpy+0x2c3>
jmp    13f8 <test_strncpy+0x2c8>
lea    -0xe(%rbp),%rdi
lea    0xbfd(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
je     1435 <test_strncpy+0x305>
lea    0xbee(%rip),%rdi
lea    0xc6a(%rip),%rsi
mov    $0xb2,%edx
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    14e3 <test_strncpy+0x3b3>
jmp    143a <test_strncpy+0x30a>
jmp    143f <test_strncpy+0x30f>
lea    -0xe(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0xe(%rbp),%rdi
lea    0xbd1(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncpy@plt>
mov    %rax,%rcx
mov    -0x38(%rbp),%rax
cmp    %rcx,%rax
je     1490 <test_strncpy+0x360>
lea    0xb93(%rip),%rdi
lea    0xc81(%rip),%rsi
mov    $0xb4,%edx
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    14e3 <test_strncpy+0x3b3>
jmp    1495 <test_strncpy+0x365>
jmp    149a <test_strncpy+0x36a>
lea    -0xe(%rbp),%rdi
lea    0xb7e(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
je     14d7 <test_strncpy+0x3a7>
lea    0xb4c(%rip),%rdi
lea    0xc57(%rip),%rsi
mov    $0xb5,%edx
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    14e3 <test_strncpy+0x3b3>
jmp    14dc <test_strncpy+0x3ac>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_strncpy>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
movw   $0x7878,0x13(%rsp)
movb   $0x0,0x15(%rsp)
lea    0xec7(%rip),%rsi
lea    0xe(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x5,%edx
call   1030 <strncpy@plt>
cmp    %rax,%rbx
je     1168 <test_strncpy+0x48>
lea    0xeaf(%rip),%rdi
lea    0xec6(%rip),%rsi
mov    $0xa6,%edx
jmp    1231 <test_strncpy+0x111>
movabs $0x78786f6c6c6568,%rax
cmp    %rax,0xe(%rsp)
je     1191 <test_strncpy+0x71>
lea    0xe86(%rip),%rdi
lea    0xec7(%rip),%rsi
mov    $0xa7,%edx
jmp    1231 <test_strncpy+0x111>
lea    0xe68(%rip),%rsi
mov    %rbx,%rdi
mov    $0x6,%edx
call   1030 <strncpy@plt>
cmp    %rax,%rbx
je     11bf <test_strncpy+0x9f>
lea    0xe55(%rip),%rdi
lea    0xeaf(%rip),%rsi
mov    $0xa9,%edx
jmp    1231 <test_strncpy+0x111>
mov    $0x6c6c6568,%eax
xor    0xe(%rsp),%eax
movzwl 0x12(%rsp),%ecx
xor    $0x6f,%ecx
or     %eax,%ecx
je     11e9 <test_strncpy+0xc9>
lea    0xe2b(%rip),%rdi
lea    0xea7(%rip),%rsi
mov    $0xaa,%edx
jmp    1231 <test_strncpy+0x111>
cmpb   $0x78,0x14(%rsp)
jne    121e <test_strncpy+0xfe>
lea    0xe09(%rip),%rsi
mov    %rbx,%rdi
mov    $0x7,%edx
call   1030 <strncpy@plt>
cmp    %rax,%rbx
je     1241 <test_strncpy+0x121>
lea    0xdf6(%rip),%rdi
lea    0xe98(%rip),%rsi
mov    $0xad,%edx
jmp    1231 <test_strncpy+0x111>
lea    0xde1(%rip),%rdi
lea    0xe74(%rip),%rsi
mov    $0xab,%edx
call   1040 <printf@plt>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret
mov    $0x6c6c6568,%eax
xor    0xe(%rsp),%eax
movzwl 0x12(%rsp),%ecx
xor    $0x6f,%ecx
or     %eax,%ecx
je     126b <test_strncpy+0x14b>
lea    0xda9(%rip),%rdi
lea    0xe25(%rip),%rsi
mov    $0xae,%edx
jmp    1231 <test_strncpy+0x111>
cmpb   $0x0,0x14(%rsp)
je     1287 <test_strncpy+0x167>
lea    0xd8d(%rip),%rdi
lea    0xe51(%rip),%rsi
mov    $0xaf,%edx
jmp    1231 <test_strncpy+0x111>
lea    0xd95(%rip),%rsi
mov    %rbx,%rdi
xor    %edx,%edx
call   1030 <strncpy@plt>
cmp    %rax,%rbx
je     12b5 <test_strncpy+0x195>
lea    0xd62(%rip),%rdi
lea    0xe33(%rip),%rsi
mov    $0xb1,%edx
jmp    1231 <test_strncpy+0x111>
mov    $0x6c6c6568,%eax
xor    0xe(%rsp),%eax
movzwl 0x12(%rsp),%ecx
xor    $0x6f,%ecx
or     %eax,%ecx
je     12e2 <test_strncpy+0x1c2>
lea    0xd35(%rip),%rdi
lea    0xdb1(%rip),%rsi
mov    $0xb2,%edx
jmp    1231 <test_strncpy+0x111>
lea    0xd3a(%rip),%rsi
mov    $0x1,%ebp
mov    %rbx,%rdi
mov    $0x1,%edx
call   1030 <strncpy@plt>
cmp    %rax,%rbx
je     1318 <test_strncpy+0x1f8>
lea    0xcff(%rip),%rdi
lea    0xded(%rip),%rsi
mov    $0xb4,%edx
jmp    1231 <test_strncpy+0x111>
cmpb   $0x0,0xe(%rsp)
je     1238 <test_strncpy+0x118>
lea    0xcdc(%rip),%rdi
lea    0xde7(%rip),%rsi
mov    $0xb5,%edx
jmp    1231 <test_strncpy+0x111>

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
@.str.1 = [30 x i8] c"expression '%s' untrue at %d\0A\00"
@.str.2 = [34 x i8] c"dest == strncpy(dest, \22hello\22, 5)\00"
@.str.3 = [8 x i8] c"helloxx\00"
@.str.4 = [25 x i8] c"!strcmp(dest, \22helloxx\22)\00"
@.str.5 = [34 x i8] c"dest == strncpy(dest, \22hello\22, 6)\00"
@.str.6 = [23 x i8] c"!strcmp(dest, \22hello\22)\00"
@.str.7 = [15 x i8] c"dest[6] == 'x'\00"
@.str.8 = [34 x i8] c"dest == strncpy(dest, \22hello\22, 7)\00"
@.str.9 = [13 x i8] c"dest[6] == 0\00"
@.str.10 = [1 x i8] zeroinitializer
@.str.11 = [29 x i8] c"dest == strncpy(dest, \22\22, 0)\00"
@.str.12 = [29 x i8] c"dest == strncpy(dest, \22\22, 1)\00"
@.str.13 = [18 x i8] c"!strcmp(dest, \22\22)\00"
define i32 @test_strncpy() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 5
store i8 120, i8* %3
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 6
store i8 120, i8* %4
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 7
store i8 0, i8* %5
br label %6
6: ; preds = %0
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%9 = call i8* @strncpy(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%10 = icmp eq i8* %7, %9
br i1 %10, label %13, label %11
11: ; preds = %6
%12 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32 166)
store i32 0, i32* %1
br label %109
13: ; preds = %6
br label %14
14: ; preds = %13
br label %15
15: ; preds = %14
%16 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%17 = call i32 @strcmp(i8* %16, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 167)
store i32 0, i32* %1
br label %109
21: ; preds = %15
br label %22
22: ; preds = %21
br label %23
23: ; preds = %22
%24 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%25 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%26 = call i8* @strncpy(i8* %25, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 6)
%27 = icmp eq i8* %24, %26
br i1 %27, label %30, label %28
28: ; preds = %23
%29 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0), i32 169)
store i32 0, i32* %1
br label %109
30: ; preds = %23
br label %31
31: ; preds = %30
br label %32
32: ; preds = %31
%33 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%34 = call i32 @strcmp(i8* %33, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%35 = icmp ne i32 %34, 0
br i1 %35, label %36, label %38
36: ; preds = %32
%37 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i32 170)
store i32 0, i32* %1
br label %109
38: ; preds = %32
br label %39
39: ; preds = %38
br label %40
40: ; preds = %39
%41 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 6
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = icmp eq i32 %43, 120
br i1 %44, label %47, label %45
45: ; preds = %40
%46 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i32 171)
store i32 0, i32* %1
br label %109
47: ; preds = %40
br label %48
48: ; preds = %47
br label %49
49: ; preds = %48
%50 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%51 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%52 = call i8* @strncpy(i8* %51, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 7)
%53 = icmp eq i8* %50, %52
br i1 %53, label %56, label %54
54: ; preds = %49
%55 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0), i32 173)
store i32 0, i32* %1
br label %109
56: ; preds = %49
br label %57
57: ; preds = %56
br label %58
58: ; preds = %57
%59 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%60 = call i32 @strcmp(i8* %59, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%61 = icmp ne i32 %60, 0
br i1 %61, label %62, label %64
62: ; preds = %58
%63 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i32 174)
store i32 0, i32* %1
br label %109
64: ; preds = %58
br label %65
65: ; preds = %64
br label %66
66: ; preds = %65
%67 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 6
%68 = load i8, i8* %67
%69 = sext i8 %68 to i32
%70 = icmp eq i32 %69, 0
br i1 %70, label %73, label %71
71: ; preds = %66
%72 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i32 175)
store i32 0, i32* %1
br label %109
73: ; preds = %66
br label %74
74: ; preds = %73
br label %75
75: ; preds = %74
%76 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%77 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%78 = call i8* @strncpy(i8* %77, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0), i32 0)
%79 = icmp eq i8* %76, %78
br i1 %79, label %82, label %80
80: ; preds = %75
%81 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0), i32 177)
store i32 0, i32* %1
br label %109
82: ; preds = %75
br label %83
83: ; preds = %82
br label %84
84: ; preds = %83
%85 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%86 = call i32 @strcmp(i8* %85, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%87 = icmp ne i32 %86, 0
br i1 %87, label %88, label %90
88: ; preds = %84
%89 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i32 178)
store i32 0, i32* %1
br label %109
90: ; preds = %84
br label %91
91: ; preds = %90
br label %92
92: ; preds = %91
%93 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%94 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%95 = call i8* @strncpy(i8* %94, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0), i32 1)
%96 = icmp eq i8* %93, %95
br i1 %96, label %99, label %97
97: ; preds = %92
%98 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.12, i64 0, i64 0), i32 180)
store i32 0, i32* %1
br label %109
99: ; preds = %92
br label %100
100: ; preds = %99
br label %101
101: ; preds = %100
%102 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%103 = call i32 @strcmp(i8* %102, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0))
%104 = icmp ne i32 %103, 0
br i1 %104, label %105, label %107
105: ; preds = %101
%106 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.13, i64 0, i64 0), i32 181)
store i32 0, i32* %1
br label %109
107: ; preds = %101
br label %108
108: ; preds = %107
store i32 1, i32* %1
br label %109
109: ; preds = %108, %105, %97, %88, %80, %71, %62, %54, %45, %36, %28, %19, %11
%110 = load i32, i32* %1
ret i32 %110
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@.str.1 = [30 x i8] c"expression '%s' untrue at %d\0A\00"
@.str.2 = [34 x i8] c"dest == strncpy(dest, \22hello\22, 5)\00"
@.str.3 = [8 x i8] c"helloxx\00"
@.str.4 = [25 x i8] c"!strcmp(dest, \22helloxx\22)\00"
@.str.5 = [34 x i8] c"dest == strncpy(dest, \22hello\22, 6)\00"
@.str.6 = [23 x i8] c"!strcmp(dest, \22hello\22)\00"
@.str.7 = [15 x i8] c"dest[6] == 'x'\00"
@.str.8 = [34 x i8] c"dest == strncpy(dest, \22hello\22, 7)\00"
@.str.9 = [13 x i8] c"dest[6] == 0\00"
@.str.10 = [1 x i8] zeroinitializer
@.str.11 = [29 x i8] c"dest == strncpy(dest, \22\22, 0)\00"
@.str.12 = [29 x i8] c"dest == strncpy(dest, \22\22, 1)\00"
@.str.13 = [18 x i8] c"!strcmp(dest, \22\22)\00"
define i32 @test_strncpy() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 5
store i8 120, i8* %3
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 6
store i8 120, i8* %4
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 7
store i8 0, i8* %5
%6 = call i8* @strncpy(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%7 = icmp eq i8* %2, %6
br i1 %7, label %10, label %8
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32 166)
br label %65
10: ; preds = %0
%11 = call i32 @bcmp(i8* dereferenceable(8) %2, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i64 8)
%12 = icmp eq i32 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 167)
br label %65
15: ; preds = %10
%16 = call i8* @strncpy(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 6)
%17 = icmp eq i8* %2, %16
br i1 %17, label %20, label %18
18: ; preds = %15
%19 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0), i32 169)
br label %65
20: ; preds = %15
%21 = call i32 @bcmp(i8* dereferenceable(6) %2, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 6)
%22 = icmp eq i32 %21, 0
br i1 %22, label %25, label %23
23: ; preds = %20
%24 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i32 170)
br label %65
25: ; preds = %20
%26 = load i8, i8* %4
%27 = icmp eq i8 %26, 120
br i1 %27, label %30, label %28
28: ; preds = %25
%29 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i32 171)
br label %65
30: ; preds = %25
%31 = call i8* @strncpy(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 7)
%32 = icmp eq i8* %2, %31
br i1 %32, label %35, label %33
33: ; preds = %30
%34 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0), i32 173)
br label %65
35: ; preds = %30
%36 = call i32 @bcmp(i8* dereferenceable(6) %2, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 6)
%37 = icmp eq i32 %36, 0
br i1 %37, label %40, label %38
38: ; preds = %35
%39 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i32 174)
br label %65
40: ; preds = %35
%41 = load i8, i8* %4
%42 = icmp eq i8 %41, 0
br i1 %42, label %45, label %43
43: ; preds = %40
%44 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i32 175)
br label %65
45: ; preds = %40
%46 = call i8* @strncpy(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0), i32 0)
%47 = icmp eq i8* %2, %46
br i1 %47, label %50, label %48
48: ; preds = %45
%49 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0), i32 177)
br label %65
50: ; preds = %45
%51 = call i32 @bcmp(i8* dereferenceable(6) %2, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 6)
%52 = icmp eq i32 %51, 0
br i1 %52, label %55, label %53
53: ; preds = %50
%54 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i32 178)
br label %65
55: ; preds = %50
%56 = call i8* @strncpy(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0), i32 1)
%57 = icmp eq i8* %2, %56
br i1 %57, label %60, label %58
58: ; preds = %55
%59 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.12, i64 0, i64 0), i32 180)
br label %65
60: ; preds = %55
%61 = load i8, i8* %2
%62 = icmp eq i8 %61, 0
br i1 %62, label %65, label %63
63: ; preds = %60
%64 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.13, i64 0, i64 0), i32 181)
br label %65
65: ; preds = %60, %63, %58, %53, %48, %43, %38, %33, %28, %23, %18, %13, %8
%66 = phi i32 [ 0, %13 ], [ 0, %23 ], [ 0, %38 ], [ 0, %53 ], [ 0, %63 ], [ 0, %58 ], [ 0, %48 ], [ 0, %43 ], [ 0, %33 ], [ 0, %28 ], [ 0, %18 ], [ 0, %8 ], [ 1, %60 ]
ret i32 %66
}