unsigned char esp8266_connect(unsigned char *ssid, unsigned char *pass) {
  _esp8266_print("AT+CWJAP=\"");
  _esp8266_print(ssid);
  _esp8266_print("\",\"");
  _esp8266_print(pass);
  _esp8266_print("\"\r\n");
  return _esp8266_waitResponse();
}


x86 assembly (clang, -O0):
<esp8266_connect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1040 <_esp8266_print@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <_esp8266_print@plt>
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1040 <_esp8266_print@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <_esp8266_print@plt>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1040 <_esp8266_print@plt>
mov    $0x0,%al
call   1030 <_esp8266_waitResponse@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<esp8266_connect>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
xor    %eax,%eax
call   1040 <_esp8266_print@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <_esp8266_print@plt>
lea    0xec2(%rip),%rdi
xor    %eax,%eax
call   1040 <_esp8266_print@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <_esp8266_print@plt>
lea    0xeae(%rip),%rdi
xor    %eax,%eax
call   1040 <_esp8266_print@plt>
xor    %eax,%eax
call   1030 <_esp8266_waitResponse@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [11 x i8] c"AT+CWJAP=\22\00"
@.str.1 = [4 x i8] c"\22,\22\00"
@.str.2 = [4 x i8] c"\22\0D\0A\00"
define zeroext i8 @esp8266_connect(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @_esp8266_print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %3
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @_esp8266_print to i32 (i8*, ...)*)(i8* %6)
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @_esp8266_print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%9 = load i8*, i8** %4
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @_esp8266_print to i32 (i8*, ...)*)(i8* %9)
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @_esp8266_print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 (...) @_esp8266_waitResponse()
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
@.str = [11 x i8] c"AT+CWJAP=\22\00"
@.str.1 = [4 x i8] c"\22,\22\00"
@.str.2 = [4 x i8] c"\22\0D\0A\00"
define zeroext i8 @esp8266_connect(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @_esp8266_print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @_esp8266_print to i32 (i8*, ...)*)(i8* %0)
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @_esp8266_print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @_esp8266_print to i32 (i8*, ...)*)(i8* %1)
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @_esp8266_print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 (...) @_esp8266_waitResponse()
%9 = trunc i32 %8 to i8
ret i8 %9
}