#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 */
struct in_addr {
  int s_addr;
};

/* Variables and functions */
int /*<<< orphan*/ inet_ntoa(struct in_addr);
int /*<<< orphan*/ printf(char *, char *, int);
int /*<<< orphan*/ strcmp(int /*<<< orphan*/, char *);
int test_inet_ntoa(void) {
  struct in_addr in;
  in.s_addr = 127 + (1 << 24);
  do {
    if (!(!strcmp(inet_ntoa(in), "127.0.0.1"))) {
      printf("expression '%s' untrue at %d\n",
             "!strcmp(inet_ntoa(in), \"127.0.0.1\")", 64);
      return 0;
    }
  } while (0);
  in.s_addr = 192 + (168 << 8) + (254 << 16) + (1 << 24);
  do {
    if (!(!strcmp(inet_ntoa(in), "192.168.254.1"))) {
      printf("expression '%s' untrue at %d\n",
             "!strcmp(inet_ntoa(in), \"192.168.254.1\")", 67);
      return 0;
    }
  } while (0);
  return 1;
}


x86 assembly (clang, -O0):
<test_inet_ntoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x100007f,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <inet_ntoa@plt>
mov    %eax,%edi
lea    0xeb0(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
je     1182 <test_inet_ntoa+0x52>
lea    0xea5(%rip),%rdi
lea    0xebc(%rip),%rsi
mov    $0x40,%edx
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11dd <test_inet_ntoa+0xad>
jmp    1187 <test_inet_ntoa+0x57>
movl   $0x1fea8c0,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <inet_ntoa@plt>
mov    %eax,%edi
lea    0xead(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
je     11d1 <test_inet_ntoa+0xa1>
lea    0xe56(%rip),%rdi
lea    0xe9f(%rip),%rsi
mov    $0x43,%edx
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11dd <test_inet_ntoa+0xad>
jmp    11d6 <test_inet_ntoa+0xa6>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_inet_ntoa>:
push   %rax
mov    $0x100007f,%edi
call   1030 <inet_ntoa@plt>
lea    0xebe(%rip),%rsi
mov    %eax,%edi
call   1050 <strcmp@plt>
test   %eax,%eax
je     1162 <test_inet_ntoa+0x32>
lea    0xeb6(%rip),%rdi
lea    0xecd(%rip),%rsi
mov    $0x40,%edx
jmp    1191 <test_inet_ntoa+0x61>
mov    $0x1fea8c0,%edi
call   1030 <inet_ntoa@plt>
lea    0xed9(%rip),%rsi
mov    %eax,%edi
call   1050 <strcmp@plt>
test   %eax,%eax
je     119a <test_inet_ntoa+0x6a>
lea    0xe85(%rip),%rdi
lea    0xece(%rip),%rsi
mov    $0x43,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@.str = [10 x i8] c"127.0.0.1\00"
@.str.1 = [30 x i8] c"expression '%s' untrue at %d\0A\00"
@.str.2 = [36 x i8] c"!strcmp(inet_ntoa(in), \22127.0.0.1\22)\00"
@.str.3 = [14 x i8] c"192.168.254.1\00"
@.str.4 = [40 x i8] c"!strcmp(inet_ntoa(in), \22192.168.254.1\22)\00"
define i32 @test_inet_ntoa() {
%1 = alloca i32
%2 = alloca %struct.in_addr
%3 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %2, i32 0, i32 0
store i32 16777343, i32* %3
br label %4
4: ; preds = %0
%5 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %2, i32 0, i32 0
%6 = load i32, i32* %5
%7 = call i32 @inet_ntoa(i32 %6)
%8 = call i32 @strcmp(i32 %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %4
%11 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 64)
store i32 0, i32* %1
br label %25
12: ; preds = %4
br label %13
13: ; preds = %12
%14 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %2, i32 0, i32 0
store i32 33466560, i32* %14
br label %15
15: ; preds = %13
%16 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %2, i32 0, i32 0
%17 = load i32, i32* %16
%18 = call i32 @inet_ntoa(i32 %17)
%19 = call i32 @strcmp(i32 %18, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %15
%22 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), i32 67)
store i32 0, i32* %1
br label %25
23: ; preds = %15
br label %24
24: ; preds = %23
store i32 1, i32* %1
br label %25
25: ; preds = %24, %21, %10
%26 = load i32, i32* %1
ret i32 %26
}

LLVM IR (-O2):
@.str = [10 x i8] c"127.0.0.1\00"
@.str.1 = [30 x i8] c"expression '%s' untrue at %d\0A\00"
@.str.2 = [36 x i8] c"!strcmp(inet_ntoa(in), \22127.0.0.1\22)\00"
@.str.3 = [14 x i8] c"192.168.254.1\00"
@.str.4 = [40 x i8] c"!strcmp(inet_ntoa(in), \22192.168.254.1\22)\00"
define i32 @test_inet_ntoa() {
%1 = tail call i32 @inet_ntoa(i32 16777343)
%2 = tail call i32 @strcmp(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 64)
br label %12
6: ; preds = %0
%7 = tail call i32 @inet_ntoa(i32 33466560)
%8 = tail call i32 @strcmp(i32 %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %6
%11 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), i32 67)
br label %12
12: ; preds = %6, %10, %4
%13 = phi i32 [ 0, %4 ], [ 0, %10 ], [ 1, %6 ]
ret i32 %13
}