xunge/DecIR huggingface dataset:
int test_imm_F6uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xF6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F6uint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0xf6,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_F6uint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 246
%7 = icmp ne i64 %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_F6uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 16121856
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int execute_fstatat64() { return 0; }


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

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

LLVM IR (-O0):
define i32 @execute_fstatat64() {
ret i32 0
}

LLVM IR (-O2):
define i32 @execute_fstatat64() {
ret i32 0
}
/* Variables and functions */
float fabs(float n) {
  if (n < 0.0) {
    return -n;
  } else {
    return n;
  }
}


x86 assembly (clang, -O0):
<fabs>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    113b <fabs+0x3b>
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1145 <fabs+0x45>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabs>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @fabs(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp olt double %5, 0.000000e+00
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load float, float* %3
%9 = fneg float %8
store float %9, float* %2
br label %12
10: ; preds = %1
%11 = load float, float* %3
store float %11, float* %2
br label %12
12: ; preds = %10, %7
%13 = load float, float* %2
ret float %13
}

LLVM IR (-O2):
define float @fabs(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t B_UNBUF32(void const *const buf) {
  return *(uint32_t const *)buf;
}


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

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

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

LLVM IR (-O2):
define i32 @B_UNBUF32(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
void strcpy(char *restrict dst, const char *restrict src) {
  char c;
  do {
    c = *(src++);
    *(dst++) = c;
  } while (c != '\0');
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
movsbl -0x11(%rbp),%eax
cmp    $0x0,%eax
jne    110c <strcpy+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcpy+0x10>
ret

LLVM IR (-O0):
define void @strcpy(i8* noalias %0, i8* noalias %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %6
6: ; preds = %13, %2
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %4
%9 = load i8, i8* %7
store i8 %9, i8* %5
%10 = load i8, i8* %5
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
store i8 %10, i8* %11
br label %13
13: ; preds = %6
%14 = load i8, i8* %5
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 0
br i1 %16, label %6, label %17
17: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @strcpy(i8* noalias nocapture writeonly %0, i8* noalias nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ video_charcolor(char, int, int);
void video_char(char c) { video_charcolor(c, 0x00, 0x07); }


x86 assembly (clang, -O0):
<video_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %esi,%esi
mov    $0x7,%edx
movsbl -0x1(%rbp),%edi
call   1030 <video_charcolor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<video_char>:
xor    %esi,%esi
mov    $0x7,%edx
jmp    1030 <video_charcolor@plt>

LLVM IR (-O0):
define void @video_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @video_charcolor(i8 signext %3, i32 0, i32 7)
ret void
}

LLVM IR (-O2):
define void @video_char(i8 signext %0) {
%2 = tail call i32 @video_charcolor(i8 signext %0, i32 0, i32 7)
ret void
}
int svp_migrate_range(unsigned long pfn) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @svp_migrate_range(i64 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void var_value_free(void *value) {
  double *v = (double *)value;
  free(v);
}


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

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

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

LLVM IR (-O2):
define void @var_value_free(i8* nocapture %0) {
%2 = bitcast i8* %0 to double*
%3 = tail call i32 @free(double* %2)
ret void
}
/* Variables and functions */
unsigned int vcmpgeu4(unsigned int, unsigned int);
unsigned int vminu4(unsigned int a, unsigned int b) {
  unsigned int r, s;
  s = vcmpgeu4(b, a);
  r = a & s;
  s = b & ~s;
  r = r | s;
  return r;
}


x86 assembly (clang, -O0):
<vminu4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <vcmpgeu4@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vminu4>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
mov    %ebp,%esi
call   1030 <vcmpgeu4@plt>
xor    %ebx,%ebp
and    %ebp,%eax
xor    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @vminu4(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = call i32 @vcmpgeu4(i32 %7, i32 %8)
store i32 %9, i32* %6
%10 = load i32, i32* %3
%11 = load i32, i32* %6
%12 = and i32 %10, %11
store i32 %12, i32* %5
%13 = load i32, i32* %4
%14 = load i32, i32* %6
%15 = xor i32 %14, -1
%16 = and i32 %13, %15
store i32 %16, i32* %6
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = or i32 %17, %18
store i32 %19, i32* %5
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
define i32 @vminu4(i32 %0, i32 %1) {
%3 = tail call i32 @vcmpgeu4(i32 %1, i32 %0)
%4 = and i32 %3, %0
%5 = xor i32 %3, -1
%6 = and i32 %5, %1
%7 = or i32 %4, %6
ret i32 %7
}
OP(ed, ef) { illegal_2(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_2()
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void __attribute__((destructor)) fini(void) { write(1, "9\n", 2); }


x86 assembly (clang, -O0):
<fini>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fini>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
mov    $0x2,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"9\0A\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @fini, i8* null }]
define void @fini() {
%1 = call i32 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"9\0A\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @fini, i8* null }]
define void @fini() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}
/* Variables and functions */
size_t bootpart_size(const char *part_type) { return (0); }


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

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

LLVM IR (-O0):
define i64 @bootpart_size(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i64 0
}

LLVM IR (-O2):
define i64 @bootpart_size(i8* nocapture readnone %0) {
ret i64 0
}
int __attribute__((warn_unused_result)) __kfifo_int_must_check_helper(int val) {
  return val;
}


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

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

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

LLVM IR (-O2):
define i32 @__kfifo_int_must_check_helper(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int crypt_hash_size(char const *);
int crypt_hmac_size(const char *name) { return crypt_hash_size(name); }


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

x86 assembly (clang, -O2):
<crypt_hmac_size>:
jmp    1030 <crypt_hash_size@plt>

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

LLVM IR (-O2):
define i32 @crypt_hmac_size(i8* %0) {
%2 = tail call i32 @crypt_hash_size(i8* %0)
ret i32 %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ focus;
};
typedef TYPE_1__ XLeaveWindowEvent;

/* Variables and functions */
int get_XLeaveWindowEvent_focus(void *_p) {
  return (int)((XLeaveWindowEvent *)_p)->focus;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XLeaveWindowEvent_focus(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_XLeaveWindowEvent_focus(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 /*<<< orphan*/ ft_putchar(char);
void print(char a, char b, char c) {
  ft_putchar(a);
  ft_putchar(b);
  ft_putchar(c);
  if (a != 55) {
    ft_putchar(',');
    ft_putchar(' ');
  }
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <ft_putchar@plt>
movsbl -0x2(%rbp),%edi
call   1030 <ft_putchar@plt>
movsbl -0x3(%rbp),%edi
call   1030 <ft_putchar@plt>
movsbl -0x1(%rbp),%eax
cmp    $0x37,%eax
je     1165 <print+0x55>
mov    $0x2c,%edi
call   1030 <ft_putchar@plt>
mov    $0x20,%edi
call   1030 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <ft_putchar@plt>
mov    %ebp,%edi
call   1030 <ft_putchar@plt>
mov    %r14d,%edi
call   1030 <ft_putchar@plt>
cmp    $0x37,%bl
jne    1139 <print+0x29>
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    $0x2c,%edi
call   1030 <ft_putchar@plt>
mov    $0x20,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <ft_putchar@plt>

LLVM IR (-O0):
define void @print(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %4
%8 = call i32 @ft_putchar(i8 signext %7)
%9 = load i8, i8* %5
%10 = call i32 @ft_putchar(i8 signext %9)
%11 = load i8, i8* %6
%12 = call i32 @ft_putchar(i8 signext %11)
%13 = load i8, i8* %4
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 55
br i1 %15, label %16, label %19
16: ; preds = %3
%17 = call i32 @ft_putchar(i8 signext 44)
%18 = call i32 @ft_putchar(i8 signext 32)
br label %19
19: ; preds = %16, %3
ret void
}

LLVM IR (-O2):
define void @print(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = tail call i32 @ft_putchar(i8 signext %0)
%5 = tail call i32 @ft_putchar(i8 signext %1)
%6 = tail call i32 @ft_putchar(i8 signext %2)
%7 = icmp eq i8 %0, 55
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = tail call i32 @ft_putchar(i8 signext 44)
%10 = tail call i32 @ft_putchar(i8 signext 32)
br label %11
11: ; preds = %8, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *, int *);
int main() {
  int A, B, C, D, diferenca;
  scanf("%d%d%d%d", &A, &B, &C, &D);
  diferenca = A * B - C * D;
  printf("DIFERENCA = %d\n", diferenca);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
imul   -0x14(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
call   1040 <scanf@plt>
mov    0x10(%rsp),%esi
imul   0x14(%rsp),%esi
mov    0x8(%rsp),%eax
imul   0xc(%rsp),%eax
sub    %eax,%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d%d%d%d\00"
@.str.1 = [16 x i8] c"DIFERENCA = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4, i32* %5)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = mul nsw i32 %8, %9
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = mul nsw i32 %11, %12
%14 = sub nsw i32 %10, %13
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d%d%d%d\00"
@.str.1 = [16 x i8] c"DIFERENCA = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = mul nsw i32 %11, %10
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = mul nsw i32 %14, %13
%16 = sub nsw i32 %12, %15
%17 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %16)
ret i32 0
}
int mu_null_emitter(void *obj, const char c) { return 1; }


x86 assembly (clang, -O0):
<mu_null_emitter>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @mu_null_emitter(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
ret i32 1
}

LLVM IR (-O2):
define i32 @mu_null_emitter(i8* nocapture readnone %0, i8 signext %1) {
ret i32 1
}
int test_imm_5Cuint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x5C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Cuint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0x5c,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_5Cuint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 92
%7 = icmp ne i64 %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_5Cuint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 395136991232
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ pic_unmask(int);
void irq_unmask(int irq) { pic_unmask(irq); }


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

x86 assembly (clang, -O2):
<irq_unmask>:
jmp    1030 <pic_unmask@plt>

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

LLVM IR (-O2):
define void @irq_unmask(i32 %0) {
%2 = tail call i32 @pic_unmask(i32 %0)
ret void
}
double f4_sum_pre_double_double_double_double_long(double v0, double v1,
                                                   double v2, double v3,
                                                   long v) {
  return v0 + v1 + v2 + v3 + ((double)(v));
}


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

x86 assembly (clang, -O2):
<f4_sum_pre_double_double_double_double_long>:
addsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %rdi,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f4_sum_pre_double_double_double_double_long(double %0, double %1, double %2, double %3, i64 %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca i64
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store i64 %4, i64* %10
%11 = load double, double* %6
%12 = load double, double* %7
%13 = fadd double %11, %12
%14 = load double, double* %8
%15 = fadd double %13, %14
%16 = load double, double* %9
%17 = fadd double %15, %16
%18 = load i64, i64* %10
%19 = sitofp i64 %18 to double
%20 = fadd double %17, %19
ret double %20
}

LLVM IR (-O2):
define double @f4_sum_pre_double_double_double_double_long(double %0, double %1, double %2, double %3, i64 %4) {
%6 = fadd double %0, %1
%7 = fadd double %6, %2
%8 = fadd double %7, %3
%9 = sitofp i64 %4 to double
%10 = fadd double %8, %9
ret double %10
}
/* Variables and functions */
int Streams_pushBordered(char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int LOG_SYSTEM(void) {
  char szBuffered[66];
  strcpy(szBuffered, "Compiled as C");
  strcat(szBuffered, " for ");
  strcat(szBuffered, "Linux.");
  return Streams_pushBordered(szBuffered);
}


x86 assembly (clang, -O0):
<LOG_SYSTEM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
lea    0xebd(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x50(%rbp),%rdi
lea    0xebb(%rip),%rsi
call   1050 <strcat@plt>
lea    -0x50(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1050 <strcat@plt>
lea    -0x50(%rbp),%rdi
call   1040 <Streams_pushBordered@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LOG_SYSTEM>:
push   %rbx
sub    $0x50,%rsp
lea    0xec4(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xec0(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
lea    0xeb7(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
mov    %rbx,%rdi
call   1040 <Streams_pushBordered@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Compiled as C\00"
@.str.1 = [6 x i8] c" for \00"
@.str.2 = [7 x i8] c"Linux.\00"
define i32 @LOG_SYSTEM() {
%1 = alloca [66 x i8]
%2 = getelementptr inbounds [66 x i8], [66 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [66 x i8], [66 x i8]* %1, i64 0, i64 0
%5 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = getelementptr inbounds [66 x i8], [66 x i8]* %1, i64 0, i64 0
%7 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%8 = getelementptr inbounds [66 x i8], [66 x i8]* %1, i64 0, i64 0
%9 = call i32 @Streams_pushBordered(i8* %8)
ret i32 %9
}

LLVM IR (-O2):
@.str = [14 x i8] c"Compiled as C\00"
@.str.1 = [6 x i8] c" for \00"
@.str.2 = [7 x i8] c"Linux.\00"
define i32 @LOG_SYSTEM() {
%1 = alloca [66 x i8]
%2 = getelementptr inbounds [66 x i8], [66 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @strcat(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @strcat(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @Streams_pushBordered(i8* %2)
ret i32 %6
}
double dSign(const double number) {
  if (number >= 0.0) {
    return 1;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<dSign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112d <dSign+0x2d>
movsd  0xee5(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113a <dSign+0x3a>
movsd  0xecb(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dSign>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setb   %al
lea    0xeec(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
ret

LLVM IR (-O0):
define double @dSign(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oge double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 1.000000e+00, double* %2
br label %8
7: ; preds = %1
store double -1.000000e+00, double* %2
br label %8
8: ; preds = %7, %6
%9 = load double, double* %2
ret double %9
}

LLVM IR (-O2):
define double @dSign(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
%3 = select i1 %2, double -1.000000e+00, double 1.000000e+00
ret double %3
}
double acos(double x) { return x; }


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

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

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

LLVM IR (-O2):
define double @acos(double returned %0) {
ret double %0
}
void foo(int x) {
  int i = 0;
#pragma omp parallel for simd
  for (i = (i & x); i < 10; i = i + 2)
    ;
  i = 0;
#pragma omp parallel for simd
  for (i = 0; i < (i & x) + 10; i = i + 2)
    ;
  i = 0;
#pragma omp parallel for simd
  for (i = 0; i < 10; i = i + ((i & x) + 2))
    ;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1134 <foo+0x34>
jmp    1126 <foo+0x26>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1117 <foo+0x17>
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
and    -0x4(%rbp),%ecx
add    $0xa,%ecx
cmp    %ecx,%eax
jge    1169 <foo+0x69>
jmp    115b <foo+0x5b>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1142 <foo+0x42>
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    119c <foo+0x9c>
jmp    1186 <foo+0x86>
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
and    -0x4(%rbp),%ecx
add    $0x2,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    1177 <foo+0x77>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *fct) {
  printf("usage:  %s [-securekey] [-noskip] [-noinit] [-h] -slot <num>\n\n",
         fct);
  return;
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [63 x i8] c"usage: %s [-securekey] [-noskip] [-noinit] [-h] -slot <num>\0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [63 x i8] c"usage: %s [-securekey] [-noskip] [-noinit] [-h] -slot <num>\0A\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *, double *);
int main() {
  double altura = 0.0;
  double raio = 0.0;
  scanf("%lf %lf", &altura, &raio);
  printf("%.1lf\n", 3.1416 * raio * raio * altura);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
movsd  0xea5(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0xecb(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm1
movsd  0xea6(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  0x10(%rsp),%xmm0
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%lf %lf\00"
@.str.1 = [7 x i8] c"%.1lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %2
store double 0.000000e+00, double* %3
%4 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %2, double* %3)
%5 = load double, double* %3
%6 = fmul double 3.141600e+00, %5
%7 = load double, double* %3
%8 = fmul double %6, %7
%9 = load double, double* %2
%10 = fmul double %8, %9
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%lf %lf\00"
@.str.1 = [7 x i8] c"%.1lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
store double 0.000000e+00, double* %1
%4 = bitcast double* %2 to i8*
store double 0.000000e+00, double* %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %1, double* %2)
%6 = load double, double* %2
%7 = fmul double %6, 3.141600e+00
%8 = fmul double %6, %7
%9 = load double, double* %1
%10 = fmul double %9, %8
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %10)
ret i32 0
}
void XMapSubwindows() {}


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

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

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

LLVM IR (-O2):
define void @XMapSubwindows() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ swap(int *, int *, int);
int main() {
  int a = 44;
  int b = 5;
  int *a_ptr = &a;
  int *b_ptr = &b;
  printf("Before swapping\n\ta = [%d]\n\tb = [%d]\n", a, b);
  swap(a_ptr, b_ptr, sizeof(int));
  printf("After swapping\n\ta = [%d]\n\tb = [%d]\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2c,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0x4,%edx
call   1040 <swap@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x2c,0x4(%rsp)
movl   $0x5,(%rsp)
lea    0xec9(%rip),%rdi
mov    $0x2c,%esi
mov    $0x5,%edx
call   1030 <printf@plt>
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x4,%edx
call   1040 <swap@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Before swapping\0A\09a = [%d]\0A\09b = [%d]\0A\00"
@.str.1 = [36 x i8] c"After swapping\0A\09a = [%d]\0A\09b = [%d]\0A\00"
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 44, i32* %2
store i32 5, i32* %3
store i32* %2, i32** %4
store i32* %3, i32** %5
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = load i32*, i32** %4
%10 = load i32*, i32** %5
%11 = call i32 @swap(i32* %9, i32* %10, i32 4)
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"Before swapping\0A\09a = [%d]\0A\09b = [%d]\0A\00"
@.str.1 = [36 x i8] c"After swapping\0A\09a = [%d]\0A\09b = [%d]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 44, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 5, i32* %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 44, i32 5)
%6 = call i32 @swap(i32* %1, i32* %2, i32 4)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ writen(int, char const *, int /*<<< orphan*/);
ssize_t writestring(int fd, const char *str) {
  return writen(fd, str, strlen(str));
}


x86 assembly (clang, -O0):
<writestring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <writen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writestring>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <writen@plt>

LLVM IR (-O0):
define i32 @writestring(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 i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @writen(i32 %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @writestring(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @writen(i32 %0, i8* %1, i32 %3)
ret i32 %4
}
void ff_hevc_put_hevc_bi_epel_v16_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_v16_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit_error(int, int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void _exit_errno(int line) { _exit_error(line, strerror(errno)); }


x86 assembly (clang, -O0):
<_exit_errno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1030 <_exit_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_exit_errno>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <_exit_error@plt>

LLVM IR (-O0):
@errno = global i32 0
define void @_exit_errno(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @errno
%5 = call i32 @strerror(i32 %4)
%6 = call i32 @_exit_error(i32 %3, i32 %5)
ret void
}

LLVM IR (-O2):
@errno = global i32 0
define void @_exit_errno(i32 %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 @strerror(i32 %2)
%4 = tail call i32 @_exit_error(i32 %0, i32 %3)
ret void
}
unsigned int rol(unsigned int n, int k) { return (n << k) | (n >> (32 - k)); }


x86 assembly (clang, -O0):
<rol>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rol>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%eax
ret

LLVM IR (-O0):
define i32 @rol(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 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = lshr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rol(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = lshr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
const char *__malidrv_build_info(void) {
  return "malidrv:  API_VERSION=19 REPO_URL= REVISION= CHANGED_REVISION= "
         "CHANGE_DATE= BUILD_DATE=Wed Feb  6 23:23:49 PST 2013 BUILD=release "
         "TARGET_PLATFORM= MALI_PLATFORM= KDIR= "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING=y "
         "USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 "
         "MALI_UPPER_HALF_SCHEDULING=1";
}


x86 assembly (clang, -O0):
<__malidrv_build_info>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__malidrv_build_info>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [314 x i8] c"malidrv: API_VERSION=19 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Wed Feb 6 23:23:49 PST 2013 BUILD=release TARGET_PLATFORM= MALI_PLATFORM= KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING=y USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([314 x i8], [314 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [314 x i8] c"malidrv: API_VERSION=19 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Wed Feb 6 23:23:49 PST 2013 BUILD=release TARGET_PLATFORM= MALI_PLATFORM= KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING=y USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([314 x i8], [314 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
long lround(double);
long int vl_round_d(double x) { return lround(x); }


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

x86 assembly (clang, -O2):
<vl_round_d>:
jmp    1030 <lround@plt>

LLVM IR (-O0):
define i64 @vl_round_d(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @lround(double %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @vl_round_d(double %0) {
%2 = tail call i64 @lround(double %0)
ret i64 %2
}
int test_imm_89int16_reg(short val) {
  return ((val) & (0x89 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_89int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x89,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_89int16_reg>:
test   $0x89,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_89int16_reg(i16 signext %0) {
%2 = and i16 %0, 137
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ INT_MIN;
int /*<<< orphan*/ itoa(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char s[100];
  itoa(INT_MIN, s);
  printf("%s\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
lea    -0x70(%rbp),%rsi
call   1040 <itoa@plt>
lea    -0x70(%rbp),%rsi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <itoa@plt>
lea    0xec0(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@INT_MIN = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = load i32, i32* @INT_MIN
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = call i32 @itoa(i32 %2, i8* %3)
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@INT_MIN = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @INT_MIN
%4 = call i32 @itoa(i32 %3, i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool is_sc(uint32_t insn) {
  switch (insn >> 26) {
  case 0x38:
  case 0x3c:
    return true;
  default:
    return false;
  }
}


x86 assembly (clang, -O0):
<is_sc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1a,%eax
or     $0x4,%eax
sub    $0x3c,%eax
je     111e <is_sc+0x1e>
jmp    112a <is_sc+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1131 <is_sc+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @is_sc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = ashr i32 %4, 26
switch i32 %5, label %7 [
i32 56, label %6
i32 60, label %6
]
6: ; preds = %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @is_sc(i32 %0) {
ret i32 0
}
void i2d_EDIPARTYNAME(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_EDIPARTYNAME() {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ free(void *);
void *malloc(int);
void *realloc(void *, int);
int main(void) {
  void *ptr1 = malloc(sizeof(char));
  if (ptr1 == NULL)
    return EXIT_SUCCESS;
  free(ptr1);
  void *ptr2 = realloc(ptr1, 2 * sizeof(char));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1169 <main+0x39>
mov    0x2e81(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1184 <main+0x54>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1050 <realloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     115c <main+0x2c>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1050 <realloc@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    0x2e7d(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i8* @malloc(i32 1)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = load i32, i32* @EXIT_SUCCESS
store i32 %8, i32* %1
br label %14
9: ; preds = %0
%10 = load i8*, i8** %2
%11 = call i32 @free(i8* %10)
%12 = load i8*, i8** %2
%13 = call i8* @realloc(i8* %12, i32 2)
store i8* %13, i8** %3
br label %14
14: ; preds = %9, %7
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = load i32, i32* @EXIT_SUCCESS
br label %8
5: ; preds = %0
%6 = tail call i32 @free(i8* %1)
%7 = tail call i8* @realloc(i8* %1, i32 2)
br label %8
8: ; preds = %5, %3
%9 = phi i32 [ %4, %3 ], [ 0, %5 ]
ret i32 %9
}