xunge/DecIR huggingface dataset:
void serial_getkey(void) {
  char c;
  while (((((*(volatile unsigned *)((((0x03ff0000) + 0xD000)) + 0x08))) &
           (1 << 5))) == 0)
    ;
  c = (*(volatile unsigned *)((((0x03ff0000) + 0xD000)) + 0x10));
  while ((((*(volatile unsigned *)((((0x03ff0000) + 0xD000)) + 0x08))) &
          (1 << 6)) == 0)
    ;
  (*(unsigned *)((((0x03ff0000) + 0xD000)) + 0x0C) = (unsigned)(c));
}


x86 assembly (clang, -O0):
<serial_getkey>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3ffd008,%eax
mov    (%rax),%eax
and    $0x20,%eax
cmp    $0x0,%eax
jne    111c <serial_getkey+0x1c>
jmp    1104 <serial_getkey+0x4>
mov    $0x3ffd010,%eax
mov    (%rax),%eax
mov    %al,-0x1(%rbp)
mov    $0x3ffd008,%eax
mov    (%rax),%eax
and    $0x40,%eax
cmp    $0x0,%eax
jne    113e <serial_getkey+0x3e>
jmp    1126 <serial_getkey+0x26>
movsbl -0x1(%rbp),%ecx
mov    $0x3ffd00c,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_getkey>:
testl  $0x20,0x3ffd008
je     1100 <serial_getkey>
mov    0x3ffd010,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
testl  $0x40,0x3ffd008
je     1120 <serial_getkey+0x20>
movsbl %al,%eax
mov    %eax,0x3ffd00c
ret

LLVM IR (-O0):
define void @serial_getkey() {
%1 = alloca i8
br label %2
2: ; preds = %6, %0
%3 = load volatile i32, i32* inttoptr (i64 67096584 to i32*)
%4 = and i32 %3, 32
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
%8 = load volatile i32, i32* inttoptr (i64 67096592 to i32*)
%9 = trunc i32 %8 to i8
store i8 %9, i8* %1
br label %10
10: ; preds = %14, %7
%11 = load volatile i32, i32* inttoptr (i64 67096584 to i32*)
%12 = and i32 %11, 64
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %10
br label %10
15: ; preds = %10
%16 = load i8, i8* %1
%17 = sext i8 %16 to i32
store i32 %17, i32* inttoptr (i64 67096588 to i32*)
ret void
}

LLVM IR (-O2):
define void @serial_getkey() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 67096584 to i32*)
%3 = and i32 %2, 32
%4 = icmp eq i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load volatile i32, i32* inttoptr (i64 67096592 to i32*)
br label %7
7: ; preds = %7, %5
%8 = load volatile i32, i32* inttoptr (i64 67096584 to i32*)
%9 = and i32 %8, 64
%10 = icmp eq i32 %9, 0
br i1 %10, label %7, label %11
11: ; preds = %7
%12 = shl i32 %6, 24
%13 = ashr exact i32 %12, 24
store i32 %13, i32* inttoptr (i64 67096588 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *xmalloc(scalar_t__);
char *strdup(const char *str) {
  char *p = xmalloc(strlen(str) + 1);
  strcpy(p, str);
  return p;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @xmalloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @xmalloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Type definitions */
typedef int wchar_t;

/* Variables and functions */
int towlower(int);
void wcstolower(wchar_t s[]) {
  while (*s != L'\0') {
    *s = towlower(*s);
    ++s;
  }
}


x86 assembly (clang, -O0):
<wcstolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
je     114d <wcstolower+0x3d>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <towlower@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <wcstolower+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcstolower>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
test   %edi,%edi
je     1132 <wcstolower+0x22>
add    $0x4,%rbx
xchg   %ax,%ax
call   1030 <towlower@plt>
mov    %eax,-0x4(%rbx)
mov    (%rbx),%edi
add    $0x4,%rbx
test   %edi,%edi
jne    1120 <wcstolower+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @wcstolower(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %9, %4 ], [ %2, %1 ]
%6 = phi i32* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @towlower(i32 %5)
store i32 %7, i32* %6
%8 = getelementptr inbounds i32, i32* %6, i64 1
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef size_t uint32_t;

/* Variables and functions */
void swap(void **data, uint32_t i, uint32_t j) {
  static void *tmp;
  tmp = data[i];
  data[i] = data[j];
  data[j] = tmp;
}


x86 assembly (clang, -O0):
<swap>:
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
mov    (%rax,%rcx,8),%rax
mov    %rax,0x2f05(%rip)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    0x2ee6(%rip),%rdx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi,%rsi,8),%rax
mov    (%rdi,%rdx,8),%rcx
mov    %rcx,(%rdi,%rsi,8)
mov    %rax,(%rdi,%rdx,8)
ret

LLVM IR (-O0):
@swap.tmp = internal global i8* null
define void @swap(i8** %0, i64 %1, i64 %2) {
%4 = alloca i8**
%5 = alloca i64
%6 = alloca i64
store i8** %0, i8*** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i8**, i8*** %4
%8 = load i64, i64* %5
%9 = getelementptr inbounds i8*, i8** %7, i64 %8
%10 = load i8*, i8** %9
store i8* %10, i8** @swap.tmp
%11 = load i8**, i8*** %4
%12 = load i64, i64* %6
%13 = getelementptr inbounds i8*, i8** %11, i64 %12
%14 = load i8*, i8** %13
%15 = load i8**, i8*** %4
%16 = load i64, i64* %5
%17 = getelementptr inbounds i8*, i8** %15, i64 %16
store i8* %14, i8** %17
%18 = load i8*, i8** @swap.tmp
%19 = load i8**, i8*** %4
%20 = load i64, i64* %6
%21 = getelementptr inbounds i8*, i8** %19, i64 %20
store i8* %18, i8** %21
ret void
}

LLVM IR (-O2):
define void @swap(i8** nocapture %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds i8*, i8** %0, i64 %1
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8*, i8** %0, i64 %2
%7 = load i8*, i8** %6
store i8* %7, i8** %4
store i8* %5, i8** %6
ret void
}
/* Variables and functions */
int getNormalizedInput(int);
void showPosAt(void) {
  int b1, b2, b3, b4, b5;
  b1 = getNormalizedInput(0 + 11);
  b3 = getNormalizedInput(1 + 11);
  b2 = getNormalizedInput(2 + 11);
  b4 = getNormalizedInput(3 + 11);
  b5 = getNormalizedInput(4 + 11);
}


x86 assembly (clang, -O0):
<showPosAt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0xb,%edi
call   1030 <getNormalizedInput@plt>
mov    %eax,-0x4(%rbp)
mov    $0xc,%edi
call   1030 <getNormalizedInput@plt>
mov    %eax,-0xc(%rbp)
mov    $0xd,%edi
call   1030 <getNormalizedInput@plt>
mov    %eax,-0x8(%rbp)
mov    $0xe,%edi
call   1030 <getNormalizedInput@plt>
mov    %eax,-0x10(%rbp)
mov    $0xf,%edi
call   1030 <getNormalizedInput@plt>
mov    %eax,-0x14(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showPosAt>:
push   %rax
mov    $0xb,%edi
call   1030 <getNormalizedInput@plt>
mov    $0xc,%edi
call   1030 <getNormalizedInput@plt>
mov    $0xd,%edi
call   1030 <getNormalizedInput@plt>
mov    $0xe,%edi
call   1030 <getNormalizedInput@plt>
mov    $0xf,%edi
pop    %rax
jmp    1030 <getNormalizedInput@plt>

LLVM IR (-O0):
define void @showPosAt() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = call i32 @getNormalizedInput(i32 11)
store i32 %6, i32* %1
%7 = call i32 @getNormalizedInput(i32 12)
store i32 %7, i32* %3
%8 = call i32 @getNormalizedInput(i32 13)
store i32 %8, i32* %2
%9 = call i32 @getNormalizedInput(i32 14)
store i32 %9, i32* %4
%10 = call i32 @getNormalizedInput(i32 15)
store i32 %10, i32* %5
ret void
}

LLVM IR (-O2):
define void @showPosAt() {
%1 = tail call i32 @getNormalizedInput(i32 11)
%2 = tail call i32 @getNormalizedInput(i32 12)
%3 = tail call i32 @getNormalizedInput(i32 13)
%4 = tail call i32 @getNormalizedInput(i32 14)
%5 = tail call i32 @getNormalizedInput(i32 15)
ret void
}
int *dns_debug_p(void) {
  static int debug;
  return &debug;
}


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

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

LLVM IR (-O0):
@dns_debug_p.debug = internal global i32 0
define i32* @dns_debug_p() {
ret i32* @dns_debug_p.debug
}

LLVM IR (-O2):
@dns_debug_p.debug = internal global i32 0
define i32* @dns_debug_p() {
ret i32* @dns_debug_p.debug
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int log2_of_pow_2(int);
uint32_t mask_ofst(uint32_t mask) { return log2_of_pow_2(mask & (~mask + 1)); }


x86 assembly (clang, -O0):
<mask_ofst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
add    $0x1,%eax
and    %eax,%edi
call   1030 <log2_of_pow_2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mask_ofst>:
mov    %edi,%eax
neg    %eax
and    %eax,%edi
jmp    1030 <log2_of_pow_2@plt>

LLVM IR (-O0):
define i32 @mask_ofst(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = xor i32 %4, -1
%6 = add nsw i32 %5, 1
%7 = and i32 %3, %6
%8 = call i32 @log2_of_pow_2(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @mask_ofst(i32 %0) {
%2 = sub i32 0, %0
%3 = and i32 %2, %0
%4 = tail call i32 @log2_of_pow_2(i32 %3)
ret i32 %4
}
/* Variables and functions */
double sin(double);
double _sin(double x) { return sin(x); }


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

x86 assembly (clang, -O2):
<_sin>:
jmp    1030 <sin@plt>

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

LLVM IR (-O2):
define double @_sin(double %0) {
%2 = tail call double @sin(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
int main(void) {
  printf("sizeof(\"123\") = %u\n", (unsigned)sizeof("123"));
  printf("sizeof(\"AB\\tC\") = %u\n", (unsigned)sizeof("AB\tC"));
  printf("sizeof(\"abc\\0def\") = %u\n", (unsigned)sizeof("abc\0def"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
mov    $0x8,%esi
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    $0x4,%esi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"sizeof(\22123\22) = %u\0A\00"
@.str.1 = [22 x i8] c"sizeof(\22AB\\tC\22) = %u\0A\00"
@.str.2 = [25 x i8] c"sizeof(\22abc\\0def\22) = %u\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 4)
%3 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 5)
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 8)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"sizeof(\22123\22) = %u\0A\00"
@.str.1 = [22 x i8] c"sizeof(\22AB\\tC\22) = %u\0A\00"
@.str.2 = [25 x i8] c"sizeof(\22abc\\0def\22) = %u\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 5)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 8)
ret i32 0
}
void U16TO8(unsigned char *p, unsigned short v) {
  p[0] = (v)&0xff;
  p[1] = (v >> 8) & 0xff;
}


x86 assembly (clang, -O0):
<U16TO8>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<U16TO8>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @U16TO8(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = zext i16 %5 to i32
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i16, i16* %4
%12 = zext i16 %11 to i32
%13 = ashr i32 %12, 8
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8 %15, i8* %17
ret void
}

LLVM IR (-O2):
define void @U16TO8(i8* nocapture writeonly %0, i16 zeroext %1) {
%3 = trunc i16 %1 to i8
store i8 %3, i8* %0
%4 = lshr i16 %1, 8
%5 = trunc i16 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret void
}
void Backlight(unsigned char state) {}


x86 assembly (clang, -O0):
<Backlight>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @Backlight(i8 zeroext %0) {
ret void
}
length(as) char *as;
{
  register char *s;
  if (s = as)
    while (*s++)
      ;
  return (s - as);
}


x86 assembly (clang, -O0):
<length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1141 <length+0x41>
jmp    111f <length+0x1f>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
je     113c <length+0x3c>
jmp    111f <length+0x1f>
jmp    1141 <length+0x41>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<length>:
test   %rdi,%rdi
je     1120 <length+0x20>
mov    %rdi,%rax
mov    %rdi,%rcx
nopl   0x0(%rax,%rax,1)
add    $0x1,%rax
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <length+0x10>
sub    %edi,%eax
ret
xor    %eax,%eax
sub    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @length(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %5, %3 ], [ %0, %1 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = ptrtoint i8* %5 to i64
br label %10
10: ; preds = %8, %1
%11 = phi i64 [ 0, %1 ], [ %9, %8 ]
%12 = ptrtoint i8* %0 to i64
%13 = sub i64 %11, %12
%14 = trunc i64 %13 to i32
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ experiment(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  int i;
  for (i = 1; i <= n; i++)
    experiment(i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1168 <main+0x48>
mov    -0xc(%rbp),%edi
call   1030 <experiment@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <main+0x26>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    1150 <main+0x30>
xor    %ebx,%ebx
nop
add    $0x1,%ebx
mov    %ebx,%edi
call   1030 <experiment@plt>
cmp    0xc(%rsp),%ebx
jl     1140 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 1, i32* %3
br label %5
5: ; preds = %12, %0
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i32, i32* %3
%11 = call i32 @experiment(i32 %10)
br label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %5
15: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 1
br i1 %5, label %12, label %6
6: ; preds = %0, %6
%7 = phi i32 [ %9, %6 ], [ 1, %0 ]
%8 = call i32 @experiment(i32 %7)
%9 = add nuw nsw i32 %7, 1
%10 = load i32, i32* %1
%11 = icmp slt i32 %7, %10
br i1 %11, label %6, label %12
12: ; preds = %6, %0
ret i32 0
}
int test_imm_A6uint8_mem(unsigned char *val) {
  return ((*val) & (-0xA6 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_A6uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 90
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void *id1(void *v1) { return v1; }


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

x86 assembly (clang, -O2):
<id1>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @id1(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void KeccakP1600_Initialize(void *state) { memset(state, 0, 1600 / 8); }


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

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

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

LLVM IR (-O2):
define void @KeccakP1600_Initialize(i8* %0) {
%2 = tail call i32 @memset(i8* %0, i32 0, i32 200)
ret void
}
/* Variables and functions */
unsigned long unpacku32(unsigned char *);
extern unsigned long int deserialize_uint32(unsigned char *buf) {
  return (unpacku32(buf));
}


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

x86 assembly (clang, -O2):
<deserialize_uint32>:
jmp    1030 <unpacku32@plt>

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

LLVM IR (-O2):
define i64 @deserialize_uint32(i8* %0) {
%2 = tail call i64 @unpacku32(i8* %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ delm(int *);
int delete (void *v) {
  int *msgvec = v;
  delm(msgvec);
  return 0;
}


x86 assembly (clang, -O0):
<delete>:
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 <delm@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete>:
push   %rax
call   1030 <delm@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @delete(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @delm(i32* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int **);
int main(int argc, const char *argv[]) {
  int valor = 25;
  int *mi_valor_apuntado;
  mi_valor_apuntado = &valor;
  printf("Ejemplo de almancemaniento a memoria [ %p ]\n", &mi_valor_apuntado);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x19,0xc(%rsp)
lea    0xc(%rsp),%rax
mov    %rax,0x10(%rsp)
lea    0xed3(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [45 x i8] c"Ejemplo de almancemaniento a memoria [ %p ]\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = bitcast i32* %3 to i8*
store i32 25, i32* %3
%6 = bitcast i32** %4 to i8*
store i32* %3, i32** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32** %4)
ret i32 0
}
void mach_led(int position, int value) {
  volatile unsigned char *p = (volatile unsigned char *)0xa2000000;
  if (value) {
    *p |= 1;
  } else {
    *p &= ~1;
  }
}


x86 assembly (clang, -O0):
<mach_led>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0xa2000000,%eax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1130 <mach_led+0x30>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
movzbl %cl,%ecx
or     $0x1,%ecx
mov    %cl,(%rax)
jmp    113e <mach_led+0x3e>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
movzbl %cl,%ecx
and    $0xfffffffe,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mach_led>:
test   %esi,%esi
setne  %al
mov    $0xa2000000,%ecx
mov    (%rcx),%dl
and    $0xfe,%dl
or     %al,%dl
mov    %dl,(%rcx)
ret

LLVM IR (-O0):
define void @mach_led(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
store i8* inttoptr (i64 2717908992 to i8*), i8** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = load volatile i8, i8* %9
%11 = zext i8 %10 to i32
%12 = or i32 %11, 1
%13 = trunc i32 %12 to i8
store volatile i8 %13, i8* %9
br label %20
14: ; preds = %2
%15 = load i8*, i8** %5
%16 = load volatile i8, i8* %15
%17 = zext i8 %16 to i32
%18 = and i32 %17, -2
%19 = trunc i32 %18 to i8
store volatile i8 %19, i8* %15
br label %20
20: ; preds = %14, %8
ret void
}

LLVM IR (-O2):
define void @mach_led(i32 %0, i32 %1) {
%3 = icmp ne i32 %1, 0
%4 = load volatile i8, i8* inttoptr (i64 2717908992 to i8*)
%5 = and i8 %4, -2
%6 = zext i1 %3 to i8
%7 = or i8 %5, %6
store volatile i8 %7, i8* inttoptr (i64 2717908992 to i8*)
ret void
}
/* Variables and functions */
char *mp_store_u8(char *, int);
char *mp_encode_bool(char *data, bool val) {
  return mp_store_u8(data, 0xc2 | (val & 1));
}


x86 assembly (clang, -O0):
<mp_encode_bool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
and    $0x1,%esi
or     $0xc2,%esi
call   1030 <mp_store_u8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_encode_bool>:
and    $0x1,%esi
or     $0xc2,%esi
jmp    1030 <mp_store_u8@plt>

LLVM IR (-O0):
define i8* @mp_encode_bool(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = and i32 %6, 1
%8 = or i32 194, %7
%9 = call i8* @mp_store_u8(i8* %5, i32 %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @mp_encode_bool(i8* %0, i32 %1) {
%3 = and i32 %1, 1
%4 = or i32 %3, 194
%5 = tail call i8* @mp_store_u8(i8* %0, i32 %4)
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void write_dummy(uint8_t pos, uint8_t output) {}


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

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

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

LLVM IR (-O2):
define void @write_dummy(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ writel(int /*<<< orphan*/, void *);
void write_pxpat0s(unsigned port, uint32_t value) {
  writel(value, (void *)0xb0010000 + (port * 0x100) + (0x44));
}


x86 assembly (clang, -O0):
<write_pxpat0s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,%eax
mov    $0xb0010000,%esi
add    %rax,%rsi
add    $0x44,%rsi
call   1030 <writel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_pxpat0s>:
mov    %esi,%eax
shl    $0x8,%edi
mov    $0xb0010044,%esi
add    %rdi,%rsi
mov    %eax,%edi
jmp    1030 <writel@plt>

LLVM IR (-O0):
define void @write_pxpat0s(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = mul i32 %6, 256
%8 = zext i32 %7 to i64
%9 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %8
%10 = getelementptr i8, i8* %9, i64 68
%11 = call i32 @writel(i32 %5, i8* %10)
ret void
}

LLVM IR (-O2):
define void @write_pxpat0s(i32 %0, i32 %1) {
%3 = shl i32 %0, 8
%4 = zext i32 %3 to i64
%5 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %4
%6 = getelementptr i8, i8* %5, i64 68
%7 = tail call i32 @writel(i32 %1, i8* %6)
ret void
}
/* Variables and functions */
double DegToRad(double);
double MercatorLongitudeSimple(double lon) { return DegToRad(lon); }


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

x86 assembly (clang, -O2):
<MercatorLongitudeSimple>:
jmp    1030 <DegToRad@plt>

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

LLVM IR (-O2):
define double @MercatorLongitudeSimple(double %0) {
%2 = tail call double @DegToRad(double %0)
ret double %2
}
/* Type definitions */
struct rtas_mem_scn {
  int dummy;
};
struct rtas_event {
  int dummy;
};

/* Variables and functions */
scalar_t__ get_re_scn(struct rtas_event *, int);
struct rtas_mem_scn *rtas_get_mem_scn(struct rtas_event *re) {
  return (struct rtas_mem_scn *)get_re_scn(re, 7);
}


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

x86 assembly (clang, -O2):
<rtas_get_mem_scn>:
mov    $0x7,%esi
jmp    1030 <get_re_scn@plt>

LLVM IR (-O0):
%struct.rtas_mem_scn = type { i32 }
%struct.rtas_event = type { i32 }
define %struct.rtas_mem_scn* @rtas_get_mem_scn(%struct.rtas_event* %0) {
%2 = alloca %struct.rtas_event*
store %struct.rtas_event* %0, %struct.rtas_event** %2
%3 = load %struct.rtas_event*, %struct.rtas_event** %2
%4 = call i64 @get_re_scn(%struct.rtas_event* %3, i32 7)
%5 = inttoptr i64 %4 to %struct.rtas_mem_scn*
ret %struct.rtas_mem_scn* %5
}

LLVM IR (-O2):
%struct.rtas_mem_scn = type { i32 }
%struct.rtas_event = type { i32 }
define %struct.rtas_mem_scn* @rtas_get_mem_scn(%struct.rtas_event* %0) {
%2 = tail call i64 @get_re_scn(%struct.rtas_event* %0, i32 7)
%3 = inttoptr i64 %2 to %struct.rtas_mem_scn*
ret %struct.rtas_mem_scn* %3
}
/* Variables and functions */
int inet_pton(int, char const *, void *);
int dns_pton(int af, const char *src, void *dst) {
  return inet_pton(af, src, dst);
}


x86 assembly (clang, -O0):
<dns_pton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <inet_pton@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dns_pton>:
jmp    1030 <inet_pton@plt>

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

LLVM IR (-O2):
define i32 @dns_pton(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @inet_pton(i32 %0, i8* %1, i8* %2)
ret i32 %4
}
void swab2(char *a) {
  char t;
  t = a[0];
  a[0] = a[1];
  a[1] = t;
}


x86 assembly (clang, -O0):
<swab2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swab2>:
rolw   $0x8,(%rdi)
ret

LLVM IR (-O0):
define void @swab2(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
store i8 %6, i8* %3
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i8, i8* %3
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 1
store i8 %12, i8* %14
ret void
}

LLVM IR (-O2):
define void @swab2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
store i8 %4, i8* %0
store i8 %2, i8* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Fist OSS Code");
  printf("Second OSS Code");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Fist OSS Code\00"
@.str.1 = [16 x i8] c"Second OSS Code\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Fist OSS Code\00"
@.str.1 = [16 x i8] c"Second OSS Code\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void ff_hevc_put_hevc_bi_pel_pixels32_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_pel_pixels32_12_sse4() {
ret void
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
double CLOCKS_PER_SEC;
double calculateTime(clock_t start, clock_t end) {
  return (double)(end - start) / CLOCKS_PER_SEC;
}


x86 assembly (clang, -O0):
<calculateTime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm0
mov    0x2ec8(%rip),%rax
divsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculateTime>:
sub    %rdi,%rsi
cvtsi2sd %rsi,%xmm0
mov    0x2ed9(%rip),%rax
divsd  (%rax),%xmm0
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @calculateTime(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = sub nsw i64 %5, %6
%8 = sitofp i64 %7 to double
%9 = load double, double* @CLOCKS_PER_SEC
%10 = fdiv double %8, %9
ret double %10
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @calculateTime(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = sitofp i64 %3 to double
%5 = load double, double* @CLOCKS_PER_SEC
%6 = fdiv double %4, %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ do_parse();
int /*<<< orphan*/ printf(char *);
int main(void) {
  while (1) {
    printf("> ");
    do_parse();
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <do_parse@plt>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <do_parse@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
@.str = [3 x i8] c"> \00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @do_parse()
%5 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %2
}

LLVM IR (-O2):
@.str = [3 x i8] c"> \00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @do_parse()
%4 = tail call i32 @putchar(i32 10)
br label %1
}
/* Variables and functions */
char mksym_i8();
void init_buff(char *buff, int len) {
  for (int i = 0; i < len; i++) {
    buff[i] = mksym_i8();
  }
  buff[len - 1] = '\0';
}


x86 assembly (clang, -O0):
<init_buff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1154 <init_buff+0x44>
mov    $0x0,%al
call   1030 <mksym_i8@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <init_buff+0x16>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_buff>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%r15
test   %esi,%esi
jle    1144 <init_buff+0x34>
mov    %r14d,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <mksym_i8@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1130 <init_buff+0x20>
movslq %r14d,%rax
movb   $0x0,-0x1(%rax,%r15,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @init_buff(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %10
6: ; preds = %10, %2
%7 = add nsw i32 %1, -1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 0, i8* %9
ret void
10: ; preds = %4, %10
%11 = phi i64 [ 0, %4 ], [ %14, %10 ]
%12 = tail call signext i8 (...) @mksym_i8()
%13 = getelementptr inbounds i8, i8* %0, i64 %11
store i8 %12, i8* %13
%14 = add nuw nsw i64 %11, 1
%15 = icmp eq i64 %14, %5
br i1 %15, label %6, label %10
}
float kmSQR(float s) { return s * s; }


x86 assembly (clang, -O0):
<kmSQR>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<kmSQR>:
mulss  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @kmSQR(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
ret float %5
}

LLVM IR (-O2):
define float @kmSQR(float %0) {
%2 = fmul float %0, %0
ret float %2
}
int tst_si_test3(int a, int b, int c) {
  int d = a & (b << 3);
  if (d == 0)
    return 12;
  else
    return 18;
}


x86 assembly (clang, -O0):
<tst_si_test3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
and    %ecx,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1131 <tst_si_test3+0x31>
movl   $0xc,-0x4(%rbp)
jmp    1138 <tst_si_test3+0x38>
movl   $0x12,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst_si_test3>:
shl    $0x3,%esi
test   %edi,%esi
mov    $0xc,%ecx
mov    $0x12,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @tst_si_test3(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %1, 3
%5 = and i32 %4, %0
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 12, i32 18
ret i32 %7
}
int test_imm_27uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x27 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_27uint64_midword_reg>:
test   $0x270000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_27uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 39
%6 = icmp ne i64 %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_27uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 2555904
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int ft_tolower(int c) {
  if (c >= 'A' && c <= 'Z')
    return ((c - 'A') + 'a');
  return (c);
}


x86 assembly (clang, -O0):
<ft_tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     112c <ft_tolower+0x2c>
cmpl   $0x5a,-0x8(%rbp)
jg     112c <ft_tolower+0x2c>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <ft_tolower+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @ft_tolower(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 90
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 65
%12 = add nsw i32 %11, 97
store i32 %12, i32* %2
br label %15
13: ; preds = %6, %1
%14 = load i32, i32* %3
store i32 %14, i32* %2
br label %15
15: ; preds = %13, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @ft_tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
scalar_t__ sqr(float);
float sqrt(scalar_t__);
float smithG_GGX_aniso(float NdotV, float VdotX, float VdotY, float ax,
                       float ay) {
  return 1 / (NdotV + sqrt(sqr(VdotX * ax) + sqr(VdotY * ay) + sqr(NdotV)));
}


x86 assembly (clang, -O0):
<smithG_GGX_aniso>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
call   1030 <sqr@plt>
mov    %rax,-0x28(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0x14(%rbp),%xmm0
call   1030 <sqr@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sqr@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
call   1040 <sqrt@plt>
movss  -0x18(%rbp),%xmm1
addss  %xmm0,%xmm1
movss  0xe5e(%rip),%xmm0
divss  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smithG_GGX_aniso>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm4,0xc(%rsp)
movss  %xmm2,0x8(%rsp)
movss  %xmm0,0x4(%rsp)
mulss  %xmm3,%xmm1
movaps %xmm1,%xmm0
call   1030 <sqr@plt>
mov    %rax,%rbx
movss  0x8(%rsp),%xmm0
mulss  0xc(%rsp),%xmm0
call   1030 <sqr@plt>
add    %rax,%rbx
movss  0x4(%rsp),%xmm0
call   1030 <sqr@plt>
add    %rax,%rbx
mov    %rbx,%rdi
call   1040 <sqrt@plt>
addss  0x4(%rsp),%xmm0
movss  0xe82(%rip),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @smithG_GGX_aniso(float %0, float %1, float %2, float %3, float %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%11 = load float, float* %6
%12 = load float, float* %7
%13 = load float, float* %9
%14 = fmul float %12, %13
%15 = call i64 @sqr(float %14)
%16 = load float, float* %8
%17 = load float, float* %10
%18 = fmul float %16, %17
%19 = call i64 @sqr(float %18)
%20 = add nsw i64 %15, %19
%21 = load float, float* %6
%22 = call i64 @sqr(float %21)
%23 = add nsw i64 %20, %22
%24 = call float @sqrt(i64 %23)
%25 = fadd float %11, %24
%26 = fdiv float 1.000000e+00, %25
ret float %26
}

LLVM IR (-O2):
define float @smithG_GGX_aniso(float %0, float %1, float %2, float %3, float %4) {
%6 = fmul float %1, %3
%7 = tail call i64 @sqr(float %6)
%8 = fmul float %2, %4
%9 = tail call i64 @sqr(float %8)
%10 = add nsw i64 %9, %7
%11 = tail call i64 @sqr(float %0)
%12 = add nsw i64 %10, %11
%13 = tail call float @sqrt(i64 %12)
%14 = fadd float %13, %0
%15 = fdiv float 1.000000e+00, %14
ret float %15
}