#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 wfa_cs_p2p_group {
  int dummy;
};

/* Variables and functions */
char *get_station_ifname();
int /*<<< orphan*/ wpa_command(char *, char *);
int cmd_sta_p2p_reset_test(void) {
  char *intf = "wlan0";
  struct wfa_cs_p2p_group *grp, *prev;
  char buf[256];
  wpa_command(intf, "P2P_GROUP_REMOVE *");
  wpa_command(intf, "P2P_STOP_FIND");
  wpa_command(intf, "P2P_FLUSH");
  wpa_command(intf, "P2P_SERVICE_FLUSH");
  wpa_command(intf, "P2P_SET ssid_postfix ");
  wpa_command(intf, "P2P_EXT_LISTEN");
  wpa_command(intf, "P2P_SET client_apsd disable");
  wpa_command(intf, "P2P_SET go_apsd disable");
  wpa_command(get_station_ifname(), "P2P_SET ps 98");
  wpa_command(get_station_ifname(), "P2P_SET ps 96");
  wpa_command(get_station_ifname(), "P2P_SET ps 0");
  wpa_command(intf, "SET ampdu 1");
  return 1;
}


x86 assembly (clang, -O0):
<cmd_sta_p2p_reset_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1040 <wpa_command@plt>
mov    -0x8(%rbp),%rdi
lea    0xec8(%rip),%rsi
call   1040 <wpa_command@plt>
mov    -0x8(%rbp),%rdi
lea    0xec6(%rip),%rsi
call   1040 <wpa_command@plt>
mov    -0x8(%rbp),%rdi
lea    0xec0(%rip),%rsi
call   1040 <wpa_command@plt>
mov    -0x8(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1040 <wpa_command@plt>
mov    -0x8(%rbp),%rdi
lea    0xec8(%rip),%rsi
call   1040 <wpa_command@plt>
mov    -0x8(%rbp),%rdi
lea    0xec7(%rip),%rsi
call   1040 <wpa_command@plt>
mov    -0x8(%rbp),%rdi
lea    0xed3(%rip),%rsi
call   1040 <wpa_command@plt>
mov    $0x0,%al
call   1030 <get_station_ifname@plt>
mov    %rax,%rdi
lea    0xed5(%rip),%rsi
call   1040 <wpa_command@plt>
mov    $0x0,%al
call   1030 <get_station_ifname@plt>
mov    %rax,%rdi
lea    0xecd(%rip),%rsi
call   1040 <wpa_command@plt>
mov    $0x0,%al
call   1030 <get_station_ifname@plt>
mov    %rax,%rdi
lea    0xec5(%rip),%rsi
call   1040 <wpa_command@plt>
mov    -0x8(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1040 <wpa_command@plt>
mov    $0x1,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_sta_p2p_reset_test>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed7(%rip),%rsi
mov    %rbx,%rdi
call   1040 <wpa_command@plt>
lea    0xedb(%rip),%rsi
mov    %rbx,%rdi
call   1040 <wpa_command@plt>
lea    0xeda(%rip),%rsi
mov    %rbx,%rdi
call   1040 <wpa_command@plt>
lea    0xed5(%rip),%rsi
mov    %rbx,%rdi
call   1040 <wpa_command@plt>
lea    0xed8(%rip),%rsi
mov    %rbx,%rdi
call   1040 <wpa_command@plt>
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
call   1040 <wpa_command@plt>
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
call   1040 <wpa_command@plt>
lea    0xeec(%rip),%rsi
mov    %rbx,%rdi
call   1040 <wpa_command@plt>
xor    %eax,%eax
call   1030 <get_station_ifname@plt>
lea    0xeee(%rip),%rsi
mov    %rax,%rdi
call   1040 <wpa_command@plt>
xor    %eax,%eax
call   1030 <get_station_ifname@plt>
lea    0xee6(%rip),%rsi
mov    %rax,%rdi
call   1040 <wpa_command@plt>
xor    %eax,%eax
call   1030 <get_station_ifname@plt>
lea    0xede(%rip),%rsi
mov    %rax,%rdi
call   1040 <wpa_command@plt>
lea    0xedc(%rip),%rsi
mov    %rbx,%rdi
call   1040 <wpa_command@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.wfa_cs_p2p_group = type { i32 }
@.str = [6 x i8] c"wlan0\00"
@.str.1 = [19 x i8] c"P2P_GROUP_REMOVE *\00"
@.str.2 = [14 x i8] c"P2P_STOP_FIND\00"
@.str.3 = [10 x i8] c"P2P_FLUSH\00"
@.str.4 = [18 x i8] c"P2P_SERVICE_FLUSH\00"
@.str.5 = [22 x i8] c"P2P_SET ssid_postfix \00"
@.str.6 = [15 x i8] c"P2P_EXT_LISTEN\00"
@.str.7 = [28 x i8] c"P2P_SET client_apsd disable\00"
@.str.8 = [24 x i8] c"P2P_SET go_apsd disable\00"
@.str.9 = [14 x i8] c"P2P_SET ps 98\00"
@.str.10 = [14 x i8] c"P2P_SET ps 96\00"
@.str.11 = [13 x i8] c"P2P_SET ps 0\00"
@.str.12 = [12 x i8] c"SET ampdu 1\00"
define i32 @cmd_sta_p2p_reset_test() {
%1 = alloca i8*
%2 = alloca %struct.wfa_cs_p2p_group*
%3 = alloca %struct.wfa_cs_p2p_group*
%4 = alloca [256 x i8]
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %1
%5 = load i8*, i8** %1
%6 = call i32 @wpa_command(i8* %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%7 = load i8*, i8** %1
%8 = call i32 @wpa_command(i8* %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%9 = load i8*, i8** %1
%10 = call i32 @wpa_command(i8* %9, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%11 = load i8*, i8** %1
%12 = call i32 @wpa_command(i8* %11, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%13 = load i8*, i8** %1
%14 = call i32 @wpa_command(i8* %13, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
%15 = load i8*, i8** %1
%16 = call i32 @wpa_command(i8* %15, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
%17 = load i8*, i8** %1
%18 = call i32 @wpa_command(i8* %17, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0))
%19 = load i8*, i8** %1
%20 = call i32 @wpa_command(i8* %19, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0))
%21 = call i8* (...) @get_station_ifname()
%22 = call i32 @wpa_command(i8* %21, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
%23 = call i8* (...) @get_station_ifname()
%24 = call i32 @wpa_command(i8* %23, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0))
%25 = call i8* (...) @get_station_ifname()
%26 = call i32 @wpa_command(i8* %25, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0))
%27 = load i8*, i8** %1
%28 = call i32 @wpa_command(i8* %27, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
%struct.wfa_cs_p2p_group = type { i32 }
@.str = [6 x i8] c"wlan0\00"
@.str.1 = [19 x i8] c"P2P_GROUP_REMOVE *\00"
@.str.2 = [14 x i8] c"P2P_STOP_FIND\00"
@.str.3 = [10 x i8] c"P2P_FLUSH\00"
@.str.4 = [18 x i8] c"P2P_SERVICE_FLUSH\00"
@.str.5 = [22 x i8] c"P2P_SET ssid_postfix \00"
@.str.6 = [15 x i8] c"P2P_EXT_LISTEN\00"
@.str.7 = [28 x i8] c"P2P_SET client_apsd disable\00"
@.str.8 = [24 x i8] c"P2P_SET go_apsd disable\00"
@.str.9 = [14 x i8] c"P2P_SET ps 98\00"
@.str.10 = [14 x i8] c"P2P_SET ps 96\00"
@.str.11 = [13 x i8] c"P2P_SET ps 0\00"
@.str.12 = [12 x i8] c"SET ampdu 1\00"
define i32 @cmd_sta_p2p_reset_test() {
%1 = tail call i32 @wpa_command(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @wpa_command(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @wpa_command(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%4 = tail call i32 @wpa_command(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%5 = tail call i32 @wpa_command(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
%6 = tail call i32 @wpa_command(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
%7 = tail call i32 @wpa_command(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0))
%8 = tail call i32 @wpa_command(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0))
%9 = tail call i8* (...) @get_station_ifname()
%10 = tail call i32 @wpa_command(i8* %9, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
%11 = tail call i8* (...) @get_station_ifname()
%12 = tail call i32 @wpa_command(i8* %11, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0))
%13 = tail call i8* (...) @get_station_ifname()
%14 = tail call i32 @wpa_command(i8* %13, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0))
%15 = tail call i32 @wpa_command(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0))
ret i32 1
}