#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*/ abms_net_linkup(char *);
int /*<<< orphan*/ abms_system(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *, char *);
void abms_net_loopback(void) {
  char lcmd[255];
  abms_net_linkup("lo");
  sprintf(lcmd, "%s%s addr add %s dev %s", "/app/os/sys/bin/", "ip",
          "127.0.0.1/8", "lo");
  abms_system(lcmd);
  return;
}


x86 assembly (clang, -O0):
<abms_net_loopback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    0xebe(%rip),%rdi
call   1030 <abms_net_linkup@plt>
lea    -0x100(%rbp),%rdi
lea    0xeae(%rip),%rsi
lea    0xebf(%rip),%rdx
lea    0xec9(%rip),%rcx
lea    0xec5(%rip),%r8
lea    0xe8f(%rip),%r9
call   1050 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1040 <abms_system@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abms_net_loopback>:
push   %r14
push   %rbx
sub    $0x108,%rsp
lea    0xebf(%rip),%r14
mov    %r14,%rdi
call   1030 <abms_net_linkup@plt>
lea    0xeb3(%rip),%rsi
lea    0xec4(%rip),%rdx
lea    0xece(%rip),%rcx
lea    0xeca(%rip),%r8
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %r14,%r9
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <abms_system@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"lo\00"
@.str.1 = [24 x i8] c"%s%s addr add %s dev %s\00"
@.str.2 = [17 x i8] c"/app/os/sys/bin/\00"
@.str.3 = [3 x i8] c"ip\00"
@.str.4 = [12 x i8] c"127.0.0.1/8\00"
define void @abms_net_loopback() {
%1 = alloca [255 x i8]
%2 = call i32 @abms_net_linkup(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%6 = call i32 @abms_system(i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"lo\00"
@.str.1 = [24 x i8] c"%s%s addr add %s dev %s\00"
@.str.2 = [17 x i8] c"/app/os/sys/bin/\00"
@.str.3 = [3 x i8] c"ip\00"
@.str.4 = [12 x i8] c"127.0.0.1/8\00"
define void @abms_net_loopback() {
%1 = alloca [255 x i8]
%2 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @abms_net_linkup(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @abms_system(i8* %2)
ret void
}