#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
double atof(char *);
double cos(double);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ printf(char *, ...);
double sin(double);
int /*<<< orphan*/ sscanf(char *, char *, double *, double *, double *,
                          double *, double *, double *, double *);
int main(int argc, char **argv) {
  double scale, x_trans, y_trans, z_trans;
  FILE *in, *out;
  char line[100];
  double t, x, y, z, rp, rr, ry;
  double qw, qx, qy, qz;
  double c1, c2, c3, s1, s2, s3;
  if (argc < 6) {
    printf("Usage: convert <file> <scale> <x_trans> <y_trans> <z_trans>\n");
    exit(0);
  }
  printf("argv1 = %s, argv2 = %s, argv3 = %s\n", argv[1], argv[2], argv[3]);
  scale = atof(argv[2]);
  x_trans = atof(argv[3]);
  y_trans = atof(argv[4]);
  z_trans = atof(argv[5]);
  printf("scale: %lf, x_trans: %lf\n", scale, x_trans);
  if ((in = fopen(argv[1], "r")) == NULL) {
    printf("Failed to open file for reading: %s\n", argv[1]);
    exit(0);
  }
  if ((out = fopen("pose.csv", "w")) == NULL) {
    printf("Could not create output file: pose.csv\n");
    exit(0);
  }
  fprintf(out, "pose_type\n");
  while (fgets(line, 99, in) != NULL) {
    sscanf(line, "%lf, %lf, %lf, %lf, %lf, %lf, %lf", &t, &x, &y, &z, &rp, &rr,
           &ry);
    c1 = cos(ry * 3.14 / 180 / 2);
    c2 = cos(rp * 3.14 / 180 / 2);
    c3 = cos(rr * 3.14 / 180 / 2);
    s1 = sin(ry * 3.14 / 180 / 2);
    s2 = sin(rp * 3.14 / 180 / 2);
    s3 = sin(rr * 3.14 / 180 / 2);
    qw = c1 * c2 * c3 - s1 * s2 * s3;
    qx = s1 * s2 * c3 + c1 * c2 * s3;
    qy = s1 * c2 * c3 + c1 * s2 * s3;
    qz = c1 * s2 * c3 - s1 * c2 * s3;
    fprintf(out, "%f, %f, %f, %f, %f, %f, %f, %f\n", t * scale, x + x_trans,
            y + y_trans, z + z_trans, qw, qx, qy, qz);
  }
  fclose(in);
  fclose(out);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x6,-0x8(%rbp)
jge    11d8 <main+0x38>
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %edi,%edi
call   10c0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rcx
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
lea    0xe22(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe26(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
jne    129d <main+0xfd>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe06(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %edi,%edi
call   10c0 <exit@plt>
lea    0xe16(%rip),%rdi
lea    0xe18(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x40(%rbp)
cmp    $0x0,%rax
jne    12d3 <main+0x133>
lea    0xe00(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %edi,%edi
call   10c0 <exit@plt>
mov    -0x40(%rbp),%rdi
lea    0xe0f(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
lea    -0xb0(%rbp),%rdi
mov    -0x38(%rbp),%rdx
mov    $0x63,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
je     162d <main+0x48d>
lea    -0xb0(%rbp),%rdi
lea    0xde6(%rip),%rsi
lea    -0xb8(%rbp),%rdx
lea    -0xc0(%rbp),%rcx
lea    -0xc8(%rbp),%r8
lea    -0xd0(%rbp),%r9
lea    -0xd8(%rbp),%r11
lea    -0xe0(%rbp),%r10
lea    -0xe8(%rbp),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1090 <sscanf@plt>
movsd  0xcb2(%rip),%xmm0
mulsd  -0xe8(%rbp),%xmm0
ff
movsd  0xc9a(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xc86(%rip),%xmm1
divsd  %xmm1,%xmm0
call   10a0 <cos@plt>
movsd  %xmm0,-0x110(%rbp)
ff
movsd  0xc7d(%rip),%xmm0
mulsd  -0xd8(%rbp),%xmm0
ff
movsd  0xc65(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xc51(%rip),%xmm1
divsd  %xmm1,%xmm0
call   10a0 <cos@plt>
movsd  %xmm0,-0x118(%rbp)
ff
movsd  0xc48(%rip),%xmm0
mulsd  -0xe0(%rbp),%xmm0
ff
movsd  0xc30(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xc1c(%rip),%xmm1
divsd  %xmm1,%xmm0
call   10a0 <cos@plt>
movsd  %xmm0,-0x120(%rbp)
ff
movsd  0xc13(%rip),%xmm0
mulsd  -0xe8(%rbp),%xmm0
ff
movsd  0xbfb(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xbe7(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1080 <sin@plt>
movsd  %xmm0,-0x128(%rbp)
ff
movsd  0xbde(%rip),%xmm0
mulsd  -0xd8(%rbp),%xmm0
ff
movsd  0xbc6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xbb2(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1080 <sin@plt>
movsd  %xmm0,-0x130(%rbp)
ff
movsd  0xba9(%rip),%xmm0
mulsd  -0xe0(%rbp),%xmm0
ff
movsd  0xb91(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xb7d(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1080 <sin@plt>
movsd  %xmm0,-0x138(%rbp)
ff
movsd  -0x110(%rbp),%xmm0
ff
mulsd  -0x118(%rbp),%xmm0
ff
movsd  -0x120(%rbp),%xmm2
ff
movsd  -0x128(%rbp),%xmm1
ff
mulsd  -0x130(%rbp),%xmm1
ff
mulsd  -0x138(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x128(%rbp),%xmm0
ff
mulsd  -0x130(%rbp),%xmm0
ff
movsd  -0x120(%rbp),%xmm2
ff
movsd  -0x110(%rbp),%xmm1
ff
mulsd  -0x118(%rbp),%xmm1
ff
mulsd  -0x138(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0x128(%rbp),%xmm0
ff
mulsd  -0x118(%rbp),%xmm0
ff
movsd  -0x120(%rbp),%xmm2
ff
movsd  -0x110(%rbp),%xmm1
ff
mulsd  -0x130(%rbp),%xmm1
ff
mulsd  -0x138(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0x110(%rbp),%xmm0
ff
mulsd  -0x130(%rbp),%xmm0
ff
movsd  -0x120(%rbp),%xmm2
ff
movsd  -0x128(%rbp),%xmm1
ff
mulsd  -0x118(%rbp),%xmm1
ff
mulsd  -0x138(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
mov    -0x40(%rbp),%rdi
movsd  -0xb8(%rbp),%xmm0
ff
mulsd  -0x18(%rbp),%xmm0
movsd  -0xc0(%rbp),%xmm1
ff
addsd  -0x20(%rbp),%xmm1
movsd  -0xc8(%rbp),%xmm2
ff
addsd  -0x28(%rbp),%xmm2
movsd  -0xd0(%rbp),%xmm3
ff
addsd  -0x30(%rbp),%xmm3
movsd  -0xf0(%rbp),%xmm4
ff
movsd  -0xf8(%rbp),%xmm5
ff
movsd  -0x100(%rbp),%xmm6
ff
movsd  -0x108(%rbp),%xmm7
ff
lea    0xaf9(%rip),%rsi
mov    $0x8,%al
call   1070 <fprintf@plt>
jmp    12e5 <main+0x145>
mov    -0x38(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x40(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x4(%rbp),%eax
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe8,%rsp
cmp    $0x5,%edi
jle    150a <main+0x34a>
mov    %rsi,%rbx
mov    0x8(%rsi),%rsi
mov    0x10(%rbx),%rdx
mov    0x18(%rbx),%rcx
lea    0xe28(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x10(%rbx),%rdi
call   1040 <atof@plt>
movsd  %xmm0,0x8(%rsp)
mov    0x18(%rbx),%rdi
call   1040 <atof@plt>
movsd  %xmm0,(%rsp)
mov    0x20(%rbx),%rdi
call   1040 <atof@plt>
movsd  %xmm0,0x30(%rsp)
mov    0x28(%rbx),%rdi
call   1040 <atof@plt>
movsd  %xmm0,0x28(%rsp)
lea    0xe03(%rip),%rdi
movsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
mov    $0x2,%al
call   1060 <printf@plt>
mov    0x8(%rbx),%rdi
lea    0xe00(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     1513 <main+0x353>
mov    %rax,%r14
lea    0xe7c(%rip),%rdi
lea    0xe08(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     152c <main+0x36c>
mov    %rax,%r12
lea    0xdf2(%rip),%rdi
mov    $0xa,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   10e0 <fwrite@plt>
lea    0x80(%rsp),%rdi
mov    $0x63,%esi
mov    %r14,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     14e6 <main+0x326>
lea    0x80(%rsp),%rbx
lea    0x68(%rsp),%r15
lea    0x60(%rsp),%r13
lea    0xdd6(%rip),%rbp
cs nopw 0x0(%rax,%rax,1)
sub    $0x8,%rsp
mov    %rbx,%rdi
lea    0xd9c(%rip),%rsi
lea    0x80(%rsp),%rdx
lea    0x78(%rsp),%rcx
mov    %r15,%r8
mov    %r13,%r9
lea    0x18(%rsp),%rax
push   %rax
lea    0x28(%rsp),%rax
push   %rax
lea    0x38(%rsp),%rax
push   %rax
call   10a0 <sscanf@plt>
add    $0x20,%rsp
movsd  0x10(%rsp),%xmm0
movsd  0xcd6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xcd2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xcce(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   10b0 <cos@plt>
movsd  %xmm0,0x58(%rsp)
movsd  0x20(%rsp),%xmm0
mulsd  0xca1(%rip),%xmm0
divsd  0xca1(%rip),%xmm0
mulsd  0xca1(%rip),%xmm0
call   10b0 <cos@plt>
movsd  %xmm0,0x50(%rsp)
movsd  0x18(%rsp),%xmm0
mulsd  0xc78(%rip),%xmm0
divsd  0xc78(%rip),%xmm0
mulsd  0xc78(%rip),%xmm0
call   10b0 <cos@plt>
movsd  %xmm0,0x48(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  0xc4f(%rip),%xmm0
divsd  0xc4f(%rip),%xmm0
mulsd  0xc4f(%rip),%xmm0
call   1090 <sin@plt>
movsd  %xmm0,0x40(%rsp)
movsd  0x20(%rsp),%xmm0
mulsd  0xc26(%rip),%xmm0
divsd  0xc26(%rip),%xmm0
mulsd  0xc26(%rip),%xmm0
call   1090 <sin@plt>
movsd  %xmm0,0x38(%rsp)
movsd  0x18(%rsp),%xmm0
mulsd  0xbfd(%rip),%xmm0
divsd  0xbfd(%rip),%xmm0
mulsd  0xbfd(%rip),%xmm0
call   1090 <sin@plt>
movsd  0x58(%rsp),%xmm8
movapd %xmm8,%xmm1
movsd  0x50(%rsp),%xmm6
mulsd  %xmm6,%xmm1
movsd  0x40(%rsp),%xmm5
mulsd  %xmm5,%xmm6
movsd  0x38(%rsp),%xmm3
mulsd  %xmm3,%xmm5
movapd %xmm0,%xmm2
mulsd  %xmm5,%xmm2
movapd %xmm1,%xmm4
movsd  0x48(%rsp),%xmm7
mulsd  %xmm7,%xmm4
subsd  %xmm2,%xmm4
mulsd  %xmm0,%xmm1
mulsd  %xmm7,%xmm5
addsd  %xmm1,%xmm5
movapd %xmm8,%xmm2
mulsd  %xmm3,%xmm2
movapd %xmm2,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm6,%xmm0
mulsd  %xmm7,%xmm6
addsd  %xmm1,%xmm6
mulsd  %xmm7,%xmm2
subsd  %xmm0,%xmm2
movapd %xmm2,%xmm7
movsd  0x78(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  0x70(%rsp),%xmm1
addsd  (%rsp),%xmm1
movsd  0x68(%rsp),%xmm2
addsd  0x30(%rsp),%xmm2
movsd  0x60(%rsp),%xmm3
addsd  0x28(%rsp),%xmm3
mov    %r12,%rdi
mov    %rbp,%rsi
mov    $0x8,%al
call   1080 <fprintf@plt>
mov    %rbx,%rdi
mov    $0x63,%esi
mov    %r14,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
jne    12e0 <main+0x120>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    %r12,%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
add    $0xe8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xbe2(%rip),%rdi
jmp    1533 <main+0x373>
mov    0x8(%rbx),%rsi
lea    0xb3a(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %edi,%edi
call   10d0 <exit@plt>
lea    0xb99(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
@.str = [61 x i8] c"Usage: convert <file> <scale> <x_trans> <y_trans> <z_trans>\0A\00"
@.str.1 = [36 x i8] c"argv1 = %s, argv2 = %s, argv3 = %s\0A\00"
@.str.2 = [26 x i8] c"scale: %lf, x_trans: %lf\0A\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [37 x i8] c"Failed to open file for reading: %s\0A\00"
@.str.5 = [9 x i8] c"pose.csv\00"
@.str.6 = [2 x i8] c"w\00"
@.str.7 = [40 x i8] c"Could not create output file: pose.csv\0A\00"
@.str.8 = [11 x i8] c"pose_type\0A\00"
@.str.9 = [34 x i8] c"%lf, %lf, %lf, %lf, %lf, %lf, %lf\00"
@.str.10 = [32 x i8] c"%f, %f, %f, %f, %f, %f, %f, %f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca [100 x i8]
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca double
%27 = alloca double
%28 = alloca double
%29 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%30 = load i32, i32* %4
%31 = icmp slt i32 %30, 6
br i1 %31, label %32, label %35
32: ; preds = %2
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%34 = call i32 @exit(i32 0)
unreachable
35: ; preds = %2
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 1
%38 = load i8*, i8** %37
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 2
%41 = load i8*, i8** %40
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 3
%44 = load i8*, i8** %43
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %38, i8* %41, i8* %44)
%46 = load i8**, i8*** %5
%47 = getelementptr inbounds i8*, i8** %46, i64 2
%48 = load i8*, i8** %47
%49 = call double @atof(i8* %48)
store double %49, double* %6
%50 = load i8**, i8*** %5
%51 = getelementptr inbounds i8*, i8** %50, i64 3
%52 = load i8*, i8** %51
%53 = call double @atof(i8* %52)
store double %53, double* %7
%54 = load i8**, i8*** %5
%55 = getelementptr inbounds i8*, i8** %54, i64 4
%56 = load i8*, i8** %55
%57 = call double @atof(i8* %56)
store double %57, double* %8
%58 = load i8**, i8*** %5
%59 = getelementptr inbounds i8*, i8** %58, i64 5
%60 = load i8*, i8** %59
%61 = call double @atof(i8* %60)
store double %61, double* %9
%62 = load double, double* %6
%63 = load double, double* %7
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), double %62, double %63)
%65 = load i8**, i8*** %5
%66 = getelementptr inbounds i8*, i8** %65, i64 1
%67 = load i8*, i8** %66
%68 = call i32* @fopen(i8* %67, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %68, i32** %10
%69 = icmp eq i32* %68, null
br i1 %69, label %70, label %76
70: ; preds = %35
%71 = load i8**, i8*** %5
%72 = getelementptr inbounds i8*, i8** %71, i64 1
%73 = load i8*, i8** %72
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), i8* %73)
%75 = call i32 @exit(i32 0)
unreachable
76: ; preds = %35
%77 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
store i32* %77, i32** %11
%78 = icmp eq i32* %77, null
br i1 %78, label %79, label %82
79: ; preds = %76
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.7, i64 0, i64 0))
%81 = call i32 @exit(i32 0)
unreachable
82: ; preds = %76
%83 = load i32*, i32** %11
%84 = call i32 (i32*, i8*, ...) @fprintf(i32* %83, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
br label %85
85: ; preds = %90, %82
%86 = getelementptr inbounds [100 x i8], [100 x i8]* %12, i64 0, i64 0
%87 = load i32*, i32** %10
%88 = call i32* @fgets(i8* %86, i32 99, i32* %87)
%89 = icmp ne i32* %88, null
br i1 %89, label %90, label %183
90: ; preds = %85
%91 = getelementptr inbounds [100 x i8], [100 x i8]* %12, i64 0, i64 0
%92 = call i32 @sscanf(i8* %91, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.9, i64 0, i64 0), double* %13, double* %14, double* %15, double* %16, double* %17, double* %18, double* %19)
%93 = load double, double* %19
%94 = fmul double %93, 3.140000e+00
%95 = fdiv double %94, 1.800000e+02
%96 = fdiv double %95, 2.000000e+00
%97 = call double @cos(double %96)
store double %97, double* %24
%98 = load double, double* %17
%99 = fmul double %98, 3.140000e+00
%100 = fdiv double %99, 1.800000e+02
%101 = fdiv double %100, 2.000000e+00
%102 = call double @cos(double %101)
store double %102, double* %25
%103 = load double, double* %18
%104 = fmul double %103, 3.140000e+00
%105 = fdiv double %104, 1.800000e+02
%106 = fdiv double %105, 2.000000e+00
%107 = call double @cos(double %106)
store double %107, double* %26
%108 = load double, double* %19
%109 = fmul double %108, 3.140000e+00
%110 = fdiv double %109, 1.800000e+02
%111 = fdiv double %110, 2.000000e+00
%112 = call double @sin(double %111)
store double %112, double* %27
%113 = load double, double* %17
%114 = fmul double %113, 3.140000e+00
%115 = fdiv double %114, 1.800000e+02
%116 = fdiv double %115, 2.000000e+00
%117 = call double @sin(double %116)
store double %117, double* %28
%118 = load double, double* %18
%119 = fmul double %118, 3.140000e+00
%120 = fdiv double %119, 1.800000e+02
%121 = fdiv double %120, 2.000000e+00
%122 = call double @sin(double %121)
store double %122, double* %29
%123 = load double, double* %24
%124 = load double, double* %25
%125 = fmul double %123, %124
%126 = load double, double* %26
%127 = load double, double* %27
%128 = load double, double* %28
%129 = fmul double %127, %128
%130 = load double, double* %29
%131 = fmul double %129, %130
%132 = fneg double %131
%133 = call double @llvm.fmuladd.f64(double %125, double %126, double %132)
store double %133, double* %20
%134 = load double, double* %27
%135 = load double, double* %28
%136 = fmul double %134, %135
%137 = load double, double* %26
%138 = load double, double* %24
%139 = load double, double* %25
%140 = fmul double %138, %139
%141 = load double, double* %29
%142 = fmul double %140, %141
%143 = call double @llvm.fmuladd.f64(double %136, double %137, double %142)
store double %143, double* %21
%144 = load double, double* %27
%145 = load double, double* %25
%146 = fmul double %144, %145
%147 = load double, double* %26
%148 = load double, double* %24
%149 = load double, double* %28
%150 = fmul double %148, %149
%151 = load double, double* %29
%152 = fmul double %150, %151
%153 = call double @llvm.fmuladd.f64(double %146, double %147, double %152)
store double %153, double* %22
%154 = load double, double* %24
%155 = load double, double* %28
%156 = fmul double %154, %155
%157 = load double, double* %26
%158 = load double, double* %27
%159 = load double, double* %25
%160 = fmul double %158, %159
%161 = load double, double* %29
%162 = fmul double %160, %161
%163 = fneg double %162
%164 = call double @llvm.fmuladd.f64(double %156, double %157, double %163)
store double %164, double* %23
%165 = load i32*, i32** %11
%166 = load double, double* %13
%167 = load double, double* %6
%168 = fmul double %166, %167
%169 = load double, double* %14
%170 = load double, double* %7
%171 = fadd double %169, %170
%172 = load double, double* %15
%173 = load double, double* %8
%174 = fadd double %172, %173
%175 = load double, double* %16
%176 = load double, double* %9
%177 = fadd double %175, %176
%178 = load double, double* %20
%179 = load double, double* %21
%180 = load double, double* %22
%181 = load double, double* %23
%182 = call i32 (i32*, i8*, ...) @fprintf(i32* %165, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.10, i64 0, i64 0), double %168, double %171, double %174, double %177, double %178, double %179, double %180, double %181)
br label %85
183: ; preds = %85
%184 = load i32*, i32** %10
%185 = call i32 @fclose(i32* %184)
%186 = load i32*, i32** %11
%187 = call i32 @fclose(i32* %186)
%188 = load i32, i32* %3
ret i32 %188
}

LLVM IR (-O2):
@.str.1 = [36 x i8] c"argv1 = %s, argv2 = %s, argv3 = %s\0A\00"
@.str.2 = [26 x i8] c"scale: %lf, x_trans: %lf\0A\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [37 x i8] c"Failed to open file for reading: %s\0A\00"
@.str.5 = [9 x i8] c"pose.csv\00"
@.str.6 = [2 x i8] c"w\00"
@.str.8 = [11 x i8] c"pose_type\0A\00"
@.str.9 = [34 x i8] c"%lf, %lf, %lf, %lf, %lf, %lf, %lf\00"
@.str.10 = [32 x i8] c"%f, %f, %f, %f, %f, %f, %f, %f\0A\00"
@str = [39 x i8] c"Could not create output file: pose.csv\00"
@str.11 = [60 x i8] c"Usage: convert <file> <scale> <x_trans> <y_trans> <z_trans>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [100 x i8]
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%12 = bitcast double* %4 to i8*
%13 = bitcast double* %5 to i8*
%14 = bitcast double* %6 to i8*
%15 = bitcast double* %7 to i8*
%16 = bitcast double* %8 to i8*
%17 = bitcast double* %9 to i8*
%18 = bitcast double* %10 to i8*
%19 = icmp slt i32 %0, 6
br i1 %19, label %20, label %23
20: ; preds = %2
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.11, i64 0, i64 0))
%22 = tail call i32 @exit(i32 0)
unreachable
23: ; preds = %2
%24 = getelementptr inbounds i8*, i8** %1, i64 1
%25 = load i8*, i8** %24
%26 = getelementptr inbounds i8*, i8** %1, i64 2
%27 = load i8*, i8** %26
%28 = getelementptr inbounds i8*, i8** %1, i64 3
%29 = load i8*, i8** %28
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %25, i8* %27, i8* %29)
%31 = load i8*, i8** %26
%32 = tail call double @atof(i8* %31)
%33 = load i8*, i8** %28
%34 = tail call double @atof(i8* %33)
%35 = getelementptr inbounds i8*, i8** %1, i64 4
%36 = load i8*, i8** %35
%37 = tail call double @atof(i8* %36)
%38 = getelementptr inbounds i8*, i8** %1, i64 5
%39 = load i8*, i8** %38
%40 = tail call double @atof(i8* %39)
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), double %32, double %34)
%42 = load i8*, i8** %24
%43 = tail call i32* @fopen(i8* %42, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%44 = icmp eq i32* %43, null
br i1 %44, label %45, label %49
45: ; preds = %23
%46 = load i8*, i8** %24
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), i8* %46)
%48 = tail call i32 @exit(i32 0)
unreachable
49: ; preds = %23
%50 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%51 = icmp eq i32* %50, null
br i1 %51, label %52, label %55
52: ; preds = %49
%53 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%54 = tail call i32 @exit(i32 0)
unreachable
55: ; preds = %49
%56 = tail call i64 @fwrite(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i64 10, i64 1, i32* %50)
%57 = call i32* @fgets(i8* %11, i32 99, i32* %43)
%58 = icmp eq i32* %57, null
br i1 %58, label %116, label %59
59: ; preds = %55, %59
%60 = call i32 @sscanf(i8* %11, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.9, i64 0, i64 0), double* %4, double* %5, double* %6, double* %7, double* %8, double* %9, double* %10)
%61 = load double, double* %10
%62 = fmul double %61, 3.140000e+00
%63 = fdiv double %62, 1.800000e+02
%64 = fmul double %63, 5.000000e-01
%65 = call double @cos(double %64)
%66 = load double, double* %8
%67 = fmul double %66, 3.140000e+00
%68 = fdiv double %67, 1.800000e+02
%69 = fmul double %68, 5.000000e-01
%70 = call double @cos(double %69)
%71 = load double, double* %9
%72 = fmul double %71, 3.140000e+00
%73 = fdiv double %72, 1.800000e+02
%74 = fmul double %73, 5.000000e-01
%75 = call double @cos(double %74)
%76 = load double, double* %10
%77 = fmul double %76, 3.140000e+00
%78 = fdiv double %77, 1.800000e+02
%79 = fmul double %78, 5.000000e-01
%80 = call double @sin(double %79)
%81 = load double, double* %8
%82 = fmul double %81, 3.140000e+00
%83 = fdiv double %82, 1.800000e+02
%84 = fmul double %83, 5.000000e-01
%85 = call double @sin(double %84)
%86 = load double, double* %9
%87 = fmul double %86, 3.140000e+00
%88 = fdiv double %87, 1.800000e+02
%89 = fmul double %88, 5.000000e-01
%90 = call double @sin(double %89)
%91 = fmul double %65, %70
%92 = fmul double %80, %85
%93 = fneg double %92
%94 = fmul double %90, %93
%95 = call double @llvm.fmuladd.f64(double %91, double %75, double %94)
%96 = fmul double %91, %90
%97 = call double @llvm.fmuladd.f64(double %92, double %75, double %96)
%98 = fmul double %70, %80
%99 = fmul double %65, %85
%100 = fmul double %99, %90
%101 = call double @llvm.fmuladd.f64(double %98, double %75, double %100)
%102 = fneg double %98
%103 = fmul double %90, %102
%104 = call double @llvm.fmuladd.f64(double %99, double %75, double %103)
%105 = load double, double* %4
%106 = fmul double %32, %105
%107 = load double, double* %5
%108 = fadd double %34, %107
%109 = load double, double* %6
%110 = fadd double %37, %109
%111 = load double, double* %7
%112 = fadd double %40, %111
%113 = call i32 (i32*, i8*, ...) @fprintf(i32* %50, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.10, i64 0, i64 0), double %106, double %108, double %110, double %112, double %95, double %97, double %101, double %104)
%114 = call i32* @fgets(i8* %11, i32 99, i32* %43)
%115 = icmp eq i32* %114, null
br i1 %115, label %116, label %59
116: ; preds = %59, %55
%117 = call i32 @fclose(i32* %43)
%118 = call i32 @fclose(i32* %50)
ret i32 0
}