#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 */
scalar_t__ system(char *);
int add_bridge(void) {
  if (system("ip link add "
             "zdtmbr0"
             " type bridge"))
    return -1;
  if (system("ip addr add 10.0.55.55/32 dev "
             "zdtmbr0"))
    return -1;
  if (system("ip addr add fe80:4567::1/64 nodad dev "
             "zdtmbr0"))
    return -1;
  if (system("ip link set "
             "zdtmbr0"
             " up"))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<add_bridge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <system@plt>
cmp    $0x0,%rax
je     113a <add_bridge+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    11a7 <add_bridge+0x97>
lea    0xedf(%rip),%rdi
call   1030 <system@plt>
cmp    $0x0,%rax
je     115c <add_bridge+0x4c>
movl   $0xffffffff,-0x4(%rbp)
jmp    11a7 <add_bridge+0x97>
lea    0xee3(%rip),%rdi
call   1030 <system@plt>
cmp    $0x0,%rax
je     117e <add_bridge+0x6e>
movl   $0xffffffff,-0x4(%rbp)
jmp    11a7 <add_bridge+0x97>
lea    0xeef(%rip),%rdi
call   1030 <system@plt>
cmp    $0x0,%rax
je     11a0 <add_bridge+0x90>
movl   $0xffffffff,-0x4(%rbp)
jmp    11a7 <add_bridge+0x97>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_bridge>:
push   %rbx
lea    0xee8(%rip),%rdi
call   1030 <system@plt>
mov    $0xffffffff,%ebx
test   %rax,%rax
jne    115a <add_bridge+0x4a>
lea    0xef2(%rip),%rdi
call   1030 <system@plt>
test   %rax,%rax
jne    115a <add_bridge+0x4a>
lea    0xf07(%rip),%rdi
call   1030 <system@plt>
test   %rax,%rax
jne    115a <add_bridge+0x4a>
lea    0xf24(%rip),%rdi
call   1030 <system@plt>
neg    %rax
sbb    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"ip link add zdtmbr0 type bridge\00"
@.str.1 = [38 x i8] c"ip addr add 10.0.55.55/32 dev zdtmbr0\00"
@.str.2 = [46 x i8] c"ip addr add fe80:4567::1/64 nodad dev zdtmbr0\00"
@.str.3 = [23 x i8] c"ip link set zdtmbr0 up\00"
define i32 @add_bridge() {
%1 = alloca i32
%2 = call i64 @system(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 -1, i32* %1
br label %18
5: ; preds = %0
%6 = call i64 @system(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 -1, i32* %1
br label %18
9: ; preds = %5
%10 = call i64 @system(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 -1, i32* %1
br label %18
13: ; preds = %9
%14 = call i64 @system(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 -1, i32* %1
br label %18
17: ; preds = %13
store i32 0, i32* %1
br label %18
18: ; preds = %17, %16, %12, %8, %4
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
@.str = [32 x i8] c"ip link add zdtmbr0 type bridge\00"
@.str.1 = [38 x i8] c"ip addr add 10.0.55.55/32 dev zdtmbr0\00"
@.str.2 = [46 x i8] c"ip addr add fe80:4567::1/64 nodad dev zdtmbr0\00"
@.str.3 = [23 x i8] c"ip link set zdtmbr0 up\00"
define i32 @add_bridge() {
%1 = tail call i64 @system(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %13
3: ; preds = %0
%4 = tail call i64 @system(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = tail call i64 @system(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = tail call i64 @system(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%11 = icmp ne i64 %10, 0
%12 = sext i1 %11 to i32
br label %13
13: ; preds = %9, %6, %3, %0
%14 = phi i32 [ -1, %0 ], [ -1, %3 ], [ -1, %6 ], [ %12, %9 ]
ret i32 %14
}