#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 atoi(char *);
int /*<<< orphan*/ drop_the_bomb(int, int, char **);
char *strtok(char *, char *);
void start_mission(int ROW, int COL, char **matrix, char *coordinate) {
  char *token = strtok(coordinate, " ");
  while (token) {
    int currentCoordinate = atoi(token);
    drop_the_bomb(ROW, currentCoordinate, matrix);
    token = strtok(NULL, " ");
  }
}


x86 assembly (clang, -O0):
<start_mission>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xeaf(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1199 <start_mission+0x69>
mov    -0x20(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <drop_the_bomb@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xe75(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x20(%rbp)
jmp    115a <start_mission+0x2a>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_mission>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %edi,%ebp
lea    0xec0(%rip),%rsi
mov    %rcx,%rdi
call   1040 <strtok@plt>
test   %rax,%rax
je     1183 <start_mission+0x53>
lea    0xeac(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rax,%rdi
call   1050 <atoi@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %rbx,%rdx
call   1030 <drop_the_bomb@plt>
xor    %edi,%edi
mov    %r14,%rsi
call   1040 <strtok@plt>
test   %rax,%rax
jne    1160 <start_mission+0x30>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @start_mission(i32 %0, i32 %1, i8** %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i8* %3, i8** %8
%11 = load i8*, i8** %8
%12 = call i8* @strtok(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %12, i8** %9
br label %13
13: ; preds = %16, %4
%14 = load i8*, i8** %9
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %24
16: ; preds = %13
%17 = load i8*, i8** %9
%18 = call i32 @atoi(i8* %17)
store i32 %18, i32* %10
%19 = load i32, i32* %5
%20 = load i32, i32* %10
%21 = load i8**, i8*** %7
%22 = call i32 @drop_the_bomb(i32 %19, i32 %20, i8** %21)
%23 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %23, i8** %9
br label %13
24: ; preds = %13
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @start_mission(i32 %0, i32 %1, i8** %2, i8* %3) {
%5 = tail call i8* @strtok(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i8* %5, null
br i1 %6, label %13, label %7
7: ; preds = %4, %7
%8 = phi i8* [ %11, %7 ], [ %5, %4 ]
%9 = tail call i32 @atoi(i8* %8)
%10 = tail call i32 @drop_the_bomb(i32 %0, i32 %9, i8** %2)
%11 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %7
13: ; preds = %7, %4
ret void
}