#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*/ asprintf(char **, char *, char *, ...);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
int main(int argc, char **argv) {
  char *command;
  char *mobile, *text;
  if (argc != 3) {
    printf("");
    return (1);
  }
  asprintf(&mobile, "%s", argv[1]);
  asprintf(&text, "%s", argv[2]);
  asprintf(&command,
           "test -e /usr/bin/gnokii && echo \"%s\" | gnokii --sendsms %s > "
           "/dev/null  2>&1",
           text, mobile);
  system(command);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1168 <main+0x38>
lea    0xef8(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11c6 <main+0x96>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    -0x20(%rbp),%rdi
lea    0xe85(%rip),%rsi
mov    $0x0,%al
call   1050 <asprintf@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    -0x28(%rbp),%rdi
lea    0xe6b(%rip),%rsi
mov    $0x0,%al
call   1050 <asprintf@plt>
mov    -0x28(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    -0x18(%rbp),%rdi
lea    0xe54(%rip),%rsi
mov    $0x0,%al
call   1050 <asprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <system@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    $0x1,%ebp
cmp    $0x3,%edi
jne    118b <main+0x6b>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdx
lea    0xec0(%rip),%r14
xor    %ebp,%ebp
lea    0x10(%rsp),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <asprintf@plt>
mov    0x10(%rbx),%rdx
lea    0x8(%rsp),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <asprintf@plt>
mov    0x8(%rsp),%rdx
mov    0x10(%rsp),%rcx
lea    0xe8e(%rip),%rsi
lea    0x18(%rsp),%rdi
xor    %eax,%eax
call   1040 <asprintf@plt>
mov    0x18(%rsp),%rdi
call   1030 <system@plt>
mov    %ebp,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [77 x i8] c"test -e /usr/bin/gnokii && echo \22%s\22 | gnokii --sendsms %s > /dev/null 2>&1\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 3
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @printf(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %27
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 (i8**, i8*, i8*, ...) @asprintf(i8** %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %16)
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 2
%20 = load i8*, i8** %19
%21 = call i32 (i8**, i8*, i8*, ...) @asprintf(i8** %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %20)
%22 = load i8*, i8** %8
%23 = load i8*, i8** %7
%24 = call i32 (i8**, i8*, i8*, ...) @asprintf(i8** %6, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.2, i64 0, i64 0), i8* %22, i8* %23)
%25 = load i8*, i8** %6
%26 = call i32 @system(i8* %25)
store i32 0, i32* %3
br label %27
27: ; preds = %13, %11
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [77 x i8] c"test -e /usr/bin/gnokii && echo \22%s\22 | gnokii --sendsms %s > /dev/null 2>&1\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = bitcast i8** %3 to i8*
%7 = bitcast i8** %4 to i8*
%8 = bitcast i8** %5 to i8*
%9 = icmp eq i32 %0, 3
br i1 %9, label %10, label %22
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = call i32 (i8**, i8*, i8*, ...) @asprintf(i8** %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds i8*, i8** %1, i64 2
%15 = load i8*, i8** %14
%16 = call i32 (i8**, i8*, i8*, ...) @asprintf(i8** %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %15)
%17 = load i8*, i8** %5
%18 = load i8*, i8** %4
%19 = call i32 (i8**, i8*, i8*, ...) @asprintf(i8** %3, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.2, i64 0, i64 0), i8* %17, i8* %18)
%20 = load i8*, i8** %3
%21 = call i32 @system(i8* %20)
br label %22
22: ; preds = %2, %10
%23 = phi i32 [ 0, %10 ], [ 1, %2 ]
ret i32 %23
}