#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char **argv) {
  int a, b;
  printf("Numero 1: ");
  scanf("%d", &a);
  printf("Numero 2: ");
  scanf("%d", &b);
  while (a != b) {
    if (a > b) {
      a = a - b;
    } else
      b = b - a;
  }
  printf("M.C.D: %d", a);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb4(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
je     11a6 <main+0x86>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    1198 <main+0x78>
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    11a1 <main+0x81>
mov    -0x18(%rbp),%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1172 <main+0x52>
mov    -0x14(%rbp),%esi
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e22(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee3(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xebd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
mov    0x8(%rsp),%esi
cmp    %esi,%eax
jne    118c <main+0x6c>
mov    %eax,%esi
jmp    119c <main+0x7c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
sub    %eax,%esi
mov    %esi,0x8(%rsp)
mov    %eax,%ecx
cmp    %esi,%ecx
je     119c <main+0x7c>
mov    %eax,%ecx
sub    %esi,%ecx
jle    1180 <main+0x60>
mov    %ecx,0xc(%rsp)
mov    %ecx,%eax
cmp    %esi,%ecx
jne    118c <main+0x6c>
lea    0xe73(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e2f(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Numero 1: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [11 x i8] c"Numero 2: \00"
@.str.3 = [10 x i8] c"M.C.D: %d\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, 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)
br label %12
12: ; preds = %28, %2
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = icmp ne i32 %13, %14
br i1 %15, label %16, label %29
16: ; preds = %12
%17 = load i32, i32* %6
%18 = load i32, i32* %7
%19 = icmp sgt i32 %17, %18
br i1 %19, label %20, label %24
20: ; preds = %16
%21 = load i32, i32* %6
%22 = load i32, i32* %7
%23 = sub nsw i32 %21, %22
store i32 %23, i32* %6
br label %28
24: ; preds = %16
%25 = load i32, i32* %7
%26 = load i32, i32* %6
%27 = sub nsw i32 %25, %26
store i32 %27, i32* %7
br label %28
28: ; preds = %24, %20
br label %12
29: ; preds = %12
%30 = load i32, i32* %6
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %30)
%32 = load i32, i32* @EXIT_SUCCESS
ret i32 %32
}

LLVM IR (-O2):
@.str = [11 x i8] c"Numero 1: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [11 x i8] c"Numero 2: \00"
@.str.3 = [10 x i8] c"M.C.D: %d\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 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* %3)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 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* %4)
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = icmp eq i32 %11, %12
br i1 %13, label %26, label %14
14: ; preds = %2, %22
%15 = phi i32 [ %24, %22 ], [ %11, %2 ]
%16 = phi i32 [ %23, %22 ], [ %12, %2 ]
%17 = icmp sgt i32 %15, %16
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = sub nsw i32 %15, %16
store i32 %19, i32* %3
br label %22
20: ; preds = %14
%21 = sub nsw i32 %16, %15
store i32 %21, i32* %4
br label %22
22: ; preds = %20, %18
%23 = phi i32 [ %21, %20 ], [ %16, %18 ]
%24 = phi i32 [ %15, %20 ], [ %19, %18 ]
%25 = icmp eq i32 %24, %23
br i1 %25, label %26, label %14
26: ; preds = %22, %2
%27 = phi i32 [ %11, %2 ], [ %23, %22 ]
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %27)
%29 = load i32, i32* @EXIT_SUCCESS
ret i32 %29
}