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

/* Variables and functions */
int /*<<< orphan*/ CGI_get_mt7687ap_passwd(struct connstruct *);
int /*<<< orphan*/ CGI_get_mt7687ap_ssid(struct connstruct *);
int WEB_write_blk(struct connstruct *, char *, int, int);
int web__AP_html(struct connstruct *cn, char *datap) {
  int send_len = 0;
  int total_send_len = 0;
  send_len = WEB_write_blk(cn, datap, 0, 166);
  if (send_len != 166)
    return send_len;
  total_send_len += send_len;
  CGI_get_mt7687ap_ssid(cn);
  send_len = WEB_write_blk(cn, datap, 166, 51);
  if (send_len != 51)
    return send_len;
  total_send_len += send_len;
  CGI_get_mt7687ap_passwd(cn);
  send_len = WEB_write_blk(cn, datap, 217, 48);
  if (send_len != 48)
    return send_len;
  total_send_len += send_len;
  CGI_get_mt7687ap_ssid(cn);
  send_len = WEB_write_blk(cn, datap, 265, 52);
  if (send_len != 52)
    return send_len;
  total_send_len += send_len;
  CGI_get_mt7687ap_passwd(cn);
  send_len = WEB_write_blk(cn, datap, 317, 1322);
  if (send_len != 1322)
    return send_len;
  total_send_len += send_len;
  return total_send_len;
}


x86 assembly (clang, -O0):
<web__AP_html>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
xor    %edx,%edx
mov    $0xa6,%ecx
call   1050 <WEB_write_blk@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xa6,-0x1c(%rbp)
je     117d <web__AP_html+0x4d>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1293 <web__AP_html+0x163>
mov    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <CGI_get_mt7687ap_ssid@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0xa6,%edx
mov    $0x33,%ecx
call   1050 <WEB_write_blk@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x33,-0x1c(%rbp)
je     11be <web__AP_html+0x8e>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1293 <web__AP_html+0x163>
mov    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <CGI_get_mt7687ap_passwd@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0xd9,%edx
mov    $0x30,%ecx
call   1050 <WEB_write_blk@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x30,-0x1c(%rbp)
je     11ff <web__AP_html+0xcf>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1293 <web__AP_html+0x163>
mov    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <CGI_get_mt7687ap_ssid@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x109,%edx
mov    $0x34,%ecx
call   1050 <WEB_write_blk@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x34,-0x1c(%rbp)
je     1240 <web__AP_html+0x110>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1293 <web__AP_html+0x163>
mov    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <CGI_get_mt7687ap_passwd@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x13d,%edx
mov    $0x52a,%ecx
call   1050 <WEB_write_blk@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x52a,-0x1c(%rbp)
je     1284 <web__AP_html+0x154>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1293 <web__AP_html+0x163>
mov    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<web__AP_html>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edx,%edx
mov    $0xa6,%ecx
call   1050 <WEB_write_blk@plt>
cmp    $0xa6,%eax
jne    11e3 <web__AP_html+0xb3>
mov    %rbx,%rdi
call   1040 <CGI_get_mt7687ap_ssid@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xa6,%edx
mov    $0x33,%ecx
call   1050 <WEB_write_blk@plt>
cmp    $0x33,%eax
jne    11e3 <web__AP_html+0xb3>
mov    %rbx,%rdi
call   1030 <CGI_get_mt7687ap_passwd@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xd9,%edx
mov    $0x30,%ecx
call   1050 <WEB_write_blk@plt>
cmp    $0x30,%eax
jne    11e3 <web__AP_html+0xb3>
mov    %rbx,%rdi
call   1040 <CGI_get_mt7687ap_ssid@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x109,%edx
mov    $0x34,%ecx
call   1050 <WEB_write_blk@plt>
cmp    $0x34,%eax
jne    11e3 <web__AP_html+0xb3>
mov    %rbx,%rdi
call   1030 <CGI_get_mt7687ap_passwd@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x13d,%edx
mov    $0x52a,%ecx
call   1050 <WEB_write_blk@plt>
mov    %eax,%ecx
cmp    $0x52a,%eax
mov    $0x667,%eax
cmovne %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.connstruct = type { i32 }
define i32 @web__AP_html(%struct.connstruct* %0, i8* %1) {
%3 = alloca i32
%4 = alloca %struct.connstruct*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store %struct.connstruct* %0, %struct.connstruct** %4
store i8* %1, i8** %5
store i32 0, i32* %6
store i32 0, i32* %7
%8 = load %struct.connstruct*, %struct.connstruct** %4
%9 = load i8*, i8** %5
%10 = call i32 @WEB_write_blk(%struct.connstruct* %8, i8* %9, i32 0, i32 166)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp ne i32 %11, 166
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = load i32, i32* %6
store i32 %14, i32* %3
br label %72
15: ; preds = %2
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = add nsw i32 %17, %16
store i32 %18, i32* %7
%19 = load %struct.connstruct*, %struct.connstruct** %4
%20 = call i32 @CGI_get_mt7687ap_ssid(%struct.connstruct* %19)
%21 = load %struct.connstruct*, %struct.connstruct** %4
%22 = load i8*, i8** %5
%23 = call i32 @WEB_write_blk(%struct.connstruct* %21, i8* %22, i32 166, i32 51)
store i32 %23, i32* %6
%24 = load i32, i32* %6
%25 = icmp ne i32 %24, 51
br i1 %25, label %26, label %28
26: ; preds = %15
%27 = load i32, i32* %6
store i32 %27, i32* %3
br label %72
28: ; preds = %15
%29 = load i32, i32* %6
%30 = load i32, i32* %7
%31 = add nsw i32 %30, %29
store i32 %31, i32* %7
%32 = load %struct.connstruct*, %struct.connstruct** %4
%33 = call i32 @CGI_get_mt7687ap_passwd(%struct.connstruct* %32)
%34 = load %struct.connstruct*, %struct.connstruct** %4
%35 = load i8*, i8** %5
%36 = call i32 @WEB_write_blk(%struct.connstruct* %34, i8* %35, i32 217, i32 48)
store i32 %36, i32* %6
%37 = load i32, i32* %6
%38 = icmp ne i32 %37, 48
br i1 %38, label %39, label %41
39: ; preds = %28
%40 = load i32, i32* %6
store i32 %40, i32* %3
br label %72
41: ; preds = %28
%42 = load i32, i32* %6
%43 = load i32, i32* %7
%44 = add nsw i32 %43, %42
store i32 %44, i32* %7
%45 = load %struct.connstruct*, %struct.connstruct** %4
%46 = call i32 @CGI_get_mt7687ap_ssid(%struct.connstruct* %45)
%47 = load %struct.connstruct*, %struct.connstruct** %4
%48 = load i8*, i8** %5
%49 = call i32 @WEB_write_blk(%struct.connstruct* %47, i8* %48, i32 265, i32 52)
store i32 %49, i32* %6
%50 = load i32, i32* %6
%51 = icmp ne i32 %50, 52
br i1 %51, label %52, label %54
52: ; preds = %41
%53 = load i32, i32* %6
store i32 %53, i32* %3
br label %72
54: ; preds = %41
%55 = load i32, i32* %6
%56 = load i32, i32* %7
%57 = add nsw i32 %56, %55
store i32 %57, i32* %7
%58 = load %struct.connstruct*, %struct.connstruct** %4
%59 = call i32 @CGI_get_mt7687ap_passwd(%struct.connstruct* %58)
%60 = load %struct.connstruct*, %struct.connstruct** %4
%61 = load i8*, i8** %5
%62 = call i32 @WEB_write_blk(%struct.connstruct* %60, i8* %61, i32 317, i32 1322)
store i32 %62, i32* %6
%63 = load i32, i32* %6
%64 = icmp ne i32 %63, 1322
br i1 %64, label %65, label %67
65: ; preds = %54
%66 = load i32, i32* %6
store i32 %66, i32* %3
br label %72
67: ; preds = %54
%68 = load i32, i32* %6
%69 = load i32, i32* %7
%70 = add nsw i32 %69, %68
store i32 %70, i32* %7
%71 = load i32, i32* %7
store i32 %71, i32* %3
br label %72
72: ; preds = %67, %65, %52, %39, %26, %13
%73 = load i32, i32* %3
ret i32 %73
}

LLVM IR (-O2):
%struct.connstruct = type { i32 }
define i32 @web__AP_html(%struct.connstruct* %0, i8* %1) {
%3 = tail call i32 @WEB_write_blk(%struct.connstruct* %0, i8* %1, i32 0, i32 166)
%4 = icmp eq i32 %3, 166
br i1 %4, label %5, label %22
5: ; preds = %2
%6 = tail call i32 @CGI_get_mt7687ap_ssid(%struct.connstruct* %0)
%7 = tail call i32 @WEB_write_blk(%struct.connstruct* %0, i8* %1, i32 166, i32 51)
%8 = icmp eq i32 %7, 51
br i1 %8, label %9, label %22
9: ; preds = %5
%10 = tail call i32 @CGI_get_mt7687ap_passwd(%struct.connstruct* %0)
%11 = tail call i32 @WEB_write_blk(%struct.connstruct* %0, i8* %1, i32 217, i32 48)
%12 = icmp eq i32 %11, 48
br i1 %12, label %13, label %22
13: ; preds = %9
%14 = tail call i32 @CGI_get_mt7687ap_ssid(%struct.connstruct* %0)
%15 = tail call i32 @WEB_write_blk(%struct.connstruct* %0, i8* %1, i32 265, i32 52)
%16 = icmp eq i32 %15, 52
br i1 %16, label %17, label %22
17: ; preds = %13
%18 = tail call i32 @CGI_get_mt7687ap_passwd(%struct.connstruct* %0)
%19 = tail call i32 @WEB_write_blk(%struct.connstruct* %0, i8* %1, i32 317, i32 1322)
%20 = icmp eq i32 %19, 1322
%21 = select i1 %20, i32 1639, i32 %19
br label %22
22: ; preds = %17, %13, %9, %5, %2
%23 = phi i32 [ %3, %2 ], [ %7, %5 ], [ %11, %9 ], [ %15, %13 ], [ %21, %17 ]
ret i32 %23
}