xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ localtime_r(int /*<<< orphan*/ *, struct tm *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void DEBUG_STAMP(void) {
  char str[200];
  time_t t;
  struct tm tm;
  t = time(NULL);
  localtime_r(&t, &tm);
  strftime(str, sizeof str, "%FT%TZ", &tm);
  printf("%s ", str);
}


x86 assembly (clang, -O0):
<DEBUG_STAMP>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0xd4(%rbp)
lea    -0xd4(%rbp),%rdi
lea    -0xd8(%rbp),%rsi
call   1030 <localtime_r@plt>
lea    -0xd0(%rbp),%rdi
mov    $0xc8,%esi
lea    0xe80(%rip),%rdx
lea    -0xd8(%rbp),%rcx
call   1060 <strftime@plt>
lea    -0xd0(%rbp),%rsi
lea    0xe6d(%rip),%rdi
call   1040 <printf@plt>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DEBUG_STAMP>:
push   %r14
push   %rbx
sub    $0xd8,%rsp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
lea    0x8(%rsp),%r14
mov    %r14,%rsi
call   1030 <localtime_r@plt>
lea    0xe92(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xc8,%esi
mov    %r14,%rcx
call   1060 <strftime@plt>
lea    0xe7d(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
add    $0xd8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [7 x i8] c"%FT%TZ\00"
@.str.1 = [4 x i8] c"%s \00"
define void @DEBUG_STAMP() {
%1 = alloca [200 x i8]
%2 = alloca i32
%3 = alloca %struct.tm
%4 = call i32 @time(i32* null)
store i32 %4, i32* %2
%5 = call i32 @localtime_r(i32* %2, %struct.tm* %3)
%6 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%7 = call i32 @strftime(i8* %6, i32 200, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %struct.tm* %3)
%8 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [7 x i8] c"%FT%TZ\00"
@.str.1 = [4 x i8] c"%s \00"
define void @DEBUG_STAMP() {
%1 = alloca [200 x i8]
%2 = alloca i32
%3 = alloca %struct.tm
%4 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%5 = bitcast i32* %2 to i8*
%6 = bitcast %struct.tm* %3 to i8*
%7 = tail call i32 @time(i32* null)
store i32 %7, i32* %2
%8 = call i32 @localtime_r(i32* %2, %struct.tm* %3)
%9 = call i32 @strftime(i8* %4, i32 200, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %struct.tm* %3)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}
extern unsigned char __inbc_p(unsigned short port) {
  unsigned char _v;
  __asm__ __volatile__("in"
                       "b"
                       " %"
                       ""
                       "1,%"
                       ""
                       "0"
                       : "=a"(_v)
                       : "id"(port));
  __asm__ __volatile__("jmp 1f\n1:\tjmp 1f\n1:");
  return _v;
}


x86 assembly (clang, -O0):
<__inbc_p>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
jmp    1118 <__inbc_p+0x18>
jmp    111d <__inbc_p+0x1d>
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__inbc_p>:
mov    %edi,%edx
in     (%dx),%al
jmp    1105 <__inbc_p+0x5>
jmp    1107 <__inbc_p+0x7>
ret

LLVM IR (-O0):
define zeroext i8 @__inbc_p(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb $1,$0", "={ax},i{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @__inbc_p(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb $1,$0", "={ax},i{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
tail call void asm sideeffect "jmp 1f\0A1:\09jmp 1f\0A1:", "~{dirflag},~{fpsr},~{flags}"()
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ rand();
size_t nextrand(size_t limit) {
  if (limit < 2)
    return (limit);
  size_t r = (size_t)rand();
  if (r > limit)
    return (r % limit);
  return (r);
}


x86 assembly (clang, -O0):
<nextrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x2,-0x10(%rbp)
jae    1134 <nextrand+0x24>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116c <nextrand+0x5c>
mov    $0x0,%al
call   1030 <rand@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1164 <nextrand+0x54>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rdx,-0x8(%rbp)
jmp    116c <nextrand+0x5c>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextrand>:
push   %rbx
mov    %rdi,%rbx
cmp    $0x2,%rdi
jb     114d <nextrand+0x3d>
xor    %eax,%eax
call   1030 <rand@plt>
movslq %eax,%rcx
cmp    %rbx,%rcx
jbe    1142 <nextrand+0x32>
mov    %rcx,%rdx
or     %rbx,%rdx
shr    $0x20,%rdx
je     1147 <nextrand+0x37>
mov    %rcx,%rax
xor    %edx,%edx
div    %rbx
mov    %rdx,%rbx
jmp    114d <nextrand+0x3d>
mov    %rcx,%rbx
jmp    114d <nextrand+0x3d>
xor    %edx,%edx
div    %ebx
mov    %edx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @nextrand(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = icmp ult i64 %5, 2
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i64, i64* %3
store i64 %8, i64* %2
br label %21
9: ; preds = %1
%10 = call i32 (...) @rand()
%11 = sext i32 %10 to i64
store i64 %11, i64* %4
%12 = load i64, i64* %4
%13 = load i64, i64* %3
%14 = icmp ugt i64 %12, %13
br i1 %14, label %15, label %19
15: ; preds = %9
%16 = load i64, i64* %4
%17 = load i64, i64* %3
%18 = urem i64 %16, %17
store i64 %18, i64* %2
br label %21
19: ; preds = %9
%20 = load i64, i64* %4
store i64 %20, i64* %2
br label %21
21: ; preds = %19, %15, %7
%22 = load i64, i64* %2
ret i64 %22
}

LLVM IR (-O2):
define i64 @nextrand(i64 %0) {
%2 = icmp ult i64 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i32 (...) @rand()
%5 = sext i32 %4 to i64
%6 = icmp ugt i64 %5, %0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = urem i64 %5, %0
br label %9
9: ; preds = %7, %3, %1
%10 = phi i64 [ %0, %1 ], [ %8, %7 ], [ %5, %3 ]
ret i64 %10
}
/* Variables and functions */
float fabsf(float);
float __attribute__((always_)) fast_fabsf(float x) { return fabsf(x); }


x86 assembly (clang, -O0):
<fast_fabsf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movaps 0xeeb(%rip),%xmm1
pand   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fast_fabsf>:
andps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define float @fast_fabsf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.fabs.f32(float %3)
ret float %4
}

LLVM IR (-O2):
define float @fast_fabsf(float %0) {
%2 = tail call float @llvm.fabs.f32(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ roadmap_search_history(char, char *);
void search_menu_my_saved_places(void) {
  roadmap_search_history('S', "Saved locations");
}


x86 assembly (clang, -O0):
<search_menu_my_saved_places>:
push   %rbp
mov    %rsp,%rbp
mov    $0x53,%edi
lea    0xee0(%rip),%rsi
call   1030 <roadmap_search_history@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<search_menu_my_saved_places>:
lea    0xee9(%rip),%rsi
mov    $0x53,%edi
jmp    1030 <roadmap_search_history@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Saved locations\00"
define void @search_menu_my_saved_places() {
%1 = call i32 @roadmap_search_history(i8 signext 83, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Saved locations\00"
define void @search_menu_my_saved_places() {
%1 = tail call i32 @roadmap_search_history(i8 signext 83, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
struct ctrl_iface_global_priv *
wpa_supplicant_global_ctrl_iface_init(struct wpa_global *global) {
  return (void *)1;
}


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

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

LLVM IR (-O0):
%struct.ctrl_iface_global_priv = type opaque
%struct.wpa_global = type opaque
define %struct.ctrl_iface_global_priv* @wpa_supplicant_global_ctrl_iface_init(%struct.wpa_global* %0) {
%2 = alloca %struct.wpa_global*
store %struct.wpa_global* %0, %struct.wpa_global** %2
ret %struct.ctrl_iface_global_priv* inttoptr (i64 1 to %struct.ctrl_iface_global_priv*)
}

LLVM IR (-O2):
%struct.ctrl_iface_global_priv = type opaque
%struct.wpa_global = type opaque
define %struct.ctrl_iface_global_priv* @wpa_supplicant_global_ctrl_iface_init(%struct.wpa_global* nocapture readnone %0) {
ret %struct.ctrl_iface_global_priv* inttoptr (i64 1 to %struct.ctrl_iface_global_priv*)
}
/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/);
int /*<<< orphan*/ get_current_dir_name();
int main(void) {
  free(get_current_dir_name());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <get_current_dir_name@plt>
mov    %eax,%edi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <get_current_dir_name@plt>
mov    %eax,%edi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @get_current_dir_name()
%3 = call i32 @free(i32 %2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @get_current_dir_name()
%2 = tail call i32 @free(i32 %1)
ret i32 0
}
/* Variables and functions */
int atoi(char *);
int main(int argc, char *argv[]) {
  if (argc != 3)
    return 1;
  int a = atoi(argv[1]), b = atoi(argv[2]);
  return a + b;
}


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)
cmpl   $0x3,-0x8(%rbp)
je     113c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1165 <main+0x55>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%eax
cmp    $0x3,%edi
jne    113c <main+0x2c>
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1030 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   1030 <atoi@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
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
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 3
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %3
br label %23
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @atoi(i8* %14)
store i32 %15, i32* %6
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 2
%18 = load i8*, i8** %17
%19 = call i32 @atoi(i8* %18)
store i32 %19, i32* %7
%20 = load i32, i32* %6
%21 = load i32, i32* %7
%22 = add nsw i32 %20, %21
store i32 %22, i32* %3
br label %23
23: ; preds = %11, %10
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
%8 = getelementptr inbounds i8*, i8** %1, i64 2
%9 = load i8*, i8** %8
%10 = tail call i32 @atoi(i8* %9)
%11 = add nsw i32 %10, %7
br label %12
12: ; preds = %2, %4
%13 = phi i32 [ %11, %4 ], [ 1, %2 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *gen_iface_msg(char *ifptr) {
  static char if_msg[20];
  if (ifptr == NULL)
    strcpy(if_msg, "all interfaces");
  else
    strncpy(if_msg, ifptr, 20);
  return if_msg;
}


x86 assembly (clang, -O0):
<gen_iface_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114f <gen_iface_msg+0x2f>
lea    0x2f02(%rip),%rdi
lea    0xebb(%rip),%rsi
call   1040 <strcpy@plt>
jmp    1164 <gen_iface_msg+0x44>
mov    -0x8(%rbp),%rsi
lea    0x2ee6(%rip),%rdi
mov    $0x14,%edx
call   1030 <strncpy@plt>
lea    0x2ed5(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_iface_msg>:
push   %rax
test   %rdi,%rdi
je     113c <gen_iface_msg+0x1c>
mov    %rdi,%rsi
lea    0x2f10(%rip),%rdi
mov    $0x14,%edx
call   1030 <strncpy@plt>
jmp    114f <gen_iface_msg+0x2f>
lea    0x2efd(%rip),%rdi
lea    0xeb6(%rip),%rsi
call   1040 <strcpy@plt>
lea    0x2eea(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@gen_iface_msg.if_msg = internal global [20 x i8] zeroinitializer
@.str = [15 x i8] c"all interfaces\00"
define i8* @gen_iface_msg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @strcpy(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gen_iface_msg.if_msg, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @strncpy(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gen_iface_msg.if_msg, i64 0, i64 0), i8* %8, i32 20)
br label %10
10: ; preds = %7, %5
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gen_iface_msg.if_msg, i64 0, i64 0)
}

LLVM IR (-O2):
@gen_iface_msg.if_msg = internal global [20 x i8] zeroinitializer
@.str = [15 x i8] c"all interfaces\00"
define i8* @gen_iface_msg(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @strcpy(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gen_iface_msg.if_msg, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 @strncpy(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gen_iface_msg.if_msg, i64 0, i64 0), i8* %0, i32 20)
br label %7
7: ; preds = %5, %3
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @gen_iface_msg.if_msg, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ ucontext_t;

/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
scalar_t__ swapcontext(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void _fco_do_swap(ucontext_t *save, ucontext_t *to) {
  if (swapcontext(save, to)) {
    fprintf(stderr, "[FATAL] swapcontext failed, detail:%s\n", strerror(errno));
    exit(1);
  }
}


x86 assembly (clang, -O0):
<_fco_do_swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <swapcontext@plt>
cmp    $0x0,%rax
je     119d <_fco_do_swap+0x5d>
mov    0x2e72(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    %rax,%rdx
lea    0xe72(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fco_do_swap>:
push   %rbx
call   1030 <swapcontext@plt>
test   %rax,%rax
jne    114d <_fco_do_swap+0xd>
pop    %rbx
ret
mov    0x2e8c(%rip),%rax
mov    (%rax),%ebx
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe95(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"[FATAL] swapcontext failed, detail:%s\0A\00"
@errno = global i32 0
define void @_fco_do_swap(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32*, i32** %4
%7 = call i64 @swapcontext(i32* %5, i32* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = load i32, i32* @errno
%12 = call i8* @strerror(i32 %11)
%13 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"[FATAL] swapcontext failed, detail:%s\0A\00"
@errno = global i32 0
define void @_fco_do_swap(i32* %0, i32* %1) {
%3 = tail call i64 @swapcontext(i32* %0, i32* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = load i32, i32* @errno
%8 = tail call i8* @strerror(i32 %7)
%9 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %2
ret void
}
int test_imm_DDint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xDD << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_DDint64_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, 221
%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_DDint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 14483456
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef scalar_t__ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ plot4points(scalar_t__, scalar_t__, scalar_t__, scalar_t__,
                               int /*<<< orphan*/);
void plot8points(uint16_t cx, uint16_t cy, uint16_t x, uint16_t y,
                 uint32_t color) {
  plot4points(cx, cy, x, y, color);
  if (x != y)
    plot4points(cx, cy, y, x, color);
}


x86 assembly (clang, -O0):
<plot8points>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1030 <plot4points@plt>
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
je     116c <plot8points+0x5c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1030 <plot4points@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plot8points>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r14d
mov    %rcx,%rbp
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%r12
call   1030 <plot4points@plt>
cmp    %rbp,%rbx
jne    113a <plot8points+0x2a>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
mov    %rbx,%rcx
mov    %r14d,%r8d
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <plot4points@plt>

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

LLVM IR (-O2):
define void @plot8points(i64 %0, i64 %1, i64 %2, i64 %3, i32 %4) {
%6 = tail call i32 @plot4points(i64 %0, i64 %1, i64 %2, i64 %3, i32 %4)
%7 = icmp eq i64 %2, %3
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @plot4points(i64 %0, i64 %1, i64 %3, i64 %2, i32 %4)
br label %10
10: ; preds = %8, %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ get_content_char(int);
void gen_src_buf(void *p, size_t size) {
  uint8_t val;
  char *buffer = p;
  int i;
  for (i = 0; i < size; i++)
    *buffer++ = get_content_char(i);
}


x86 assembly (clang, -O0):
<gen_src_buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movslq -0x24(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1166 <gen_src_buf+0x56>
mov    -0x24(%rbp),%edi
call   1030 <get_content_char@plt>
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    112f <gen_src_buf+0x1f>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_src_buf>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1144 <gen_src_buf+0x34>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%edi
call   1030 <get_content_char@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <gen_src_buf+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @gen_src_buf(i8* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %11, %4 ], [ 0, %2 ]
%6 = phi i8* [ %10, %4 ], [ %0, %2 ]
%7 = trunc i64 %5 to i32
%8 = tail call i32 @get_content_char(i32 %7)
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %9, i8* %6
%11 = add nuw i64 %5, 1
%12 = icmp eq i64 %11, %1
br i1 %12, label %13, label %4
13: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int pthread_mutex_lock(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void safe_mutex_lock(pthread_mutex_t *mutex) {
  int ret = pthread_mutex_lock(mutex);
  if (ret != 0) {
    fprintf(stderr, "pthread_mutex_lock error [%d]! Aborting immediately!\n",
            ret);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<safe_mutex_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <pthread_mutex_lock@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1174 <safe_mutex_lock+0x44>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
lea    0xe9b(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_mutex_lock>:
push   %rax
call   1050 <pthread_mutex_lock@plt>
test   %eax,%eax
jne    113c <safe_mutex_lock+0xc>
pop    %rax
ret
mov    0x2e9d(%rip),%rcx
mov    (%rcx),%edi
lea    0xeb4(%rip),%rsi
mov    %eax,%edx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [54 x i8] c"pthread_mutex_lock error [%d]! Aborting immediately!\0A\00"
define void @safe_mutex_lock(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @pthread_mutex_lock(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i32, i32* %3
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [54 x i8] c"pthread_mutex_lock error [%d]! Aborting immediately!\0A\00"
define void @safe_mutex_lock(i32* %0) {
%2 = tail call i32 @pthread_mutex_lock(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %2)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ptr_list_append_check(void ***, unsigned int *, void *);
void ptr_list_append(void ***list, unsigned int *count, void *new) {
  (void)ptr_list_append_check(list, count, new);
}


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

x86 assembly (clang, -O2):
<ptr_list_append>:
jmp    1030 <ptr_list_append_check@plt>

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

LLVM IR (-O2):
define void @ptr_list_append(i8*** %0, i32* %1, i8* %2) {
%4 = tail call i32 @ptr_list_append_check(i8*** %0, i32* %1, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Cigebs2d(int, char *, char *, int, int, int *, int);
void wcc_Cigebs2d(int ConTxt, char *scope, char *top, int m, int n, char *A,
                  int lda) {
  Cigebs2d(ConTxt, scope, top, m, n, (int *)A, lda);
}


x86 assembly (clang, -O0):
<wcc_Cigebs2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0x28(%rbp),%r9
mov    0x10(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <Cigebs2d@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcc_Cigebs2d>:
jmp    1030 <Cigebs2d@plt>

LLVM IR (-O0):
define void @wcc_Cigebs2d(i32 %0, i8* %1, i8* %2, i32 %3, i32 %4, i8* %5, i32 %6) {
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i32
store i32 %0, i32* %8
store i8* %1, i8** %9
store i8* %2, i8** %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i8* %5, i8** %13
store i32 %6, i32* %14
%15 = load i32, i32* %8
%16 = load i8*, i8** %9
%17 = load i8*, i8** %10
%18 = load i32, i32* %11
%19 = load i32, i32* %12
%20 = load i8*, i8** %13
%21 = bitcast i8* %20 to i32*
%22 = load i32, i32* %14
%23 = call i32 @Cigebs2d(i32 %15, i8* %16, i8* %17, i32 %18, i32 %19, i32* %21, i32 %22)
ret void
}

LLVM IR (-O2):
define void @wcc_Cigebs2d(i32 %0, i8* %1, i8* %2, i32 %3, i32 %4, i8* %5, i32 %6) {
%8 = bitcast i8* %5 to i32*
%9 = tail call i32 @Cigebs2d(i32 %0, i8* %1, i8* %2, i32 %3, i32 %4, i32* %8, i32 %6)
ret void
}
/* Type definitions */
struct line_map {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ linemap_macro_expansion_map_p(struct line_map *);
struct line_map *linemap_check_ordinary(struct line_map *map) {
  ((void)(0 && (!linemap_macro_expansion_map_p(map))));
  return map;
}


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

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

LLVM IR (-O0):
%struct.line_map = type { i32 }
define %struct.line_map* @linemap_check_ordinary(%struct.line_map* %0) {
%2 = alloca %struct.line_map*
store %struct.line_map* %0, %struct.line_map** %2
%3 = load %struct.line_map*, %struct.line_map** %2
ret %struct.line_map* %3
}

LLVM IR (-O2):
%struct.line_map = type { i32 }
define %struct.line_map* @linemap_check_ordinary(%struct.line_map* readnone returned %0) {
ret %struct.line_map* %0
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ chr2setBank1(int);
void s3setParams9800(uint16_t addr, uint8_t val) {
  (void)addr;
  chr2setBank1(val << 11);
}


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

x86 assembly (clang, -O2):
mov    %esi,%edi
shl    $0xb,%edi
jmp    1030 <chr2setBank1@plt>

LLVM IR (-O0):
define void @s3setParams9800(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %6, 11
%8 = call i32 @chr2setBank1(i32 %7)
ret void
}

LLVM IR (-O2):
define void @s3setParams9800(i32 %0, i32 %1) {
%3 = shl i32 %1, 11
%4 = tail call i32 @chr2setBank1(i32 %3)
ret void
}
/* Variables and functions */
scalar_t__ AES128_set_hw(int);
int /*<<< orphan*/ AES_CBC_set_hw(int);
int do_testsuite();
int aes_main(void) {
  int rc = do_testsuite();
  if (AES128_set_hw(1) == 0) {
    AES128_set_hw(0);
    AES_CBC_set_hw(0);
    rc |= do_testsuite();
  }
  AES128_set_hw(-1);
  AES_CBC_set_hw(-1);
  return rc;
}


x86 assembly (clang, -O0):
<aes_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <do_testsuite@plt>
mov    %eax,-0x4(%rbp)
mov    $0x1,%edi
call   1050 <AES128_set_hw@plt>
cmp    $0x0,%rax
jne    1171 <aes_main+0x41>
xor    %edi,%edi
call   1050 <AES128_set_hw@plt>
xor    %edi,%edi
call   1030 <AES_CBC_set_hw@plt>
mov    $0x0,%al
call   1040 <do_testsuite@plt>
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0xffffffff,%edi
call   1050 <AES128_set_hw@plt>
mov    $0xffffffff,%edi
call   1030 <AES_CBC_set_hw@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aes_main>:
push   %rbx
xor    %eax,%eax
call   1040 <do_testsuite@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1050 <AES128_set_hw@plt>
test   %rax,%rax
jne    1160 <aes_main+0x30>
xor    %edi,%edi
call   1050 <AES128_set_hw@plt>
xor    %edi,%edi
call   1030 <AES_CBC_set_hw@plt>
xor    %eax,%eax
call   1040 <do_testsuite@plt>
or     %eax,%ebx
mov    $0xffffffff,%edi
call   1050 <AES128_set_hw@plt>
mov    $0xffffffff,%edi
call   1030 <AES_CBC_set_hw@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @aes_main() {
%1 = alloca i32
%2 = call i32 (...) @do_testsuite()
store i32 %2, i32* %1
%3 = call i64 @AES128_set_hw(i32 1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %0
%6 = call i64 @AES128_set_hw(i32 0)
%7 = call i32 @AES_CBC_set_hw(i32 0)
%8 = call i32 (...) @do_testsuite()
%9 = load i32, i32* %1
%10 = or i32 %9, %8
store i32 %10, i32* %1
br label %11
11: ; preds = %5, %0
%12 = call i64 @AES128_set_hw(i32 -1)
%13 = call i32 @AES_CBC_set_hw(i32 -1)
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
define i32 @aes_main() {
%1 = tail call i32 (...) @do_testsuite()
%2 = tail call i64 @AES128_set_hw(i32 1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %0
%5 = tail call i64 @AES128_set_hw(i32 0)
%6 = tail call i32 @AES_CBC_set_hw(i32 0)
%7 = tail call i32 (...) @do_testsuite()
%8 = or i32 %7, %1
br label %9
9: ; preds = %4, %0
%10 = phi i32 [ %8, %4 ], [ %1, %0 ]
%11 = tail call i64 @AES128_set_hw(i32 -1)
%12 = tail call i32 @AES_CBC_set_hw(i32 -1)
ret i32 %10
}
/* Type definitions */
struct variable_list {
  int dummy;
};
struct enum_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sprint_by_type(char *, struct variable_list *,
                                  int /*<<< orphan*/, int /*<<< orphan*/,
                                  int /*<<< orphan*/);
void sprint_unknowntype(char *buf, struct variable_list *var,
                        struct enum_list *enums, const char *hint,
                        const char *units) {
  sprint_by_type(buf, var, 0, 0, 0);
}


x86 assembly (clang, -O0):
<sprint_unknowntype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %r8d,%r8d
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <sprint_by_type@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_unknowntype>:
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <sprint_by_type@plt>

LLVM IR (-O0):
%struct.variable_list = type { i32 }
%struct.enum_list = type { i32 }
define void @sprint_unknowntype(i8* %0, %struct.variable_list* %1, %struct.enum_list* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca %struct.variable_list*
%8 = alloca %struct.enum_list*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store %struct.variable_list* %1, %struct.variable_list** %7
store %struct.enum_list* %2, %struct.enum_list** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load %struct.variable_list*, %struct.variable_list** %7
%13 = call i32 @sprint_by_type(i8* %11, %struct.variable_list* %12, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
%struct.variable_list = type { i32 }
%struct.enum_list = type { i32 }
define void @sprint_unknowntype(i8* %0, %struct.variable_list* %1, %struct.enum_list* nocapture readnone %2, i8* nocapture readnone %3, i8* nocapture readnone %4) {
%6 = tail call i32 @sprint_by_type(i8* %0, %struct.variable_list* %1, i32 0, i32 0, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
float stdlib_strided_sdssumpw(int /*<<< orphan*/ const, float const *,
                              int /*<<< orphan*/ const);
float stdlib_strided_sdssum(const int64_t N, const float *X,
                            const int64_t stride) {
  return stdlib_strided_sdssumpw(N, X, stride);
}


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

x86 assembly (clang, -O2):
<stdlib_strided_sdssum>:
jmp    1030 <stdlib_strided_sdssumpw@plt>

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

LLVM IR (-O2):
define float @stdlib_strided_sdssum(i32 %0, float* %1, i32 %2) {
%4 = tail call float @stdlib_strided_sdssumpw(i32 %0, float* %1, i32 %2)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ wait(int /*<<< orphan*/ *);
void myExit(int n) { wait(NULL); }


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

x86 assembly (clang, -O2):
<myExit>:
xor    %edi,%edi
jmp    1030 <wait@plt>

LLVM IR (-O0):
define void @myExit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @wait(i32* null)
ret void
}

LLVM IR (-O2):
define void @myExit(i32 %0) {
%2 = tail call i32 @wait(i32* null)
ret void
}
double acs712_getcurrent(double voltagein, double adcvref) {
  return (double)((double)(voltagein - (double)(adcvref / (double)2)) /
                  (double)0.185);
}


x86 assembly (clang, -O0):
<acs712_getcurrent>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xee8(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  0xed0(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<acs712_getcurrent>:
mulsd  0xef8(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @acs712_getcurrent(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 = load double, double* %4
%7 = fdiv double %6, 2.000000e+00
%8 = fsub double %5, %7
%9 = fdiv double %8, 1.850000e-01
ret double %9
}

LLVM IR (-O2):
define double @acs712_getcurrent(double %0, double %1) {
%3 = fmul double %1, 5.000000e-01
%4 = fsub double %0, %3
%5 = fdiv double %4, 1.850000e-01
ret double %5
}
IR0IR1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if ((*p0) <= (*p1))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<IR0IR1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
ja     1136 <IR0IR1+0x36>
movl   $0x1,-0x4(%rbp)
jmp    113d <IR0IR1+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0IR1>:
mov    (%r8),%ecx
xor    %eax,%eax
cmp    (%r9),%ecx
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @IR0IR1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture %5) {
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp ule i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
int test_02(unsigned char *a) { return a[0] + ((a[0] & 0x80) == 0); }


x86 assembly (clang, -O0):
<test_02>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
and    $0x80,%ecx
cmp    $0x0,%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_02>:
movzbl (%rdi),%ecx
mov    %ecx,%eax
shr    $0x7,%eax
xor    $0x1,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_02(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = and i32 %10, 128
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
%14 = add nsw i32 %6, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @test_02(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = lshr i32 %3, 7
%5 = xor i32 %4, 1
%6 = add nuw nsw i32 %5, %3
ret i32 %6
}
int test_imm_8Buint16_reg(unsigned short val) {
  return ((val) & (0x8B << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_8Buint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 139
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ scrClear();
int ClearScreen(int argc, char *argv[]) {
  scrClear();
  return 0;
}


x86 assembly (clang, -O0):
<ClearScreen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <scrClear@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ClearScreen(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @scrClear()
ret i32 0
}
/* Variables and functions */
void *malloc(unsigned int);
void *kmalloc(unsigned int len) { return malloc(len); }


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

x86 assembly (clang, -O2):
<kmalloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @kmalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
/* Variables and functions */
char *hello();
int printf(char *, char *, char *);
char *world();
int main(void) { return printf("%s %s\n", hello(), world()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <hello@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <world@plt>
mov    -0x10(%rbp),%rsi
mov    %rax,%rdx
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <hello@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <world@plt>
lea    0xeb7(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
pop    %rbx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%s %s\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @hello()
%2 = tail call i8* (...) @world()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret i32 %3
}
unsigned int at91_sys_read(unsigned int reg_offset) {
  void *addr = (void *)0xffffe800;
  return (*(volatile unsigned int *)(addr + reg_offset));
}


x86 assembly (clang, -O0):
<at91_sys_read>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0xffffe800,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
mov    (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<at91_sys_read>:
mov    %edi,%eax
mov    $0xffffe800,%ecx
mov    (%rax,%rcx,1),%eax
ret

LLVM IR (-O0):
define i32 @at91_sys_read(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* inttoptr (i64 4294961152 to i8*), i8** %3
%4 = load i8*, i8** %3
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = getelementptr i8, i8* %4, i64 %6
%8 = bitcast i8* %7 to i32*
%9 = load volatile i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @at91_sys_read(i32 %0) {
%2 = zext i32 %0 to i64
%3 = getelementptr i8, i8* inttoptr (i64 4294961152 to i8*), i64 %2
%4 = bitcast i8* %3 to i32*
%5 = load volatile i32, i32* %4
ret i32 %5
}
void REMR3NotifyInterruptClear(void) {}


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

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

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

LLVM IR (-O2):
define void @REMR3NotifyInterruptClear() {
ret void
}
int compare_tree_asc_x(const void *p1, const void *p2) {
  const double x1 = *((const double *)p1);
  const double x2 = *((const double *)p2);
  if (x1 != x2)
    return (x1 < x2) ? -1 : 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<compare_tree_asc_x>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jne    1141 <compare_tree_asc_x+0x41>
jp     1141 <compare_tree_asc_x+0x41>
jmp    1164 <compare_tree_asc_x+0x64>
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
mov    $0x1,%eax
mov    $0xffffffff,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    116b <compare_tree_asc_x+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_tree_asc_x>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
setbe  %cl
xor    %eax,%eax
ucomisd %xmm1,%xmm0
lea    -0x1(%rcx,%rcx,1),%ecx
cmovne %ecx,%eax
cmovp  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare_tree_asc_x(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
store double %10, double* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to double*
%13 = load double, double* %12
store double %13, double* %7
%14 = load double, double* %6
%15 = load double, double* %7
%16 = fcmp une double %14, %15
br i1 %16, label %17, label %23
17: ; preds = %2
%18 = load double, double* %6
%19 = load double, double* %7
%20 = fcmp olt double %18, %19
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 -1, i32 1
store i32 %22, i32* %3
br label %24
23: ; preds = %2
store i32 0, i32* %3
br label %24
24: ; preds = %23, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @compare_tree_asc_x(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp une double %4, %6
%8 = fcmp olt double %4, %6
%9 = select i1 %8, i32 -1, i32 1
%10 = select i1 %7, i32 %9, i32 0
ret i32 %10
}