#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 *, int *);
int main(void) {
  int m, n, side1, side2, hypotenuse;
  printf("indtast en vaerdi til m \n");
  scanf("%d", &m);
  printf("indtast en vaerdi til n, denne vaerdi skal vaere mindre end m \n");
  scanf("%d", &n);
  if (n >= m) {
    printf("n er stoerre eller lig med m \n");
    return 0;
  } else
    printf("");
  side1 = (m * m) - (n * n);
  side2 = (2 * m * n);
  hypotenuse = (m * m) + (n * n);
  printf("side1 = %d, side2 = %d, hypotenuse = %d \n", side1, side2,
         hypotenuse);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1191 <main+0x71>
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11f0 <main+0xd0>
lea    0xf0d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xef1(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x8(%rsp),%edx
mov    0xc(%rsp),%eax
cmp    %eax,%edx
jge    119f <main+0x6f>
mov    %eax,%edi
imul   %eax,%edi
mov    %edx,%ecx
imul   %edx,%ecx
mov    %edi,%esi
sub    %ecx,%esi
imul   %eax,%edx
add    %edx,%edx
add    %edi,%ecx
lea    0xe6d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11ab <main+0x7b>
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"indtast en vaerdi til m \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [64 x i8] c"indtast en vaerdi til n, denne vaerdi skal vaere mindre end m \0A\00"
@.str.3 = [31 x i8] c"n er stoerre eller lig med m \0A\00"
@.str.4 = [1 x i8] zeroinitializer
@.str.5 = [42 x i8] c"side1 = %d, side2 = %d, hypotenuse = %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = icmp sge i32 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %1
br label %41
16: ; preds = %0
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0))
br label %18
18: ; preds = %16
%19 = load i32, i32* %2
%20 = load i32, i32* %2
%21 = mul nsw i32 %19, %20
%22 = load i32, i32* %3
%23 = load i32, i32* %3
%24 = mul nsw i32 %22, %23
%25 = sub nsw i32 %21, %24
store i32 %25, i32* %4
%26 = load i32, i32* %2
%27 = mul nsw i32 2, %26
%28 = load i32, i32* %3
%29 = mul nsw i32 %27, %28
store i32 %29, i32* %5
%30 = load i32, i32* %2
%31 = load i32, i32* %2
%32 = mul nsw i32 %30, %31
%33 = load i32, i32* %3
%34 = load i32, i32* %3
%35 = mul nsw i32 %33, %34
%36 = add nsw i32 %32, %35
store i32 %36, i32* %6
%37 = load i32, i32* %4
%38 = load i32, i32* %5
%39 = load i32, i32* %6
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i32 %37, i32 %38, i32 %39)
store i32 0, i32* %1
br label %41
41: ; preds = %18, %14
%42 = load i32, i32* %1
ret i32 %42
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.5 = [42 x i8] c"side1 = %d, side2 = %d, hypotenuse = %d \0A\00"
@str = [25 x i8] c"indtast en vaerdi til m \00"
@str.6 = [63 x i8] c"indtast en vaerdi til n, denne vaerdi skal vaere mindre end m \00"
@str.7 = [30 x i8] c"n er stoerre eller lig med m \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.6, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
%10 = load i32, i32* %1
%11 = icmp slt i32 %9, %10
br i1 %11, label %14, label %12
12: ; preds = %0
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.7, i64 0, i64 0))
br label %22
14: ; preds = %0
%15 = mul nsw i32 %10, %10
%16 = mul nsw i32 %9, %9
%17 = sub nsw i32 %15, %16
%18 = shl i32 %9, 1
%19 = mul i32 %18, %10
%20 = add nuw nsw i32 %15, %16
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i32 %17, i32 %19, i32 %20)
br label %22
22: ; preds = %14, %12
ret i32 0
}