#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*/ fprintf(int /*<<< orphan*/, char *, char);
int getopt(int, char **, char *);
int /*<<< orphan*/ isprint(char);
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(char *, int, int);
char *optarg;
char optopt;
int /*<<< orphan*/ printf(char *, char *, char *);
int sendsms(char *, char *, char *, int, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcat(char *, char *);
scalar_t__ strlen(char *);
int /*<<< orphan*/ usage(char *);
int main(int argc, char *argv[]) {
  int err = 0;
  int retval, c, checksent = 0;
  char *serveraddr, *port, *gsmnumber, *gsmtext, *errstr;
  serveraddr = (char *)malloc(40);
  memset(serveraddr, 0x0, 40);
  gsmnumber = (char *)malloc(40);
  memset(gsmnumber, 0x0, 40);
  gsmtext = (char *)malloc(40);
  memset(gsmtext, 0x0, 40);
  errstr = (char *)malloc(1000);
  memset(errstr, 0x0, 1000);
  if (argc < 4) {
    usage(argv[0]);
    return -1;
  }
  while ((c = getopt(argc, argv, "chs:b:t:p:")) != -1)
    switch (c) {
    case 'c':
      checksent = 1;
      break;
    case 's':
      serveraddr = optarg;
      break;
    case 'b':
      gsmnumber = optarg;
      break;
    case 't':
      gsmtext = optarg;
      break;
    case 'p':
      port = optarg;
      break;
    case '?':
      if (optopt == 's' || optopt == 'b' || optopt == 't')
        fprintf(stderr, "Option -%c requires an argument.\n", optopt);
      else if (isprint(optopt))
        fprintf(stderr, "Unknown option `-%c'.\n", optopt);
      else
        fprintf(stderr, "Unknown option character `\\x%x'.\n", optopt);
      return 1;
    case 'h':
      usage(argv[0]);
      return 0;
      break;
    default:
      return -1;
    }
  if (strlen(serveraddr) == 0) {
    strcat(errstr, "Server address/name must be specified\n");
    err = 1;
  }
  if (strlen(gsmnumber) == 0) {
    strcat(errstr, "Number to send must be specified\n");
    err = 1;
  }
  if (strlen(gsmtext) == 0) {
    strcat(errstr, "Text to send must be specified\n");
    err = 1;
  }
  if (err == 1) {
    printf("Errors detected:\n%s\nType \"%s -h\" for help\n", errstr, argv[0]);
    return -1;
  }
  if (checksent == 1) {
  }
  retval = sendsms(serveraddr, gsmnumber, gsmtext, checksent, port);
  return retval;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x20(%rbp)
mov    $0x28,%edi
call   1080 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1060 <memset@plt>
mov    $0x28,%edi
call   1080 <malloc@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1060 <memset@plt>
mov    $0x28,%edi
call   1080 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1060 <memset@plt>
mov    $0x3e8,%edi
call   1080 <malloc@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   1060 <memset@plt>
cmpl   $0x4,-0x8(%rbp)
jge    125e <main+0xbe>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1090 <usage@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14d0 <main+0x330>
jmp    1263 <main+0xc3>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe67(%rip),%rdx
call   10b0 <getopt@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0xffffffff,%eax
je     13f5 <main+0x255>
mov    -0x1c(%rbp),%eax
add    $0xffffffc1,%eax
mov    %eax,%ecx
mov    %rcx,-0x50(%rbp)
sub    $0x35,%eax
ja     13e4 <main+0x244>
mov    -0x50(%rbp),%rax
lea    0xd5e(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x20(%rbp)
jmp    13f0 <main+0x250>
mov    0x2d3a(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
jmp    13f0 <main+0x250>
mov    0x2d27(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
jmp    13f0 <main+0x250>
mov    0x2d14(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x40(%rbp)
jmp    13f0 <main+0x250>
mov    0x2d01(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
jmp    13f0 <main+0x250>
mov    0x2cd6(%rip),%rax
movsbl (%rax),%eax
cmp    $0x73,%eax
je     133c <main+0x19c>
mov    0x2cc3(%rip),%rax
movsbl (%rax),%eax
cmp    $0x62,%eax
je     133c <main+0x19c>
mov    0x2cb0(%rip),%rax
movsbl (%rax),%eax
cmp    $0x74,%eax
jne    1360 <main+0x1c0>
mov    0x2c8d(%rip),%rax
mov    (%rax),%edi
lea    0xd97(%rip),%rsi
mov    0x2c8d(%rip),%rax
movsbl (%rax),%edx
call   1070 <fprintf@plt>
jmp    13c0 <main+0x220>
mov    0x2c79(%rip),%rax
movsbl (%rax),%edi
call   10a0 <isprint@plt>
cmp    $0x0,%eax
je     139c <main+0x1fc>
mov    0x2c51(%rip),%rax
mov    (%rax),%edi
lea    0xd7d(%rip),%rsi
mov    0x2c51(%rip),%rax
movsbl (%rax),%edx
call   1070 <fprintf@plt>
jmp    13bb <main+0x21b>
mov    0x2c2d(%rip),%rax
mov    (%rax),%edi
lea    0xd70(%rip),%rsi
mov    0x2c2d(%rip),%rax
movsbl (%rax),%edx
call   1070 <fprintf@plt>
jmp    13c0 <main+0x220>
movl   $0x1,-0x4(%rbp)
jmp    14d0 <main+0x330>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1090 <usage@plt>
movl   $0x0,-0x4(%rbp)
jmp    14d0 <main+0x330>
movl   $0xffffffff,-0x4(%rbp)
jmp    14d0 <main+0x330>
jmp    1263 <main+0xc3>
mov    -0x28(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
jne    141f <main+0x27f>
mov    -0x48(%rbp),%rdi
lea    0xd2b(%rip),%rsi
call   10c0 <strcat@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x38(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
jne    1449 <main+0x2a9>
mov    -0x48(%rbp),%rdi
lea    0xd28(%rip),%rsi
call   10c0 <strcat@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x40(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
jne    1473 <main+0x2d3>
mov    -0x48(%rbp),%rdi
lea    0xd20(%rip),%rsi
call   10c0 <strcat@plt>
movl   $0x1,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    14a0 <main+0x300>
mov    -0x48(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xd18(%rip),%rdi
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14d0 <main+0x330>
cmpl   $0x1,-0x20(%rbp)
jne    14af <main+0x30f>
jmp    14af <main+0x30f>
mov    -0x28(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0x20(%rbp),%ecx
mov    -0x30(%rbp),%r8
call   1030 <sendsms@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r13
mov    %edi,%r14d
mov    $0x28,%edi
call   1070 <malloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1050 <memset@plt>
mov    $0x28,%edi
call   1070 <malloc@plt>
mov    %rax,%rbp
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1050 <memset@plt>
mov    $0x28,%edi
call   1070 <malloc@plt>
mov    %rax,%r12
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1050 <memset@plt>
mov    $0x3e8,%edi
call   1070 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   1050 <memset@plt>
cmp    $0x4,%r14d
jge    1237 <main+0xa7>
mov    0x0(%r13),%rdi
call   1080 <usage@plt>
mov    $0xffffffff,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rbx,0x20(%rsp)
mov    %rbp,0x10(%rsp)
mov    %r15,0x8(%rsp)
movl   $0x0,0x4(%rsp)
lea    0xe7f(%rip),%r15
mov    0x2d9c(%rip),%rbp
lea    0xd9d(%rip),%rbx
jmp    1274 <main+0xe4>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x0(%rbp),%r12
mov    %r14d,%edi
mov    %r13,%rsi
mov    %r15,%rdx
call   10a0 <getopt@plt>
cmp    $0x74,%eax
je     1270 <main+0xe0>
lea    -0x3f(%rax),%ecx
cmp    $0x34,%ecx
ja     12c6 <main+0x136>
mov    %rbx,%rdx
movslq (%rbx,%rcx,4),%rax
add    %rbx,%rax
jmp    *%rax
mov    0x0(%rbp),%rax
mov    %rax,0x10(%rsp)
jmp    1274 <main+0xe4>
movl   $0x1,0x4(%rsp)
jmp    1274 <main+0xe4>
mov    0x0(%rbp),%rax
mov    %rax,0x18(%rsp)
jmp    1274 <main+0xe4>
mov    0x0(%rbp),%rax
mov    %rax,0x8(%rsp)
jmp    1274 <main+0xe4>
cmp    $0xffffffff,%eax
jne    1223 <main+0x93>
mov    0x8(%rsp),%rbx
mov    (%rbx),%r14b
test   %r14b,%r14b
mov    0x20(%rsp),%rbp
jne    12f0 <main+0x160>
lea    0xe52(%rip),%rsi
mov    %rbp,%rdi
call   10b0 <strcat@plt>
mov    0x10(%rsp),%rsi
cmpb   $0x0,(%rsi)
mov    0x4(%rsp),%ecx
mov    0x18(%rsp),%r8
je     1381 <main+0x1f1>
cmpb   $0x0,(%r12)
je     1397 <main+0x207>
test   %r14b,%r14b
je     13a6 <main+0x216>
mov    %rbx,%rdi
mov    %r12,%rdx
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <sendsms@plt>
mov    0x2ca9(%rip),%rbx
mov    (%rbx),%al
lea    -0x62(%rax),%ecx
cmp    $0x12,%cl
ja     13be <main+0x22e>
movzbl %cl,%ecx
mov    $0x60001,%edx
bt     %rcx,%rdx
jae    13be <main+0x22e>
mov    0x2c7a(%rip),%rcx
mov    (%rcx),%edi
movsbl %al,%edx
lea    0xd7d(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x1,%eax
jmp    1228 <main+0x98>
mov    0x0(%r13),%rdi
call   1080 <usage@plt>
xor    %eax,%eax
jmp    1228 <main+0x98>
lea    0xdd9(%rip),%rsi
mov    %rbp,%rdi
call   10b0 <strcat@plt>
cmpb   $0x0,(%r12)
jne    13a6 <main+0x216>
lea    0xde5(%rip),%rsi
mov    %rbp,%rdi
call   10b0 <strcat@plt>
mov    0x0(%r13),%rdx
lea    0xdf2(%rip),%rdi
mov    %rbp,%rsi
call   1040 <printf@plt>
jmp    1223 <main+0x93>
movsbl %al,%edi
call   1090 <isprint@plt>
mov    0x2c03(%rip),%rcx
mov    (%rcx),%edi
mov    (%rbx),%cl
movsbl %cl,%edx
test   %eax,%eax
je     13e1 <main+0x251>
lea    0xd22(%rip),%rsi
jmp    1362 <main+0x1d2>
lea    0xd30(%rip),%rsi
jmp    1362 <main+0x1d2>

LLVM IR (-O0):
@.str = [11 x i8] c"chs:b:t:p:\00"
@optarg = global i8* null
@optopt = global i8 0
@stderr = global i32 0
@.str.1 = [34 x i8] c"Option -%c requires an argument.\0A\00"
@.str.2 = [23 x i8] c"Unknown option `-%c'.\0A\00"
@.str.3 = [34 x i8] c"Unknown option character `\\x%x'.\0A\00"
@.str.4 = [39 x i8] c"Server address/name must be specified\0A\00"
@.str.5 = [34 x i8] c"Number to send must be specified\0A\00"
@.str.6 = [32 x i8] c"Text to send must be specified\0A\00"
@.str.7 = [43 x i8] c"Errors detected:\0A%s\0AType \22%s -h\22 for help\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %9
%15 = call i64 @malloc(i32 40)
%16 = inttoptr i64 %15 to i8*
store i8* %16, i8** %10
%17 = load i8*, i8** %10
%18 = call i32 @memset(i8* %17, i32 0, i32 40)
%19 = call i64 @malloc(i32 40)
%20 = inttoptr i64 %19 to i8*
store i8* %20, i8** %12
%21 = load i8*, i8** %12
%22 = call i32 @memset(i8* %21, i32 0, i32 40)
%23 = call i64 @malloc(i32 40)
%24 = inttoptr i64 %23 to i8*
store i8* %24, i8** %13
%25 = load i8*, i8** %13
%26 = call i32 @memset(i8* %25, i32 0, i32 40)
%27 = call i64 @malloc(i32 1000)
%28 = inttoptr i64 %27 to i8*
store i8* %28, i8** %14
%29 = load i8*, i8** %14
%30 = call i32 @memset(i8* %29, i32 0, i32 1000)
%31 = load i32, i32* %4
%32 = icmp slt i32 %31, 4
br i1 %32, label %33, label %38
33: ; preds = %2
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 0
%36 = load i8*, i8** %35
%37 = call i32 @usage(i8* %36)
store i32 -1, i32* %3
br label %134
38: ; preds = %2
br label %39
39: ; preds = %91, %38
%40 = load i32, i32* %4
%41 = load i8**, i8*** %5
%42 = call i32 @getopt(i32 %40, i8** %41, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i32 %42, i32* %8
%43 = icmp ne i32 %42, -1
br i1 %43, label %44, label %92
44: ; preds = %39
%45 = load i32, i32* %8
switch i32 %45, label %90 [
i32 99, label %46
i32 115, label %47
i32 98, label %49
i32 116, label %51
i32 112, label %53
i32 63, label %55
i32 104, label %85
]
46: ; preds = %44
store i32 1, i32* %9
br label %91
47: ; preds = %44
%48 = load i8*, i8** @optarg
store i8* %48, i8** %10
br label %91
49: ; preds = %44
%50 = load i8*, i8** @optarg
store i8* %50, i8** %12
br label %91
51: ; preds = %44
%52 = load i8*, i8** @optarg
store i8* %52, i8** %13
br label %91
53: ; preds = %44
%54 = load i8*, i8** @optarg
store i8* %54, i8** %11
br label %91
55: ; preds = %44
%56 = load i8, i8* @optopt
%57 = sext i8 %56 to i32
%58 = icmp eq i32 %57, 115
br i1 %58, label %67, label %59
59: ; preds = %55
%60 = load i8, i8* @optopt
%61 = sext i8 %60 to i32
%62 = icmp eq i32 %61, 98
br i1 %62, label %67, label %63
63: ; preds = %59
%64 = load i8, i8* @optopt
%65 = sext i8 %64 to i32
%66 = icmp eq i32 %65, 116
br i1 %66, label %67, label %71
67: ; preds = %63, %59, %55
%68 = load i32, i32* @stderr
%69 = load i8, i8* @optopt
%70 = call i32 @fprintf(i32 %68, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8 signext %69)
br label %84
71: ; preds = %63
%72 = load i8, i8* @optopt
%73 = call i32 @isprint(i8 signext %72)
%74 = icmp ne i32 %73, 0
br i1 %74, label %75, label %79
75: ; preds = %71
%76 = load i32, i32* @stderr
%77 = load i8, i8* @optopt
%78 = call i32 @fprintf(i32 %76, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8 signext %77)
br label %83
79: ; preds = %71
%80 = load i32, i32* @stderr
%81 = load i8, i8* @optopt
%82 = call i32 @fprintf(i32 %80, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i8 signext %81)
br label %83
83: ; preds = %79, %75
br label %84
84: ; preds = %83, %67
store i32 1, i32* %3
br label %134
85: ; preds = %44
%86 = load i8**, i8*** %5
%87 = getelementptr inbounds i8*, i8** %86, i64 0
%88 = load i8*, i8** %87
%89 = call i32 @usage(i8* %88)
store i32 0, i32* %3
br label %134
90: ; preds = %44
store i32 -1, i32* %3
br label %134
91: ; preds = %53, %51, %49, %47, %46
br label %39
92: ; preds = %39
%93 = load i8*, i8** %10
%94 = call i64 @strlen(i8* %93)
%95 = icmp eq i64 %94, 0
br i1 %95, label %96, label %99
96: ; preds = %92
%97 = load i8*, i8** %14
%98 = call i32 @strcat(i8* %97, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %6
br label %99
99: ; preds = %96, %92
%100 = load i8*, i8** %12
%101 = call i64 @strlen(i8* %100)
%102 = icmp eq i64 %101, 0
br i1 %102, label %103, label %106
103: ; preds = %99
%104 = load i8*, i8** %14
%105 = call i32 @strcat(i8* %104, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %6
br label %106
106: ; preds = %103, %99
%107 = load i8*, i8** %13
%108 = call i64 @strlen(i8* %107)
%109 = icmp eq i64 %108, 0
br i1 %109, label %110, label %113
110: ; preds = %106
%111 = load i8*, i8** %14
%112 = call i32 @strcat(i8* %111, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %6
br label %113
113: ; preds = %110, %106
%114 = load i32, i32* %6
%115 = icmp eq i32 %114, 1
br i1 %115, label %116, label %122
116: ; preds = %113
%117 = load i8*, i8** %14
%118 = load i8**, i8*** %5
%119 = getelementptr inbounds i8*, i8** %118, i64 0
%120 = load i8*, i8** %119
%121 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0), i8* %117, i8* %120)
store i32 -1, i32* %3
br label %134
122: ; preds = %113
%123 = load i32, i32* %9
%124 = icmp eq i32 %123, 1
br i1 %124, label %125, label %126
125: ; preds = %122
br label %126
126: ; preds = %125, %122
%127 = load i8*, i8** %10
%128 = load i8*, i8** %12
%129 = load i8*, i8** %13
%130 = load i32, i32* %9
%131 = load i8*, i8** %11
%132 = call i32 @sendsms(i8* %127, i8* %128, i8* %129, i32 %130, i8* %131)
store i32 %132, i32* %7
%133 = load i32, i32* %7
store i32 %133, i32* %3
br label %134
134: ; preds = %126, %116, %90, %85, %84, %33
%135 = load i32, i32* %3
ret i32 %135
}

LLVM IR (-O2):
@.str = [11 x i8] c"chs:b:t:p:\00"
@optarg = global i8* null
@optopt = global i8 0
@stderr = global i32 0
@.str.1 = [34 x i8] c"Option -%c requires an argument.\0A\00"
@.str.2 = [23 x i8] c"Unknown option `-%c'.\0A\00"
@.str.3 = [34 x i8] c"Unknown option character `\\x%x'.\0A\00"
@.str.4 = [39 x i8] c"Server address/name must be specified\0A\00"
@.str.5 = [34 x i8] c"Number to send must be specified\0A\00"
@.str.6 = [32 x i8] c"Text to send must be specified\0A\00"
@.str.7 = [43 x i8] c"Errors detected:\0A%s\0AType \22%s -h\22 for help\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i64 @malloc(i32 40)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @memset(i8* %4, i32 0, i32 40)
%6 = tail call i64 @malloc(i32 40)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @memset(i8* %7, i32 0, i32 40)
%9 = tail call i64 @malloc(i32 40)
%10 = inttoptr i64 %9 to i8*
%11 = tail call i32 @memset(i8* %10, i32 0, i32 40)
%12 = tail call i64 @malloc(i32 1000)
%13 = inttoptr i64 %12 to i8*
%14 = tail call i32 @memset(i8* %13, i32 0, i32 1000)
%15 = icmp slt i32 %0, 4
br i1 %15, label %16, label %22
16: ; preds = %2
%17 = load i8*, i8** %1
%18 = tail call i32 @usage(i8* %17)
br label %88
19: ; preds = %41, %44
%20 = phi i8* [ %45, %44 ], [ %43, %41 ]
%21 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
switch i32 %21, label %88 [
i32 -1, label %65
i32 99, label %22
i32 115, label %28
i32 98, label %39
i32 116, label %44
i32 112, label %46
i32 63, label %48
i32 104, label %62
]
22: ; preds = %19, %2
%23 = phi i32 [ 0, %2 ], [ 1, %19 ]
%24 = phi i8* [ %4, %2 ], [ %31, %19 ]
%25 = phi i8* [ undef, %2 ], [ %36, %19 ]
%26 = phi i8* [ %7, %2 ], [ %42, %19 ]
%27 = phi i8* [ %10, %2 ], [ %20, %19 ]
br label %30
28: ; preds = %19
%29 = load i8*, i8** @optarg
br label %30
30: ; preds = %22, %28
%31 = phi i8* [ %24, %22 ], [ %29, %28 ]
%32 = phi i8* [ %25, %22 ], [ %36, %28 ]
%33 = phi i8* [ %26, %22 ], [ %42, %28 ]
%34 = phi i8* [ %27, %22 ], [ %20, %28 ]
br label %35
35: ; preds = %30, %46
%36 = phi i8* [ %32, %30 ], [ %47, %46 ]
%37 = phi i8* [ %33, %30 ], [ %42, %46 ]
%38 = phi i8* [ %34, %30 ], [ %20, %46 ]
br label %41
39: ; preds = %19
%40 = load i8*, i8** @optarg
br label %41
41: ; preds = %35, %39
%42 = phi i8* [ %37, %35 ], [ %40, %39 ]
%43 = phi i8* [ %38, %35 ], [ %20, %39 ]
br label %19
44: ; preds = %19
%45 = load i8*, i8** @optarg
br label %19
46: ; preds = %19
%47 = load i8*, i8** @optarg
br label %35
48: ; preds = %19
%49 = load i8, i8* @optopt
switch i8 %49, label %53 [
i8 116, label %50
i8 115, label %50
i8 98, label %50
]
50: ; preds = %48, %48, %48
%51 = load i32, i32* @stderr
%52 = tail call i32 @fprintf(i32 %51, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8 signext %49)
br label %88
53: ; preds = %48
%54 = tail call i32 @isprint(i8 signext %49)
%55 = icmp eq i32 %54, 0
%56 = load i32, i32* @stderr
%57 = load i8, i8* @optopt
br i1 %55, label %60, label %58
58: ; preds = %53
%59 = tail call i32 @fprintf(i32 %56, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8 signext %57)
br label %88
60: ; preds = %53
%61 = tail call i32 @fprintf(i32 %56, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i8 signext %57)
br label %88
62: ; preds = %19
%63 = load i8*, i8** %1
%64 = tail call i32 @usage(i8* %63)
br label %88
65: ; preds = %19
%66 = load i8, i8* %31
%67 = icmp eq i8 %66, 0
br i1 %67, label %68, label %70
68: ; preds = %65
%69 = tail call i32 @strcat(i8* %13, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0))
br label %70
70: ; preds = %68, %65
%71 = load i8, i8* %42
%72 = icmp eq i8 %71, 0
br i1 %72, label %76, label %73
73: ; preds = %70
%74 = load i8, i8* %20
%75 = icmp eq i8 %74, 0
br i1 %75, label %80, label %82
76: ; preds = %70
%77 = tail call i32 @strcat(i8* %13, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0))
%78 = load i8, i8* %20
%79 = icmp eq i8 %78, 0
br i1 %79, label %80, label %83
80: ; preds = %76, %73
%81 = tail call i32 @strcat(i8* %13, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0))
br label %83
82: ; preds = %73
br i1 %67, label %83, label %86
83: ; preds = %76, %80, %82
%84 = load i8*, i8** %1
%85 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0), i8* %13, i8* %84)
br label %88
86: ; preds = %82
%87 = tail call i32 @sendsms(i8* %31, i8* %42, i8* %20, i32 %23, i8* %36)
br label %88
88: ; preds = %19, %50, %60, %58, %86, %83, %62, %16
%89 = phi i32 [ -1, %16 ], [ 0, %62 ], [ -1, %83 ], [ %87, %86 ], [ 1, %58 ], [ 1, %60 ], [ 1, %50 ], [ -1, %19 ]
ret i32 %89
}