#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(int argc, char *argv[]) {
  char str[80];
  int a, b, c;
  printf("nhap a: ");
  scanf("%d", &a);
  printf("\n nhap b: ");
  scanf("%d", &b);
  printf("\n nhap c: ");
  scanf("%d", &c);
  if (a + b > c || b + c > a || a + c > b) {
    printf("\n a b c khong the la canh cua 1 tam giac");
  } else {
    printf("\n a b c la canh cua 1 tam giac");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
lea    -0x64(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
lea    0xea4(%rip),%rdi
lea    -0x68(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
lea    0xe88(%rip),%rdi
lea    -0x6c(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x64(%rbp),%eax
add    -0x68(%rbp),%eax
cmp    -0x6c(%rbp),%eax
jg     11b7 <main+0x97>
mov    -0x68(%rbp),%eax
add    -0x6c(%rbp),%eax
cmp    -0x64(%rbp),%eax
jg     11b7 <main+0x97>
mov    -0x64(%rbp),%eax
add    -0x6c(%rbp),%eax
cmp    -0x68(%rbp),%eax
jle    11c8 <main+0xa8>
lea    0xe64(%rip),%rdi
call   1030 <printf@plt>
jmp    11d4 <main+0xb4>
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
lea    0xed1(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
mov    0x8(%rsp),%ecx
mov    0x4(%rsp),%edx
lea    (%rdx,%rax,1),%esi
cmp    %ecx,%esi
lea    0xe93(%rip),%rsi
lea    0xeb5(%rip),%rdi
cmovg  %rsi,%rdi
lea    (%rdx,%rcx,1),%ebx
cmp    %eax,%ebx
cmovg  %rsi,%rdi
add    %ecx,%eax
cmp    %edx,%eax
cmovg  %rsi,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"nhap a: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [11 x i8] c"\0A nhap b: \00"
@.str.3 = [11 x i8] c"\0A nhap c: \00"
@.str.4 = [41 x i8] c"\0A a b c khong the la canh cua 1 tam giac\00"
@.str.5 = [31 x i8] c"\0A a b c la canh cua 1 tam giac\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [80 x i8]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%12 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%14 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = add nsw i32 %16, %17
%19 = load i32, i32* %9
%20 = icmp sgt i32 %18, %19
br i1 %20, label %33, label %21
21: ; preds = %2
%22 = load i32, i32* %8
%23 = load i32, i32* %9
%24 = add nsw i32 %22, %23
%25 = load i32, i32* %7
%26 = icmp sgt i32 %24, %25
br i1 %26, label %33, label %27
27: ; preds = %21
%28 = load i32, i32* %7
%29 = load i32, i32* %9
%30 = add nsw i32 %28, %29
%31 = load i32, i32* %8
%32 = icmp sgt i32 %30, %31
br i1 %32, label %33, label %35
33: ; preds = %27, %21, %2
%34 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0))
br label %37
35: ; preds = %27
%36 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
br label %37
37: ; preds = %35, %33
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"nhap a: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [11 x i8] c"\0A nhap b: \00"
@.str.3 = [11 x i8] c"\0A nhap c: \00"
@.str.4 = [41 x i8] c"\0A a b c khong the la canh cua 1 tam giac\00"
@.str.5 = [31 x i8] c"\0A a b c la canh cua 1 tam giac\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, 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 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%13 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = add nsw i32 %16, %15
%18 = load i32, i32* %5
%19 = icmp sgt i32 %17, %18
%20 = add nsw i32 %18, %16
%21 = icmp sgt i32 %20, %15
%22 = select i1 %19, i1 true, i1 %21
%23 = add nsw i32 %18, %15
%24 = icmp sgt i32 %23, %16
%25 = select i1 %22, i1 true, i1 %24
%26 = select i1 %25, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0)
%27 = call i32 @printf(i8* dereferenceable(1) %26)
ret i32 0
}