#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 */
float asin(float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
void angll(int MAX) {
  float x, a, z, angle;
  printf("Enter the absolute value of the first vector: \n");
  scanf("%f", &x);
  printf("Enter the absolute value of the second vector: \n");
  scanf("%f", &a);
  printf(
      "Enter the absolute value of the cross product of the two vectors: \n");
  scanf("%f", &z);
  printf("The numbers you have input are %.2f, %.2f, and %.2f. \n", x, a, z);
  for (int i = 0; i < MAX; i++) {
    angle = asin(z / (x * a));
  }
  printf("The angle, in radians, between vector A and vector B is %.2f. \n",
         angle);
}


x86 assembly (clang, -O0):
<angll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xee6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea4(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x10(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xef1(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11fc <angll+0xcc>
movss  -0x10(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
call   1040 <asin@plt>
movss  %xmm0,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11c5 <angll+0x95>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xed3(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<angll>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebx
lea    0xf2a(%rip),%rdi
call   1030 <puts@plt>
lea    0xea4(%rip),%r14
lea    0x14(%rsp),%rsi
mov    %r14,%rdi
call   1060 <scanf@plt>
lea    0xf39(%rip),%rdi
call   1030 <puts@plt>
lea    0x10(%rsp),%rsi
mov    %r14,%rdi
call   1060 <scanf@plt>
lea    0xf50(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rsi
mov    %r14,%rdi
call   1060 <scanf@plt>
movss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x10(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  0xc(%rsp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xe43(%rip),%rdi
mov    $0x3,%al
call   1040 <printf@plt>
nopw   0x0(%rax,%rax,1)
movss  0xc(%rsp),%xmm0
movss  0x14(%rsp),%xmm1
mulss  0x10(%rsp),%xmm1
divss  %xmm1,%xmm0
call   1050 <asin@plt>
add    $0xffffffff,%ebx
jne    11d0 <angll+0x90>
cvtss2sd %xmm0,%xmm0
lea    0xe3f(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [48 x i8] c"Enter the absolute value of the first vector: \0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [49 x i8] c"Enter the absolute value of the second vector: \0A\00"
@.str.3 = [68 x i8] c"Enter the absolute value of the cross product of the two vectors: \0A\00"
@.str.4 = [55 x i8] c"The numbers you have input are %.2f, %.2f, and %.2f. \0A\00"
@.str.5 = [64 x i8] c"The angle, in radians, between vector A and vector B is %.2f. \0A\00"
define void @angll(i32 %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca i32
store i32 %0, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %5)
%14 = load float, float* %3
%15 = fpext float %14 to double
%16 = load float, float* %4
%17 = fpext float %16 to double
%18 = load float, float* %5
%19 = fpext float %18 to double
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.4, i64 0, i64 0), double %15, double %17, double %19)
store i32 0, i32* %7
br label %21
21: ; preds = %32, %1
%22 = load i32, i32* %7
%23 = load i32, i32* %2
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %35
25: ; preds = %21
%26 = load float, float* %5
%27 = load float, float* %3
%28 = load float, float* %4
%29 = fmul float %27, %28
%30 = fdiv float %26, %29
%31 = call float @asin(float %30)
store float %31, float* %6
br label %32
32: ; preds = %25
%33 = load i32, i32* %7
%34 = add nsw i32 %33, 1
store i32 %34, i32* %7
br label %21
35: ; preds = %21
%36 = load float, float* %6
%37 = fpext float %36 to double
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.5, i64 0, i64 0), double %37)
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.4 = [55 x i8] c"The numbers you have input are %.2f, %.2f, and %.2f. \0A\00"
@.str.5 = [64 x i8] c"The angle, in radians, between vector A and vector B is %.2f. \0A\00"
@str = [47 x i8] c"Enter the absolute value of the first vector: \00"
@str.6 = [48 x i8] c"Enter the absolute value of the second vector: \00"
@str.7 = [67 x i8] c"Enter the absolute value of the cross product of the two vectors: \00"
define void @angll(i32 %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = bitcast float* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = bitcast float* %4 to i8*
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.6, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str.7, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%14 = load float, float* %2
%15 = fpext float %14 to double
%16 = load float, float* %3
%17 = fpext float %16 to double
%18 = load float, float* %4
%19 = fpext float %18 to double
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.4, i64 0, i64 0), double %15, double %17, double %19)
%21 = icmp sgt i32 %0, 0
br label %25
22: ; preds = %25
%23 = fpext float %32 to double
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str.5, i64 0, i64 0), double %23)
ret void
25: ; preds = %1, %25
%26 = phi i32 [ %33, %25 ], [ 0, %1 ]
%27 = load float, float* %4
%28 = load float, float* %2
%29 = load float, float* %3
%30 = fmul float %28, %29
%31 = fdiv float %27, %30
%32 = call float @asin(float %31)
%33 = add nuw nsw i32 %26, 1
%34 = icmp eq i32 %33, %0
br i1 %34, label %22, label %25
}