#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 INADDR_ANY;
int INADDR_BROADCAST;
int INADDR_LOOPBACK;
int test(int, char *);
int main(void) {
  int result = 0;
  result |= test(INADDR_LOOPBACK, "127.0.0.1");
  result |= test(INADDR_BROADCAST, "255.255.255.255");
  result |= test(INADDR_ANY, "0.0.0.0");
  result |= test(0xc0060746, "192.6.7.70");
  return result;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <test@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
call   1030 <test@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
call   1030 <test@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0xc0060746,%edi
lea    0xe9f(%rip),%rsi
call   1030 <test@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
call   1030 <test@plt>
mov    %eax,%ebx
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    0xed0(%rip),%rsi
call   1030 <test@plt>
mov    %eax,%ebp
or     %ebx,%ebp
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1030 <test@plt>
mov    %eax,%ebx
lea    0xec1(%rip),%rsi
mov    $0xc0060746,%edi
call   1030 <test@plt>
or     %ebx,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@INADDR_LOOPBACK = global i32 0
@.str = [10 x i8] c"127.0.0.1\00"
@INADDR_BROADCAST = global i32 0
@.str.1 = [16 x i8] c"255.255.255.255\00"
@INADDR_ANY = global i32 0
@.str.2 = [8 x i8] c"0.0.0.0\00"
@.str.3 = [11 x i8] c"192.6.7.70\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* @INADDR_LOOPBACK
%4 = call i32 @test(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = or i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* @INADDR_BROADCAST
%8 = call i32 @test(i32 %7, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* %2
%10 = or i32 %9, %8
store i32 %10, i32* %2
%11 = load i32, i32* @INADDR_ANY
%12 = call i32 @test(i32 %11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%13 = load i32, i32* %2
%14 = or i32 %13, %12
store i32 %14, i32* %2
%15 = call i32 @test(i32 -1073346746, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%16 = load i32, i32* %2
%17 = or i32 %16, %15
store i32 %17, i32* %2
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@INADDR_LOOPBACK = global i32 0
@.str = [10 x i8] c"127.0.0.1\00"
@INADDR_BROADCAST = global i32 0
@.str.1 = [16 x i8] c"255.255.255.255\00"
@INADDR_ANY = global i32 0
@.str.2 = [8 x i8] c"0.0.0.0\00"
@.str.3 = [11 x i8] c"192.6.7.70\00"
define i32 @main() {
%1 = load i32, i32* @INADDR_LOOPBACK
%2 = tail call i32 @test(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @INADDR_BROADCAST
%4 = tail call i32 @test(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%5 = or i32 %4, %2
%6 = load i32, i32* @INADDR_ANY
%7 = tail call i32 @test(i32 %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%8 = or i32 %5, %7
%9 = tail call i32 @test(i32 -1073346746, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%10 = or i32 %8, %9
ret i32 %10
}