#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 */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int sum, a, b, c, d, e, i;
  FILE *fout;
  fout = fopen("Acending.txt", "w");
  fprintf(fout, "enter five number each are not the same\n");
  scanf("%d", &a);
  scanf("%d", &b);
  scanf("%d", &c);
  scanf("%d", &d);
  scanf("%d", &e);
  sum = a + b + c + d + e;
  for (i = 0; i <= sum; i++) {
    if (a == i || b == i || c == i || d == i || e == i)
      fprintf(fout, "Acending five number %d\n", i);
  }
  fclose(fout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    0xeb0(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xe9e(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
lea    0xeb9(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xea9(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xe99(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xe89(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xe79(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1251 <main+0x111>
mov    -0xc(%rbp),%eax
cmp    -0x20(%rbp),%eax
je     1229 <main+0xe9>
mov    -0x10(%rbp),%eax
cmp    -0x20(%rbp),%eax
je     1229 <main+0xe9>
mov    -0x14(%rbp),%eax
cmp    -0x20(%rbp),%eax
je     1229 <main+0xe9>
mov    -0x18(%rbp),%eax
cmp    -0x20(%rbp),%eax
je     1229 <main+0xe9>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    123e <main+0xfe>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%edx
lea    0xe04(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1243 <main+0x103>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11e1 <main+0xa1>
mov    -0x28(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xe9f(%rip),%rdi
lea    0xea5(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%r15
lea    0xe98(%rip),%rdi
mov    $0x28,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1070 <fwrite@plt>
lea    0xea8(%rip),%rbp
lea    0x14(%rsp),%rsi
mov    %rbp,%rdi
call   1050 <scanf@plt>
lea    0x10(%rsp),%rsi
mov    %rbp,%rdi
call   1050 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbp,%rdi
call   1050 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbp,%rdi
call   1050 <scanf@plt>
lea    0x4(%rsp),%rsi
mov    %rbp,%rdi
call   1050 <scanf@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%eax
lea    (%rax,%rdi,1),%ebp
mov    0xc(%rsp),%esi
add    %esi,%ebp
mov    0x8(%rsp),%edx
add    %edx,%ebp
mov    0x4(%rsp),%ecx
add    %ecx,%ebp
js     1250 <main+0x100>
lea    (%rdi,%rsi,1),%ebx
add    %edx,%ebx
add    %ecx,%ebx
add    %eax,%ebx
lea    0xe3b(%rip),%r14
xor    %ebp,%ebp
cmp    %edi,%ebp
je     1220 <main+0xd0>
cs nopw 0x0(%rax,%rax,1)
cmp    %eax,%ebp
je     1220 <main+0xd0>
cmp    %esi,%ebp
je     1220 <main+0xd0>
cmp    %edx,%ebp
je     1220 <main+0xd0>
cmp    %ecx,%ebp
jne    122f <main+0xdf>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
cmp    %ebp,%ebx
je     1250 <main+0x100>
add    $0x1,%ebp
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%eax
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    0x4(%rsp),%ecx
cmp    %edi,%ebp
jne    1210 <main+0xc0>
jmp    1220 <main+0xd0>
mov    %r15,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Acending.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [41 x i8] c"enter five number each are not the same\0A\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [25 x i8] c"Acending five number %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
store i32 0, i32* %1
%10 = call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %10, i32** %9
%11 = load i32*, i32** %9
%12 = call i32 (i32*, i8*, ...) @fprintf(i32* %11, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %3)
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %4)
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %5)
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %6)
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %7)
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = add nsw i32 %18, %19
%21 = load i32, i32* %5
%22 = add nsw i32 %20, %21
%23 = load i32, i32* %6
%24 = add nsw i32 %22, %23
%25 = load i32, i32* %7
%26 = add nsw i32 %24, %25
store i32 %26, i32* %2
store i32 0, i32* %8
br label %27
27: ; preds = %56, %0
%28 = load i32, i32* %8
%29 = load i32, i32* %2
%30 = icmp sle i32 %28, %29
br i1 %30, label %31, label %59
31: ; preds = %27
%32 = load i32, i32* %3
%33 = load i32, i32* %8
%34 = icmp eq i32 %32, %33
br i1 %34, label %51, label %35
35: ; preds = %31
%36 = load i32, i32* %4
%37 = load i32, i32* %8
%38 = icmp eq i32 %36, %37
br i1 %38, label %51, label %39
39: ; preds = %35
%40 = load i32, i32* %5
%41 = load i32, i32* %8
%42 = icmp eq i32 %40, %41
br i1 %42, label %51, label %43
43: ; preds = %39
%44 = load i32, i32* %6
%45 = load i32, i32* %8
%46 = icmp eq i32 %44, %45
br i1 %46, label %51, label %47
47: ; preds = %43
%48 = load i32, i32* %7
%49 = load i32, i32* %8
%50 = icmp eq i32 %48, %49
br i1 %50, label %51, label %55
51: ; preds = %47, %43, %39, %35, %31
%52 = load i32*, i32** %9
%53 = load i32, i32* %8
%54 = call i32 (i32*, i8*, ...) @fprintf(i32* %52, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %53)
br label %55
55: ; preds = %51, %47
br label %56
56: ; preds = %55
%57 = load i32, i32* %8
%58 = add nsw i32 %57, 1
store i32 %58, i32* %8
br label %27
59: ; preds = %27
%60 = load i32*, i32** %9
%61 = call i32 @fclose(i32* %60)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Acending.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [41 x i8] c"enter five number each are not the same\0A\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [25 x i8] c"Acending five number %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %1 to i8*
%7 = bitcast i32* %2 to i8*
%8 = bitcast i32* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = bitcast i32* %5 to i8*
%11 = tail call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%12 = tail call i64 @fwrite(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i64 40, i64 1, i32* %11)
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %1)
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %2)
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %3)
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %4)
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %5)
%18 = load i32, i32* %1
%19 = load i32, i32* %2
%20 = add i32 %19, %18
%21 = load i32, i32* %3
%22 = add i32 %20, %21
%23 = load i32, i32* %4
%24 = add i32 %22, %23
%25 = load i32, i32* %5
%26 = add i32 %24, %25
%27 = icmp slt i32 %26, 0
br i1 %27, label %55, label %28
28: ; preds = %0, %48
%29 = phi i32 [ %54, %48 ], [ %25, %0 ]
%30 = phi i32 [ %53, %48 ], [ %23, %0 ]
%31 = phi i32 [ %52, %48 ], [ %21, %0 ]
%32 = phi i32 [ %51, %48 ], [ %19, %0 ]
%33 = phi i32 [ %50, %48 ], [ %18, %0 ]
%34 = phi i32 [ %49, %48 ], [ 0, %0 ]
%35 = icmp eq i32 %33, %34
%36 = icmp eq i32 %32, %34
%37 = select i1 %35, i1 true, i1 %36
%38 = icmp eq i32 %31, %34
%39 = select i1 %37, i1 true, i1 %38
%40 = icmp eq i32 %30, %34
%41 = select i1 %39, i1 true, i1 %40
%42 = icmp eq i32 %29, %34
%43 = select i1 %41, i1 true, i1 %42
br i1 %43, label %44, label %46
44: ; preds = %28
%45 = call i32 (i32*, i8*, ...) @fprintf(i32* %11, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %34)
br label %46
46: ; preds = %28, %44
%47 = icmp eq i32 %34, %26
br i1 %47, label %55, label %48
48: ; preds = %46
%49 = add nuw i32 %34, 1
%50 = load i32, i32* %1
%51 = load i32, i32* %2
%52 = load i32, i32* %3
%53 = load i32, i32* %4
%54 = load i32, i32* %5
br label %28
55: ; preds = %46, %0
%56 = call i32 @fclose(i32* %11)
ret i32 0
}