#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*/ Log(char *, char *);
int /*<<< orphan*/ glTranslatef(float, float, float);
int sscanf(char *, char *, float *, float *, float *);
int DoLoc(char *s) {
  float loc[3];
  if (3 != sscanf(s, "%f %f %f", &loc[0], &loc[1], &loc[2])) {
    Log("DoLoc: Illegal loc record: %s", s);
  }
  loc[0] /= 100.0;
  loc[1] /= 100.0;
  loc[2] /= 100.0;
  glTranslatef(loc[0], loc[1], loc[2]);
  return 0;
}


x86 assembly (clang, -O0):
<DoLoc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x14(%rbp),%rdx
lea    -0x14(%rbp),%rcx
add    $0x4,%rcx
lea    -0x14(%rbp),%r8
add    $0x8,%r8
lea    0xead(%rip),%rsi
call   1030 <sscanf@plt>
mov    %eax,%ecx
mov    $0x3,%eax
cmp    %ecx,%eax
je     117f <DoLoc+0x4f>
mov    -0x8(%rbp),%rsi
lea    0xe97(%rip),%rdi
call   1040 <Log@plt>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe70(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe52(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe34(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1050 <glTranslatef@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoLoc>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rcx
lea    0xc(%rsp),%r8
lea    0xebb(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
cmp    $0x3,%eax
je     1167 <DoLoc+0x37>
lea    0xeae(%rip),%rdi
mov    %rbx,%rsi
call   1040 <Log@plt>
movss  0x4(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
movss  0xe85(%rip),%xmm3
divss  %xmm3,%xmm0
movss  %xmm0,0x4(%rsp)
divss  %xmm3,%xmm1
movss  %xmm1,0x8(%rsp)
movss  0xc(%rsp),%xmm2
divss  %xmm3,%xmm2
movss  %xmm2,0xc(%rsp)
call   1050 <glTranslatef@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%f %f %f\00"
@.str.1 = [30 x i8] c"DoLoc: Illegal loc record: %s\00"
define i32 @DoLoc(i8* %0) {
%2 = alloca i8*
%3 = alloca [3 x float]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 0
%6 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 1
%7 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 2
%8 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float* %5, float* %6, float* %7)
%9 = icmp ne i32 3, %8
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i8*, i8** %2
%12 = call i32 @Log(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %10, %1
%14 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 0
%15 = load float, float* %14
%16 = fpext float %15 to double
%17 = fdiv double %16, 1.000000e+02
%18 = fptrunc double %17 to float
store float %18, float* %14
%19 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 1
%20 = load float, float* %19
%21 = fpext float %20 to double
%22 = fdiv double %21, 1.000000e+02
%23 = fptrunc double %22 to float
store float %23, float* %19
%24 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 2
%25 = load float, float* %24
%26 = fpext float %25 to double
%27 = fdiv double %26, 1.000000e+02
%28 = fptrunc double %27 to float
store float %28, float* %24
%29 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 0
%30 = load float, float* %29
%31 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 1
%32 = load float, float* %31
%33 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 2
%34 = load float, float* %33
%35 = call i32 @glTranslatef(float %30, float %32, float %34)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%f %f %f\00"
@.str.1 = [30 x i8] c"DoLoc: Illegal loc record: %s\00"
define i32 @DoLoc(i8* %0) {
%2 = alloca [3 x float]
%3 = bitcast [3 x float]* %2 to i8*
%4 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 0
%5 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 1
%6 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 2
%7 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float* %4, float* %5, float* %6)
%8 = icmp eq i32 %7, 3
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = call i32 @Log(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %11
11: ; preds = %9, %1
%12 = load float, float* %4
%13 = fdiv float %12, 1.000000e+02
store float %13, float* %4
%14 = load float, float* %5
%15 = fdiv float %14, 1.000000e+02
store float %15, float* %5
%16 = load float, float* %6
%17 = fdiv float %16, 1.000000e+02
store float %17, float* %6
%18 = call i32 @glTranslatef(float %13, float %15, float %17)
ret i32 0
}