xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello World!\r\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Hello World!\0D\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello World!\0D\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
unsigned bit_offset(const unsigned cfgbit) { return (cfgbit & ((1 << 3) - 1)); }


x86 assembly (clang, -O0):
<bit_offset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_offset>:
mov    %edi,%eax
and    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @bit_offset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 7
ret i32 %4
}

LLVM IR (-O2):
define i32 @bit_offset(i32 %0) {
%2 = and i32 %0, 7
ret i32 %2
}
/* Variables and functions */
double exp(double);
double sqrt(int);
double ir_gaussian(double x, double stdDev) {
  return (exp((-x * x) / (2 * stdDev * stdDev)) /
          (sqrt(2 * 3.1415926535897932384626433832795) * stdDev));
}


x86 assembly (clang, -O0):
<ir_gaussian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xea5(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x18(%rbp)
mov    $0x6,%edi
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ir_gaussian>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movapd 0xece(%rip),%xmm2
xorpd  %xmm0,%xmm2
mulsd  %xmm2,%xmm0
movapd %xmm1,%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x6,%edi
call   1040 <sqrt@plt>
mulsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @ir_gaussian(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fneg double %5
%7 = load double, double* %3
%8 = fmul double %6, %7
%9 = load double, double* %4
%10 = fmul double 2.000000e+00, %9
%11 = load double, double* %4
%12 = fmul double %10, %11
%13 = fdiv double %8, %12
%14 = call double @exp(double %13)
%15 = call double @sqrt(i32 6)
%16 = load double, double* %4
%17 = fmul double %15, %16
%18 = fdiv double %14, %17
ret double %18
}

LLVM IR (-O2):
define double @ir_gaussian(double %0, double %1) {
%3 = fneg double %0
%4 = fmul double %3, %0
%5 = fmul double %1, 2.000000e+00
%6 = fmul double %5, %1
%7 = fdiv double %4, %6
%8 = tail call double @exp(double %7)
%9 = tail call double @sqrt(i32 6)
%10 = fmul double %9, %1
%11 = fdiv double %8, %10
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ handle_login(int, char *);
int /*<<< orphan*/ handle_userlist(int);
void handle_message(int fd, char *msg) {
  switch (msg[0]) {
  case '1':
    break;
  case '2':
    handle_login(fd, msg);
    break;
  case '6':
    handle_userlist(fd);
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<handle_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
sub    $0x31,%eax
je     1169 <handle_message+0x49>
jmp    1147 <handle_message+0x27>
mov    -0x14(%rbp),%eax
sub    $0x32,%eax
je     116e <handle_message+0x4e>
jmp    1158 <handle_message+0x38>
mov    -0x14(%rbp),%eax
sub    $0x36,%eax
je     117f <handle_message+0x5f>
jmp    118c <handle_message+0x6c>
jmp    1191 <handle_message+0x71>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <handle_login@plt>
jmp    1191 <handle_message+0x71>
mov    -0x4(%rbp),%edi
call   1040 <handle_userlist@plt>
jmp    1191 <handle_message+0x71>
jmp    1191 <handle_message+0x71>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_message>:
movsbl (%rsi),%eax
cmp    $0x36,%eax
je     1132 <handle_message+0x12>
cmp    $0x32,%eax
jne    1137 <handle_message+0x17>
jmp    1030 <handle_login@plt>
jmp    1040 <handle_userlist@plt>
ret

LLVM IR (-O0):
define void @handle_message(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
switch i32 %8, label %17 [
i32 49, label %9
i32 50, label %10
i32 54, label %14
]
9: ; preds = %2
br label %18
10: ; preds = %2
%11 = load i32, i32* %3
%12 = load i8*, i8** %4
%13 = call i32 @handle_login(i32 %11, i8* %12)
br label %18
14: ; preds = %2
%15 = load i32, i32* %3
%16 = call i32 @handle_userlist(i32 %15)
br label %18
17: ; preds = %2
br label %18
18: ; preds = %17, %14, %10, %9
ret void
}

LLVM IR (-O2):
define void @handle_message(i32 %0, i8* %1) {
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
switch i32 %4, label %9 [
i32 54, label %7
i32 50, label %5
]
5: ; preds = %2
%6 = tail call i32 @handle_login(i32 %0, i8* %1)
br label %9
7: ; preds = %2
%8 = tail call i32 @handle_userlist(i32 %0)
br label %9
9: ; preds = %2, %7, %5
ret void
}
/* Variables and functions */
scalar_t__ strtoumax(char const *, char **, int);
unsigned long long strtoull(const char *nptr, char **endptr, int base) {
  return (unsigned long long)strtoumax(nptr, endptr, base);
}


x86 assembly (clang, -O0):
<strtoull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strtoumax@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoull>:
jmp    1030 <strtoumax@plt>

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

LLVM IR (-O2):
define i64 @strtoull(i8* %0, i8** %1, i32 %2) {
%4 = tail call i64 @strtoumax(i8* %0, i8** %1, i32 %2)
ret i64 %4
}
/* Variables and functions */
scalar_t__ time(int /*<<< orphan*/ *);
int shadow_time() { return (int)time(NULL) / 86400; }


x86 assembly (clang, -O0):
<shadow_time>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
mov    $0x15180,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<shadow_time>:
push   %rax
xor    %edi,%edi
call   1030 <time@plt>
cltq
imul   $0xffffffffc22e4507,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x10,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @shadow_time() {
%1 = call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = sdiv i32 %2, 86400
ret i32 %3
}

LLVM IR (-O2):
define i32 @shadow_time() {
%1 = tail call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = sdiv i32 %2, 86400
ret i32 %3
}
long NET_close() { return 0; }


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

x86 assembly (clang, -O2):
<NET_close>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @NET_close() {
ret i64 0
}

LLVM IR (-O2):
define i64 @NET_close() {
ret i64 0
}
int test_imm_B0int8_mem(signed char *val) {
  return ((*val) & (0xB0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B0int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xb0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B0int8_mem>:
testb  $0xb0,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_B0int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 176
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_B0int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -80
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int comparator(const void *a, const void *b) {
  double x = *((double *)b) - *((double *)a);
  return x < 0 ? -1 : x > 0 ? 1 : 0;
}


x86 assembly (clang, -O0):
<comparator>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    113c <comparator+0x3c>
mov    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    1155 <comparator+0x55>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
xor    %eax,%eax
mov    $0x1,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @comparator(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca double
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to double*
%8 = load double, double* %7
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to double*
%11 = load double, double* %10
%12 = fsub double %8, %11
store double %12, double* %5
%13 = load double, double* %5
%14 = fcmp olt double %13, 0.000000e+00
br i1 %14, label %15, label %16
15: ; preds = %2
br label %21
16: ; preds = %2
%17 = load double, double* %5
%18 = fcmp ogt double %17, 0.000000e+00
%19 = zext i1 %18 to i64
%20 = select i1 %18, i32 1, i32 0
br label %21
21: ; preds = %16, %15
%22 = phi i32 [ -1, %15 ], [ %20, %16 ]
ret i32 %22
}

LLVM IR (-O2):
define i32 @comparator(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to double*
%4 = load double, double* %3
%5 = bitcast i8* %0 to double*
%6 = load double, double* %5
%7 = fsub double %4, %6
%8 = fcmp olt double %7, 0.000000e+00
%9 = fcmp ogt double %7, 0.000000e+00
%10 = zext i1 %9 to i32
%11 = select i1 %8, i32 -1, i32 %10
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ tempString;

/* Variables and functions */
int setStandardProcedure(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *, int, int, int);
int setCommandXYZ(int x, int y, int z, const char *cmd) {
  char tempString[16];
  snprintf(tempString, sizeof(tempString), "%s %02d:%02d:%02d#", cmd, x, y, z);
  return (setStandardProcedure(tempString));
}


x86 assembly (clang, -O0):
<setCommandXYZ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    -0x4(%rbp),%r8d
mov    -0x8(%rbp),%r9d
mov    -0xc(%rbp),%eax
mov    $0x10,%esi
lea    0xeac(%rip),%rdx
mov    %eax,(%rsp)
call   1040 <snprintf@plt>
lea    -0x30(%rbp),%rdi
call   1030 <setStandardProcedure@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setCommandXYZ>:
push   %rbx
sub    $0x20,%rsp
mov    %esi,%r9d
mov    %edi,%r8d
mov    %edx,(%rsp)
lea    0xecb(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x10,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <setStandardProcedure@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"%s %02d:%02d:%02d#\00"
define i32 @setCommandXYZ(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca [16 x i8]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%11 = load i8*, i8** %8
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = call i32 @snprintf(i8* %10, i32 16, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %11, i32 %12, i32 %13, i32 %14)
%16 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%17 = call i32 @setStandardProcedure(i8* %16)
ret i32 %17
}

LLVM IR (-O2):
@.str = [19 x i8] c"%s %02d:%02d:%02d#\00"
define i32 @setCommandXYZ(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca [16 x i8]
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%7 = call i32 @snprintf(i8* %6, i32 16, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %0, i32 %1, i32 %2)
%8 = call i32 @setStandardProcedure(i8* %6)
ret i32 %8
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int memoryAlloc(char **arr, size_t size) {
  if (size <= 0)
    return -1;
  *arr = (char *)malloc(size);
  return 0;
}


x86 assembly (clang, -O0):
<memoryAlloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
ja     1137 <memoryAlloc+0x27>
movl   $0xffffffff,-0x4(%rbp)
jmp    1151 <memoryAlloc+0x41>
mov    -0x18(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memoryAlloc>:
test   %rsi,%rsi
je     1128 <memoryAlloc+0x18>
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <malloc@plt>
mov    %rax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @memoryAlloc(i8** nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i64 @malloc(i64 %1)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %0
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ 0, %4 ], [ -1, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ heapify(int *, int, int /*<<< orphan*/);
int heapExtract(int *a, int n) {
  int bigger;
  bigger = a[0];
  a[0] = a[n - 1];
  heapify(a, n - 1, 0);
  return bigger;
}


x86 assembly (clang, -O0):
<heapExtract>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
xor    %edx,%edx
call   1030 <heapify@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heapExtract>:
push   %rbx
mov    (%rdi),%ebx
movslq %esi,%rax
add    $0xffffffff,%esi
mov    -0x4(%rdi,%rax,4),%eax
mov    %eax,(%rdi)
xor    %edx,%edx
call   1030 <heapify@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @heapExtract(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
store i32 %8, i32* %5
%9 = load i32*, i32** %3
%10 = load i32, i32* %4
%11 = sub nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %9, i64 %12
%14 = load i32, i32* %13
%15 = load i32*, i32** %3
%16 = getelementptr inbounds i32, i32* %15, i64 0
store i32 %14, i32* %16
%17 = load i32*, i32** %3
%18 = load i32, i32* %4
%19 = sub nsw i32 %18, 1
%20 = call i32 @heapify(i32* %17, i32 %19, i32 0)
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
define i32 @heapExtract(i32* %0, i32 %1) {
%3 = load i32, i32* %0
%4 = add nsw i32 %1, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
store i32 %7, i32* %0
%8 = tail call i32 @heapify(i32* %0, i32 %4, i32 0)
ret i32 %3
}
int batadv_nc_init(struct batadv_priv *bat_priv) { return 0; }


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

x86 assembly (clang, -O2):
<batadv_nc_init>:
xor    %eax,%eax
ret

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

LLVM IR (-O2):
%struct.batadv_priv = type opaque
define i32 @batadv_nc_init(%struct.batadv_priv* nocapture readnone %0) {
ret i32 0
}
void f13(void) {}


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

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

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

LLVM IR (-O2):
define void @f13() {
ret void
}
/* Variables and functions */
int CHAR_BIT;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stdout;
int main() {
  fprintf(stdout, "%d", CHAR_BIT);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [3 x i8] c"%d\00"
@CHAR_BIT = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdout
%3 = load i32, i32* @CHAR_BIT
%4 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [3 x i8] c"%d\00"
@CHAR_BIT = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = load i32, i32* @CHAR_BIT
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int strlen(char *);
int glp_lpx_check_name(char *name) {
  return name == NULL || name[0] == '\0' || strlen(name) > 255;
}


x86 assembly (clang, -O0):
<glp_lpx_check_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1155 <glp_lpx_check_name+0x45>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1155 <glp_lpx_check_name+0x45>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0xff,%eax
setg   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glp_lpx_check_name>:
push   %rax
mov    $0x1,%eax
test   %rdi,%rdi
je     1132 <glp_lpx_check_name+0x22>
cmpb   $0x0,(%rdi)
je     1132 <glp_lpx_check_name+0x22>
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x100,%ecx
setge  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @glp_lpx_check_name(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %15, label %5
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %5
%12 = load i8*, i8** %2
%13 = call i32 @strlen(i8* %12)
%14 = icmp sgt i32 %13, 255
br label %15
15: ; preds = %11, %5, %1
%16 = phi i1 [ true, %5 ], [ true, %1 ], [ %14, %11 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @glp_lpx_check_name(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i32 @strlen(i8* %0)
%8 = icmp sgt i32 %7, 255
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %1
%11 = phi i32 [ 1, %3 ], [ 1, %1 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ STDIN_FILENO;
int pipexec_redir(void *, int /*<<< orphan*/, int /*<<< orphan*/,
                  int /*<<< orphan*/);
int pipexec_redir_stdin(void *path) {
  return pipexec_redir(path, STDIN_FILENO, O_RDONLY, 0);
}


x86 assembly (clang, -O0):
<pipexec_redir_stdin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
call   1030 <pipexec_redir@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pipexec_redir_stdin>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    0x2ec8(%rip),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
jmp    1030 <pipexec_redir@plt>

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
@O_RDONLY = global i32 0
define i32 @pipexec_redir_stdin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @STDIN_FILENO
%5 = load i32, i32* @O_RDONLY
%6 = call i32 @pipexec_redir(i8* %3, i32 %4, i32 %5, i32 0)
ret i32 %6
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
@O_RDONLY = global i32 0
define i32 @pipexec_redir_stdin(i8* %0) {
%2 = load i32, i32* @STDIN_FILENO
%3 = load i32, i32* @O_RDONLY
%4 = tail call i32 @pipexec_redir(i8* %0, i32 %2, i32 %3, i32 0)
ret i32 %4
}
/* Variables and functions */
long long abs(int);
void test_int_size(long long *pll) {
  *pll = abs(*pll);
  *pll = abs((int)*pll);
}


x86 assembly (clang, -O0):
<test_int_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %eax,%edi
call   1030 <abs@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %eax,%edi
call   1030 <abs@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_int_size>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <abs@plt>
mov    %rax,(%rbx)
mov    %eax,%edi
call   1030 <abs@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @test_int_size(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = call i64 @abs(i32 %5)
%7 = load i64*, i64** %2
store i64 %6, i64* %7
%8 = load i64*, i64** %2
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = call i64 @abs(i32 %10)
%12 = load i64*, i64** %2
store i64 %11, i64* %12
ret void
}

LLVM IR (-O2):
define void @test_int_size(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = tail call i64 @abs(i32 %3)
store i64 %4, i64* %0
%5 = trunc i64 %4 to i32
%6 = tail call i64 @abs(i32 %5)
store i64 %6, i64* %0
ret void
}
unsigned int lrand0(unsigned int *s) {
  unsigned int i;
  i = *s;
  i = ((1103515245 * i) + 12345);
  *s = i;
  return i & 0x7fffffff;
}


x86 assembly (clang, -O0):
<lrand0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
imul   $0x41c64e6d,-0xc(%rbp),%eax
add    $0x3039,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
and    $0x7fffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lrand0>:
imul   $0x41c64e6d,(%rdi),%eax
add    $0x3039,%eax
mov    %eax,(%rdi)
and    $0x7fffffff,%eax
ret

LLVM IR (-O0):
define i32 @lrand0(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = mul i32 1103515245, %6
%8 = add i32 %7, 12345
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i32*, i32** %2
store i32 %9, i32* %10
%11 = load i32, i32* %3
%12 = and i32 %11, 2147483647
ret i32 %12
}

LLVM IR (-O2):
define i32 @lrand0(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul i32 %2, 1103515245
%4 = add i32 %3, 12345
store i32 %4, i32* %0
%5 = and i32 %4, 2147483647
ret i32 %5
}
void INI_Rename_seq_ctx() { ; }


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

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

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

LLVM IR (-O2):
define void @INI_Rename_seq_ctx() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solcon_length_current_quaddobl_solution_string(int *cursor, int *n) {
  int fail;
  double *c;
  fail = _ada_use_c2phc(527, cursor, n, c);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_length_current_quaddobl_solution_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x20f,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_length_current_quaddobl_solution_string>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x20f,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @solcon_length_current_quaddobl_solution_string(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca double*
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %3
%8 = load i32*, i32** %4
%9 = load double*, double** %6
%10 = call i32 @_ada_use_c2phc(i32 527, i32* %7, i32* %8, double* %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @solcon_length_current_quaddobl_solution_string(i32* %0, i32* %1) {
%3 = tail call i32 @_ada_use_c2phc(i32 527, i32* %0, i32* %1, double* undef)
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int int64_cas(int64_t *p, int64_t oldval, int64_t newval) {
  int64_t v = *p;
  int out = 0;
  if (v == oldval) {
    *p = newval;
    out = 1;
  }
  return out;
}


x86 assembly (clang, -O0):
<int64_cas>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1142 <int64_cas+0x42>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int64_cas>:
xor    %eax,%eax
cmp    %rsi,(%rdi)
jne    110f <int64_cas+0xf>
mov    %rdx,(%rdi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @int64_cas(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32
store i64* %0, i64** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%9 = load i64*, i64** %4
%10 = load i64, i64* %9
store i64 %10, i64* %7
store i32 0, i32* %8
%11 = load i64, i64* %7
%12 = load i64, i64* %5
%13 = icmp eq i64 %11, %12
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = load i64, i64* %6
%16 = load i64*, i64** %4
store i64 %15, i64* %16
store i32 1, i32* %8
br label %17
17: ; preds = %14, %3
%18 = load i32, i32* %8
ret i32 %18
}

LLVM IR (-O2):
define i32 @int64_cas(i64* nocapture %0, i64 %1, i64 %2) {
%4 = load i64, i64* %0
%5 = icmp eq i64 %4, %1
br i1 %5, label %6, label %7
6: ; preds = %3
store i64 %2, i64* %0
br label %7
7: ; preds = %6, %3
%8 = phi i32 [ 1, %6 ], [ 0, %3 ]
ret i32 %8
}
void init(int argc, char *argv[]) {
  {
    extern void input_init(int, char *[]);
    input_init(argc, argv);
  }
  {
    extern void main_init(int, char *[]);
    main_init(argc, argv);
  }
  {
    extern void type_init(int, char *[]);
    type_init(argc, argv);
  }
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <input_init@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <main_init@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <type_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1050 <input_init@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <main_init@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <type_init@plt>

LLVM IR (-O0):
define void @init(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = load i8**, i8*** %4
%7 = load i32, i32* %3
%8 = load i8**, i8*** %4
%9 = load i32, i32* %3
%10 = load i8**, i8*** %4
ret void
}

LLVM IR (-O2):
define void @init(i32 %0, i8** %1) {
tail call void @input_init(i32 %0, i8** %1)
tail call void @main_init(i32 %0, i8** %1)
tail call void @type_init(i32 %0, i8** %1)
ret void
}
char getCharacter(char **xml) {
  char c = '\0';
  c = **xml;
  (*xml)++;
  return c;
}


x86 assembly (clang, -O0):
<getCharacter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
movsbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCharacter>:
mov    (%rdi),%rcx
mov    (%rcx),%al
add    $0x1,%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define signext i8 @getCharacter(i8** %0) {
%2 = alloca i8**
%3 = alloca i8
store i8** %0, i8*** %2
store i8 0, i8* %3
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
store i8 %6, i8* %3
%7 = load i8**, i8*** %2
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %7
%10 = load i8, i8* %3
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @getCharacter(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = getelementptr inbounds i8, i8* %2, i64 1
store i8* %4, i8** %0
ret i8 %3
}
double _Complex add_double_cr(double _Complex a, double b) { return a + b; }


x86 assembly (clang, -O0):
<add_double_cr>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
addsd  %xmm2,%xmm1
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_double_cr>:
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define { double, double } @add_double_cr(double %0, double %1, double %2) {
%4 = alloca { double, double }
%5 = alloca { double, double }
%6 = alloca double
%7 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
store double %0, double* %7
%8 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
store double %1, double* %8
store double %2, double* %6
%9 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
%10 = load double, double* %9
%11 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
%12 = load double, double* %11
%13 = load double, double* %6
%14 = fadd double %10, %13
%15 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
%16 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
store double %14, double* %15
store double %12, double* %16
%17 = load { double, double }, { double, double }* %4
ret { double, double } %17
}

LLVM IR (-O2):
define { double, double } @add_double_cr(double %0, double %1, double %2) {
%4 = fadd double %0, %2
%5 = insertvalue { double, double } poison, double %4, 0
%6 = insertvalue { double, double } %5, double %1, 1
ret { double, double } %6
}
/* Variables and functions */
int /*<<< orphan*/ alocaMatriz(int **, int, int);
int /*<<< orphan*/ leMatriz(int **, int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(int argc, char **argv) {
  int lin, col;
  int **matriz;
  printf("Digite as dimensoes da matriz: ");
  scanf("%d %d", &lin, &col);
  alocaMatriz(matriz, lin, col);
  leMatriz(matriz, lin, col);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
lea    0xebe(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1060 <scanf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <alocaMatriz@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1050 <leMatriz@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
lea    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1060 <scanf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
call   1030 <alocaMatriz@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
call   1050 <leMatriz@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Digite as dimensoes da matriz: \00"
@.str.1 = [6 x i8] c"%d %d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%8 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %5, i32* %6)
%10 = load i32**, i32*** %7
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = call i32 @alocaMatriz(i32** %10, i32 %11, i32 %12)
%14 = load i32**, i32*** %7
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = call i32 @leMatriz(i32** %14, i32 %15, i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"Digite as dimensoes da matriz: \00"
@.str.1 = [6 x i8] c"%d %d\00"
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 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %4)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @alocaMatriz(i32** undef, i32 %9, i32 %10)
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = call i32 @leMatriz(i32** undef, i32 %12, i32 %13)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ x;
};
typedef TYPE_1__ XPoint;

/* Variables and functions */
short get_XPoint_x(void *_p) { return (short)((XPoint *)_p)->x; }


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

x86 assembly (clang, -O2):
<get_XPoint_x>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define signext i16 @get_XPoint_x(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i16
ret i16 %7
}

LLVM IR (-O2):
define signext i16 @get_XPoint_x(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i16
ret i16 %4
}
int check_in_board(int i, int j) {
  if (i > 7 || i < 0 || j < 0 || j > 7)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<check_in_board>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x7,-0x8(%rbp)
jg     1132 <check_in_board+0x32>
cmpl   $0x0,-0x8(%rbp)
jl     1132 <check_in_board+0x32>
cmpl   $0x0,-0xc(%rbp)
jl     1132 <check_in_board+0x32>
cmpl   $0x7,-0xc(%rbp)
jle    113e <check_in_board+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1145 <check_in_board+0x45>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_in_board>:
or     %esi,%edi
xor    %eax,%eax
cmp    $0x8,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @check_in_board(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = icmp ult i32 %3, 8
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
scalar_t__ _isalpha(char);
scalar_t__ _isdigit(char);
int _isalnum(char c) { return _isalpha(c) || _isdigit(c); }


x86 assembly (clang, -O0):
<_isalnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <_isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    115c <_isalnum+0x3c>
movsbl -0x1(%rbp),%edi
call   1030 <_isdigit@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_isalnum>:
push   %rbx
mov    %edi,%ebx
call   1040 <_isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <_isalnum+0x17>
pop    %rbx
ret
movsbl %bl,%edi
call   1030 <_isdigit@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @_isalnum(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @_isalpha(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @_isdigit(i8 signext %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @_isalnum(i8 signext %0) {
%2 = tail call i64 @_isalpha(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @_isdigit(i8 signext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int encodeImmDoubleHigh(int);
int encodeImmDouble(int valLo, int valHi) {
  int res = -1;
  if (valLo == 0)
    res = encodeImmDoubleHigh(valHi);
  return res;
}


x86 assembly (clang, -O0):
<encodeImmDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113a <encodeImmDouble+0x2a>
mov    -0x8(%rbp),%edi
call   1030 <encodeImmDoubleHigh@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encodeImmDouble>:
test   %edi,%edi
je     111a <encodeImmDouble+0xa>
mov    $0xffffffff,%eax
ret
mov    %esi,%edi
jmp    1030 <encodeImmDoubleHigh@plt>

LLVM IR (-O0):
define i32 @encodeImmDouble(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 -1, i32* %5
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %4
%10 = call i32 @encodeImmDoubleHigh(i32 %9)
store i32 %10, i32* %5
br label %11
11: ; preds = %8, %2
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @encodeImmDouble(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @encodeImmDoubleHigh(i32 %1)
br label %6
6: ; preds = %4, %2
%7 = phi i32 [ %5, %4 ], [ -1, %2 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
uint32_t read_u32_from_buffer(const char *read) {
  uint32_t n_u32 = *((uint32_t *)read);
  return ntohl(n_u32);
}


x86 assembly (clang, -O0):
<read_u32_from_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <ntohl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_u32_from_buffer>:
mov    (%rdi),%edi
jmp    1030 <ntohl@plt>

LLVM IR (-O0):
define i32 @read_u32_from_buffer(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @ntohl(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @read_u32_from_buffer(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @ntohl(i32 %3)
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_5__ TYPE_2__;
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int sival_int;
};
struct TYPE_5__ {
  TYPE_1__ si_value;
};
typedef TYPE_2__ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void handler(int s, siginfo_t *info, void *cntx) {
  printf("rec sig  %ddata %d\n", s, info->si_value.sival_int);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
mov    %edi,%eax
mov    (%rsi),%edx
lea    0xee5(%rip),%rdi
mov    %eax,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.TYPE_5__ = type { %struct.TYPE_4__ }
%struct.TYPE_4__ = type { i32 }
@.str = [20 x i8] c"rec sig %ddata %d\0A\00"
define void @handler(i32 %0, %struct.TYPE_5__* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct.TYPE_5__*
%6 = alloca i8*
store i32 %0, i32* %4
store %struct.TYPE_5__* %1, %struct.TYPE_5__** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load %struct.TYPE_5__*, %struct.TYPE_5__** %5
%9 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %8, i32 0, i32 0
%10 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %11)
ret void
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { %struct.TYPE_4__ }
%struct.TYPE_4__ = type { i32 }
@.str = [20 x i8] c"rec sig %ddata %d\0A\00"
define void @handler(i32 %0, %struct.TYPE_5__* nocapture %1, i8* nocapture readnone %2) {
%4 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %1, i64 0, i32 0, i32 0
%5 = load i32, i32* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %5)
ret void
}
int indexof(char s[], char c) {
  int i = 0;
  char ch;
  while ((ch = s[i++]) != '\0') {
    if (ch == c) {
      return --i;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<indexof>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x18(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x19(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     115f <indexof+0x5f>
movsbl -0x19(%rbp),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    115a <indexof+0x5a>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    %eax,-0x4(%rbp)
jmp    1166 <indexof+0x66>
jmp    1115 <indexof+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indexof>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rdi),%ecx
test   %cl,%cl
je     1124 <indexof+0x24>
add    $0x1,%eax
add    $0x1,%rdi
cmp    %sil,%cl
jne    1110 <indexof+0x10>
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @indexof(i8* nocapture %0, i8 signext %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i64 [ %9, %8 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = add nuw i64 %4, 1
%10 = icmp eq i8 %6, %1
br i1 %10, label %11, label %3
11: ; preds = %8
%12 = trunc i64 %4 to i32
br label %13
13: ; preds = %3, %11
%14 = phi i32 [ %12, %11 ], [ -1, %3 ]
ret i32 %14
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t getVgaEntry(unsigned char uc, uint8_t color) {
  return (uint16_t)uc | (uint16_t)color << 8;
}


x86 assembly (clang, -O0):
<getVgaEntry>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x10(%rbp),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getVgaEntry>:
shl    $0x8,%esi
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @getVgaEntry(i8 zeroext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 8
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @getVgaEntry(i8 zeroext %0, i64 %1) {
%3 = zext i8 %0 to i32
%4 = trunc i64 %1 to i32
%5 = shl i32 %4, 8
%6 = or i32 %5, %3
ret i32 %6
}