#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*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int matriz[50][3];
  int i = 2;
  int cociente;
  int j, k;
  for (j = 0; j < 50; j++) {
    for (k = 0; k < 3; k++) {
      matriz[j][k] = 0;
    }
  }
  matriz[0][1] = 1;
  matriz[1][2] = 1;
  printf("Este programa calcula el MCD de dos numeros y la ");
  printf("identidad de Bezout. \n");
  printf("Introduce dos numeros: \n");
  scanf("%d", &matriz[0][0]);
  scanf("%d", &matriz[1][0]);
  while (1) {
    cociente = (matriz[i - 2][0] / matriz[i - 1][0]);
    matriz[i][0] = (matriz[i - 2][0] % matriz[i - 1][0]);
    matriz[i][1] = (matriz[i - 2][1] - (cociente * matriz[i - 1][1]));
    matriz[i][2] = (matriz[i - 2][2] - (cociente * matriz[i - 1][2]));
    if (matriz[i][0] == 0)
      break;
    i++;
  }
  printf("\n");
  printf("El MCD de %d y %d es %d \n\n", matriz[0][0], matriz[1][0],
         matriz[i - 1][0]);
  printf("Los coeficientes de la Identidad de Bezout son: \n\n");
  printf("x0 = %d \n", matriz[i - 1][1]);
  printf("y0 = %d \n\n", matriz[i - 1][2]);
  printf("%d*(%d) + %d*(%d) = %d", matriz[0][0], matriz[i - 1][1], matriz[1][0],
         matriz[i - 1][2], matriz[i - 1][0]);
  getchar();
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x270,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x264(%rbp)
movl   $0x0,-0x26c(%rbp)
cmpl   $0x32,-0x26c(%rbp)
jge    11ca <main+0x9a>
movl   $0x0,-0x270(%rbp)
cmpl   $0x3,-0x270(%rbp)
jge    11b1 <main+0x81>
movslq -0x26c(%rbp),%rcx
lea    -0x260(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x270(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x270(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x270(%rbp)
jmp    116d <main+0x3d>
jmp    11b6 <main+0x86>
mov    -0x26c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x26c(%rbp)
jmp    1156 <main+0x26>
movl   $0x1,-0x25c(%rbp)
movl   $0x1,-0x24c(%rbp)
lea    0xe1b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x260(%rbp),%rsi
lea    0xec3(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x260(%rbp),%rsi
add    $0xc,%rsi
lea    0xeac(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x264(%rbp),%eax
sub    $0x2,%eax
movslq %eax,%rcx
lea    -0x260(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
mov    (%rax),%eax
mov    -0x264(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rdx
lea    -0x260(%rbp),%rcx
imul   $0xc,%rdx,%rdx
add    %rdx,%rcx
cltd
idivl  (%rcx)
mov    %eax,-0x268(%rbp)
mov    -0x264(%rbp),%eax
sub    $0x2,%eax
movslq %eax,%rcx
lea    -0x260(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
mov    (%rax),%eax
mov    -0x264(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rdx
lea    -0x260(%rbp),%rcx
imul   $0xc,%rdx,%rdx
add    %rdx,%rcx
cltd
idivl  (%rcx)
movslq -0x264(%rbp),%rcx
lea    -0x260(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
mov    %edx,(%rax)
mov    -0x264(%rbp),%eax
sub    $0x2,%eax
movslq %eax,%rcx
lea    -0x260(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
mov    0x4(%rax),%ecx
mov    -0x268(%rbp),%eax
mov    -0x264(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rsi
lea    -0x260(%rbp),%rdx
imul   $0xc,%rsi,%rsi
add    %rsi,%rdx
imul   0x4(%rdx),%eax
sub    %eax,%ecx
movslq -0x264(%rbp),%rdx
lea    -0x260(%rbp),%rax
imul   $0xc,%rdx,%rdx
add    %rdx,%rax
mov    %ecx,0x4(%rax)
mov    -0x264(%rbp),%eax
sub    $0x2,%eax
movslq %eax,%rcx
lea    -0x260(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
mov    0x8(%rax),%ecx
mov    -0x268(%rbp),%eax
mov    -0x264(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rsi
lea    -0x260(%rbp),%rdx
imul   $0xc,%rsi,%rsi
add    %rsi,%rdx
imul   0x8(%rdx),%eax
sub    %eax,%ecx
movslq -0x264(%rbp),%rdx
lea    -0x260(%rbp),%rax
imul   $0xc,%rdx,%rdx
add    %rdx,%rax
mov    %ecx,0x8(%rax)
movslq -0x264(%rbp),%rcx
lea    -0x260(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
cmpl   $0x0,(%rax)
jne    139a <main+0x26a>
jmp    13ae <main+0x27e>
mov    -0x264(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x264(%rbp)
jmp    1232 <main+0x102>
lea    0xcf9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x260(%rbp),%esi
mov    -0x254(%rbp),%edx
mov    -0x264(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    -0x260(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
mov    (%rax),%ecx
lea    0xc77(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xc84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x264(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    -0x260(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
mov    0x4(%rax),%esi
lea    0xc8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x264(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    -0x260(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
mov    0x8(%rax),%esi
lea    0xc6b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x260(%rbp),%esi
mov    -0x264(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    -0x260(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
mov    0x4(%rax),%edx
mov    -0x254(%rbp),%ecx
mov    -0x264(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rdi
lea    -0x260(%rbp),%rax
imul   $0xc,%rdi,%rdi
add    %rdi,%rax
mov    0x8(%rax),%r8d
mov    -0x264(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rdi
lea    -0x260(%rbp),%rax
imul   $0xc,%rdi,%rdi
add    %rdi,%rax
mov    (%rax),%r9d
lea    0xc04(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    -0x4(%rbp),%eax
add    $0x270,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x258,%rsp
mov    %rsp,%r12
mov    $0x258,%edx
mov    %r12,%rdi
xor    %esi,%esi
call   1060 <memset@plt>
movl   $0x1,0x4(%rsp)
lea    0xc(%rsp),%r14
movl   $0x1,0x14(%rsp)
lea    0xe64(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xecf(%rip),%rdi
call   1040 <puts@plt>
lea    0xed9(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb4(%rip),%r15
mov    %r15,%rdi
mov    %r12,%rsi
call   1080 <scanf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1080 <scanf@plt>
mov    (%rsp),%eax
mov    0x4(%rsp),%esi
mov    0xc(%rsp),%edx
mov    0x10(%rsp),%r9d
mov    0x8(%rsp),%edi
mov    0x14(%rsp),%ebx
mov    %edx,%r8d
cltd
idiv   %r8d
mov    %eax,%ecx
mov    %r9d,%r10d
mov    %ebx,%r9d
mov    %r8d,%eax
mov    %edx,0x18(%r12)
mov    %r10d,%ebx
imul   %ecx,%ebx
sub    %ebx,%esi
mov    %esi,0x1c(%r12)
imul   %r9d,%ecx
sub    %ecx,%edi
mov    %edi,0x20(%r12)
add    $0xc,%r12
mov    %edi,%ebx
mov    %r9d,%edi
mov    %esi,%r9d
mov    %r10d,%esi
test   %edx,%edx
jne    11f0 <main+0x90>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    (%rsp),%esi
mov    0xc(%rsp),%edx
mov    (%r12),%ecx
lea    0xde4(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe4b(%rip),%rdi
call   1040 <puts@plt>
mov    0x4(%r12),%esi
lea    0xde0(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%r12),%esi
lea    0xdd7(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%r12),%r9d
mov    0x4(%r12),%edx
mov    (%rsp),%esi
mov    0xc(%rsp),%ecx
mov    0x8(%r12),%r8d
lea    0xdbf(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1070 <getchar@plt>
xor    %eax,%eax
call   1070 <getchar@plt>
xor    %eax,%eax
add    $0x258,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [50 x i8] c"Este programa calcula el MCD de dos numeros y la \00"
@.str.1 = [23 x i8] c"identidad de Bezout. \0A\00"
@.str.2 = [25 x i8] c"Introduce dos numeros: \0A\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [27 x i8] c"El MCD de %d y %d es %d \0A\0A\00"
@.str.6 = [51 x i8] c"Los coeficientes de la Identidad de Bezout son: \0A\0A\00"
@.str.7 = [10 x i8] c"x0 = %d \0A\00"
@.str.8 = [11 x i8] c"y0 = %d \0A\0A\00"
@.str.9 = [23 x i8] c"%d*(%d) + %d*(%d) = %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x [3 x i32]]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %3
store i32 0, i32* %5
br label %7
7: ; preds = %25, %0
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 50
br i1 %9, label %10, label %28
10: ; preds = %7
store i32 0, i32* %6
br label %11
11: ; preds = %21, %10
%12 = load i32, i32* %6
%13 = icmp slt i32 %12, 3
br i1 %13, label %14, label %24
14: ; preds = %11
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %2, i64 0, i64 %16
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [3 x i32], [3 x i32]* %17, i64 0, i64 %19
store i32 0, i32* %20
br label %21
21: ; preds = %14
%22 = load i32, i32* %6
%23 = add nsw i32 %22, 1
store i32 %23, i32* %6
br label %11
24: ; preds = %11
br label %25
25: ; preds = %24
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %7
28: ; preds = %7
%29 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %2, i64 0, i64 0
%30 = getelementptr inbounds [3 x i32], [3 x i32]* %29, i64 0, i64 1
store i32 1, i32* %30
%31 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %2, i64 0, i64 1
%32 = getelementptr inbounds [3 x i32], [3 x i32]* %31, i64 0, i64 2
store i32 1, i32* %32
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%36 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %2, i64 0, i64 0
%37 = getelementptr inbounds [3 x i32], [3 x i32]* %36, i64 0, i64 0
%38 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %37)
%39 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %2, i64 0, i64 1
%40 = getelementptr inbounds [3 x i32], [3 x i32]* %39, i64 0, i64 0
%41 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %40)
br label %42
42: ; preds = %28, %118
%43 = load i32, i32* %3
%44 = sub nsw i32 %43, 2
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %2, i64 0, i64 %45
%47 = getelementptr inbounds [3 x i32], [3 x i32]* %46, i64 0, i64 0
%48 = load i32, i32* %47
%49 = load i32, i32* %3
%50 = sub nsw i32 %49, 1
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %2, i64 0, i64 %51
%53 = getelementptr inbounds [3 x i32], [3 x i32]* %52, i64 0, i64 0
%54 = load i32, i32* %53
%55 = sdiv i32 %48, %54
store i32 %55, i32* %4
%56 = load i32, i32* %3
%57 = sub nsw i32 %56, 2
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %2, i64 0, i64 %58
%60 = getelementptr inbounds [3 x i32], [3 x i32]* %59, i64 0, i64 0
%61 = load i32, i32* %60
%62 = load i32, i32* %3
%63 = sub nsw i32 %62, 1
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %2, i64 0, i64 %64
%66 = getelementptr inbounds [3 x i32], [3 x i32]* %65, i64 0, i64 0
%67 = load i32, i32* %66
%68 = srem i32 %61, %67
%69 = load i32, i32* %3
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %2, i64 0, i64 %70
%72 = getelementptr inbounds [3 x i32], [3 x i32]* %71, i64 0, i64 0
store i32 %68, i32* %72
%73 = load i32, i32* %3
%74 = sub nsw i32 %73, 2
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %2, i64 0, i64 %75
%77 = getelementptr inbounds [3 x i32], [3 x i32]* %76, i64 0, i64 1
%78 = load i32, i32* %77
%79 = load i32, i32* %4
%80 = load i32, i32* %3
%81 = sub nsw i32 %80, 1
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %2, i64 0, i64 %82
%84 = getelementptr inbounds [3 x i32], [3 x i32]* %83, i64 0, i64 1
%85 = load i32, i32* %84
%86 = mul nsw i32 %79, %85
%87 = sub nsw i32 %78, %86
%88 = load i32, i32* %3
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %2, i64 0, i64 %89
%91 = getelementptr inbounds [3 x i32], [3 x i32]* %90, i64 0, i64 1
store i32 %87, i32* %91
%92 = load i32, i32* %3
%93 = sub nsw i32 %92, 2
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %2, i64 0, i64 %94
%96 = getelementptr inbounds [3 x i32], [3 x i32]* %95, i64 0, i64 2
%97 = load i32, i32* %96
%98 = load i32, i32* %4
%99 = load i32, i32* %3
%100 = sub nsw i32 %99, 1
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %2, i64 0, i64 %101
%103 = getelementptr inbounds [3 x i32], [3 x i32]* %102, i64 0, i64 2
%104 = load i32, i32* %103
%105 = mul nsw i32 %98, %104
%106 = sub nsw i32 %97, %105
%107 = load i32, i32* %3
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %2, i64 0, i64 %108
%110 = getelementptr inbounds [3 x i32], [3 x i32]* %109, i64 0, i64 2
store i32 %106, i32* %110
%111 = load i32, i32* %3
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %2, i64 0, i64 %112
%114 = getelementptr inbounds [3 x i32], [3 x i32]* %113, i64 0, i64 0
%115 = load i32, i32* %114
%116 = icmp eq i32 %115, 0
br i1 %116, label %117, label %118
117: ; preds = %42
br label %121
118: ; preds = %42
%119 = load i32, i32* %3
%120 = add nsw i32 %119, 1
store i32 %120, i32* %3
br label %42
121: ; preds = %117
%122 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%123 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %2, i64 0, i64 0
%124 = getelementptr inbounds [3 x i32], [3 x i32]* %123, i64 0, i64 0
%125 = load i32, i32* %124
%126 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %2, i64 0, i64 1
%127 = getelementptr inbounds [3 x i32], [3 x i32]* %126, i64 0, i64 0
%128 = load i32, i32* %127
%129 = load i32, i32* %3
%130 = sub nsw i32 %129, 1
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %2, i64 0, i64 %131
%133 = getelementptr inbounds [3 x i32], [3 x i32]* %132, i64 0, i64 0
%134 = load i32, i32* %133
%135 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i32 %125, i32 %128, i32 %134)
%136 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.6, i64 0, i64 0))
%137 = load i32, i32* %3
%138 = sub nsw i32 %137, 1
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %2, i64 0, i64 %139
%141 = getelementptr inbounds [3 x i32], [3 x i32]* %140, i64 0, i64 1
%142 = load i32, i32* %141
%143 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32 %142)
%144 = load i32, i32* %3
%145 = sub nsw i32 %144, 1
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %2, i64 0, i64 %146
%148 = getelementptr inbounds [3 x i32], [3 x i32]* %147, i64 0, i64 2
%149 = load i32, i32* %148
%150 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i32 %149)
%151 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %2, i64 0, i64 0
%152 = getelementptr inbounds [3 x i32], [3 x i32]* %151, i64 0, i64 0
%153 = load i32, i32* %152
%154 = load i32, i32* %3
%155 = sub nsw i32 %154, 1
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %2, i64 0, i64 %156
%158 = getelementptr inbounds [3 x i32], [3 x i32]* %157, i64 0, i64 1
%159 = load i32, i32* %158
%160 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %2, i64 0, i64 1
%161 = getelementptr inbounds [3 x i32], [3 x i32]* %160, i64 0, i64 0
%162 = load i32, i32* %161
%163 = load i32, i32* %3
%164 = sub nsw i32 %163, 1
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %2, i64 0, i64 %165
%167 = getelementptr inbounds [3 x i32], [3 x i32]* %166, i64 0, i64 2
%168 = load i32, i32* %167
%169 = load i32, i32* %3
%170 = sub nsw i32 %169, 1
%171 = sext i32 %170 to i64
%172 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %2, i64 0, i64 %171
%173 = getelementptr inbounds [3 x i32], [3 x i32]* %172, i64 0, i64 0
%174 = load i32, i32* %173
%175 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i32 %153, i32 %159, i32 %162, i32 %168, i32 %174)
%176 = call i32 (...) @getchar()
%177 = call i32 (...) @getchar()
%178 = load i32, i32* %1
ret i32 %178
}

LLVM IR (-O2):
@.str = [50 x i8] c"Este programa calcula el MCD de dos numeros y la \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.5 = [27 x i8] c"El MCD de %d y %d es %d \0A\0A\00"
@.str.7 = [10 x i8] c"x0 = %d \0A\00"
@.str.8 = [11 x i8] c"y0 = %d \0A\0A\00"
@.str.9 = [23 x i8] c"%d*(%d) + %d*(%d) = %d\00"
@str = [22 x i8] c"identidad de Bezout. \00"
@str.10 = [24 x i8] c"Introduce dos numeros: \00"
@str.11 = [50 x i8] c"Los coeficientes de la Identidad de Bezout son: \0A\00"
define i32 @main() {
%1 = alloca [50 x [3 x i32]]
%2 = bitcast [50 x [3 x i32]]* %1 to i8*
%3 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %1, i64 0, i64 0, i64 1
store i32 1, i32* %3
%4 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %1, i64 0, i64 1, i64 2
store i32 1, i32* %4
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.10, i64 0, i64 0))
%8 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %1, i64 0, i64 0, i64 0
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %8)
%10 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %1, i64 0, i64 1, i64 0
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %10)
%12 = load i32, i32* %8
%13 = load i32, i32* %10
%14 = load i32, i32* %3
%15 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %1, i64 0, i64 1, i64 1
%16 = load i32, i32* %15
%17 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %1, i64 0, i64 0, i64 2
%18 = load i32, i32* %17
%19 = load i32, i32* %4
br label %20
20: ; preds = %20, %0
%21 = phi i32 [ %35, %20 ], [ %19, %0 ]
%22 = phi i32 [ %21, %20 ], [ %18, %0 ]
%23 = phi i32 [ %32, %20 ], [ %16, %0 ]
%24 = phi i32 [ %23, %20 ], [ %14, %0 ]
%25 = phi i32 [ %29, %20 ], [ %13, %0 ]
%26 = phi i32 [ %25, %20 ], [ %12, %0 ]
%27 = phi i64 [ %38, %20 ], [ 2, %0 ]
%28 = sdiv i32 %26, %25
%29 = srem i32 %26, %25
%30 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %1, i64 0, i64 %27, i64 0
store i32 %29, i32* %30
%31 = mul nsw i32 %23, %28
%32 = sub nsw i32 %24, %31
%33 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %1, i64 0, i64 %27, i64 1
store i32 %32, i32* %33
%34 = mul nsw i32 %21, %28
%35 = sub nsw i32 %22, %34
%36 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %1, i64 0, i64 %27, i64 2
store i32 %35, i32* %36
%37 = icmp eq i32 %29, 0
%38 = add nuw i64 %27, 1
br i1 %37, label %39, label %20
39: ; preds = %20
%40 = add nsw i64 %27, -1
%41 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %1, i64 0, i64 %40, i64 0
%42 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %1, i64 0, i64 %40, i64 1
%43 = getelementptr inbounds [50 x [3 x i32]], [50 x [3 x i32]]* %1, i64 0, i64 %40, i64 2
%44 = call i32 @putchar(i32 10)
%45 = load i32, i32* %8
%46 = load i32, i32* %10
%47 = load i32, i32* %41
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i32 %45, i32 %46, i32 %47)
%49 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.11, i64 0, i64 0))
%50 = load i32, i32* %42
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32 %50)
%52 = load i32, i32* %43
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i32 %52)
%54 = load i32, i32* %8
%55 = load i32, i32* %42
%56 = load i32, i32* %10
%57 = load i32, i32* %43
%58 = load i32, i32* %41
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i32 %54, i32 %55, i32 %56, i32 %57, i32 %58)
%60 = call i32 (...) @getchar()
%61 = call i32 (...) @getchar()
ret i32 0
}