#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 double int16_t;

/* Variables and functions */
int atan(double);
unsigned char *malloc(int);
int /*<<< orphan*/ printf(char *, unsigned char *);
int /*<<< orphan*/ sprintf(unsigned char *, char *, double);
int main() {
  int16_t inints[] = {23.9, 52.1};
  unsigned char *msg = malloc(10);
  double angle = atan((double)inints[1] / (double)inints[0]) * 180 / 3.1428;
  sprintf(msg, "%lf.\t", angle);
  printf("%s", msg);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1040 <atan@plt>
imul   $0xb4,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  0xe73(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
movsd  -0x20(%rbp),%xmm0
lea    0xe7a(%rip),%rsi
call   1060 <sprintf@plt>
mov    -0x18(%rbp),%rsi
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
movsd  0xeaa(%rip),%xmm0
call   1040 <atan@plt>
imul   $0xb4,%eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0xe98(%rip),%xmm0
lea    0xe99(%rip),%rsi
mov    %rbx,%rdi
call   1060 <sprintf@plt>
lea    0xe90(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.inints = [2 x double] [double 2.390000e+01, double 5.210000e+01]
@.str = [6 x i8] c"%lf.\09\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [2 x double]
%2 = alloca i8*
%3 = alloca double
%4 = bitcast [2 x double]* %1 to i8*
%5 = call i8* @malloc(i32 10)
store i8* %5, i8** %2
%6 = getelementptr inbounds [2 x double], [2 x double]* %1, i64 0, i64 1
%7 = load double, double* %6
%8 = getelementptr inbounds [2 x double], [2 x double]* %1, i64 0, i64 0
%9 = load double, double* %8
%10 = fdiv double %7, %9
%11 = call i32 @atan(double %10)
%12 = mul nsw i32 %11, 180
%13 = sitofp i32 %12 to double
%14 = fdiv double %13, 3.142800e+00
store double %14, double* %3
%15 = load i8*, i8** %2
%16 = load double, double* %3
%17 = call i32 @sprintf(i8* %15, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %16)
%18 = load i8*, i8** %2
%19 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%lf.\09\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%2 = tail call i32 @atan(double 0x40017077F76E538D)
%3 = mul nsw i32 %2, 180
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 3.142800e+00
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret i32 0
}