#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*/ printf(char *);
int sendATComm(char *, char *, char *, int);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ sprintf(char *, char *, ...);
int gsm_init() {
  char temp[150];
  sprintf(temp, "AT+CPIN=%d", 3103);
  if (sendATComm(temp, "OK", "ERROR", 3000) == 1) {
    while (sendATComm("AT+CREG?", "+CREG: 0,1", "+CREG: 0,5", 1000) == 0)
      ;
    if (sendATComm("AT+CIPMUX=0", "OK", "ERROR", 1000) == 1) {
      while (sendATComm("AT+CIPSTATUS", "INITIAL", "", 500) == 0)
        ;
      sleep(5);
      sprintf(temp, "AT+CSTT=\"%s\",\"\",\"\"", "internet");
      if (sendATComm(temp, "OK", "ERROR", 30000) == 1) {
        while (sendATComm("AT+CIPSTATUS", "START", "", 500) == 0)
          ;
        sleep(5);
        if (sendATComm("AT+CIICR", "OK", "ERROR", 30000) == 1) {
          while (sendATComm("AT+CIPSTATUS", "START", "", 500) == 0)
            ;
          sleep(5);
          if (sendATComm("AT+CIFSR", ".", "ERROR", 10000) == 1) {
            while (sendATComm("AT+CIPSTATUS", "START", "", 500) == 0)
              ;
            sleep(5);
            sprintf(temp, "AT+CIPSTART=\"TCP\",\"%s\",\"%d\"", "myserver.hu",
                    2015);
            if (sendATComm(temp, "CONNECT OK", "CONNECT FAIL", 30000) == 1) {
              printf("Connected\n");
              return 1;
            }
          }
        }
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<gsm_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
lea    -0xa0(%rbp),%rdi
lea    0xea7(%rip),%rsi
mov    $0xc1f,%edx
mov    $0x0,%al
call   1050 <sprintf@plt>
lea    -0xa0(%rbp),%rdi
lea    0xf44(%rip),%rsi
lea    0xe91(%rip),%rdx
mov    $0xbb8,%ecx
call   1040 <sendATComm@plt>
cmp    $0x1,%eax
jne    13e5 <gsm_init+0x2a5>
jmp    1192 <gsm_init+0x52>
lea    0xe78(%rip),%rdi
lea    0xe7a(%rip),%rsi
lea    0xe7e(%rip),%rdx
mov    $0x3e8,%ecx
call   1040 <sendATComm@plt>
cmp    $0x0,%eax
jne    11bf <gsm_init+0x7f>
jmp    1192 <gsm_init+0x52>
lea    0xe6a(%rip),%rdi
lea    0xeea(%rip),%rsi
lea    0xe37(%rip),%rdx
mov    $0x3e8,%ecx
call   1040 <sendATComm@plt>
cmp    $0x1,%eax
jne    13e0 <gsm_init+0x2a0>
jmp    11ec <gsm_init+0xac>
lea    0xe49(%rip),%rdi
lea    0xe4f(%rip),%rsi
lea    0xed0(%rip),%rdx
mov    $0x1f4,%ecx
call   1040 <sendATComm@plt>
cmp    $0x0,%eax
jne    1219 <gsm_init+0xd9>
jmp    11ec <gsm_init+0xac>
mov    $0x5,%edi
call   1060 <sleep@plt>
lea    -0xa0(%rbp),%rdi
lea    0xe20(%rip),%rsi
lea    0xe2c(%rip),%rdx
mov    $0x0,%al
call   1050 <sprintf@plt>
lea    -0xa0(%rbp),%rdi
lea    0xe6a(%rip),%rsi
lea    0xdb7(%rip),%rdx
mov    $0x7530,%ecx
call   1040 <sendATComm@plt>
cmp    $0x1,%eax
jne    13db <gsm_init+0x29b>
jmp    126c <gsm_init+0x12c>
lea    0xdc9(%rip),%rdi
lea    0xdf3(%rip),%rsi
lea    0xe50(%rip),%rdx
mov    $0x1f4,%ecx
call   1040 <sendATComm@plt>
cmp    $0x0,%eax
jne    1299 <gsm_init+0x159>
jmp    126c <gsm_init+0x12c>
mov    $0x5,%edi
call   1060 <sleep@plt>
lea    0xdc9(%rip),%rdi
lea    0xe06(%rip),%rsi
lea    0xd53(%rip),%rdx
mov    $0x7530,%ecx
call   1040 <sendATComm@plt>
cmp    $0x1,%eax
jne    13d6 <gsm_init+0x296>
jmp    12d0 <gsm_init+0x190>
lea    0xd65(%rip),%rdi
lea    0xd8f(%rip),%rsi
lea    0xdec(%rip),%rdx
mov    $0x1f4,%ecx
call   1040 <sendATComm@plt>
cmp    $0x0,%eax
jne    12fd <gsm_init+0x1bd>
jmp    12d0 <gsm_init+0x190>
mov    $0x5,%edi
call   1060 <sleep@plt>
lea    0xd6e(%rip),%rdi
lea    0xd70(%rip),%rsi
lea    0xcef(%rip),%rdx
mov    $0x2710,%ecx
call   1040 <sendATComm@plt>
cmp    $0x1,%eax
jne    13d1 <gsm_init+0x291>
jmp    1334 <gsm_init+0x1f4>
lea    0xd01(%rip),%rdi
lea    0xd2b(%rip),%rsi
lea    0xd88(%rip),%rdx
mov    $0x1f4,%ecx
call   1040 <sendATComm@plt>
cmp    $0x0,%eax
jne    1361 <gsm_init+0x221>
jmp    1334 <gsm_init+0x1f4>
mov    $0x5,%edi
call   1060 <sleep@plt>
lea    -0xa0(%rbp),%rdi
lea    0xd0e(%rip),%rsi
lea    0xd23(%rip),%rdx
mov    $0x7df,%ecx
mov    $0x0,%al
call   1050 <sprintf@plt>
lea    -0xa0(%rbp),%rdi
lea    0xd15(%rip),%rsi
lea    0xd19(%rip),%rdx
mov    $0x7530,%ecx
call   1040 <sendATComm@plt>
cmp    $0x1,%eax
jne    13cc <gsm_init+0x28c>
lea    0xd0c(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    13ec <gsm_init+0x2ac>
jmp    13d1 <gsm_init+0x291>
jmp    13d6 <gsm_init+0x296>
jmp    13db <gsm_init+0x29b>
jmp    13e0 <gsm_init+0x2a0>
jmp    13e5 <gsm_init+0x2a5>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsm_init>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x98,%rsp
lea    0xeac(%rip),%rsi
xor    %r14d,%r14d
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xc1f,%edx
xor    %eax,%eax
call   1050 <sprintf@plt>
lea    0xf47(%rip),%rsi
lea    0xe94(%rip),%rdx
mov    %rbx,%rdi
mov    $0xbb8,%ecx
call   1040 <sendATComm@plt>
cmp    $0x1,%eax
jne    13c6 <gsm_init+0x286>
lea    0xe7d(%rip),%r15
lea    0xe7f(%rip),%rbp
lea    0xe83(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
mov    $0x3e8,%ecx
call   1040 <sendATComm@plt>
test   %eax,%eax
je     11b0 <gsm_init+0x70>
lea    0xe62(%rip),%rdi
lea    0xee2(%rip),%rsi
lea    0xe2f(%rip),%rdx
mov    $0x3e8,%ecx
call   1040 <sendATComm@plt>
cmp    $0x1,%eax
jne    13c6 <gsm_init+0x286>
lea    0xe46(%rip),%r14
lea    0xe4c(%rip),%rbp
lea    0xe5f(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
mov    $0x1f4,%ecx
call   1040 <sendATComm@plt>
test   %eax,%eax
je     1210 <gsm_init+0xd0>
mov    $0x5,%edi
call   1060 <sleep@plt>
lea    0xe19(%rip),%rsi
lea    0xe25(%rip),%rdx
xor    %r14d,%r14d
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <sprintf@plt>
lea    0xe61(%rip),%rsi
lea    0xdae(%rip),%rdx
mov    %rbx,%rdi
mov    $0x7530,%ecx
call   1040 <sendATComm@plt>
cmp    $0x1,%eax
jne    13c6 <gsm_init+0x286>
lea    0xdc2(%rip),%r15
lea    0xdec(%rip),%rbp
lea    0xddb(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
mov    $0x1f4,%ecx
call   1040 <sendATComm@plt>
test   %eax,%eax
je     1290 <gsm_init+0x150>
mov    $0x5,%edi
call   1060 <sleep@plt>
lea    0xdbb(%rip),%rdi
lea    0xdf8(%rip),%rsi
lea    0xd45(%rip),%rdx
mov    $0x7530,%ecx
call   1040 <sendATComm@plt>
cmp    $0x1,%eax
jne    13c6 <gsm_init+0x286>
lea    0xd5c(%rip),%r15
lea    0xd86(%rip),%rbp
lea    0xd75(%rip),%rbx
xchg   %ax,%ax
mov    %r15,%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
mov    $0x1f4,%ecx
call   1040 <sendATComm@plt>
test   %eax,%eax
je     12f0 <gsm_init+0x1b0>
mov    $0x5,%edi
call   1060 <sleep@plt>
lea    0xd64(%rip),%rdi
lea    0xd66(%rip),%rsi
lea    0xce5(%rip),%rdx
mov    $0x2710,%ecx
call   1040 <sendATComm@plt>
cmp    $0x1,%eax
jne    13c6 <gsm_init+0x286>
lea    0xcfc(%rip),%r14
lea    0xd26(%rip),%rbp
lea    0xd15(%rip),%rbx
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
mov    $0x1f4,%ecx
call   1040 <sendATComm@plt>
test   %eax,%eax
je     1350 <gsm_init+0x210>
mov    $0x5,%edi
call   1060 <sleep@plt>
lea    0xd0f(%rip),%rsi
lea    0xd24(%rip),%rdx
xor    %r14d,%r14d
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x7df,%ecx
xor    %eax,%eax
call   1050 <sprintf@plt>
lea    0xd14(%rip),%rsi
lea    0xd18(%rip),%rdx
mov    %rbx,%rdi
mov    $0x7530,%ecx
call   1040 <sendATComm@plt>
cmp    $0x1,%eax
jne    13c6 <gsm_init+0x286>
lea    0xd0c(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%r14d
mov    %r14d,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"AT+CPIN=%d\00"
@.str.1 = [3 x i8] c"OK\00"
@.str.2 = [6 x i8] c"ERROR\00"
@.str.3 = [9 x i8] c"AT+CREG?\00"
@.str.4 = [11 x i8] c"+CREG: 0,1\00"
@.str.5 = [11 x i8] c"+CREG: 0,5\00"
@.str.6 = [12 x i8] c"AT+CIPMUX=0\00"
@.str.7 = [13 x i8] c"AT+CIPSTATUS\00"
@.str.8 = [8 x i8] c"INITIAL\00"
@.str.9 = [1 x i8] zeroinitializer
@.str.10 = [19 x i8] c"AT+CSTT=\22%s\22,\22\22,\22\22\00"
@.str.11 = [9 x i8] c"internet\00"
@.str.12 = [6 x i8] c"START\00"
@.str.13 = [9 x i8] c"AT+CIICR\00"
@.str.14 = [9 x i8] c"AT+CIFSR\00"
@.str.15 = [2 x i8] c".\00"
@.str.16 = [28 x i8] c"AT+CIPSTART=\22TCP\22,\22%s\22,\22%d\22\00"
@.str.17 = [12 x i8] c"myserver.hu\00"
@.str.18 = [11 x i8] c"CONNECT OK\00"
@.str.19 = [13 x i8] c"CONNECT FAIL\00"
@.str.20 = [11 x i8] c"Connected\0A\00"
define i32 @gsm_init() {
%1 = alloca i32
%2 = alloca [150 x i8]
%3 = getelementptr inbounds [150 x i8], [150 x i8]* %2, i64 0, i64 0
%4 = call i32 (i8*, i8*, ...) @sprintf(i8* %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 3103)
%5 = getelementptr inbounds [150 x i8], [150 x i8]* %2, i64 0, i64 0
%6 = call i32 @sendATComm(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 3000)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %65
8: ; preds = %0
br label %9
9: ; preds = %12, %8
%10 = call i32 @sendATComm(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i32 1000)
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9
br label %9
13: ; preds = %9
%14 = call i32 @sendATComm(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 1000)
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %64
16: ; preds = %13
br label %17
17: ; preds = %20, %16
%18 = call i32 @sendATComm(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.9, i64 0, i64 0), i32 500)
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %17
br label %17
21: ; preds = %17
%22 = call i32 @sleep(i32 5)
%23 = getelementptr inbounds [150 x i8], [150 x i8]* %2, i64 0, i64 0
%24 = call i32 (i8*, i8*, ...) @sprintf(i8* %23, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0))
%25 = getelementptr inbounds [150 x i8], [150 x i8]* %2, i64 0, i64 0
%26 = call i32 @sendATComm(i8* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 30000)
%27 = icmp eq i32 %26, 1
br i1 %27, label %28, label %63
28: ; preds = %21
br label %29
29: ; preds = %32, %28
%30 = call i32 @sendATComm(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.9, i64 0, i64 0), i32 500)
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %33
32: ; preds = %29
br label %29
33: ; preds = %29
%34 = call i32 @sleep(i32 5)
%35 = call i32 @sendATComm(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 30000)
%36 = icmp eq i32 %35, 1
br i1 %36, label %37, label %62
37: ; preds = %33
br label %38
38: ; preds = %41, %37
%39 = call i32 @sendATComm(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.9, i64 0, i64 0), i32 500)
%40 = icmp eq i32 %39, 0
br i1 %40, label %41, label %42
41: ; preds = %38
br label %38
42: ; preds = %38
%43 = call i32 @sleep(i32 5)
%44 = call i32 @sendATComm(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 10000)
%45 = icmp eq i32 %44, 1
br i1 %45, label %46, label %61
46: ; preds = %42
br label %47
47: ; preds = %50, %46
%48 = call i32 @sendATComm(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.9, i64 0, i64 0), i32 500)
%49 = icmp eq i32 %48, 0
br i1 %49, label %50, label %51
50: ; preds = %47
br label %47
51: ; preds = %47
%52 = call i32 @sleep(i32 5)
%53 = getelementptr inbounds [150 x i8], [150 x i8]* %2, i64 0, i64 0
%54 = call i32 (i8*, i8*, ...) @sprintf(i8* %53, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.17, i64 0, i64 0), i32 2015)
%55 = getelementptr inbounds [150 x i8], [150 x i8]* %2, i64 0, i64 0
%56 = call i32 @sendATComm(i8* %55, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.19, i64 0, i64 0), i32 30000)
%57 = icmp eq i32 %56, 1
br i1 %57, label %58, label %60
58: ; preds = %51
%59 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.20, i64 0, i64 0))
store i32 1, i32* %1
br label %66
60: ; preds = %51
br label %61
61: ; preds = %60, %42
br label %62
62: ; preds = %61, %33
br label %63
63: ; preds = %62, %21
br label %64
64: ; preds = %63, %13
br label %65
65: ; preds = %64, %0
store i32 0, i32* %1
br label %66
66: ; preds = %65, %58
%67 = load i32, i32* %1
ret i32 %67
}

LLVM IR (-O2):
@.str = [11 x i8] c"AT+CPIN=%d\00"
@.str.1 = [3 x i8] c"OK\00"
@.str.2 = [6 x i8] c"ERROR\00"
@.str.3 = [9 x i8] c"AT+CREG?\00"
@.str.4 = [11 x i8] c"+CREG: 0,1\00"
@.str.5 = [11 x i8] c"+CREG: 0,5\00"
@.str.6 = [12 x i8] c"AT+CIPMUX=0\00"
@.str.7 = [13 x i8] c"AT+CIPSTATUS\00"
@.str.8 = [8 x i8] c"INITIAL\00"
@.str.9 = [1 x i8] zeroinitializer
@.str.10 = [19 x i8] c"AT+CSTT=\22%s\22,\22\22,\22\22\00"
@.str.11 = [9 x i8] c"internet\00"
@.str.12 = [6 x i8] c"START\00"
@.str.13 = [9 x i8] c"AT+CIICR\00"
@.str.14 = [9 x i8] c"AT+CIFSR\00"
@.str.15 = [2 x i8] c".\00"
@.str.16 = [28 x i8] c"AT+CIPSTART=\22TCP\22,\22%s\22,\22%d\22\00"
@.str.17 = [12 x i8] c"myserver.hu\00"
@.str.18 = [11 x i8] c"CONNECT OK\00"
@.str.19 = [13 x i8] c"CONNECT FAIL\00"
@str = [10 x i8] c"Connected\00"
define i32 @gsm_init() {
%1 = alloca [150 x i8]
%2 = getelementptr inbounds [150 x i8], [150 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 3103)
%4 = call i32 @sendATComm(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 3000)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %44
6: ; preds = %0, %6
%7 = call i32 @sendATComm(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i32 1000)
%8 = icmp eq i32 %7, 0
br i1 %8, label %6, label %9
9: ; preds = %6
%10 = call i32 @sendATComm(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 1000)
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %44
12: ; preds = %9, %12
%13 = call i32 @sendATComm(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.9, i64 0, i64 0), i32 500)
%14 = icmp eq i32 %13, 0
br i1 %14, label %12, label %15
15: ; preds = %12
%16 = call i32 @sleep(i32 5)
%17 = call i32 (i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0))
%18 = call i32 @sendATComm(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 30000)
%19 = icmp eq i32 %18, 1
br i1 %19, label %20, label %44
20: ; preds = %15, %20
%21 = call i32 @sendATComm(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.9, i64 0, i64 0), i32 500)
%22 = icmp eq i32 %21, 0
br i1 %22, label %20, label %23
23: ; preds = %20
%24 = call i32 @sleep(i32 5)
%25 = call i32 @sendATComm(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 30000)
%26 = icmp eq i32 %25, 1
br i1 %26, label %27, label %44
27: ; preds = %23, %27
%28 = call i32 @sendATComm(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.9, i64 0, i64 0), i32 500)
%29 = icmp eq i32 %28, 0
br i1 %29, label %27, label %30
30: ; preds = %27
%31 = call i32 @sleep(i32 5)
%32 = call i32 @sendATComm(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 10000)
%33 = icmp eq i32 %32, 1
br i1 %33, label %34, label %44
34: ; preds = %30, %34
%35 = call i32 @sendATComm(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.9, i64 0, i64 0), i32 500)
%36 = icmp eq i32 %35, 0
br i1 %36, label %34, label %37
37: ; preds = %34
%38 = call i32 @sleep(i32 5)
%39 = call i32 (i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.17, i64 0, i64 0), i32 2015)
%40 = call i32 @sendATComm(i8* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.19, i64 0, i64 0), i32 30000)
%41 = icmp eq i32 %40, 1
br i1 %41, label %42, label %44
42: ; preds = %37
%43 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
br label %44
44: ; preds = %0, %15, %30, %37, %23, %9, %42
%45 = phi i32 [ 1, %42 ], [ 0, %9 ], [ 0, %23 ], [ 0, %37 ], [ 0, %30 ], [ 0, %15 ], [ 0, %0 ]
ret i32 %45
}