#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 can_use_network();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ quit();
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ test_getaddrinfo_all(int);
int /*<<< orphan*/ test_getnameinfo_all();
int main(void) {
  int use_network;
  printf("Test 48 ");
  fflush(stdout);
  use_network = can_use_network();
  if (!use_network)
    printf("Warning: no network\n");
  test_getaddrinfo_all(use_network);
  test_getnameinfo_all();
  quit();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    $0x0,%al
call   1030 <can_use_network@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    11a9 <main+0x49>
lea    0xe65(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
call   1080 <test_getaddrinfo_all@plt>
mov    $0x0,%al
call   1070 <test_getnameinfo_all@plt>
mov    $0x0,%al
call   1050 <quit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xe88(%rip),%rdi
call   1050 <printf@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
xor    %eax,%eax
call   1040 <can_use_network@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    11a4 <main+0x34>
lea    0xe6a(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1090 <test_getaddrinfo_all@plt>
xor    %eax,%eax
call   1080 <test_getnameinfo_all@plt>
xor    %eax,%eax
call   1060 <quit@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Test 48 \00"
@stdout = global i32 0
@.str.1 = [21 x i8] c"Warning: no network\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = call i32 @fflush(i32 %4)
%6 = call i32 (...) @can_use_network()
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %0
%12 = load i32, i32* %2
%13 = call i32 @test_getaddrinfo_all(i32 %12)
%14 = call i32 (...) @test_getnameinfo_all()
%15 = call i32 (...) @quit()
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"Test 48 \00"
@stdout = global i32 0
@str = [20 x i8] c"Warning: no network\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
%4 = tail call i32 (...) @can_use_network()
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
%9 = tail call i32 @test_getaddrinfo_all(i32 %4)
%10 = tail call i32 (...) @test_getnameinfo_all()
%11 = tail call i32 (...) @quit()
ret i32 0
}