#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*/ LED(int /*<<< orphan*/, int, int, int);
char is_sensor(char *);
char *server(int, char *, char *, char *, char *, char *, char *, char *, int);
int main(int arrgc, char *argv[]) {
  char *str1, a[5];
  int i = 1000;
  while (1) {
    str1 = server(80, "42.96.164.52", "api.yeelink.net",
                  "31054cd8bd56c3f756544c3daed9793e", "14565", "25008", "GET",
                  "", 1);
    a[0] = is_sensor(str1);
    (int)a;
    a[1] = a[0] - 48;
    if (a[1] == 0)
      LED(0, 1, 1, 0);
    else
      LED(0, 1, 1, 1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x3e8,-0x24(%rbp)
mov    $0x50,%edi
lea    0xea7(%rip),%rsi
lea    0xead(%rip),%rdx
lea    0xeb6(%rip),%rcx
lea    0xed0(%rip),%r8
lea    0xecf(%rip),%r9
lea    0xece(%rip),%r10
lea    0xe89(%rip),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
movl   $0x1,0x10(%rsp)
call   1040 <server@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <is_sensor@plt>
mov    %al,-0x1d(%rbp)
movsbl -0x1d(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x1c(%rbp)
movsbl -0x1c(%rbp),%eax
cmp    $0x0,%eax
jne    11d5 <main+0xa5>
xor    %ecx,%ecx
mov    $0x1,%edx
mov    %ecx,%edi
mov    %edx,%esi
call   1050 <LED@plt>
jmp    11e5 <main+0xb5>
xor    %edi,%edi
mov    $0x1,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1050 <LED@plt>
jmp    114d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xf08(%rip),%rbp
lea    0xeb7(%rip),%r14
lea    0xebd(%rip),%r15
lea    0xec6(%rip),%r12
lea    0xee0(%rip),%r13
lea    0xedf(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
sub    $0x8,%rsp
mov    $0x50,%edi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
mov    %r13,%r8
mov    %rbx,%r9
push   $0x1
lea    0xe7b(%rip),%rax
push   %rax
push   %rbp
call   1040 <server@plt>
add    $0x20,%rsp
mov    %rax,%rdi
call   1030 <is_sensor@plt>
xor    %ecx,%ecx
cmp    $0x30,%al
setne  %cl
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%edx
call   1050 <LED@plt>
jmp    1170 <main+0x40>

LLVM IR (-O0):
@.str = [13 x i8] c"42.96.164.52\00"
@.str.1 = [16 x i8] c"api.yeelink.net\00"
@.str.2 = [33 x i8] c"31054cd8bd56c3f756544c3daed9793e\00"
@.str.3 = [6 x i8] c"14565\00"
@.str.4 = [6 x i8] c"25008\00"
@.str.5 = [4 x i8] c"GET\00"
@.str.6 = [1 x i8] zeroinitializer
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca [5 x i8]
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1000, i32* %8
br label %9
9: ; preds = %2, %30
%10 = call i8* @server(i32 80, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.6, i64 0, i64 0), i32 1)
store i8* %10, i8** %6
%11 = load i8*, i8** %6
%12 = call signext i8 @is_sensor(i8* %11)
%13 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
store i8 %12, i8* %13
%14 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%15 = ptrtoint i8* %14 to i32
%16 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = sub nsw i32 %18, 48
%20 = trunc i32 %19 to i8
%21 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 1
store i8 %20, i8* %21
%22 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 1
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %9
%27 = call i32 @LED(i32 0, i32 1, i32 1, i32 0)
br label %30
28: ; preds = %9
%29 = call i32 @LED(i32 0, i32 1, i32 1, i32 1)
br label %30
30: ; preds = %28, %26
br label %9
}

LLVM IR (-O2):
@.str = [13 x i8] c"42.96.164.52\00"
@.str.1 = [16 x i8] c"api.yeelink.net\00"
@.str.2 = [33 x i8] c"31054cd8bd56c3f756544c3daed9793e\00"
@.str.3 = [6 x i8] c"14565\00"
@.str.4 = [6 x i8] c"25008\00"
@.str.5 = [4 x i8] c"GET\00"
@.str.6 = [1 x i8] zeroinitializer
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i8* @server(i32 80, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.6, i64 0, i64 0), i32 1)
%5 = tail call signext i8 @is_sensor(i8* %4)
%6 = icmp ne i8 %5, 48
%7 = zext i1 %6 to i32
%8 = tail call i32 @LED(i32 0, i32 1, i32 1, i32 %7)
br label %3
}