#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*/ glMultMatrixf(float **);
int sscanf(char *, char *, float *, float *, float *, float *, float *, float *,
           float *, float *, float *);
int DoRot(char *s) {
  float mat[4][4];
  mat[0][3] = mat[1][3] = mat[2][3] = mat[3][0] = mat[3][1] = mat[3][2] = 0.0f;
  mat[3][3] = 1.0f;
  if (9 != sscanf(s, "%f %f %f %f %f %f %f %f %f", &mat[0][0], &mat[0][1],
                  &mat[0][2], &mat[1][0], &mat[1][1], &mat[1][2], &mat[2][0],
                  &mat[2][1], &mat[2][2])) {
    Log("DoRot: Illegal rot record: %s", s);
  }
  glMultMatrixf(mat);
  return 0;
}


x86 assembly (clang, -O0):
<DoRot>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %rdi,-0x18(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x2c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x44(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x54(%rbp)
movss  0xe86(%rip),%xmm0
movss  %xmm0,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x60(%rbp),%rdx
lea    -0x60(%rbp),%rcx
add    $0x4,%rcx
lea    -0x60(%rbp),%r8
add    $0x8,%r8
lea    -0x60(%rbp),%r9
add    $0x10,%r9
lea    -0x60(%rbp),%r14
add    $0x10,%r14
add    $0x4,%r14
lea    -0x60(%rbp),%rbx
add    $0x10,%rbx
add    $0x8,%rbx
lea    -0x60(%rbp),%r11
add    $0x20,%r11
lea    -0x60(%rbp),%r10
add    $0x20,%r10
add    $0x4,%r10
lea    -0x60(%rbp),%rax
add    $0x20,%rax
add    $0x8,%rax
lea    0xe26(%rip),%rsi
mov    %r14,(%rsp)
mov    %rbx,0x8(%rsp)
mov    %r11,0x10(%rsp)
mov    %r10,0x18(%rsp)
mov    %rax,0x20(%rsp)
call   1030 <sscanf@plt>
mov    %eax,%ecx
mov    $0x9,%eax
cmp    %ecx,%eax
je     121a <DoRot+0xea>
mov    -0x18(%rbp),%rsi
lea    0xe0a(%rip),%rdi
call   1050 <Log@plt>
lea    -0x60(%rbp),%rdi
call   1040 <glMultMatrixf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoRot>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %rdi,%rbx
lea    0x20(%rsp),%r10
lea    0x10(%rsp),%r9
movl   $0x0,0x1c(%rsp)
movl   $0x0,0xc(%rsp)
xorps  %xmm0,%xmm0
movups %xmm0,0x2c(%rsp)
movl   $0x3f800000,0x3c(%rsp)
3f
lea    0x4(%rsp),%rcx
lea    0x8(%rsp),%r8
lea    0x14(%rsp),%r11
lea    0x18(%rsp),%r14
lea    0x24(%rsp),%r15
lea    0x28(%rsp),%rax
sub    $0x8,%rsp
lea    0xe71(%rip),%rsi
lea    0x8(%rsp),%rdx
push   %rax
push   %r15
push   %r10
push   %r14
push   %r11
call   1030 <sscanf@plt>
add    $0x30,%rsp
cmp    $0x9,%eax
je     11ba <DoRot+0x8a>
lea    0xe69(%rip),%rdi
mov    %rbx,%rsi
call   1050 <Log@plt>
mov    %rsp,%rdi
call   1040 <glMultMatrixf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [27 x i8] c"%f %f %f %f %f %f %f %f %f\00"
@.str.1 = [30 x i8] c"DoRot: Illegal rot record: %s\00"
define i32 @DoRot(i8* %0) {
%2 = alloca i8*
%3 = alloca [4 x [4 x float]]
store i8* %0, i8** %2
%4 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 3
%5 = getelementptr inbounds [4 x float], [4 x float]* %4, i64 0, i64 2
store float 0.000000e+00, float* %5
%6 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 3
%7 = getelementptr inbounds [4 x float], [4 x float]* %6, i64 0, i64 1
store float 0.000000e+00, float* %7
%8 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 3
%9 = getelementptr inbounds [4 x float], [4 x float]* %8, i64 0, i64 0
store float 0.000000e+00, float* %9
%10 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 2
%11 = getelementptr inbounds [4 x float], [4 x float]* %10, i64 0, i64 3
store float 0.000000e+00, float* %11
%12 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 1
%13 = getelementptr inbounds [4 x float], [4 x float]* %12, i64 0, i64 3
store float 0.000000e+00, float* %13
%14 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 0
%15 = getelementptr inbounds [4 x float], [4 x float]* %14, i64 0, i64 3
store float 0.000000e+00, float* %15
%16 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 3
%17 = getelementptr inbounds [4 x float], [4 x float]* %16, i64 0, i64 3
store float 1.000000e+00, float* %17
%18 = load i8*, i8** %2
%19 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 0
%20 = getelementptr inbounds [4 x float], [4 x float]* %19, i64 0, i64 0
%21 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 0
%22 = getelementptr inbounds [4 x float], [4 x float]* %21, i64 0, i64 1
%23 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 0
%24 = getelementptr inbounds [4 x float], [4 x float]* %23, i64 0, i64 2
%25 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 1
%26 = getelementptr inbounds [4 x float], [4 x float]* %25, i64 0, i64 0
%27 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 1
%28 = getelementptr inbounds [4 x float], [4 x float]* %27, i64 0, i64 1
%29 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 1
%30 = getelementptr inbounds [4 x float], [4 x float]* %29, i64 0, i64 2
%31 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 2
%32 = getelementptr inbounds [4 x float], [4 x float]* %31, i64 0, i64 0
%33 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 2
%34 = getelementptr inbounds [4 x float], [4 x float]* %33, i64 0, i64 1
%35 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 2
%36 = getelementptr inbounds [4 x float], [4 x float]* %35, i64 0, i64 2
%37 = call i32 @sscanf(i8* %18, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), float* %20, float* %22, float* %24, float* %26, float* %28, float* %30, float* %32, float* %34, float* %36)
%38 = icmp ne i32 9, %37
br i1 %38, label %39, label %42
39: ; preds = %1
%40 = load i8*, i8** %2
%41 = call i32 @Log(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %40)
br label %42
42: ; preds = %39, %1
%43 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %3, i64 0, i64 0
%44 = bitcast [4 x float]* %43 to float**
%45 = call i32 @glMultMatrixf(float** %44)
ret i32 0
}

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