xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void instruct(void) {
  printf(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n");
  printf("Welcome!!This program get the height and surface area\n");
  printf("of a cylinder and calculate the value of radius.\n");
  printf("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n");
}


x86 assembly (clang, -O0):
<instruct>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf11(%rip),%rdi
call   1030 <printf@plt>
lea    0xf3c(%rip),%rdi
call   1030 <printf@plt>
lea    0xf62(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<instruct>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf13(%rip),%rdi
call   1030 <puts@plt>
lea    0xf3d(%rip),%rdi
call   1030 <puts@plt>
lea    0xf62(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [56 x i8] c">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\0A\00"
@.str.1 = [55 x i8] c"Welcome!!This program get the height and surface area\0A\00"
@.str.2 = [50 x i8] c"of a cylinder and calculate the value of radius.\0A\00"
@.str.3 = [56 x i8] c"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\0A\00"
define void @instruct() {
%1 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [55 x i8] c">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\00"
@str.4 = [54 x i8] c"Welcome!!This program get the height and surface area\00"
@str.5 = [49 x i8] c"of a cylinder and calculate the value of radius.\00"
@str.6 = [55 x i8] c"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\00"
define void @instruct() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _my_log(char *, int, char *, char *, int, char const *);
void log_info(const char *errstr) {
  do {
    _my_log("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/"
            "master/transfer/fix.c",
            386, "[ INFO ] at %s:%d ,info: %s\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/"
            "master/transfer/fix.c",
            386, errstr);
  } while (0);
}


x86 assembly (clang, -O0):
<log_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%r9
lea    0xed9(%rip),%rcx
mov    $0x182,%r8d
lea    0xf62(%rip),%rdx
mov    %rcx,%rdi
mov    %r8d,%esi
call   1030 <_my_log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_info>:
mov    %rdi,%r9
lea    0xf7c(%rip),%rdx
lea    0xedf(%rip),%rcx
mov    %rcx,%rdi
mov    $0x182,%esi
mov    $0x182,%r8d
jmp    1030 <_my_log@plt>

LLVM IR (-O0):
@.str = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/master/transfer/fix.c\00"
@.str.1 = [29 x i8] c"[ INFO ] at %s:%d ,info: %s\0A\00"
define void @log_info(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1
%4 = load i8*, i8** %2
%5 = call i32 @_my_log(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 386, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 386, i8* %4)
br label %6
6: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/master/transfer/fix.c\00"
@.str.1 = [29 x i8] c"[ INFO ] at %s:%d ,info: %s\0A\00"
define void @log_info(i8* %0) {
%2 = tail call i32 @_my_log(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 386, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 386, i8* %0)
ret void
}
int strang_order(int a, int b) {
  if (a == 0 || b == 0) {
    return 0;
  } else {
    return a % b;
  }
}


x86 assembly (clang, -O0):
<strang_order>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     111e <strang_order+0x1e>
cmpl   $0x0,-0xc(%rbp)
jne    112a <strang_order+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1134 <strang_order+0x34>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strang_order>:
xor    %eax,%eax
test   %edi,%edi
je     1111 <strang_order+0x11>
test   %esi,%esi
je     1111 <strang_order+0x11>
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @strang_order(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = icmp eq i32 %1, 0
%5 = or i1 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = srem i32 %0, %1
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ 0, %2 ]
ret i32 %9
}
int com_nborder(unsigned int orgValue) {
  int nbValue = 0;
  char *p;
  int i = 0;
  char tmp[sizeof(int)];
  int *ip;
  p = (char *)&orgValue;
  for (i = 0; i < (int)sizeof(int); i++) {
    tmp[i] = *(p + sizeof(orgValue) - 1 - i);
  }
  ip = (int *)tmp;
  nbValue = *ip;
  return nbValue;
}


x86 assembly (clang, -O0):
<com_nborder>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1155 <com_nborder+0x55>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
mov    0x3(%rax,%rcx,1),%cl
movslq -0x14(%rbp),%rax
mov    %cl,-0x18(%rbp,%rax,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1124 <com_nborder+0x24>
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @com_nborder(i32 %0) {
%2 = call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
int do_605() { return 605; }


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

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

LLVM IR (-O0):
define i32 @do_605() {
ret i32 605
}

LLVM IR (-O2):
define i32 @do_605() {
ret i32 605
}
void gdk_x11_get_default_screen() {}


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

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

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

LLVM IR (-O2):
define void @gdk_x11_get_default_screen() {
ret void
}
/* Variables and functions */
bool nrf91_errata_7(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf91_errata_7() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *low_libopen(char *, int);
FILE *libopen(char *file) { return low_libopen(file, 1); }


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

x86 assembly (clang, -O2):
<libopen>:
mov    $0x1,%esi
jmp    1030 <low_libopen@plt>

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

LLVM IR (-O2):
define i32* @libopen(i8* %0) {
%2 = tail call i32* @low_libopen(i8* %0, i32 1)
ret i32* %2
}
/* Variables and functions */
double atan(double);
double aCot(double x) { return atan(1.0 / x); }


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

x86 assembly (clang, -O2):
<aCot>:
movsd  0xee8(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
jmp    1030 <atan@plt>

LLVM IR (-O0):
define double @aCot(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double 1.000000e+00, %3
%5 = call double @atan(double %4)
ret double %5
}

LLVM IR (-O2):
define double @aCot(double %0) {
%2 = fdiv double 1.000000e+00, %0
%3 = tail call double @atan(double %2)
ret double %3
}
void compute_coupling_el_ac_cuda_(long *Mesh_pointer, int *iphasef,
                                  int *num_coupling_ac_el_facesf) {}


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

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

LLVM IR (-O0):
define void @compute_coupling_el_ac_cuda_(i64* %0, i32* %1, i32* %2) {
%4 = alloca i64*
%5 = alloca i32*
%6 = alloca i32*
store i64* %0, i64** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
ret void
}

LLVM IR (-O2):
define void @compute_coupling_el_ac_cuda_(i64* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
ret void
}
/* Variables and functions */
bool cc3_button_get_state(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @cc3_button_get_state() {
ret i32 1
}

LLVM IR (-O2):
define i32 @cc3_button_get_state() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void u_free(void *addr, unsigned int size) {
  if (!addr)
    return;
  free(addr);
}


x86 assembly (clang, -O0):
<u_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112f <u_free+0x1f>
jmp    1138 <u_free+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @u_free(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 = icmp ne i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %2
br label %11
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = call i32 @free(i8* %9)
br label %11
11: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
define void @u_free(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @free(i8* %0)
br label %6
6: ; preds = %2, %4
ret void
}
double test_erfc(double x) { return __builtin_erfc(x); }


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

x86 assembly (clang, -O2):
<test_erfc>:
jmp    1030 <erfc@plt>

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

LLVM IR (-O2):
define double @test_erfc(double %0) {
%2 = tail call double @erfc(double %0)
ret double %2
}
unsigned char convertASCIIHexHigh(unsigned char temp) {
  unsigned char res = temp & 0xF0;
  res = res >> 4;
  if (res <= 9)
    return res + 0x30;
  else
    return res + 0x37;
}


x86 assembly (clang, -O0):
<convertASCIIHexHigh>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
and    $0xf0,%eax
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
sar    $0x4,%eax
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
cmp    $0x9,%eax
jg     113c <convertASCIIHexHigh+0x3c>
movzbl -0x3(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1146 <convertASCIIHexHigh+0x46>
movzbl -0x3(%rbp),%eax
add    $0x37,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertASCIIHexHigh>:
mov    %edi,%eax
shr    $0x4,%al
lea    0x30(%rax),%ecx
add    $0x37,%al
cmp    $0xa0,%dil
movzbl %cl,%ecx
movzbl %al,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @convertASCIIHexHigh(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = and i32 %6, 240
%8 = trunc i32 %7 to i8
store i8 %8, i8* %4
%9 = load i8, i8* %4
%10 = zext i8 %9 to i32
%11 = ashr i32 %10, 4
%12 = trunc i32 %11 to i8
store i8 %12, i8* %4
%13 = load i8, i8* %4
%14 = zext i8 %13 to i32
%15 = icmp sle i32 %14, 9
br i1 %15, label %16, label %21
16: ; preds = %1
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = add nsw i32 %18, 48
%20 = trunc i32 %19 to i8
store i8 %20, i8* %2
br label %26
21: ; preds = %1
%22 = load i8, i8* %4
%23 = zext i8 %22 to i32
%24 = add nsw i32 %23, 55
%25 = trunc i32 %24 to i8
store i8 %25, i8* %2
br label %26
26: ; preds = %21, %16
%27 = load i8, i8* %2
ret i8 %27
}

LLVM IR (-O2):
define zeroext i8 @convertASCIIHexHigh(i8 zeroext %0) {
%2 = lshr i8 %0, 4
%3 = icmp ult i8 %0, -96
%4 = or i8 %2, 48
%5 = add nuw nsw i8 %2, 55
%6 = select i1 %3, i8 %4, i8 %5
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ RTLD_LAZY;
int /*<<< orphan*/ RTLD_NOW;
int /*<<< orphan*/ dlclose(void *);
void *dlopen(char const *, int /*<<< orphan*/);
void *dlsym(void *, char const *);
void dl(const char *libname, const char *func) {
  void *lib = dlopen(libname, RTLD_NOW);
  lib = dlopen(libname, RTLD_LAZY);
  const char *funcname;
  void *sym = dlsym(lib, funcname);
  dlsym(lib, "foo");
  void *uninit;
  dlclose(uninit);
}


x86 assembly (clang, -O0):
<dl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
call   1030 <dlopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e77(%rip),%rax
mov    (%rax),%esi
call   1030 <dlopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <dlsym@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe78(%rip),%rsi
call   1040 <dlsym@plt>
mov    -0x30(%rbp),%rdi
call   1050 <dlclose@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dl>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
call   1030 <dlopen@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1030 <dlopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <dlsym@plt>
lea    0xe9b(%rip),%rsi
mov    %rbx,%rdi
call   1040 <dlsym@plt>
pop    %rbx
jmp    1050 <dlclose@plt>

LLVM IR (-O0):
@RTLD_NOW = global i32 0
@RTLD_LAZY = global i32 0
@.str = [4 x i8] c"foo\00"
define void @dl(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%9 = load i8*, i8** %3
%10 = load i32, i32* @RTLD_NOW
%11 = call i8* @dlopen(i8* %9, i32 %10)
store i8* %11, i8** %5
%12 = load i8*, i8** %3
%13 = load i32, i32* @RTLD_LAZY
%14 = call i8* @dlopen(i8* %12, i32 %13)
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = load i8*, i8** %6
%17 = call i8* @dlsym(i8* %15, i8* %16)
store i8* %17, i8** %7
%18 = load i8*, i8** %5
%19 = call i8* @dlsym(i8* %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%20 = load i8*, i8** %8
%21 = call i32 @dlclose(i8* %20)
ret void
}

LLVM IR (-O2):
@RTLD_NOW = global i32 0
@RTLD_LAZY = global i32 0
@.str = [4 x i8] c"foo\00"
define void @dl(i8* %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @RTLD_NOW
%4 = tail call i8* @dlopen(i8* %0, i32 %3)
%5 = load i32, i32* @RTLD_LAZY
%6 = tail call i8* @dlopen(i8* %0, i32 %5)
%7 = tail call i8* @dlsym(i8* %6, i8* undef)
%8 = tail call i8* @dlsym(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @dlclose(i8* undef)
ret void
}
void print_SOF(const unsigned char *stream) {
  int width, height, nr_components, precision;
  precision = stream[2];
  height = (((stream + 3)[0] << 8) | (stream + 3)[1]);
  width = (((stream + 5)[0] << 8) | (stream + 5)[1]);
  nr_components = stream[7];
  do {
  } while (0);
  do {
  } while (0);
}


x86 assembly (clang, -O0):
<print_SOF>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x4(%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x5(%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x6(%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x7(%rax),%eax
mov    %eax,-0x14(%rbp)
jmp    1153 <print_SOF+0x53>
jmp    1158 <print_SOF+0x58>
jmp    115d <print_SOF+0x5d>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @print_SOF(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %2
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 2
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
store i32 %10, i32* %6
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 3
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = shl i32 %15, 8
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i64 3
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = or i32 %16, %21
store i32 %22, i32* %4
%23 = load i8*, i8** %2
%24 = getelementptr inbounds i8, i8* %23, i64 5
%25 = getelementptr inbounds i8, i8* %24, i64 0
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = shl i32 %27, 8
%29 = load i8*, i8** %2
%30 = getelementptr inbounds i8, i8* %29, i64 5
%31 = getelementptr inbounds i8, i8* %30, i64 1
%32 = load i8, i8* %31
%33 = zext i8 %32 to i32
%34 = or i32 %28, %33
store i32 %34, i32* %3
%35 = load i8*, i8** %2
%36 = getelementptr inbounds i8, i8* %35, i64 7
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
store i32 %38, i32* %5
br label %39
39: ; preds = %1
br label %40
40: ; preds = %39
br label %41
41: ; preds = %40
br label %42
42: ; preds = %41
ret void
}

LLVM IR (-O2):
define void @print_SOF(i8* nocapture %0) {
ret void
}
/* Variables and functions */
char EOF;
char fgetc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
char getAChar() {
  char temp = fgetc(stdin);
  while (temp == '\n' || temp == EOF) {
    temp = fgetc(stdin);
  }
  return temp;
}


x86 assembly (clang, -O0):
<getAChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
call   1030 <fgetc@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     1151 <getAChar+0x41>
movsbl -0x1(%rbp),%eax
mov    0x2e9a(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
test   $0x1,%al
jne    1161 <getAChar+0x51>
jmp    1177 <getAChar+0x67>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1030 <fgetc@plt>
mov    %al,-0x1(%rbp)
jmp    1129 <getAChar+0x19>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getAChar>:
push   %r14
push   %rbx
push   %rax
mov    0x2ecd(%rip),%rbx
mov    (%rbx),%edi
call   1030 <fgetc@plt>
mov    0x2eb7(%rip),%r14
jmp    1137 <getAChar+0x27>
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edi
call   1030 <fgetc@plt>
cmp    $0xa,%al
je     1130 <getAChar+0x20>
cmp    (%r14),%al
je     1130 <getAChar+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdin = global i32 0
@EOF = global i8 0
define signext i8 @getAChar() {
%1 = alloca i8
%2 = load i32, i32* @stdin
%3 = call signext i8 @fgetc(i32 %2)
store i8 %3, i8* %1
br label %4
4: ; preds = %16, %0
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 10
br i1 %7, label %14, label %8
8: ; preds = %4
%9 = load i8, i8* %1
%10 = sext i8 %9 to i32
%11 = load i8, i8* @EOF
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %10, %12
br label %14
14: ; preds = %8, %4
%15 = phi i1 [ true, %4 ], [ %13, %8 ]
br i1 %15, label %16, label %19
16: ; preds = %14
%17 = load i32, i32* @stdin
%18 = call signext i8 @fgetc(i32 %17)
store i8 %18, i8* %1
br label %4
19: ; preds = %14
%20 = load i8, i8* %1
ret i8 %20
}

LLVM IR (-O2):
@stdin = global i32 0
@EOF = global i8 0
define signext i8 @getAChar() {
%1 = load i32, i32* @stdin
%2 = tail call signext i8 @fgetc(i32 %1)
%3 = icmp eq i8 %2, 10
%4 = load i8, i8* @EOF
%5 = icmp eq i8 %2, %4
%6 = select i1 %3, i1 true, i1 %5
br i1 %6, label %7, label %14
7: ; preds = %0, %7
%8 = load i32, i32* @stdin
%9 = tail call signext i8 @fgetc(i32 %8)
%10 = icmp eq i8 %9, 10
%11 = load i8, i8* @EOF
%12 = icmp eq i8 %9, %11
%13 = select i1 %10, i1 true, i1 %12
br i1 %13, label %7, label %14
14: ; preds = %7, %0
%15 = phi i8 [ %2, %0 ], [ %9, %7 ]
ret i8 %15
}
/* Variables and functions */
scalar_t__ memcmp(unsigned char const *, char *, int);
int search_dc(const unsigned char *payload, const int plen, int payload_len) {
  if (payload[0] != 0x24)
    return 0;
  else {
    if (memcmp(&payload[1], "Send|", 5) == 0)
      return (4 * 100);
    else
      return 0;
  }
}


x86 assembly (clang, -O0):
<search_dc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x24,%eax
je     113e <search_dc+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1174 <search_dc+0x64>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
lea    0xeb3(%rip),%rsi
mov    $0x5,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
jne    116d <search_dc+0x5d>
movl   $0x190,-0x4(%rbp)
jmp    1174 <search_dc+0x64>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<search_dc>:
push   %rax
xor    %eax,%eax
cmpb   $0x24,(%rdi)
jne    113a <search_dc+0x2a>
add    $0x1,%rdi
lea    0xedd(%rip),%rsi
mov    $0x5,%edx
call   1030 <memcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
mov    $0x190,%eax
cmovne %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Send|\00"
define i32 @search_dc(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i8*, i8** %5
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = icmp ne i32 %11, 36
br i1 %12, label %13, label %14
13: ; preds = %3
store i32 0, i32* %4
br label %21
14: ; preds = %3
%15 = load i8*, i8** %5
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = call i64 @memcmp(i8* %16, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %14
store i32 400, i32* %4
br label %21
20: ; preds = %14
store i32 0, i32* %4
br label %21
21: ; preds = %20, %19, %13
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
@.str = [6 x i8] c"Send|\00"
define i32 @search_dc(i8* %0, i32 %1, i32 %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 36
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = tail call i64 @memcmp(i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%9 = icmp eq i64 %8, 0
%10 = select i1 %9, i32 400, i32 0
br label %11
11: ; preds = %6, %3
%12 = phi i32 [ 0, %3 ], [ %10, %6 ]
ret i32 %12
}
void freeLabelLines(unsigned int n, char **lines) {
  while (n > 0) {
    n--;
    free(lines[n]);
  }
  free(lines);
}


x86 assembly (clang, -O0):
<freeLabelLines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jbe    1147 <freeLabelLines+0x37>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
jmp    111f <freeLabelLines+0xf>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeLabelLines>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
test   %edi,%edi
je     1130 <freeLabelLines+0x20>
mov    %edi,%ebx
nopl   (%rax)
mov    -0x8(%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0xffffffffffffffff,%rbx
jne    1120 <freeLabelLines+0x10>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freeLabelLines(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = icmp eq i64 %8, 0
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = bitcast i8** %1 to i8*
tail call void @free(i8* %13)
ret void
}
double xor (double x, double y) { return (x != 0.0) ^ (y != 0.0); }


x86 assembly (clang, -O0):
<xor>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setne  %cl
setp   %dl
or     %dl,%cl
and    $0x1,%cl
movzbl %cl,%ecx
xor    %ecx,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<xor>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
setp   %al
setne  %cl
or     %al,%cl
ucomisd %xmm2,%xmm1
setp   %al
setne  %dl
or     %al,%dl
xor    %cl,%dl
movzbl %dl,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
ret

LLVM IR (-O0):
define double @xor(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fcmp une double %5, 0.000000e+00
%7 = zext i1 %6 to i32
%8 = load double, double* %4
%9 = fcmp une double %8, 0.000000e+00
%10 = zext i1 %9 to i32
%11 = xor i32 %7, %10
%12 = sitofp i32 %11 to double
ret double %12
}

LLVM IR (-O2):
define double @xor(double %0, double %1) {
%3 = fcmp une double %0, 0.000000e+00
%4 = fcmp une double %1, 0.000000e+00
%5 = xor i1 %3, %4
%6 = uitofp i1 %5 to double
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float);
void cubic(float n) {
  float cub = n * n * n;
  printf("cub of %.0f = %.0f", n, cub);
}


x86 assembly (clang, -O0):
<cubic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cubic>:
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
lea    0xede(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"cub of %.0f = %.0f\00"
define void @cubic(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = load float, float* %2
%6 = fmul float %4, %5
%7 = load float, float* %2
%8 = fmul float %6, %7
store float %8, float* %3
%9 = load float, float* %2
%10 = load float, float* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), float %9, float %10)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"cub of %.0f = %.0f\00"
define void @cubic(float %0) {
%2 = fmul float %0, %0
%3 = fmul float %2, %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), float %0, float %3)
ret void
}
test03(const char *s1, int n) { return __builtin_strncmp(s1, "abcde", n); }


x86 assembly (clang, -O0):
<test03>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rdx
lea    0xed2(%rip),%rsi
call   1030 <strncmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test03>:
movslq %esi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <strncmp@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"abcde\00"
define i32 @test03(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 = sext i32 %6 to i64
%8 = call i32 @strncmp(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [6 x i8] c"abcde\00"
define i32 @test03(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %3)
ret i32 %4
}
void gtk_separator_tool_item_new() {}


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

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

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

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

/* Variables and functions */
uint32_t demarshal32(uint8_t *d) {
  return (*d << 24) | (*(d + 1) << 16) | (*(d + 2) << 8) | (*(d + 3));
}


x86 assembly (clang, -O0):
<demarshal32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     0xc(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<demarshal32>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @demarshal32(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = shl i32 %4, 24
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = shl i32 %8, 16
%10 = or i32 %5, %9
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 2
%13 = load i32, i32* %12
%14 = shl i32 %13, 8
%15 = or i32 %10, %14
%16 = load i32*, i32** %2
%17 = getelementptr inbounds i32, i32* %16, i64 3
%18 = load i32, i32* %17
%19 = or i32 %15, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @demarshal32(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 24
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = or i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = or i32 %7, %10
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = or i32 %11, %13
ret i32 %14
}
int test_imm_71int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x71 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_71int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 7405568
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int sysCall(int, int, unsigned long, int);
int read(int file, char *buf, int nbytes) {
  return sysCall(3, file, (unsigned long)buf, nbytes);
}


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x3,%edi
call   1030 <sysCall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x3,%edi
jmp    1030 <sysCall@plt>

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

LLVM IR (-O2):
define i32 @read(i32 %0, i8* %1, i32 %2) {
%4 = ptrtoint i8* %1 to i64
%5 = tail call i32 @sysCall(i32 3, i32 %0, i64 %4, i32 %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ b();
void c(void) { b(); }


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

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

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

LLVM IR (-O2):
define void @c() {
%1 = tail call i32 (...) @b()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int key_equal(const void *key1, const void *key2) {
  assert(key1 != NULL && key2 != NULL);
  int *a = (int *)key1;
  int *b = (int *)key2;
  return *a == *b;
}


x86 assembly (clang, -O0):
<key_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x21(%rbp)
je     113b <key_equal+0x2b>
cmpq   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key_equal>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
test   %rdi,%rdi
setne  %al
test   %rsi,%rsi
setne  %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
mov    (%rbx),%ecx
xor    %eax,%eax
cmp    (%r14),%ecx
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @key_equal(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = icmp ne i8* %10, null
br label %12
12: ; preds = %9, %2
%13 = phi i1 [ false, %2 ], [ %11, %9 ]
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i8*, i8** %3
%17 = bitcast i8* %16 to i32*
store i32* %17, i32** %5
%18 = load i8*, i8** %4
%19 = bitcast i8* %18 to i32*
store i32* %19, i32** %6
%20 = load i32*, i32** %5
%21 = load i32, i32* %20
%22 = load i32*, i32** %6
%23 = load i32, i32* %22
%24 = icmp eq i32 %21, %23
%25 = zext i1 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @key_equal(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = bitcast i8* %0 to i32*
%9 = bitcast i8* %1 to i32*
%10 = load i32, i32* %8
%11 = load i32, i32* %9
%12 = icmp eq i32 %10, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
void test45_Test2_pollen__run__E() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int const);
void omp_sched_print(const omp_sched_t omp_sched_kind,
                     const int omp_sched_modifier) {
  printf("// omp_sched_kind = %d, omp_sched_modifier = %d\n",
         (int)omp_sched_kind, omp_sched_modifier);
}


x86 assembly (clang, -O0):
<omp_sched_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%esi
mov    -0xc(%rbp),%edx
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [49 x i8] c"// omp_sched_kind = %d, omp_sched_modifier = %d\0A\00"
define void @omp_sched_print(i64 %0, i32 %1) {
%3 = trunc i64 %0 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %1)
ret void
}
int movzbw_2(void) {
  int res;
  __asm__ __volatile__("movl $0x12345678, %%eax\n\t"
                       "movb $0x99, %%al\n\t"
                       "movzbw %%al,%%ax\n\t"
                       "mov %%eax, %0"
                       : "=r"(res)
                       :
                       : "eax");
  return res;
}


x86 assembly (clang, -O0):
<movzbw_2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x12345678,%eax
mov    $0x99,%al
movzbw %al,%ax
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<movzbw_2>:
mov    $0x12345678,%eax
mov    $0x99,%al
movzbw %al,%ax
mov    %eax,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @movzbw_2() {
%1 = alloca i32
%2 = call i32 asm sideeffect "movl $$0x12345678, %eax\0A\09movb $$0x99, %al\0A\09movzbw %al,%ax\0A\09mov %eax, $0", "=r,~{eax},~{dirflag},~{fpsr},~{flags}"()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @movzbw_2() {
%1 = tail call i32 asm sideeffect "movl $$0x12345678, %eax\0A\09movb $$0x99, %al\0A\09movzbw %al,%ax\0A\09mov %eax, $0", "=r,~{eax},~{dirflag},~{fpsr},~{flags}"()
ret i32 %1
}
int Operand_uimm8x4_encode(unsigned int *valp) {
  unsigned imm8_0, uimm8x4_0;
  uimm8x4_0 = *valp;
  imm8_0 = ((uimm8x4_0 >> 2) & 0xff);
  *valp = imm8_0;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_uimm8x4_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shr    $0x2,%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_uimm8x4_encode>:
mov    (%rdi),%eax
shr    $0x2,%eax
movzbl %al,%eax
mov    %eax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Operand_uimm8x4_encode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = lshr i32 %7, 2
%9 = and i32 %8, 255
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = load i32*, i32** %2
store i32 %10, i32* %11
ret i32 0
}

LLVM IR (-O2):
define i32 @Operand_uimm8x4_encode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = lshr i32 %2, 2
%4 = and i32 %3, 255
store i32 %4, i32* %0
ret i32 0
}
/* Type definitions */
struct gamehandle {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ erase();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ mvprintw(int /*<<< orphan*/, int /*<<< orphan*/, char *);
int /*<<< orphan*/ quit_game(struct gamehandle *);
int /*<<< orphan*/ refresh();
void pc_dies(struct gamehandle *myrill) {
  erase();
  mvprintw(0, 0, "You were killed");
  refresh();
  getch();
  quit_game(myrill);
}


x86 assembly (clang, -O0):
<pc_dies>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <erase@plt>
xor    %esi,%esi
lea    0xe94(%rip),%rdx
mov    %esi,%edi
call   1070 <mvprintw@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
mov    $0x0,%al
call   1060 <getch@plt>
mov    -0x8(%rbp),%rdi
call   1040 <quit_game@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pc_dies>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <erase@plt>
lea    0xe9e(%rip),%rdx
xor    %edi,%edi
xor    %esi,%esi
call   1070 <mvprintw@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
xor    %eax,%eax
call   1060 <getch@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <quit_game@plt>

LLVM IR (-O0):
%struct.gamehandle = type { i32 }
@.str = [16 x i8] c"You were killed\00"
define void @pc_dies(%struct.gamehandle* %0) {
%2 = alloca %struct.gamehandle*
store %struct.gamehandle* %0, %struct.gamehandle** %2
%3 = call i32 (...) @erase()
%4 = call i32 @mvprintw(i32 0, i32 0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @refresh()
%6 = call i32 (...) @getch()
%7 = load %struct.gamehandle*, %struct.gamehandle** %2
%8 = call i32 @quit_game(%struct.gamehandle* %7)
ret void
}

LLVM IR (-O2):
%struct.gamehandle = type { i32 }
@.str = [16 x i8] c"You were killed\00"
define void @pc_dies(%struct.gamehandle* %0) {
%2 = tail call i32 (...) @erase()
%3 = tail call i32 @mvprintw(i32 0, i32 0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @refresh()
%5 = tail call i32 (...) @getch()
%6 = tail call i32 @quit_game(%struct.gamehandle* %0)
ret void
}
/* Variables and functions */
int *malloc(int);
int test_cmp() {
  int *x = malloc(2 * sizeof(int));
  int *y = x + 1;
  if (x == y) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<test_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    114c <test_cmp+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1153 <test_cmp+0x43>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_cmp>:
push   %rax
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @test_cmp() {
%1 = tail call i32* @malloc(i32 8)
ret i32 1
}
int test_imm_A9int32_reg(int val) { return ((val) & (0xA9 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_A9int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xa9,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_A9int32_reg(i32 %0) {
%2 = and i32 %0, 169
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void _exit(int status) {
  printf("Program terminated with status %d.\n", status);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
jmp    112a <_exit+0x1a>

x86 assembly (clang, -O2):
<_exit>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
nop
jmp    1120 <_exit+0x10>

LLVM IR (-O0):
@.str = [36 x i8] c"Program terminated with status %d.\0A\00"
define void @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %3)
br label %5
5: ; preds = %1, %5
br label %5
}

LLVM IR (-O2):
@.str = [36 x i8] c"Program terminated with status %d.\0A\00"
define void @_exit(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %3
3: ; preds = %1, %3
br label %3
}