xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
void test_func(void) {
  char buf[16];
  memset(buf, 0, 32);
}


x86 assembly (clang, -O0):
<test_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_func>:
sub    $0x18,%rsp
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1030 <memset@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @test_func() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 32)
ret void
}

LLVM IR (-O2):
define void @test_func() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 32)
ret void
}
void wait(int period) {
  for (int i = 0; i < 50000 * period; i++) {
    __asm("nop");
  }
}


x86 assembly (clang, -O0):
<wait>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   $0xc350,-0x4(%rbp),%ecx
cmp    %ecx,%eax
jge    112f <wait+0x2f>
nop
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <wait+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait>:
test   %edi,%edi
jle    1126 <wait+0x26>
imul   $0xc350,%edi,%ecx
cmp    $0x2,%ecx
mov    $0x1,%eax
cmovge %ecx,%eax
cs nopw 0x0(%rax,%rax,1)
nop
nop
add    $0xffffffff,%eax
jne    1120 <wait+0x20>
ret

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

LLVM IR (-O2):
define void @wait(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = mul i32 %0, 50000
%5 = call i32 @llvm.smax.i32(i32 %4, i32 1)
br label %7
6: ; preds = %7, %1
ret void
7: ; preds = %3, %7
%8 = phi i32 [ %9, %7 ], [ 0, %3 ]
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
%9 = add nuw nsw i32 %8, 1
%10 = icmp eq i32 %9, %5
br i1 %10, label %6, label %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ encode_msg_0(int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ mode_is_connnected();
void send_message_0(uint8_t msg_id) {
  if (mode_is_connnected() != 0)
    encode_msg_0(msg_id, 0);
}


x86 assembly (clang, -O0):
<send_message_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <mode_is_connnected@plt>
cmp    $0x0,%rax
je     1146 <send_message_0+0x26>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <encode_msg_0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_message_0>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <mode_is_connnected@plt>
test   %rax,%rax
je     1139 <send_message_0+0x19>
mov    %ebx,%edi
xor    %esi,%esi
pop    %rbx
jmp    1030 <encode_msg_0@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @send_message_0(i32 %0) {
%2 = tail call i64 (...) @mode_is_connnected()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @encode_msg_0(i32 %0, i32 0)
br label %6
6: ; preds = %4, %1
ret void
}
int c032(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c032() {
ret i32 0
}
/* Variables and functions */
float exp(double);
double log(float);
float mysqrt(float x) {
  if (x <= 0) {
    return 0;
  }
  return exp(log(x) * 0.5);
}


x86 assembly (clang, -O0):
<mysqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     1147 <mysqrt+0x27>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1167 <mysqrt+0x47>
movss  -0x8(%rbp),%xmm0
call   1040 <log@plt>
movsd  0xea7(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mysqrt>:
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jae    113c <mysqrt+0x1c>
push   %rax
call   1040 <log@plt>
mulsd  0xeca(%rip),%xmm0
pop    %rax
jmp    1030 <exp@plt>
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @mysqrt(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp ole float %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store float 0.000000e+00, float* %2
br label %12
7: ; preds = %1
%8 = load float, float* %3
%9 = call double @log(float %8)
%10 = fmul double %9, 5.000000e-01
%11 = call float @exp(double %10)
store float %11, float* %2
br label %12
12: ; preds = %7, %6
%13 = load float, float* %2
ret float %13
}

LLVM IR (-O2):
define float @mysqrt(float %0) {
%2 = fcmp ugt float %0, 0.000000e+00
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call double @log(float %0)
%5 = fmul double %4, 5.000000e-01
%6 = tail call float @exp(double %5)
br label %7
7: ; preds = %1, %3
%8 = phi float [ %6, %3 ], [ 0.000000e+00, %1 ]
ret float %8
}
void inclass_element2FF() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ set_rounding(int /*<<< orphan*/ const *);
void sub_d(const uint32_t *fcr31, const double *source1, const double *source2,
           double *target) {
  set_rounding(fcr31);
  *target = *source1 - *source2;
}


x86 assembly (clang, -O0):
<sub_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <set_rounding@plt>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_d>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
call   1030 <set_rounding@plt>
movsd  (%rbx),%xmm0
subsd  (%r15),%xmm0
movsd  %xmm0,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @sub_d(i32* %0, double* %1, double* %2, double* %3) {
%5 = alloca i32*
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
store i32* %0, i32** %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load i32*, i32** %5
%10 = call i32 @set_rounding(i32* %9)
%11 = load double*, double** %6
%12 = load double, double* %11
%13 = load double*, double** %7
%14 = load double, double* %13
%15 = fsub double %12, %14
%16 = load double*, double** %8
store double %15, double* %16
ret void
}

LLVM IR (-O2):
define void @sub_d(i32* %0, double* nocapture %1, double* nocapture %2, double* nocapture writeonly %3) {
%5 = tail call i32 @set_rounding(i32* %0)
%6 = load double, double* %1
%7 = load double, double* %2
%8 = fsub double %6, %7
store double %8, double* %3
ret void
}
unsigned long djb(const char *key) {
  unsigned long hash = 5381;
  int c;
  while ((c = *key++)) {
    hash = ((hash << 5) + hash) + c;
  }
  return hash;
}


x86 assembly (clang, -O0):
<djb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <djb+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <djb+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<djb>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <djb+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <djb+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @djb(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = sext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Variables and functions */
int write_key(char const *, char const *, char const *, int /*<<< orphan*/);
int textfile_put(const char *pathname, const char *key, const char *value) {
  return write_key(pathname, key, value, 0);
}


x86 assembly (clang, -O0):
<textfile_put>:
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
xor    %ecx,%ecx
call   1030 <write_key@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<textfile_put>:
xor    %ecx,%ecx
jmp    1030 <write_key@plt>

LLVM IR (-O0):
define i32 @textfile_put(i8* %0, i8* %1, i8* %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 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @write_key(i8* %7, i8* %8, i8* %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @textfile_put(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @write_key(i8* %0, i8* %1, i8* %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ft_putstr(char *);
void ft_generic(void) { ft_putstr("Tu tu tu tu ; Tu tu tu tu\n"); }


x86 assembly (clang, -O0):
<ft_generic>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <ft_putstr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_generic>:
lea    0xee9(%rip),%rdi
jmp    1030 <ft_putstr@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Tu tu tu tu ; Tu tu tu tu\0A\00"
define void @ft_generic() {
%1 = call i32 @ft_putstr(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"Tu tu tu tu ; Tu tu tu tu\0A\00"
define void @ft_generic() {
%1 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}
void HandleCreateNotify(void) {}


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

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

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

LLVM IR (-O2):
define void @HandleCreateNotify() {
ret void
}
void getCycles(unsigned *lowp, unsigned *highp) {
  *lowp = 0;
  *highp = 0;
}


x86 assembly (clang, -O0):
<getCycles>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCycles>:
movl   $0x0,(%rdi)
movl   $0x0,(%rsi)
ret

LLVM IR (-O0):
define void @getCycles(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
store i32 0, i32* %5
%6 = load i32*, i32** %4
store i32 0, i32* %6
ret void
}

LLVM IR (-O2):
define void @getCycles(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
store i32 0, i32* %0
store i32 0, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x2d() {
  Assert_real((islower(45) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              230, ("islower should be 0 for -"));
}


x86 assembly (clang, -O0):
<t_islower_0x2d>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2d,%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0xe6,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_islower_0x2d>:
push   %rax
mov    $0x2d,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xe6,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for -\00"
define void @t_islower_0x2d() {
%1 = call i64 @islower(i32 45)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 230, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for -\00"
define void @t_islower_0x2d() {
%1 = tail call i64 @islower(i32 45)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 230, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *const);
void safeFree(void *const ptr) {
  if (ptr)
    free(ptr);
}


x86 assembly (clang, -O0):
<safeFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <safeFree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safeFree>:
test   %rdi,%rdi
je     111a <safeFree+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @safeFree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
void transfer_RGB888_to_RGB888(unsigned char *(*output), unsigned char *input) {
  *(*output)++ = *input++;
  *(*output)++ = *input++;
  *(*output)++ = *input;
}


x86 assembly (clang, -O0):
<transfer_RGB888_to_RGB888>:
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),%cl
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<transfer_RGB888_to_RGB888>:
mov    (%rsi),%al
mov    (%rdi),%rcx
lea    0x1(%rcx),%rdx
mov    %rdx,(%rdi)
mov    %al,(%rcx)
mov    0x1(%rsi),%al
mov    (%rdi),%rcx
lea    0x1(%rcx),%rdx
mov    %rdx,(%rdi)
mov    %al,(%rcx)
mov    0x2(%rsi),%al
mov    (%rdi),%rcx
lea    0x1(%rcx),%rdx
mov    %rdx,(%rdi)
mov    %al,(%rcx)
ret

LLVM IR (-O0):
define void @transfer_RGB888_to_RGB888(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %4
%7 = load i8, i8* %5
%8 = load i8**, i8*** %3
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %8
store i8 %7, i8* %9
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %4
%13 = load i8, i8* %11
%14 = load i8**, i8*** %3
%15 = load i8*, i8** %14
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %14
store i8 %13, i8* %15
%17 = load i8*, i8** %4
%18 = load i8, i8* %17
%19 = load i8**, i8*** %3
%20 = load i8*, i8** %19
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %19
store i8 %18, i8* %20
ret void
}

LLVM IR (-O2):
define void @transfer_RGB888_to_RGB888(i8** nocapture %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 1
%4 = load i8, i8* %1
%5 = load i8*, i8** %0
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8* %6, i8** %0
store i8 %4, i8* %5
%7 = getelementptr inbounds i8, i8* %1, i64 2
%8 = load i8, i8* %3
%9 = load i8*, i8** %0
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8* %10, i8** %0
store i8 %8, i8* %9
%11 = load i8, i8* %7
%12 = load i8*, i8** %0
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8* %13, i8** %0
store i8 %11, i8* %12
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int options;
};

/* Variables and functions */
int RES_STAYOPEN;
int RES_USEVC;
TYPE_1__ _res;
void _setnetdnsent(int stayopen) {
  if (stayopen)
    _res.options |= RES_STAYOPEN | RES_USEVC;
}


x86 assembly (clang, -O0):
<_setnetdnsent>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1135 <_setnetdnsent+0x35>
mov    0x2eb8(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec7(%rip),%rax
or     (%rax),%ecx
mov    0x2eb6(%rip),%rax
or     (%rax),%ecx
mov    0x2ead(%rip),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_setnetdnsent>:
test   %edi,%edi
je     111f <_setnetdnsent+0x1f>
mov    0x2ec5(%rip),%rax
mov    0x2ed6(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
mov    0x2ec3(%rip),%rax
or     %ecx,(%rax)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
@RES_STAYOPEN = global i32 0
@RES_USEVC = global i32 0
@_res = global %struct.TYPE_2__ zeroinitializer
define void @_setnetdnsent(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* @RES_STAYOPEN
%7 = load i32, i32* @RES_USEVC
%8 = or i32 %6, %7
%9 = load i32, i32* getelementptr inbounds (%struct.TYPE_2__, %struct.TYPE_2__* @_res, i32 0, i32 0)
%10 = or i32 %9, %8
store i32 %10, i32* getelementptr inbounds (%struct.TYPE_2__, %struct.TYPE_2__* @_res, i32 0, i32 0)
br label %11
11: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.TYPE_2__ = type { i32 }
@RES_STAYOPEN = global i32 0
@RES_USEVC = global i32 0
@_res = global %struct.TYPE_2__ zeroinitializer
define void @_setnetdnsent(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = load i32, i32* @RES_STAYOPEN
%5 = load i32, i32* @RES_USEVC
%6 = or i32 %5, %4
%7 = load i32, i32* getelementptr inbounds (%struct.TYPE_2__, %struct.TYPE_2__* @_res, i64 0, i32 0)
%8 = or i32 %6, %7
store i32 %8, i32* getelementptr inbounds (%struct.TYPE_2__, %struct.TYPE_2__* @_res, i64 0, i32 0)
br label %9
9: ; preds = %3, %1
ret void
}
double max(double d1, double d2) {
  if (d1 > d2)
    return (d1);
  return (d2);
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    112d <max+0x2d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1137 <max+0x37>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @max(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp ogt double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %4
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %5
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @max(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int magic = 0x00796177;
  printf("magic = %0X\n", magic);
  printf("magic = \"%s\"\n", (char *)(&magic));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x796177,0x4(%rsp)
lea    0xee0(%rip),%rdi
mov    $0x796177,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"magic = %0X\0A\00"
@.str.1 = [14 x i8] c"magic = \22%s\22\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 7954807, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = bitcast i32* %2 to i8*
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"magic = %0X\0A\00"
@.str.1 = [14 x i8] c"magic = \22%s\22\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 7954807, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 7954807)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32* %1)
ret i32 0
}
/* Variables and functions */
int inner(int);
int middle(int x) {
  if (x == 0)
    return inner(5);
  else
    return inner(6);
}


x86 assembly (clang, -O0):
<middle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1137 <middle+0x27>
mov    $0x5,%edi
call   1030 <inner@plt>
mov    %eax,-0x4(%rbp)
jmp    1144 <middle+0x34>
mov    $0x6,%edi
call   1030 <inner@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<middle>:
cmp    $0x1,%edi
mov    $0x6,%edi
sbb    $0x0,%edi
jmp    1030 <inner@plt>

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

LLVM IR (-O2):
define i32 @middle(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 5, i32 6
%4 = tail call i32 @inner(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = 3, j = 5;
  {
    int _z;
    _z = j;
    j = i;
    i = _z;
  };
  printf("%d\n", i);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}
/* Variables and functions */
scalar_t__ graphicMode();
int tfd_shellementaryPresent(void) {
  static int lShellementaryPresent = -1;
  if (lShellementaryPresent < 0) {
    lShellementaryPresent = 0;
  }
  return lShellementaryPresent && graphicMode();
}


x86 assembly (clang, -O0):
<tfd_shellementaryPresent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,0x2f09(%rip)
jge    112f <tfd_shellementaryPresent+0x1f>
movl   $0x0,0x2ef9(%rip)
xor    %eax,%eax
cmpl   $0x0,0x2ef0(%rip)
mov    %al,-0x1(%rbp)
je     1152 <tfd_shellementaryPresent+0x42>
mov    $0x0,%al
call   1030 <graphicMode@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tfd_shellementaryPresent>:
cmpb   $0x0,0x2f1d(%rip)
jne    1110 <tfd_shellementaryPresent+0x10>
movb   $0x1,0x2f14(%rip)
xor    %eax,%eax
ret

LLVM IR (-O0):
@tfd_shellementaryPresent.lShellementaryPresent = internal global i32 -1
define i32 @tfd_shellementaryPresent() {
%1 = load i32, i32* @tfd_shellementaryPresent.lShellementaryPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %4
3: ; preds = %0
store i32 0, i32* @tfd_shellementaryPresent.lShellementaryPresent
br label %4
4: ; preds = %3, %0
%5 = load i32, i32* @tfd_shellementaryPresent.lShellementaryPresent
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = call i64 (...) @graphicMode()
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %7, %4
%11 = phi i1 [ false, %4 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@tfd_shellementaryPresent.lShellementaryPresent = internal unnamed_addr global i1 false
define i32 @tfd_shellementaryPresent() {
%1 = load i1, i1* @tfd_shellementaryPresent.lShellementaryPresent
br i1 %1, label %3, label %2
2: ; preds = %0
store i1 true, i1* @tfd_shellementaryPresent.lShellementaryPresent
br label %3
3: ; preds = %0, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putch(unsigned char);
void putchx(unsigned char chl) {
  chl &= 0xf;
  chl += (chl <= (unsigned char)9) ? '0' : 'A' - 10;
  putch(chl);
}


x86 assembly (clang, -O0):
<putchx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
mov    $0x37,%ecx
mov    $0x30,%eax
cmp    $0x9,%edx
cmovle %eax,%ecx
movzbl -0x1(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <putch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchx>:
and    $0xf,%dil
cmp    $0xa,%dil
mov    $0x30,%eax
mov    $0x37,%ecx
cmovb  %eax,%ecx
add    %dil,%cl
movzbl %cl,%edi
jmp    1030 <putch@plt>

LLVM IR (-O0):
define void @putchx(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 15
%6 = trunc i32 %5 to i8
store i8 %6, i8* %2
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp sle i32 %8, 9
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 48, i32 55
%12 = load i8, i8* %2
%13 = zext i8 %12 to i32
%14 = add nsw i32 %13, %11
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
%16 = load i8, i8* %2
%17 = call i32 @putch(i8 zeroext %16)
ret void
}

LLVM IR (-O2):
define void @putchx(i8 zeroext %0) {
%2 = and i8 %0, 15
%3 = icmp ult i8 %2, 10
%4 = select i1 %3, i8 48, i8 55
%5 = add nuw nsw i8 %4, %2
%6 = tail call i32 @putch(i8 zeroext %5)
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int dobldobl_Newton_series(int idx, int maxdeg, int nbr, int verbose) {
  int fail = 0;
  int idxnbr[3];
  double *c;
  idxnbr[0] = idx;
  idxnbr[1] = maxdeg;
  idxnbr[2] = nbr;
  fail = _ada_use_c2phc4c(692, idxnbr, &verbose, c, 0);
  return fail;
}


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

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

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

LLVM IR (-O2):
define i32 @dobldobl_Newton_series(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca [3 x i32]
store i32 %3, i32* %5
%7 = bitcast [3 x i32]* %6 to i8*
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
store i32 %0, i32* %8
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 1
store i32 %1, i32* %9
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 2
store i32 %2, i32* %10
%11 = call i32 @_ada_use_c2phc4c(i32 692, i32* %8, i32* %5, double* undef, i32 0)
ret i32 %11
}
int foo1(int a) { return a; }


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

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

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

LLVM IR (-O2):
define i32 @foo1(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
char cpu_le() {
  const uint32_t cpu_le_test = 0x12345678;
  return ((const unsigned char *)&cpu_le_test)[0] == 0x78;
}


x86 assembly (clang, -O0):
<cpu_le>:
push   %rbp
mov    %rsp,%rbp
movl   $0x12345678,-0x4(%rbp)
movzbl -0x4(%rbp),%eax
cmp    $0x78,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @cpu_le() {
%1 = alloca i32
store i32 305419896, i32* %1
%2 = bitcast i32* %1 to i8*
%3 = getelementptr inbounds i8, i8* %2, i64 0
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp eq i32 %5, 120
%7 = zext i1 %6 to i32
%8 = trunc i32 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define signext i8 @cpu_le() {
ret i8 1
}
/* Variables and functions */
double fmod(double, double);
double cprMod(double a, double b) {
  double res = fmod(a, b);
  if (res < 0)
    res += b;
  return res;
}


x86 assembly (clang, -O0):
<cprMod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <fmod@plt>
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1153 <cprMod+0x43>
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cprMod>:
sub    $0x18,%rsp
movapd %xmm1,(%rsp)
call   1030 <fmod@plt>
xorpd  %xmm1,%xmm1
movapd %xmm0,%xmm2
cmpltsd %xmm1,%xmm2
movapd (%rsp),%xmm3
andpd  %xmm2,%xmm3
movsd  0xec4(%rip),%xmm1
andnpd %xmm1,%xmm2
orpd   %xmm3,%xmm2
addsd  %xmm2,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @cprMod(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = call double @fmod(double %6, double %7)
store double %8, double* %5
%9 = load double, double* %5
%10 = fcmp olt double %9, 0.000000e+00
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load double, double* %4
%13 = load double, double* %5
%14 = fadd double %13, %12
store double %14, double* %5
br label %15
15: ; preds = %11, %2
%16 = load double, double* %5
ret double %16
}

LLVM IR (-O2):
define double @cprMod(double %0, double %1) {
%3 = tail call double @fmod(double %0, double %1)
%4 = fcmp olt double %3, 0.000000e+00
%5 = select i1 %4, double %1, double -0.000000e+00
%6 = fadd double %3, %5
ret double %6
}
int fun757() { return 757; }


x86 assembly (clang, -O0):
<fun757>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2f5,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fun757() {
ret i32 757
}

LLVM IR (-O2):
define i32 @fun757() {
ret i32 757
}
/* Variables and functions */
int /*<<< orphan*/ tlb_validate();
void tlb_exit(void) { tlb_validate(); }


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

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

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

LLVM IR (-O2):
define void @tlb_exit() {
%1 = tail call i32 (...) @tlb_validate()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: uncomment [-9tw] [-o outfile] [infile]\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [47 x i8] c"usage: uncomment [-9tw] [-o outfile] [infile]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"usage: uncomment [-9tw] [-o outfile] [infile]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Type definitions */
typedef char *__m128d;

/* Variables and functions */
char *_mm_div_sd(char *, char *);
__m128d __attribute__((no, unused)) test(__m128d s1, __m128d s2) {
  __asm("" : "+v"(s1), "+v"(s2));
  return _mm_div_sd(s1, s2);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
movq   %rcx,%xmm0
movq   %rax,%xmm1
movq   %xmm1,%rax
movq   %xmm0,%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <_mm_div_sd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
movq   %rdi,%xmm0
movq   %rsi,%xmm1
movq   %xmm0,%rdi
movq   %xmm1,%rsi
jmp    1030 <_mm_div_sd@plt>

LLVM IR (-O0):
define i8* @test(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call { i8*, i8* } asm "", "=v,=v,0,1,~{dirflag},~{fpsr},~{flags}"(i8* %5, i8* %6)
%8 = extractvalue { i8*, i8* } %7, 0
%9 = extractvalue { i8*, i8* } %7, 1
store i8* %8, i8** %3
store i8* %9, i8** %4
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = call i8* @_mm_div_sd(i8* %10, i8* %11)
ret i8* %12
}

LLVM IR (-O2):
define i8* @test(i8* %0, i8* %1) {
%3 = tail call { i8*, i8* } asm "", "=v,=v,0,1,~{dirflag},~{fpsr},~{flags}"(i8* %0, i8* %1)
%4 = extractvalue { i8*, i8* } %3, 0
%5 = extractvalue { i8*, i8* } %3, 1
%6 = tail call i8* @_mm_div_sd(i8* %4, i8* %5)
ret i8* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ stderr;
int rtlsdr_rpc_write_eeprom(void *dev, uint8_t *data, uint8_t offset,
                            uint16_t len) {
  fprintf(stderr, "[u] %s,%u\n",
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/Excalibur201010/librtlsdr_direct_sp/refs/"
          "heads/master/src/rtlsdr_rpc.c",
          727);
  return -1;
}


x86 assembly (clang, -O0):
<rtlsdr_rpc_write_eeprom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
lea    0xece(%rip),%rdx
mov    $0x2d7,%ecx
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtlsdr_rpc_write_eeprom>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
lea    0xee3(%rip),%rdx
mov    $0x2d7,%ecx
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"[u] %s,%u\0A\00"
@.str.1 = [161 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Excalibur201010/librtlsdr_direct_sp/refs/heads/master/src/rtlsdr_rpc.c\00"
define i32 @rtlsdr_rpc_write_eeprom(i8* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str.1, i64 0, i64 0), i32 727)
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"[u] %s,%u\0A\00"
@.str.1 = [161 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Excalibur201010/librtlsdr_direct_sp/refs/heads/master/src/rtlsdr_rpc.c\00"
define i32 @rtlsdr_rpc_write_eeprom(i8* nocapture readnone %0, i32* nocapture readnone %1, i32 %2, i32 %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str.1, i64 0, i64 0), i32 727)
ret i32 -1
}
void cpu_load_update_nohz_start(void) {}


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

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

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

LLVM IR (-O2):
define void @cpu_load_update_nohz_start() {
ret void
}
int main(int argc, char *argv[]) { int A = 10; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
long scale(long x, long y, long z) { return x + 8 * y + 4; }


x86 assembly (clang, -O0):
<scale>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x4,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale>:
lea    (%rdi,%rsi,8),%rax
add    $0x4,%rax
ret

LLVM IR (-O0):
define i64 @scale(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = mul nsw i64 8, %8
%10 = add nsw i64 %7, %9
%11 = add nsw i64 %10, 4
ret i64 %11
}

LLVM IR (-O2):
define i64 @scale(i64 %0, i64 %1, i64 %2) {
%4 = shl nsw i64 %1, 3
%5 = add i64 %0, 4
%6 = add i64 %5, %4
ret i64 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ sem_t;

/* Variables and functions */
int sem_wait(sem_t *sem) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @sem_wait(i32* nocapture readnone %0) {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ line;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int yes(void) {
  char line[20];
  if (!fgets(line, sizeof(line), stdin) || (*line != 'y' && *line != 'Y'))
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<yes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rdi
mov    0x2ec5(%rip),%rax
mov    (%rax),%edx
mov    $0x14,%esi
call   1030 <fgets@plt>
cmp    $0x0,%eax
je     1152 <yes+0x42>
movsbl -0x20(%rbp),%eax
cmp    $0x79,%eax
je     115e <yes+0x4e>
movsbl -0x20(%rbp),%eax
cmp    $0x59,%eax
je     115e <yes+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1165 <yes+0x55>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yes>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rdi
mov    $0x14,%esi
call   1030 <fgets@plt>
test   %eax,%eax
setne  %al
mov    (%rsp),%cl
and    $0xdf,%cl
cmp    $0x59,%cl
sete   %cl
and    %al,%cl
movzbl %cl,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @yes() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 20, i32 %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %17
7: ; preds = %0
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 121
br i1 %11, label %12, label %18
12: ; preds = %7
%13 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 89
br i1 %16, label %17, label %18
17: ; preds = %12, %0
store i32 0, i32* %1
br label %19
18: ; preds = %12, %7
store i32 1, i32* %1
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @yes() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 20, i32 %3)
%5 = icmp ne i32 %4, 0
%6 = load i8, i8* %2
%7 = and i8 %6, -33
%8 = icmp eq i8 %7, 89
%9 = select i1 %5, i1 %8, i1 false
%10 = zext i1 %9 to i32
ret i32 %10
}
__attribute__((global)) void barglob() {}


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

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

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

LLVM IR (-O2):
define void @barglob() {
ret void
}
/* Variables and functions */
int diminuto_ipc_close(int);
int diminuto_ipc6_close(int fd) { return diminuto_ipc_close(fd); }


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

x86 assembly (clang, -O2):
<diminuto_ipc6_close>:
jmp    1030 <diminuto_ipc_close@plt>

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

LLVM IR (-O2):
define i32 @diminuto_ipc6_close(i32 %0) {
%2 = tail call i32 @diminuto_ipc_close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ putc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void foo() {
  putc('h', stdout);
  putc('i', stdout);
  putc('\n', stdout);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
mov    $0x68,%edi
call   1030 <putc@plt>
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
mov    $0x69,%edi
call   1030 <putc@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1030 <putc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%esi
mov    $0x68,%edi
call   1030 <putc@plt>
mov    (%rbx),%esi
mov    $0x69,%edi
call   1030 <putc@plt>
mov    (%rbx),%esi
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putc@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @foo() {
%1 = load i32, i32* @stdout
%2 = call i32 @putc(i8 signext 104, i32 %1)
%3 = load i32, i32* @stdout
%4 = call i32 @putc(i8 signext 105, i32 %3)
%5 = load i32, i32* @stdout
%6 = call i32 @putc(i8 signext 10, i32 %5)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @foo() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @putc(i8 signext 104, i32 %1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @putc(i8 signext 105, i32 %3)
%5 = load i32, i32* @stdout
%6 = tail call i32 @putc(i8 signext 10, i32 %5)
ret void
}