#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 */
char *alloca(size_t);
int /*<<< orphan*/ report(float, float, char *, int /*<<< orphan*/,
                          int /*<<< orphan*/);
int /*<<< orphan*/ snprintf(char *, size_t, char *, char *, char *);
int sscanf(char *, char *, float *, float *);
size_t strlen(char *);
int guess_by_manual(char **args) {
  size_t len = strlen(args[0]) + strlen(args[1]);
  char *text = alloca((len + 2) * sizeof(char));
  float latitude;
  float longitude;
  snprintf(text, len + 2, "%s %s", args[0], args[1]);
  if (sscanf(text, "%f %f", &latitude, &longitude) < 2)
    return 1;
  report(latitude, longitude, "manual", 0, 0);
  return 0;
}


x86 assembly (clang, -O0):
<guess_by_manual>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x2,%rdi
shl    $0x0,%rdi
call   1050 <alloca@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x2,%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%r8
lea    0xe42(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xe38(%rip),%rsi
lea    -0x24(%rbp),%rdx
lea    -0x28(%rbp),%rcx
call   1060 <sscanf@plt>
cmp    $0x2,%eax
jge    11f0 <guess_by_manual+0xa0>
movl   $0x1,-0x4(%rbp)
jmp    1211 <guess_by_manual+0xc1>
movss  -0x24(%rbp),%xmm0
movss  -0x28(%rbp),%xmm1
lea    0xe0b(%rip),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1070 <report@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<guess_by_manual>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <strlen@plt>
mov    %rax,%r14
mov    0x8(%rbx),%rdi
call   1030 <strlen@plt>
add    %rax,%r14
add    $0x2,%r14
mov    %r14,%rdi
call   1050 <alloca@plt>
mov    %rax,%r15
mov    (%rbx),%rcx
mov    0x8(%rbx),%r8
lea    0xe70(%rip),%rdx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <snprintf@plt>
lea    0xe64(%rip),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    %r15,%rdi
call   1060 <sscanf@plt>
mov    $0x1,%ebx
cmp    $0x2,%eax
jl     11dc <guess_by_manual+0x8c>
movss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
lea    0xe3b(%rip),%rdi
xor    %ebx,%ebx
xor    %esi,%esi
xor    %edx,%edx
call   1070 <report@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s %s\00"
@.str.1 = [6 x i8] c"%f %f\00"
@.str.2 = [7 x i8] c"manual\00"
define i32 @guess_by_manual(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
%4 = alloca i64
%5 = alloca i8*
%6 = alloca float
%7 = alloca float
store i8** %0, i8*** %3
%8 = load i8**, i8*** %3
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = call i64 @strlen(i8* %10)
%12 = load i8**, i8*** %3
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i64 @strlen(i8* %14)
%16 = add i64 %11, %15
store i64 %16, i64* %4
%17 = load i64, i64* %4
%18 = add i64 %17, 2
%19 = mul i64 %18, 1
%20 = call i8* @alloca(i64 %19)
store i8* %20, i8** %5
%21 = load i8*, i8** %5
%22 = load i64, i64* %4
%23 = add i64 %22, 2
%24 = load i8**, i8*** %3
%25 = getelementptr inbounds i8*, i8** %24, i64 0
%26 = load i8*, i8** %25
%27 = load i8**, i8*** %3
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = call i32 @snprintf(i8* %21, i64 %23, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %26, i8* %29)
%31 = load i8*, i8** %5
%32 = call i32 @sscanf(i8* %31, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float* %6, float* %7)
%33 = icmp slt i32 %32, 2
br i1 %33, label %34, label %35
34: ; preds = %1
store i32 1, i32* %2
br label %39
35: ; preds = %1
%36 = load float, float* %6
%37 = load float, float* %7
%38 = call i32 @report(float %36, float %37, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 0)
store i32 0, i32* %2
br label %39
39: ; preds = %35, %34
%40 = load i32, i32* %2
ret i32 %40
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s %s\00"
@.str.1 = [6 x i8] c"%f %f\00"
@.str.2 = [7 x i8] c"manual\00"
define i32 @guess_by_manual(i8** nocapture %0) {
%2 = alloca float
%3 = alloca float
%4 = load i8*, i8** %0
%5 = tail call i64 @strlen(i8* dereferenceable(1) %4)
%6 = getelementptr inbounds i8*, i8** %0, i64 1
%7 = load i8*, i8** %6
%8 = tail call i64 @strlen(i8* dereferenceable(1) %7)
%9 = add i64 %5, 2
%10 = add i64 %9, %8
%11 = tail call i8* @alloca(i64 %10)
%12 = bitcast float* %2 to i8*
%13 = bitcast float* %3 to i8*
%14 = load i8*, i8** %0
%15 = load i8*, i8** %6
%16 = tail call i32 @snprintf(i8* %11, i64 %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %14, i8* %15)
%17 = call i32 @sscanf(i8* %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float* %2, float* %3)
%18 = icmp slt i32 %17, 2
br i1 %18, label %23, label %19
19: ; preds = %1
%20 = load float, float* %2
%21 = load float, float* %3
%22 = call i32 @report(float %20, float %21, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 0)
br label %23
23: ; preds = %1, %19
%24 = phi i32 [ 0, %19 ], [ 1, %1 ]
ret i32 %24
}