xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
int funzione_b(const int a) {
  printf("sono la funzione b e il mio valore e %d\n", a);
  return a;
}


x86 assembly (clang, -O0):
<funzione_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funzione_b>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"sono la funzione b e il mio valore e %d\0A\00"
define i32 @funzione_b(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
@.str = [41 x i8] c"sono la funzione b e il mio valore e %d\0A\00"
define i32 @funzione_b(i32 returned %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *program) {
  fprintf(stderr, "usage: %s [-o filename] [-s] teledisk-dump\n", program);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"usage: %s [-o filename] [-s] teledisk-dump\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"usage: %s [-o filename] [-s] teledisk-dump\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct cec_msg {
  int len;
  int /*<<< orphan*/ *msg;
};

/* Variables and functions */
int /*<<< orphan*/ CEC_MSG_TUNER_STEP_DECREMENT;
void cec_msg_tuner_step_decrement(struct cec_msg *msg) {
  msg->len = 2;
  msg->msg[1] = CEC_MSG_TUNER_STEP_DECREMENT;
}


x86 assembly (clang, -O0):
<cec_msg_tuner_step_decrement>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
mov    0x2ed7(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cec_msg_tuner_step_decrement>:
movl   $0x2,(%rdi)
mov    0x2ee3(%rip),%rax
mov    (%rax),%eax
mov    0x8(%rdi),%rcx
mov    %eax,0x4(%rcx)
ret

LLVM IR (-O0):
%struct.cec_msg = type { i32, i32* }
@CEC_MSG_TUNER_STEP_DECREMENT = global i32 0
define void @cec_msg_tuner_step_decrement(%struct.cec_msg* %0) {
%2 = alloca %struct.cec_msg*
store %struct.cec_msg* %0, %struct.cec_msg** %2
%3 = load %struct.cec_msg*, %struct.cec_msg** %2
%4 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %3, i32 0, i32 0
store i32 2, i32* %4
%5 = load i32, i32* @CEC_MSG_TUNER_STEP_DECREMENT
%6 = load %struct.cec_msg*, %struct.cec_msg** %2
%7 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %6, i32 0, i32 1
%8 = load i32*, i32** %7
%9 = getelementptr inbounds i32, i32* %8, i64 1
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
%struct.cec_msg = type { i32, i32* }
@CEC_MSG_TUNER_STEP_DECREMENT = global i32 0
define void @cec_msg_tuner_step_decrement(%struct.cec_msg* nocapture %0) {
%2 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 0
store i32 2, i32* %2
%3 = load i32, i32* @CEC_MSG_TUNER_STEP_DECREMENT
%4 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 1
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 %3, i32* %6
ret void
}
void free(void *ptr) {
  static void *(*original)(void *p) = 0;
  load_func_or_crash((void *)&original, __FUNCTION__);
  if (!original) {
    return;
  }
  original(ptr);
  log_alloc(__FUNCTION__, 0, ptr, 0, 0);
}


x86 assembly (clang, -O0):
<free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0x2f05(%rip),%rdi
lea    0xec6(%rip),%rsi
mov    $0x0,%al
call   1040 <load_func_or_crash@plt>
cmpq   $0x0,0x2eef(%rip)
jne    1154 <free+0x34>
jmp    117c <free+0x5c>
mov    0x2edd(%rip),%rax
mov    -0x8(%rbp),%rdi
call   *%rax
mov    -0x8(%rbp),%rdx
lea    0xe94(%rip),%rdi
xor    %r8d,%r8d
mov    %r8d,%esi
mov    %r8d,%ecx
mov    $0x0,%al
call   1030 <log_alloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free>:
push   %rbx
mov    %rdi,%rbx
lea    0x2f0d(%rip),%rdi
lea    0xece(%rip),%rsi
xor    %eax,%eax
call   1040 <load_func_or_crash@plt>
mov    0x2ef8(%rip),%rax
test   %rax,%rax
je     1163 <free+0x43>
mov    %rbx,%rdi
call   *%rax
lea    0xeaf(%rip),%rdi
xor    %esi,%esi
mov    %rbx,%rdx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %eax,%eax
pop    %rbx
jmp    1030 <log_alloc@plt>
pop    %rbx
ret

LLVM IR (-O0):
@free.original = internal global i8* (i8*)* null
@__FUNCTION__.free = [5 x i8] c"free\00"
define void @free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @load_func_or_crash to i32 (i8*, i8*, ...)*)(i8* bitcast (i8* (i8*)** @free.original to i8*), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.free, i64 0, i64 0))
%4 = load i8* (i8*)*, i8* (i8*)** @free.original
%5 = icmp ne i8* (i8*)* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
br label %13
7: ; preds = %1
%8 = load i8* (i8*)*, i8* (i8*)** @free.original
%9 = load i8*, i8** %2
%10 = call i8* %8(i8* %9)
%11 = load i8*, i8** %2
%12 = call i32 (i8*, i32, i8*, i32, i32, ...) bitcast (i32 (...)* @log_alloc to i32 (i8*, i32, i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.free, i64 0, i64 0), i32 0, i8* %11, i32 0, i32 0)
br label %13
13: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
@free.original = internal global i8* (i8*)* null
@__FUNCTION__.free = [5 x i8] c"free\00"
define void @free(i8* %0) {
%2 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @load_func_or_crash to i32 (i8*, i8*, ...)*)(i8* bitcast (i8* (i8*)** @free.original to i8*), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.free, i64 0, i64 0))
%3 = load i8* (i8*)*, i8* (i8*)** @free.original
%4 = icmp eq i8* (i8*)* %3, null
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call i8* %3(i8* %0)
%7 = tail call i32 (i8*, i32, i8*, i32, i32, ...) bitcast (i32 (...)* @log_alloc to i32 (i8*, i32, i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.free, i64 0, i64 0), i32 0, i8* %0, i32 0, i32 0)
br label %8
8: ; preds = %1, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ ft_putstrerrno(char *);
int ft_positive(int n) {
  if (n == -2147483648) {
    ft_putstrerrno("I can't make positive the -2147483648 value in int");
    exit(2);
  }
  if (n < 0)
    return (-1 * n);
  return (n);
}


x86 assembly (clang, -O0):
<ft_positive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movslq -0x8(%rbp),%rax
cmp    $0xffffffff80000000,%rax
jne    1151 <ft_positive+0x31>
lea    0xebe(%rip),%rdi
call   1030 <ft_putstrerrno@plt>
mov    $0x2,%edi
call   1040 <exit@plt>
cmpl   $0x0,-0x8(%rbp)
jge    116a <ft_positive+0x4a>
imul   $0xffffffff,-0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1170 <ft_positive+0x50>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_positive>:
cmp    $0x80000000,%edi
je     1130 <ft_positive+0x10>
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <ft_putstrerrno@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [51 x i8] c"I can't make positive the -2147483648 value in int\00"
define i32 @ft_positive(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = sext i32 %4 to i64
%6 = icmp eq i64 %5, -2147483648
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = call i32 @ft_putstrerrno(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 2)
unreachable
10: ; preds = %1
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* %3
%15 = mul nsw i32 -1, %14
store i32 %15, i32* %2
br label %18
16: ; preds = %10
%17 = load i32, i32* %3
store i32 %17, i32* %2
br label %18
18: ; preds = %16, %13
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@.str = [51 x i8] c"I can't make positive the -2147483648 value in int\00"
define i32 @ft_positive(i32 %0) {
%2 = icmp eq i32 %0, -2147483648
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @ft_putstrerrno(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 2)
unreachable
6: ; preds = %1
%7 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ detexPack32RGBA8(int, int, int, int);
__attribute__((always_)) uint32_t detexPack32RGB8Alpha0xFF(int r, int g,
                                                           int b) {
  return detexPack32RGBA8(r, g, b, 0xFF);
}


x86 assembly (clang, -O0):
<detexPack32RGB8Alpha0xFF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0xff,%ecx
call   1030 <detexPack32RGBA8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<detexPack32RGB8Alpha0xFF>:
mov    $0xff,%ecx
jmp    1030 <detexPack32RGBA8@plt>

LLVM IR (-O0):
define i32 @detexPack32RGB8Alpha0xFF(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @detexPack32RGBA8(i32 %7, i32 %8, i32 %9, i32 255)
ret i32 %10
}

LLVM IR (-O2):
define i32 @detexPack32RGB8Alpha0xFF(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @detexPack32RGBA8(i32 %0, i32 %1, i32 %2, i32 255)
ret i32 %4
}
void jz4740_clock_debugfs_update_parent(struct clk *clk) {}


x86 assembly (clang, -O0):
<jz4740_clock_debugfs_update_parent>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<jz4740_clock_debugfs_update_parent>:
ret

LLVM IR (-O0):
%struct.clk = type opaque
define void @jz4740_clock_debugfs_update_parent(%struct.clk* %0) {
%2 = alloca %struct.clk*
store %struct.clk* %0, %struct.clk** %2
ret void
}

LLVM IR (-O2):
%struct.clk = type opaque
define void @jz4740_clock_debugfs_update_parent(%struct.clk* nocapture %0) {
ret void
}
/* Variables and functions */
unsigned int atoi(char *);
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ sprintf(char *, char *, unsigned int);
unsigned int shortHash(unsigned int x) {
  char stringNum[10 * 2];
  char stringShort[6 + 1];
  sprintf(stringNum, "%u", x);
  memcpy(stringShort, stringNum, 6);
  stringShort[6] = '\0';
  return atoi(stringShort);
}


x86 assembly (clang, -O0):
<shortHash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeb7(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x27(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x6,%edx
call   1030 <memcpy@plt>
movb   $0x0,-0x21(%rbp)
lea    -0x27(%rbp),%rdi
call   1040 <atoi@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shortHash>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %edi,%edx
lea    0xec0(%rip),%rsi
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1050 <sprintf@plt>
lea    0x9(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x6,%edx
call   1030 <memcpy@plt>
movb   $0x0,0xf(%rsp)
mov    %rbx,%rdi
call   1040 <atoi@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%u\00"
define i32 @shortHash(i32 %0) {
%2 = alloca i32
%3 = alloca [20 x i8]
%4 = alloca [7 x i8]
store i32 %0, i32* %2
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [7 x i8], [7 x i8]* %4, i64 0, i64 0
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%10 = call i32 @memcpy(i8* %8, i8* %9, i32 6)
%11 = getelementptr inbounds [7 x i8], [7 x i8]* %4, i64 0, i64 6
store i8 0, i8* %11
%12 = getelementptr inbounds [7 x i8], [7 x i8]* %4, i64 0, i64 0
%13 = call i32 @atoi(i8* %12)
ret i32 %13
}

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
define i32 @shortHash(i32 %0) {
%2 = alloca [20 x i8]
%3 = alloca [7 x i8]
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 0
%6 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = call i32 @memcpy(i8* %5, i8* %4, i32 6)
%8 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 6
store i8 0, i8* %8
%9 = call i32 @atoi(i8* %5)
ret i32 %9
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_dobldobl_multi_homogenization(int n, int m, int *idz, int lintype) {
  int fail;
  int pars[3];
  double *c;
  pars[0] = n;
  pars[1] = m;
  pars[2] = lintype;
  fail = _ada_use_c2phc4c(905, pars, idz, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_dobldobl_multi_homogenization>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    -0x24(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    $0x389,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_dobldobl_multi_homogenization>:
sub    $0x18,%rsp
mov    %edi,0xc(%rsp)
mov    %esi,0x10(%rsp)
mov    %ecx,0x14(%rsp)
lea    0xc(%rsp),%rsi
mov    $0x389,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @syscon_dobldobl_multi_homogenization(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca [3 x i32]
%11 = alloca double*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%12 = load i32, i32* %5
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 0
store i32 %12, i32* %13
%14 = load i32, i32* %6
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 1
store i32 %14, i32* %15
%16 = load i32, i32* %8
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 2
store i32 %16, i32* %17
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 0
%19 = load i32*, i32** %7
%20 = load double*, double** %11
%21 = call i32 @_ada_use_c2phc4c(i32 905, i32* %18, i32* %19, double* %20, i32 0)
store i32 %21, i32* %9
%22 = load i32, i32* %9
ret i32 %22
}

LLVM IR (-O2):
define i32 @syscon_dobldobl_multi_homogenization(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca [3 x i32]
%6 = bitcast [3 x i32]* %5 to i8*
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
store i32 %0, i32* %7
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 1
store i32 %1, i32* %8
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 2
store i32 %3, i32* %9
%10 = call i32 @_ada_use_c2phc4c(i32 905, i32* %7, i32* %2, double* undef, i32 0)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
void malloc_good() {
  int *p = (int *)malloc(sizeof(int));
  if (p) {
    *p = 5;
    int x = *p;
  }
  free(p);
}


x86 assembly (clang, -O0):
<malloc_good>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1154 <malloc_good+0x34>
mov    -0x8(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_good>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1136 <malloc_good+0x16>
movl   $0x5,(%rax)
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @malloc_good() {
%1 = alloca i32*
%2 = alloca i32
%3 = call i64 @malloc(i32 4)
%4 = inttoptr i64 %3 to i32*
store i32* %4, i32** %1
%5 = load i32*, i32** %1
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = load i32*, i32** %1
store i32 5, i32* %8
%9 = load i32*, i32** %1
%10 = load i32, i32* %9
store i32 %10, i32* %2
br label %11
11: ; preds = %7, %0
%12 = load i32*, i32** %1
%13 = call i32 @free(i32* %12)
ret void
}

LLVM IR (-O2):
define void @malloc_good() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
%3 = icmp eq i64 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %0
store i32 5, i32* %2
br label %5
5: ; preds = %4, %0
%6 = tail call i32 @free(i32* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ASN1_T61STRING;

/* Variables and functions */
int /*<<< orphan*/ ASN1_T61STRING_it;
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void ASN1_T61STRING_free(ASN1_T61STRING *a) {
  ASN1_item_free((ASN1_VALUE *)a, &ASN1_T61STRING_it);
}


x86 assembly (clang, -O0):
<ASN1_T61STRING_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rsi
call   1030 <ASN1_item_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASN1_T61STRING_free>:
mov    0x2ec9(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

LLVM IR (-O0):
@ASN1_T61STRING_it = global i32 0
define void @ASN1_T61STRING_free(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @ASN1_item_free(i32* %3, i32* @ASN1_T61STRING_it)
ret void
}

LLVM IR (-O2):
@ASN1_T61STRING_it = global i32 0
define void @ASN1_T61STRING_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @ASN1_T61STRING_it)
ret void
}
int double_comp(const void *r1_ptr, const void *r2_ptr) {
  double *r1 = (double *)r1_ptr;
  double *r2 = (double *)r2_ptr;
  if (*r1 < *r2)
    return (-1);
  else if (*r1 > *r2)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<double_comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1142 <double_comp+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <double_comp+0x6b>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    1164 <double_comp+0x64>
movl   $0x1,-0x4(%rbp)
jmp    116b <double_comp+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_comp>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @double_comp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double*
%7 = alloca double*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
store double* %9, double** %6
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to double*
store double* %11, double** %7
%12 = load double*, double** %6
%13 = load double, double* %12
%14 = load double*, double** %7
%15 = load double, double* %14
%16 = fcmp olt double %13, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %26
18: ; preds = %2
%19 = load double*, double** %6
%20 = load double, double* %19
%21 = load double*, double** %7
%22 = load double, double* %21
%23 = fcmp ogt double %20, %22
br i1 %23, label %24, label %25
24: ; preds = %18
store i32 1, i32* %3
br label %26
25: ; preds = %18
store i32 0, i32* %3
br label %26
26: ; preds = %25, %24, %17
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @double_comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = bitcast i8* %1 to double*
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
%8 = fcmp ogt double %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ DefineKeys();
BeginOfProgram() { DefineKeys(); }


x86 assembly (clang, -O0):
<BeginOfProgram>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <DefineKeys@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BeginOfProgram>:
xor    %eax,%eax
jmp    1030 <DefineKeys@plt>

LLVM IR (-O0):
define i32 @BeginOfProgram() {
%1 = alloca i32
%2 = call i32 (...) @DefineKeys()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @BeginOfProgram() {
%1 = tail call i32 (...) @DefineKeys()
ret i32 undef
}
/* Type definitions */
struct fsm {
  int dummy;
};

/* Variables and functions */
struct fsm *fsm_kleene_closure(struct fsm *, int /*<<< orphan*/);
struct fsm *fsm_kleene_star(struct fsm *net) {
  return (fsm_kleene_closure(net, 0));
}


x86 assembly (clang, -O0):
<fsm_kleene_star>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <fsm_kleene_closure@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsm_kleene_star>:
xor    %esi,%esi
jmp    1030 <fsm_kleene_closure@plt>

LLVM IR (-O0):
%struct.fsm = type { i32 }
define %struct.fsm* @fsm_kleene_star(%struct.fsm* %0) {
%2 = alloca %struct.fsm*
store %struct.fsm* %0, %struct.fsm** %2
%3 = load %struct.fsm*, %struct.fsm** %2
%4 = call %struct.fsm* @fsm_kleene_closure(%struct.fsm* %3, i32 0)
ret %struct.fsm* %4
}

LLVM IR (-O2):
%struct.fsm = type { i32 }
define %struct.fsm* @fsm_kleene_star(%struct.fsm* %0) {
%2 = tail call %struct.fsm* @fsm_kleene_closure(%struct.fsm* %0, i32 0)
ret %struct.fsm* %2
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ printf(char *, char *, char *, char *);
int main(void) {
  char s1[17];
  char s2[] = "Copy this string";
  memcpy(s1, s2, 17);
  printf("%s\n%s\"%s\"\n", "After s2 is copied into s1 with memcpy,",
         "s1 contains ", s1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xec5(%rip),%al
mov    %al,-0x30(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x11,%edx
call   1040 <memcpy@plt>
lea    -0x20(%rbp),%rcx
lea    0xea6(%rip),%rdi
lea    0xeaa(%rip),%rsi
lea    0xecb(%rip),%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
movb   $0x0,0x10(%rsp)
lea    0x20(%rsp),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    $0x11,%edx
call   1040 <memcpy@plt>
lea    0xec0(%rip),%rdi
lea    0xec4(%rip),%rsi
lea    0xee5(%rip),%rdx
mov    %rbx,%rcx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s2 = [17 x i8] c"Copy this string\00"
@.str = [11 x i8] c"%s\0A%s\22%s\22\0A\00"
@.str.1 = [40 x i8] c"After s2 is copied into s1 with memcpy,\00"
@.str.2 = [13 x i8] c"s1 contains \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [17 x i8]
%3 = alloca [17 x i8]
store i32 0, i32* %1
%4 = bitcast [17 x i8]* %3 to i8*
%5 = getelementptr inbounds [17 x i8], [17 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [17 x i8], [17 x i8]* %3, i64 0, i64 0
%7 = call i32 @memcpy(i8* %5, i8* %6, i32 17)
%8 = getelementptr inbounds [17 x i8], [17 x i8]* %2, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s2 = [17 x i8] c"Copy this string\00"
@.str = [11 x i8] c"%s\0A%s\22%s\22\0A\00"
@.str.1 = [40 x i8] c"After s2 is copied into s1 with memcpy,\00"
@.str.2 = [13 x i8] c"s1 contains \00"
define i32 @main() {
%1 = alloca [17 x i8]
%2 = alloca [17 x i8]
%3 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [17 x i8], [17 x i8]* %2, i64 0, i64 0
%5 = call i32 @memcpy(i8* %3, i8* %4, i32 17)
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %3)
ret i32 0
}
void gtk_widget_class_install_style_property_parser() {}


x86 assembly (clang, -O0):
<gtk_widget_class_install_style_property_parser>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gtk_widget_class_install_style_property_parser>:
ret

LLVM IR (-O0):
define void @gtk_widget_class_install_style_property_parser() {
ret void
}

LLVM IR (-O2):
define void @gtk_widget_class_install_style_property_parser() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
char *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void GetLine(char *str, FILE *in) {
  char *result;
  result = fgets(str, 256, in);
  if ((result == NULL) && !feof(in))
    fprintf(stderr, "Error occurred while reading from file\n");
}


x86 assembly (clang, -O0):
<GetLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x100,%esi
call   1030 <fgets@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1188 <GetLine+0x58>
mov    -0x10(%rbp),%rdi
call   1050 <feof@plt>
cmp    $0x0,%eax
jne    1188 <GetLine+0x58>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
lea    0xe7d(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetLine>:
push   %rbx
mov    %rsi,%rbx
mov    $0x100,%esi
mov    %rbx,%rdx
call   1030 <fgets@plt>
test   %rax,%rax
jne    1152 <GetLine+0x22>
mov    %rbx,%rdi
call   1050 <feof@plt>
test   %eax,%eax
je     1154 <GetLine+0x24>
pop    %rbx
ret
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"Error occurred while reading from file\0A\00"
define void @GetLine(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i8*
store i8* %0, i8** %3
store i32* %1, i32** %4
%6 = load i8*, i8** %3
%7 = load i32*, i32** %4
%8 = call i8* @fgets(i8* %6, i32 256, i32* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i32*, i32** %4
%13 = call i32 @feof(i32* %12)
%14 = icmp ne i32 %13, 0
br i1 %14, label %18, label %15
15: ; preds = %11
%16 = load i32, i32* @stderr
%17 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %15, %11, %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"Error occurred while reading from file\0A\00"
define void @GetLine(i8* %0, i32* nocapture %1) {
%3 = tail call i8* @fgets(i8* %0, i32 256, i32* %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = tail call i32 @feof(i32* %1)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* @stderr
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %8, %5, %2
ret void
}
void removeComments(char *s) {
  int i;
  for (i = 0; s[i] != '\0'; i++) {
    if (s[i] == '#') {
      s[i] = '\0';
    }
  }
}


x86 assembly (clang, -O0):
<removeComments>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1158 <removeComments+0x58>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x23,%eax
jne    1145 <removeComments+0x45>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    114a <removeComments+0x4a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <removeComments+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeComments>:
jmp    1117 <removeComments+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x0,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x23,%al
je     1110 <removeComments+0x10>
test   %al,%al
jne    1113 <removeComments+0x13>
ret

LLVM IR (-O0):
define void @removeComments(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %26, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %29
12: ; preds = %4
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 35
br i1 %19, label %20, label %25
20: ; preds = %12
%21 = load i8*, i8** %2
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
store i8 0, i8* %24
br label %25
25: ; preds = %20, %12
br label %26
26: ; preds = %25
%27 = load i32, i32* %3
%28 = add nsw i32 %27, 1
store i32 %28, i32* %3
br label %4
29: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @removeComments(i8* nocapture %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i64 [ %8, %7 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %7 [
i8 0, label %9
i8 35, label %6
]
6: ; preds = %2
store i8 0, i8* %4
br label %7
7: ; preds = %2, %6
%8 = add nuw i64 %3, 1
br label %2
9: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
void lectura_dim(int dimensiones[], const int i) {
  printf("Tamano la matriz %d:\n\tFilas = ", i);
  scanf("%d", &dimensiones[1]);
  printf("\tColumnas = ");
  scanf("%d", &dimensiones[0]);
}


x86 assembly (clang, -O0):
<lectura_dim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
add    $0x4,%rsi
lea    0xed0(%rip),%rdi
call   1040 <scanf@plt>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1040 <scanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lectura_dim>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rbx),%rsi
lea    0xedf(%rip),%r14
mov    %r14,%rdi
call   1040 <scanf@plt>
lea    0xed3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <scanf@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Tamano la matriz %d:\0A\09Filas = \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [13 x i8] c"\09Columnas = \00"
define void @lectura_dim(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 0
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %12)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"Tamano la matriz %d:\0A\09Filas = \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [13 x i8] c"\09Columnas = \00"
define void @lectura_dim(i32* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %0)
ret void
}
int kvm_read(void *kd, unsigned long addr, void *buf, unsigned int nbytes) {
  return (-1);
}


x86 assembly (clang, -O0):
<kvm_read>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kvm_read>:
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @kvm_read(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret i32 -1
}

LLVM IR (-O2):
define i32 @kvm_read(i8* nocapture readnone %0, i64 %1, i8* nocapture readnone %2, i32 %3) {
ret i32 -1
}
/* Type definitions */
struct hostent {
  int dummy;
};

/* Variables and functions */
struct hostent *gethostbyaddr(void const *, size_t, int);
int h_errno;
struct hostent *getipnodebyaddr(const void *addr, size_t len, int af,
                                int *error_num) {
  struct hostent *hostent = gethostbyaddr(addr, len, af);
  if (!hostent && error_num)
    *error_num = h_errno;
  return hostent;
}


x86 assembly (clang, -O0):
<getipnodebyaddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <gethostbyaddr@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1160 <getipnodebyaddr+0x50>
cmpq   $0x0,-0x20(%rbp)
je     1160 <getipnodebyaddr+0x50>
mov    0x2e90(%rip),%rax
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getipnodebyaddr>:
push   %rbx
mov    %rcx,%rbx
call   1030 <gethostbyaddr@plt>
test   %rbx,%rbx
je     112e <getipnodebyaddr+0x1e>
test   %rax,%rax
jne    112e <getipnodebyaddr+0x1e>
mov    0x2ebe(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.hostent = type { i32 }
@h_errno = global i32 0
define %struct.hostent* @getipnodebyaddr(i8* %0, i64 %1, i32 %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32*
%9 = alloca %struct.hostent*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = load i32, i32* %7
%13 = call %struct.hostent* @gethostbyaddr(i8* %10, i64 %11, i32 %12)
store %struct.hostent* %13, %struct.hostent** %9
%14 = load %struct.hostent*, %struct.hostent** %9
%15 = icmp ne %struct.hostent* %14, null
br i1 %15, label %22, label %16
16: ; preds = %4
%17 = load i32*, i32** %8
%18 = icmp ne i32* %17, null
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load i32, i32* @h_errno
%21 = load i32*, i32** %8
store i32 %20, i32* %21
br label %22
22: ; preds = %19, %16, %4
%23 = load %struct.hostent*, %struct.hostent** %9
ret %struct.hostent* %23
}

LLVM IR (-O2):
%struct.hostent = type { i32 }
@h_errno = global i32 0
define %struct.hostent* @getipnodebyaddr(i8* %0, i64 %1, i32 %2, i32* writeonly %3) {
%5 = tail call %struct.hostent* @gethostbyaddr(i8* %0, i64 %1, i32 %2)
%6 = icmp eq %struct.hostent* %5, null
%7 = icmp ne i32* %3, null
%8 = and i1 %7, %6
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = load i32, i32* @h_errno
store i32 %10, i32* %3
br label %11
11: ; preds = %9, %4
ret %struct.hostent* %5
}
void sme_event_ch_switch(struct wpa_supplicant *wpa_s) {}


x86 assembly (clang, -O0):
<sme_event_ch_switch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sme_event_ch_switch>:
ret

LLVM IR (-O0):
%struct.wpa_supplicant = type opaque
define void @sme_event_ch_switch(%struct.wpa_supplicant* %0) {
%2 = alloca %struct.wpa_supplicant*
store %struct.wpa_supplicant* %0, %struct.wpa_supplicant** %2
ret void
}

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
define void @sme_event_ch_switch(%struct.wpa_supplicant* nocapture %0) {
ret void
}
float ScalePointY(float y, float centerY, float scale) {
  return (scale * (y - centerY)) + centerY;
}


x86 assembly (clang, -O0):
<ScalePointY>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
subss  -0x8(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ScalePointY>:
subss  %xmm1,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @ScalePointY(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %6
%8 = load float, float* %4
%9 = load float, float* %5
%10 = fsub float %8, %9
%11 = load float, float* %5
%12 = call float @llvm.fmuladd.f32(float %7, float %10, float %11)
ret float %12
}

LLVM IR (-O2):
define float @ScalePointY(float %0, float %1, float %2) {
%4 = fsub float %0, %1
%5 = tail call float @llvm.fmuladd.f32(float %2, float %4, float %1)
ret float %5
}
void strappend(char *z, int *pI, const char *zAppend) {
  int i = *pI;
  while (zAppend[0]) {
    z[i++] = *(zAppend++);
  }
  z[i] = 0;
  *pI = i;
}


x86 assembly (clang, -O0):
<strappend>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1151 <strappend+0x51>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%dl
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x1c(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1119 <strappend+0x19>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<strappend>:
mov    (%rsi),%r8d
mov    (%rdx),%cl
test   %cl,%cl
je     1137 <strappend+0x37>
movslq %r8d,%r9
add    %rdi,%r9
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %cl,(%r9,%rax,1)
movzbl 0x1(%rdx,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1120 <strappend+0x20>
add    %r8d,%eax
mov    %eax,%r8d
movslq %r8d,%rax
movb   $0x0,(%rdi,%rax,1)
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @strappend(i8* %0, i32* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
store i32 %9, i32* %7
br label %10
10: ; preds = %15, %3
%11 = load i8*, i8** %6
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = icmp ne i8 %13, 0
br i1 %14, label %15, label %24
15: ; preds = %10
%16 = load i8*, i8** %6
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %6
%18 = load i8, i8* %16
%19 = load i8*, i8** %4
%20 = load i32, i32* %7
%21 = add nsw i32 %20, 1
store i32 %21, i32* %7
%22 = sext i32 %20 to i64
%23 = getelementptr inbounds i8, i8* %19, i64 %22
store i8 %18, i8* %23
br label %10
24: ; preds = %10
%25 = load i8*, i8** %4
%26 = load i32, i32* %7
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %25, i64 %27
store i8 0, i8* %28
%29 = load i32, i32* %7
%30 = load i32*, i32** %5
store i32 %29, i32* %30
ret void
}

LLVM IR (-O2):
define void @strappend(i8* nocapture writeonly %0, i32* nocapture %1, i8* nocapture %2) {
%4 = load i32, i32* %1
%5 = load i8, i8* %2
%6 = icmp eq i8 %5, 0
br i1 %6, label %20, label %7
7: ; preds = %3
%8 = sext i32 %4 to i64
br label %9
9: ; preds = %7, %9
%10 = phi i64 [ %8, %7 ], [ %14, %9 ]
%11 = phi i8 [ %5, %7 ], [ %16, %9 ]
%12 = phi i8* [ %2, %7 ], [ %13, %9 ]
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = add i64 %10, 1
%15 = getelementptr inbounds i8, i8* %0, i64 %10
store i8 %11, i8* %15
%16 = load i8, i8* %13
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %9
18: ; preds = %9
%19 = trunc i64 %14 to i32
br label %20
20: ; preds = %18, %3
%21 = phi i32 [ %4, %3 ], [ %19, %18 ]
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %0, i64 %22
store i8 0, i8* %23
store i32 %21, i32* %1
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};
typedef int /*<<< orphan*/ path_stat;
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ memset(struct stat *, int /*<<< orphan*/, int);
scalar_t__ stat(char const *, struct stat *);
int32_t mz_os_file_exists(const char *path) {
  struct stat path_stat;
  memset(&path_stat, 0, sizeof(path_stat));
  if (stat(path, &path_stat) == 0)
    return (0);
  return (-107);
}


x86 assembly (clang, -O0):
<mz_os_file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
jne    115f <mz_os_file_exists+0x3f>
movl   $0x0,-0x4(%rbp)
jmp    1166 <mz_os_file_exists+0x46>
movl   $0xffffff95,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mz_os_file_exists>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%r14
xor    %ebp,%ebp
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <stat@plt>
test   %rax,%rax
mov    $0xffffff95,%eax
cmove  %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @mz_os_file_exists(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = call i32 @memset(%struct.stat* %4, i32 0, i32 4)
%6 = load i8*, i8** %3
%7 = call i64 @stat(i8* %6, %struct.stat* %4)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 0, i32* %2
br label %11
10: ; preds = %1
store i32 -107, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @mz_os_file_exists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @memset(%struct.stat* %2, i32 0, i32 4)
%5 = call i64 @stat(i8* %0, %struct.stat* %2)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i32 0, i32 -107
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ permute(char *, int /*<<< orphan*/, int);
int main() {
  char a[] = "ABCD";
  permute(a, 0, 3);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xec6(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x9(%rbp),%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   1030 <permute@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x0,0x4(%rsp)
movl   $0x44434241,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   1030 <permute@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.a = [5 x i8] c"ABCD\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8]
store i32 0, i32* %1
%3 = bitcast [5 x i8]* %2 to i8*
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%5 = call i32 @permute(i8* %4, i32 0, i32 3)
%6 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [5 x i8] c"ABCD\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @permute(i8* %2, i32 0, i32 3)
%4 = call i32 (...) @getchar()
ret i32 0
}
void foo(int a, int b, int c) {
  int m, n, o, i;
  m = 6;
  n = 1;
  o = 5;
  a = 6;
  b = 1;
  c = 5;
#pragma omp parallel for num_threads(m) if (n) schedule(static, o)
  for (i = 0; i < 10; i++)
    ;
#pragma omp parallel for num_threads(a) if (b) schedule(static, c)
  for (i = 0; i < 10; i++)
    ;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x6,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x5,-0x18(%rbp)
movl   $0x6,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0xa,-0x1c(%rbp)
jge    115b <foo+0x5b>
jmp    114d <foo+0x4d>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113e <foo+0x3e>
movl   $0x0,-0x1c(%rbp)
cmpl   $0xa,-0x1c(%rbp)
jge    117f <foo+0x7f>
jmp    1171 <foo+0x71>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1162 <foo+0x62>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
ret

LLVM IR (-O0):
define void @foo(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 6, i32* %7
store i32 1, i32* %8
store i32 5, i32* %9
store i32 6, i32* %4
store i32 1, i32* %5
store i32 5, i32* %6
store i32 0, i32* %10
br label %11
11: ; preds = %15, %3
%12 = load i32, i32* %10
%13 = icmp slt i32 %12, 10
br i1 %13, label %14, label %18
14: ; preds = %11
br label %15
15: ; preds = %14
%16 = load i32, i32* %10
%17 = add nsw i32 %16, 1
store i32 %17, i32* %10
br label %11
18: ; preds = %11
store i32 0, i32* %10
br label %19
19: ; preds = %23, %18
%20 = load i32, i32* %10
%21 = icmp slt i32 %20, 10
br i1 %21, label %22, label %26
22: ; preds = %19
br label %23
23: ; preds = %22
%24 = load i32, i32* %10
%25 = add nsw i32 %24, 1
store i32 %25, i32* %10
br label %19
26: ; preds = %19
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0, i32 %1, i32 %2) {
ret void
}