#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*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sscanf(char *, char *, int *);
int main(void) {
  int a, b;
  char frase[40 + 1];
  char linea[80 + 1];
  printf("Dame el valor de un entero: ");
  gets(linea);
  sscanf(linea, "%d", &a);
  printf("Introduce ahora una frase: ");
  gets(frase);
  printf("Y ahora dame el valor de otro entero:");
  gets(linea);
  sscanf(linea, "%d", &b);
  printf("Enteros Ledos: %d, %d. \n", a, b);
  printf("Frase leida: %s. \n", frase);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xa0(%rbp),%rdi
call   1040 <gets@plt>
lea    -0xa0(%rbp),%rdi
lea    0xeb3(%rip),%rsi
lea    -0x8(%rbp),%rdx
call   1050 <sscanf@plt>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
call   1040 <gets@plt>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xa0(%rbp),%rdi
call   1040 <gets@plt>
lea    -0xa0(%rbp),%rdi
lea    0xe6b(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <sscanf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x40(%rbp),%rsi
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0xa0,%rsp
lea    0xebd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x40(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
lea    0xebf(%rip),%r15
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <sscanf@plt>
lea    0xeab(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1040 <gets@plt>
lea    0xeac(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <gets@plt>
lea    0x8(%rsp),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <sscanf@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
lea    0xea4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Dame el valor de un entero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [28 x i8] c"Introduce ahora una frase: \00"
@.str.3 = [38 x i8] c"Y ahora dame el valor de otro entero:\00"
@.str.4 = [25 x i8] c"Enteros Ledos: %d, %d. \0A\00"
@.str.5 = [19 x i8] c"Frase leida: %s. \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [41 x i8]
%5 = alloca [81 x i8]
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [81 x i8], [81 x i8]* %5, i64 0, i64 0
%8 = call i32 @gets(i8* %7)
%9 = getelementptr inbounds [81 x i8], [81 x i8]* %5, i64 0, i64 0
%10 = call i32 @sscanf(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%12 = getelementptr inbounds [41 x i8], [41 x i8]* %4, i64 0, i64 0
%13 = call i32 @gets(i8* %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%15 = getelementptr inbounds [81 x i8], [81 x i8]* %5, i64 0, i64 0
%16 = call i32 @gets(i8* %15)
%17 = getelementptr inbounds [81 x i8], [81 x i8]* %5, i64 0, i64 0
%18 = call i32 @sscanf(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %19, i32 %20)
%22 = getelementptr inbounds [41 x i8], [41 x i8]* %4, i64 0, i64 0
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i8* %22)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Dame el valor de un entero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [28 x i8] c"Introduce ahora una frase: \00"
@.str.3 = [38 x i8] c"Y ahora dame el valor de otro entero:\00"
@.str.4 = [25 x i8] c"Enteros Ledos: %d, %d. \0A\00"
@.str.5 = [19 x i8] c"Frase leida: %s. \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [41 x i8]
%4 = alloca [81 x i8]
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = getelementptr inbounds [41 x i8], [41 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [81 x i8], [81 x i8]* %4, i64 0, i64 0
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @gets(i8* %8)
%11 = call i32 @sscanf(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @gets(i8* %7)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%15 = call i32 @gets(i8* %8)
%16 = call i32 @sscanf(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%17 = load i32, i32* %1
%18 = load i32, i32* %2
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %17, i32 %18)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i8* %7)
ret i32 0
}