xunge/DecIR huggingface dataset:
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int /*<<< orphan*/ S_ISDIR(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int git_release_ssh_is_folder(const char *folder) {
  struct stat path_stat;
  if (stat(folder, &path_stat) || !S_ISDIR(path_stat.st_mode)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<git_release_ssh_is_folder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
jne    1154 <git_release_ssh_is_folder+0x34>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%eax
jne    1160 <git_release_ssh_is_folder+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1167 <git_release_ssh_is_folder+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<git_release_ssh_is_folder>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1138 <git_release_ssh_is_folder+0x18>
pop    %rcx
ret
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @git_release_ssh_is_folder(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp ne i64 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i32 @S_ISDIR(i32 %10)
%12 = icmp ne i32 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %8, %1
store i32 1, i32* %2
br label %15
14: ; preds = %8
store i32 0, i32* %2
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @git_release_ssh_is_folder(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @S_ISDIR(i32 %8)
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 1, %1 ], [ %11, %6 ]
ret i32 %13
}
void __aebi_unwind_cpp_pr0() { ; }


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

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

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

LLVM IR (-O2):
define void @__aebi_unwind_cpp_pr0() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ acc_delete(unsigned char *, int const);
void *acc_present_or_create(unsigned char *, int /*<<< orphan*/);
int /*<<< orphan*/ free(unsigned char *);
scalar_t__ malloc(int const);
int main(int argc, char **argv) {
  const int N = 256;
  unsigned char *h;
  void *d;
  h = (unsigned char *)malloc(N);
  d = acc_present_or_create(h, 0);
  if (!d)
    abort();
  acc_delete(h, N);
  free(h);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x100,-0x14(%rbp)
mov    $0x100,%edi
call   1060 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
xor    %esi,%esi
call   1050 <acc_present_or_create@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    119c <main+0x4c>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x20(%rbp),%rdi
mov    $0x100,%esi
call   1070 <acc_delete@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x100,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
call   1050 <acc_present_or_create@plt>
test   %rax,%rax
je     1186 <main+0x36>
mov    %rbx,%rdi
mov    $0x100,%esi
call   1070 <acc_delete@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 256, i32* %6
%9 = call i64 @malloc(i32 256)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = call i8* @acc_present_or_create(i8* %11, i32 0)
store i8* %12, i8** %8
%13 = load i8*, i8** %8
%14 = icmp ne i8* %13, null
br i1 %14, label %17, label %15
15: ; preds = %2
%16 = call i32 (...) @abort()
unreachable
17: ; preds = %2
%18 = load i8*, i8** %7
%19 = call i32 @acc_delete(i8* %18, i32 256)
%20 = load i8*, i8** %7
%21 = call i32 @free(i8* %20)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 256)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i8* @acc_present_or_create(i8* %4, i32 0)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %2
%10 = tail call i32 @acc_delete(i8* %4, i32 256)
%11 = tail call i32 @free(i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void scamper_udp6_close(int fd) {
  close(fd);
  return;
}


x86 assembly (clang, -O0):
<scamper_udp6_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scamper_udp6_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @scamper_udp6_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Type definitions */
typedef scalar_t__ int32_t;
typedef scalar_t__ int16_t;

/* Variables and functions */
scalar_t__ INT16_MAX;
scalar_t__ INT16_MIN;
int16_t clamp16(int32_t v) {
  if (v > INT16_MAX)
    return INT16_MAX;
  else if (v < INT16_MIN)
    return INT16_MIN;
  return v;
}


x86 assembly (clang, -O0):
<clamp16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ecd(%rip),%rcx
cmp    (%rcx),%rax
jle    112f <clamp16+0x2f>
mov    0x2ebd(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1163 <clamp16+0x63>
mov    -0x10(%rbp),%rax
mov    0x2e9e(%rip),%rcx
cmp    (%rcx),%rax
jge    1156 <clamp16+0x56>
mov    0x2e8e(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1163 <clamp16+0x63>
jmp    115b <clamp16+0x5b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp16>:
mov    0x2ed9(%rip),%rcx
mov    0x2eca(%rip),%rax
mov    (%rax),%rax
cmp    %rdi,%rax
cmovle %rdi,%rax
mov    (%rcx),%rcx
cmp    %rdi,%rcx
cmovl  %rcx,%rax
ret

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

LLVM IR (-O2):
@INT16_MAX = global i64 0
@INT16_MIN = global i64 0
define i64 @clamp16(i64 %0) {
%2 = load i64, i64* @INT16_MAX
%3 = icmp slt i64 %2, %0
%4 = load i64, i64* @INT16_MIN
%5 = icmp sgt i64 %4, %0
%6 = select i1 %5, i64 %4, i64 %0
%7 = select i1 %3, i64 %2, i64 %6
ret i64 %7
}
double caprasse(double x, double y, double z, double t) {
  return y * y * z + 2 * x * y * t - 2 * x - z;
}


x86 assembly (clang, -O0):
<caprasse>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  0xed1(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
subsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<caprasse>:
addsd  %xmm0,%xmm0
movapd %xmm0,%xmm4
mulsd  %xmm1,%xmm4
mulsd  %xmm1,%xmm1
mulsd  %xmm3,%xmm4
mulsd  %xmm2,%xmm1
addsd  %xmm4,%xmm1
subsd  %xmm0,%xmm1
subsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @caprasse(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %6
%10 = load double, double* %6
%11 = fmul double %9, %10
%12 = load double, double* %7
%13 = load double, double* %5
%14 = fmul double 2.000000e+00, %13
%15 = load double, double* %6
%16 = fmul double %14, %15
%17 = load double, double* %8
%18 = fmul double %16, %17
%19 = call double @llvm.fmuladd.f64(double %11, double %12, double %18)
%20 = load double, double* %5
%21 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %20, double %19)
%22 = load double, double* %7
%23 = fsub double %21, %22
ret double %23
}

LLVM IR (-O2):
define double @caprasse(double %0, double %1, double %2, double %3) {
%5 = fmul double %1, %1
%6 = fmul double %0, 2.000000e+00
%7 = fmul double %6, %1
%8 = fmul double %7, %3
%9 = tail call double @llvm.fmuladd.f64(double %5, double %2, double %8)
%10 = tail call double @llvm.fmuladd.f64(double %0, double -2.000000e+00, double %9)
%11 = fsub double %10, %2
ret double %11
}
double fltoFl(double fl) { return fl; }


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

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

LLVM IR (-O0):
define double @fltoFl(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
ret double %3
}

LLVM IR (-O2):
define double @fltoFl(double returned %0) {
ret double %0
}
/* Variables and functions */
bool string_is_empty(const char *str) { return !(*str); }


x86 assembly (clang, -O0):
<string_is_empty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_is_empty>:
xor    %eax,%eax
cmpb   $0x0,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @string_is_empty(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = icmp ne i8 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @string_is_empty(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int main() { return 2 < 3; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 1
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ max_keypermod;
};
typedef TYPE_1__ XModifierKeymap;

/* Variables and functions */
int get_XModifierKeymap_max_keypermod(void *_p) {
  return (int)((XModifierKeymap *)_p)->max_keypermod;
}


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

x86 assembly (clang, -O2):
<get_XModifierKeymap_max_keypermod>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XModifierKeymap_max_keypermod(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 i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XModifierKeymap_max_keypermod(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
unsigned short adc_scan(int);
unsigned short adc_read(int channel) { return adc_scan(channel); }


x86 assembly (clang, -O0):
<adc_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <adc_scan@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adc_read>:
jmp    1030 <adc_scan@plt>

LLVM IR (-O0):
define zeroext i16 @adc_read(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call zeroext i16 @adc_scan(i32 %3)
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @adc_read(i32 %0) {
%2 = tail call zeroext i16 @adc_scan(i32 %0)
ret i16 %2
}
void p04d(buf, val) char buf[];
int val;
{ sprintf(buf, "%04d", val); }


x86 assembly (clang, -O0):
<p04d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p04d>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
xor    %eax,%eax
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%04d\00"
define void @p04d(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 (i8*, i8*, ...) @sprintf(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%04d\00"
define void @p04d(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void imprime_vetor(int *itinerario, int tamanho_do_vetor) {
  int i;
  for (i = 0; i < tamanho_do_vetor; i++) {
    printf(" %d", itinerario[i]);
  }
}


x86 assembly (clang, -O0):
<imprime_vetor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <imprime_vetor+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <imprime_vetor+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprime_vetor>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <imprime_vetor+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <imprime_vetor+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c" %d\00"
define void @imprime_vetor(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 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c" %d\00"
define void @imprime_vetor(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ I2C_SLAVE;
scalar_t__ ioctl(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *);
void selectDevice(int file, int addr) {
  if (ioctl(file, I2C_SLAVE, addr) < 0) {
    printf("Failed to select I2C device.");
  }
}


x86 assembly (clang, -O0):
<selectDevice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
call   1040 <ioctl@plt>
cmp    $0x0,%rax
jge    1158 <selectDevice+0x38>
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<selectDevice>:
push   %rax
mov    %esi,%edx
mov    0x2ebe(%rip),%rax
mov    (%rax),%esi
call   1040 <ioctl@plt>
test   %rax,%rax
js     1138 <selectDevice+0x18>
pop    %rax
ret
lea    0xec1(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@I2C_SLAVE = global i32 0
@.str = [29 x i8] c"Failed to select I2C device.\00"
define void @selectDevice(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* @I2C_SLAVE
%7 = load i32, i32* %4
%8 = call i64 @ioctl(i32 %5, i32 %6, i32 %7)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
@I2C_SLAVE = global i32 0
@.str = [29 x i8] c"Failed to select I2C device.\00"
define void @selectDevice(i32 %0, i32 %1) {
%3 = load i32, i32* @I2C_SLAVE
%4 = tail call i64 @ioctl(i32 %0, i32 %3, i32 %1)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret void
}
int test_imm_54int16_mem(short *val) {
  return ((*val) & (0x54 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_54int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 84
%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_54int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 84
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ type;
};
typedef TYPE_1__ XFocusChangeEvent;

/* Variables and functions */
int get_XFocusChangeEvent_type(void *_p) {
  return (int)((XFocusChangeEvent *)_p)->type;
}


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

x86 assembly (clang, -O2):
<get_XFocusChangeEvent_type>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XFocusChangeEvent_type(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 i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XFocusChangeEvent_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int rand();
unsigned int getIntRandomNumber(int nLow, int nHigh) {
  return (rand() % (nHigh - nLow + 1)) + nLow;
}


x86 assembly (clang, -O0):
<getIntRandomNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getIntRandomNumber>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getIntRandomNumber(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = srem i32 %5, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @getIntRandomNumber(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void m_free(double *m) { free(m); }


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

x86 assembly (clang, -O2):
<m_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @m_free(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = call i32 @free(double* %3)
ret void
}

LLVM IR (-O2):
define void @m_free(double* nocapture %0) {
%2 = tail call i32 @free(double* %0)
ret void
}
int main() {
  int a = 1;
  int b = 2;
  int c = 3;
  int d = 4;
  if (a > b || c < d) {
    a = b + c;
  } else if (b > d) {
    c = 3;
  } else {
    c = 4;
  }
  a = 2;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     113f <main+0x3f>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    114d <main+0x4d>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1171 <main+0x71>
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    1165 <main+0x65>
movl   $0x3,-0x10(%rbp)
jmp    116c <main+0x6c>
movl   $0x4,-0x10(%rbp)
jmp    1171 <main+0x71>
movl   $0x2,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int isBottom(char *cs) { return strcmp(cs, "B") == 0; }


x86 assembly (clang, -O0):
<isBottom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isBottom>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"B\00"
define i32 @isBottom(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [2 x i8] c"B\00"
define i32 @isBottom(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int get_u32(int /*<<< orphan*/ const *);
char *indent(int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, int);
void mp4tree_box_mfhd_print(const uint8_t *p, size_t len, int depth) {
  printf("%s  Sequence Number: %u\n", indent(depth, 0), get_u32(p + 4));
}


x86 assembly (clang, -O0):
<mp4tree_box_mfhd_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edi
xor    %esi,%esi
call   1050 <indent@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
call   1040 <get_u32@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp4tree_box_mfhd_print>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %edx,%edi
xor    %esi,%esi
call   1050 <indent@plt>
mov    %rax,%r14
add    $0x10,%rbx
mov    %rbx,%rdi
call   1040 <get_u32@plt>
lea    0xeaa(%rip),%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"%s Sequence Number: %u\0A\00"
define void @mp4tree_box_mfhd_print(i32* %0, i64 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i32
store i32* %0, i32** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = call i8* @indent(i32 %7, i32 0)
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 4
%11 = call i32 @get_u32(i32* %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"%s Sequence Number: %u\0A\00"
define void @mp4tree_box_mfhd_print(i32* %0, i64 %1, i32 %2) {
%4 = tail call i8* @indent(i32 %2, i32 0)
%5 = getelementptr inbounds i32, i32* %0, i64 4
%6 = tail call i32 @get_u32(i32* %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %6)
ret void
}
/* Variables and functions */
void *b_mem_allocate(int);
void *liballoc_alloc(int n) { return b_mem_allocate(n); }


x86 assembly (clang, -O0):
<liballoc_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <b_mem_allocate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<liballoc_alloc>:
jmp    1030 <b_mem_allocate@plt>

LLVM IR (-O0):
define i8* @liballoc_alloc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i8* @b_mem_allocate(i32 %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @liballoc_alloc(i32 %0) {
%2 = tail call i8* @b_mem_allocate(i32 %0)
ret i8* %2
}
int f(int b) {
  int y;
  {
    int x[10];
    x[2 + 3 - 5] = b + f(5 + x[2] * b);
  }
  {
    int x[10];
    x[2 + 3 - 5] = b + f(5 + x[2] * b);
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x78(%rbp)
mov    -0x38(%rbp),%edi
imul   -0x8(%rbp),%edi
add    $0x5,%edi
call   1030 <f@plt>
mov    %eax,%ecx
mov    -0x78(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x40(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x74(%rbp)
mov    -0x68(%rbp),%edi
imul   -0x8(%rbp),%edi
add    $0x5,%edi
call   1030 <f@plt>
mov    %eax,%ecx
mov    -0x74(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x70(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
jmp    1100 <f>

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [10 x i32]
%6 = alloca [10 x i32]
store i32 %0, i32* %3
%7 = load i32, i32* %3
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 2
%9 = load i32, i32* %8
%10 = load i32, i32* %3
%11 = mul nsw i32 %9, %10
%12 = add nsw i32 5, %11
%13 = call i32 @f(i32 %12)
%14 = add nsw i32 %7, %13
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 0
store i32 %14, i32* %15
%16 = load i32, i32* %3
%17 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 2
%18 = load i32, i32* %17
%19 = load i32, i32* %3
%20 = mul nsw i32 %18, %19
%21 = add nsw i32 5, %20
%22 = call i32 @f(i32 %21)
%23 = add nsw i32 %16, %22
%24 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 0
store i32 %23, i32* %24
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
scalar_t__ strchr(char const *, int);
int isxdigit(int c) {
  const char *hex = "0123456789abcdefABCDEF";
  if (strchr(hex, c))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xede(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     1148 <isxdigit+0x38>
movl   $0x1,-0x4(%rbp)
jmp    114f <isxdigit+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxdigit>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <strchr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"0123456789abcdefABCDEF\00"
define i32 @isxdigit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8** %4
%5 = load i8*, i8** %4
%6 = load i32, i32* %3
%7 = call i64 @strchr(i8* %5, i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [23 x i8] c"0123456789abcdefABCDEF\00"
define i32 @isxdigit(i32 %0) {
%2 = tail call i64 @strchr(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ a5(int);
void a4(int n) { a5(n); }


x86 assembly (clang, -O0):
<a4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <a5@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a4>:
jmp    1030 <a5@plt>

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

LLVM IR (-O2):
define void @a4(i32 %0) {
%2 = tail call i32 @a5(i32 %0)
ret void
}
void gdk_rgb_set_install() {}


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

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

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

LLVM IR (-O2):
define void @gdk_rgb_set_install() {
ret void
}
int multiplicacao(int x, int y) { return x * y; }


x86 assembly (clang, -O0):
<multiplicacao>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiplicacao>:
mov    %edi,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @multiplicacao(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @multiplicacao(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void __attribute__((weak))
__aeabi_memcpy4_impl2(void *dest, const void *src, size_t n) {
  memcpy(dest, src, n);
}


x86 assembly (clang, -O0):
<__aeabi_memcpy4_impl2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__aeabi_memcpy4_impl2>:
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define weak void @__aeabi_memcpy4_impl2(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
ret void
}
__attribute__((always_, no)) int fn4(int r) { return r & 8; }


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

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

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

LLVM IR (-O2):
define i32 @fn4(i32 %0) {
%2 = and i32 %0, 8
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ compilerAssert();
void chpl_incRefCountsForDomainsInArrayEltTypes3(void) {
  compilerAssert();
  return;
}


x86 assembly (clang, -O0):
<chpl_incRefCountsForDomainsInArrayEltTypes3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <compilerAssert@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @chpl_incRefCountsForDomainsInArrayEltTypes3() {
%1 = call i32 (...) @compilerAssert()
ret void
}

LLVM IR (-O2):
define void @chpl_incRefCountsForDomainsInArrayEltTypes3() {
%1 = tail call i32 (...) @compilerAssert()
ret void
}
/* Type definitions */
struct pivec_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct pivec_t *);
int /*<<< orphan*/ pivec_destroy(struct pivec_t *);
void pivec_free(struct pivec_t *v) {
  ;
  pivec_destroy(v);
  free(v);
  { return; };
}


x86 assembly (clang, -O0):
<pivec_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pivec_destroy@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pivec_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <pivec_destroy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.pivec_t = type { i32 }
define void @pivec_free(%struct.pivec_t* %0) {
%2 = alloca %struct.pivec_t*
store %struct.pivec_t* %0, %struct.pivec_t** %2
%3 = load %struct.pivec_t*, %struct.pivec_t** %2
%4 = call i32 @pivec_destroy(%struct.pivec_t* %3)
%5 = load %struct.pivec_t*, %struct.pivec_t** %2
%6 = call i32 @free(%struct.pivec_t* %5)
ret void
}

LLVM IR (-O2):
%struct.pivec_t = type { i32 }
define void @pivec_free(%struct.pivec_t* %0) {
%2 = tail call i32 @pivec_destroy(%struct.pivec_t* %0)
%3 = tail call i32 @free(%struct.pivec_t* %0)
ret void
}
void save_state(struct parser *p, struct parse_state *ps) {}


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

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

LLVM IR (-O0):
%struct.parser = type opaque
%struct.parse_state = type opaque
define void @save_state(%struct.parser* %0, %struct.parse_state* %1) {
%3 = alloca %struct.parser*
%4 = alloca %struct.parse_state*
store %struct.parser* %0, %struct.parser** %3
store %struct.parse_state* %1, %struct.parse_state** %4
ret void
}

LLVM IR (-O2):
%struct.parser = type opaque
%struct.parse_state = type opaque
define void @save_state(%struct.parser* nocapture %0, %struct.parse_state* nocapture %1) {
ret void
}
int dsf_make_link(int *t, int a, int b) {
  if (a < b) {
    t[b] = a;
    return a;
  } else {
    t[a] = b;
    return b;
  }
}


x86 assembly (clang, -O0):
<dsf_make_link>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1133 <dsf_make_link+0x33>
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <dsf_make_link+0x47>
mov    -0x18(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dsf_make_link>:
mov    %edx,%eax
cmp    %edx,%esi
mov    %esi,%ecx
cmovl  %edx,%ecx
cmovl  %esi,%eax
movslq %ecx,%rcx
mov    %eax,(%rdi,%rcx,4)
ret

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

LLVM IR (-O2):
define i32 @dsf_make_link(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
%5 = select i1 %4, i32 %2, i32 %1
%6 = select i1 %4, i32 %1, i32 %2
%7 = sext i32 %5 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 %6, i32* %8
ret i32 %6
}
int main() {
  int Se7en_var, b;
  Se7en_var = 10;
  b = Se7en_var + 20;
  if (Se7en_var <= b) {
    Se7en_var = b;
  } else {
    b = 3.14;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x14,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1132 <main+0x32>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1139 <main+0x39>
movl   $0x3,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void clsSoc(int soc) {
  if (soc > 0) {
    close(soc);
  }
}


x86 assembly (clang, -O0):
<clsSoc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    112d <clsSoc+0x1d>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clsSoc>:
test   %edi,%edi
jle    1119 <clsSoc+0x9>
jmp    1030 <close@plt>
ret

LLVM IR (-O0):
define void @clsSoc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @close(i32 %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @clsSoc(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int ioctl(int, int /*<<< orphan*/);
int cbmarch_unlisten(int f) { return ioctl(f, _IO(0xcb, 3)); }


x86 assembly (clang, -O0):
<cbmarch_unlisten>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0xcb,%edi
mov    $0x3,%esi
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbmarch_unlisten>:
push   %rbx
mov    %edi,%ebx
mov    $0xcb,%edi
mov    $0x3,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @cbmarch_unlisten(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_IO(i32 203, i32 3)
%5 = call i32 @ioctl(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @cbmarch_unlisten(i32 %0) {
%2 = tail call i32 @_IO(i32 203, i32 3)
%3 = tail call i32 @ioctl(i32 %0, i32 %2)
ret i32 %3
}
int __ctzsi2(unsigned long i) {
  int b;
  if (i == 0)
    return 0;
  for (b = 0; !(i & 1); ++b)
    i = (unsigned long)i >> 1;
  return b;
}


x86 assembly (clang, -O0):
<__ctzsi2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <__ctzsi2+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1164 <__ctzsi2+0x64>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1144 <__ctzsi2+0x44>
jmp    115e <__ctzsi2+0x5e>
mov    -0x10(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <__ctzsi2+0x26>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ctzsi2>:
xor    %eax,%eax
test   %rdi,%rdi
je     112f <__ctzsi2+0x2f>
mov    %edi,%ecx
and    $0x1,%ecx
test   %rcx,%rcx
jne    112f <__ctzsi2+0x2f>
xor    %eax,%eax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
shr    %rcx
add    $0x1,%eax
test   $0x2,%dil
mov    %rcx,%rdi
je     1120 <__ctzsi2+0x20>
ret

LLVM IR (-O0):
define i32 @__ctzsi2(i64 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %22
8: ; preds = %1
store i32 0, i32* %4
br label %9
9: ; preds = %17, %8
%10 = load i64, i64* %3
%11 = and i64 %10, 1
%12 = icmp ne i64 %11, 0
%13 = xor i1 %12, true
br i1 %13, label %14, label %20
14: ; preds = %9
%15 = load i64, i64* %3
%16 = lshr i64 %15, 1
store i64 %16, i64* %3
br label %17
17: ; preds = %14
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %9
20: ; preds = %9
%21 = load i32, i32* %4
store i32 %21, i32* %2
br label %22
22: ; preds = %20, %7
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @__ctzsi2(i64 %0) {
%2 = icmp ne i64 %0, 0
%3 = and i64 %0, 1
%4 = icmp eq i64 %3, 0
%5 = and i1 %2, %4
br i1 %5, label %6, label %13
6: ; preds = %1, %6
%7 = phi i32 [ %10, %6 ], [ 0, %1 ]
%8 = phi i64 [ %9, %6 ], [ %0, %1 ]
%9 = lshr i64 %8, 1
%10 = add nuw nsw i32 %7, 1
%11 = and i64 %8, 2
%12 = icmp eq i64 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %6, %1
%14 = phi i32 [ 0, %1 ], [ %10, %6 ]
ret i32 %14
}
/* Variables and functions */
double const fabs(double);
int double_close(double x, double y) {
  const double rtol = 1E-5;
  const double atol = 1E-8;
  if (fabs(x - y) <= (atol + rtol * fabs(y))) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<double_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  0xed6(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xed1(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
call   1030 <fabs@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <fabs@plt>
movsd  -0x30(%rbp),%xmm1
movsd  0xe99(%rip),%xmm2
mulsd  %xmm2,%xmm0
movsd  0xe95(%rip),%xmm2
addsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jb     118d <double_close+0x7d>
movl   $0x1,-0x4(%rbp)
jmp    1194 <double_close+0x84>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_close>:
subsd  %xmm1,%xmm0
movapd 0xef4(%rip),%xmm2
andpd  %xmm2,%xmm0
andpd  %xmm2,%xmm1
mulsd  0xef4(%rip),%xmm1
addsd  0xef4(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setae  %al
ret

LLVM IR (-O0):
define i32 @double_close(double %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double 1.000000e-05, double* %6
store double 1.000000e-08, double* %7
%8 = load double, double* %4
%9 = load double, double* %5
%10 = fsub double %8, %9
%11 = call double @fabs(double %10)
%12 = load double, double* %5
%13 = call double @fabs(double %12)
%14 = call double @llvm.fmuladd.f64(double 1.000000e-05, double %13, double 1.000000e-08)
%15 = fcmp ole double %11, %14
br i1 %15, label %16, label %17
16: ; preds = %2
store i32 1, i32* %3
br label %18
17: ; preds = %2
store i32 0, i32* %3
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @double_close(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call double @llvm.fabs.f64(double %3)
%5 = tail call double @llvm.fabs.f64(double %1)
%6 = tail call double @llvm.fmuladd.f64(double %5, double 1.000000e-05, double 1.000000e-08)
%7 = fcmp ole double %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void PrintError(char *s) {
  fprintf(stderr, "%s", s);
  exit(1);
}


x86 assembly (clang, -O0):
<PrintError>:
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):
<PrintError>:
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 = [3 x i8] c"%s\00"
define void @PrintError(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 ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @PrintError(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}