#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, long *, long *);
void program1() {
  long int a, b;
  double c;
  printf("Enter two LONG numbers:\n");
  scanf("%ld %ld", &a, &b);
  if (b == 0) {
    printf("Error: Denominator cannot be Zero.");
  } else {
    c = (float)a / b;
    printf("The result is: %lf\n\n", c);
  }
}


x86 assembly (clang, -O0):
<program1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <scanf@plt>
cmpq   $0x0,-0x10(%rbp)
jne    1168 <program1+0x48>
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1194 <program1+0x74>
cvtsi2ssq -0x8(%rbp),%xmm0
cvtsi2ssq -0x10(%rbp),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xeb7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<program1>:
sub    $0x18,%rsp
lea    0xf05(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1050 <scanf@plt>
mov    0x8(%rsp),%rax
test   %rax,%rax
je     1187 <program1+0x57>
cvtsi2ssq 0x10(%rsp),%xmm0
cvtsi2ss %rax,%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb0(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x18,%rsp
ret
lea    0xe7a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Enter two LONG numbers:\0A\00"
@.str.1 = [8 x i8] c"%ld %ld\00"
@.str.2 = [35 x i8] c"Error: Denominator cannot be Zero.\00"
@.str.3 = [21 x i8] c"The result is: %lf\0A\0A\00"
define void @program1() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca double
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64* %1, i64* %2)
%6 = load i64, i64* %2
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
br label %19
10: ; preds = %0
%11 = load i64, i64* %1
%12 = sitofp i64 %11 to float
%13 = load i64, i64* %2
%14 = sitofp i64 %13 to float
%15 = fdiv float %12, %14
%16 = fpext float %15 to double
store double %16, double* %3
%17 = load double, double* %3
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), double %17)
br label %19
19: ; preds = %10, %8
ret void
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"%ld %ld\00"
@.str.2 = [35 x i8] c"Error: Denominator cannot be Zero.\00"
@.str.3 = [21 x i8] c"The result is: %lf\0A\0A\00"
@str = [24 x i8] c"Enter two LONG numbers:\00"
define void @program1() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64* %1, i64* %2)
%7 = load i64, i64* %2
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
br label %18
11: ; preds = %0
%12 = load i64, i64* %1
%13 = sitofp i64 %12 to float
%14 = sitofp i64 %7 to float
%15 = fdiv float %13, %14
%16 = fpext float %15 to double
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), double %16)
br label %18
18: ; preds = %11, %9
ret void
}