xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ putstring(char *);
void nl(void) {
  char cr[2];
  cr[0] = '\n';
  cr[1] = 0;
  putstring(cr);
}


x86 assembly (clang, -O0):
<nl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0xa,-0x2(%rbp)
movb   $0x0,-0x1(%rbp)
lea    -0x2(%rbp),%rdi
call   1030 <putstring@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nl>:
push   %rax
movw   $0xa,0x6(%rsp)
lea    0x6(%rsp),%rdi
call   1030 <putstring@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @nl() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
store i8 10, i8* %2
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 1
store i8 0, i8* %3
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%5 = call i32 @putstring(i8* %4)
ret void
}

LLVM IR (-O2):
define void @nl() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
store i8 10, i8* %2
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 1
store i8 0, i8* %3
%4 = call i32 @putstring(i8* %2)
ret void
}
int cbtable_hash(const char *type) {
  unsigned acc = 0;
  const unsigned char *p;
  for (p = (const unsigned char *)type; *p; p++)
    acc = (acc + *p) % 8;
  return acc;
}


x86 assembly (clang, -O0):
<cbtable_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1147 <cbtable_hash+0x47>
mov    -0xc(%rbp),%eax
mov    -0x18(%rbp),%rcx
movzbl (%rcx),%ecx
add    %ecx,%eax
and    $0x7,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <cbtable_hash+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbtable_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <cbtable_hash+0x26>
add    $0x1,%rdi
xor    %edx,%edx
nopl   0x0(%rax)
movzbl %cl,%eax
add    %edx,%eax
and    $0x7,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1110 <cbtable_hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @cbtable_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %11, %4 ], [ %0, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = zext i8 %5 to i32
%9 = add nuw nsw i32 %7, %8
%10 = and i32 %9, 7
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
void hugo_musicvolume(int vol) {}


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

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

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

LLVM IR (-O2):
define void @hugo_musicvolume(i32 %0) {
ret void
}
/* Type definitions */
struct hwtest_ctx {
  int dummy;
};

/* Variables and functions */
int nv84_ptherm_prep(struct hwtest_ctx *);
int nv84_clock_gating_prep(struct hwtest_ctx *ctx) {
  return nv84_ptherm_prep(ctx);
}


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

x86 assembly (clang, -O2):
<nv84_clock_gating_prep>:
jmp    1030 <nv84_ptherm_prep@plt>

LLVM IR (-O0):
%struct.hwtest_ctx = type { i32 }
define i32 @nv84_clock_gating_prep(%struct.hwtest_ctx* %0) {
%2 = alloca %struct.hwtest_ctx*
store %struct.hwtest_ctx* %0, %struct.hwtest_ctx** %2
%3 = load %struct.hwtest_ctx*, %struct.hwtest_ctx** %2
%4 = call i32 @nv84_ptherm_prep(%struct.hwtest_ctx* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.hwtest_ctx = type { i32 }
define i32 @nv84_clock_gating_prep(%struct.hwtest_ctx* %0) {
%2 = tail call i32 @nv84_ptherm_prep(%struct.hwtest_ctx* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ EnableHDCP(int /*<<< orphan*/);
void HDMITX_TrunOffHDCP(void) { EnableHDCP(0); }


x86 assembly (clang, -O0):
<HDMITX_TrunOffHDCP>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <EnableHDCP@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @HDMITX_TrunOffHDCP() {
%1 = call i32 @EnableHDCP(i32 0)
ret void
}

LLVM IR (-O2):
define void @HDMITX_TrunOffHDCP() {
%1 = tail call i32 @EnableHDCP(i32 0)
ret void
}
char *(strcchrnul)(const char *string, int c, int stop) {
  for (;; string++)
    if (*string == c)
      return string;
    else if (!*string || (*string == stop))
      return string;
}


x86 assembly (clang, -O0):
<strcchrnul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    112b <strcchrnul+0x2b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1170 <strcchrnul+0x70>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1148 <strcchrnul+0x48>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x18(%rbp),%eax
jne    1155 <strcchrnul+0x55>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1170 <strcchrnul+0x70>
jmp    115a <strcchrnul+0x5a>
jmp    115f <strcchrnul+0x5f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110e <strcchrnul+0xe>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcchrnul>:
mov    %rdi,%rax
mov    (%rdi),%cl
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %cl,%edi
cmp    %esi,%edi
je     1129 <strcchrnul+0x29>
test   %cl,%cl
je     1129 <strcchrnul+0x29>
cmp    %edx,%edi
je     1129 <strcchrnul+0x29>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
jmp    1110 <strcchrnul+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcchrnul(i8* %0, i32 %1, i32 %2) {
%4 = load i8, i8* %0
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, %1
br i1 %6, label %19, label %7
7: ; preds = %3, %14
%8 = phi i32 [ %17, %14 ], [ %5, %3 ]
%9 = phi i8 [ %16, %14 ], [ %4, %3 ]
%10 = phi i8* [ %15, %14 ], [ %0, %3 ]
%11 = icmp eq i8 %9, 0
%12 = icmp eq i32 %8, %2
%13 = or i1 %11, %12
br i1 %13, label %19, label %14
14: ; preds = %7
%15 = getelementptr inbounds i8, i8* %10, i64 1
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, %1
br i1 %18, label %19, label %7
19: ; preds = %14, %7, %3
%20 = phi i8* [ %0, %3 ], [ %10, %7 ], [ %15, %14 ]
ret i8* %20
}
void FPU_FNOP(void) {}


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

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

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

LLVM IR (-O2):
define void @FPU_FNOP() {
ret void
}
/* Type definitions */
struct user_regs_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exec_by_all_variants(int, int *);
void sys_rt_sigprocmask(int variant_count, int *child,
                        struct user_regs_struct *regs) {
  exec_by_all_variants(variant_count, child);
}


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

x86 assembly (clang, -O2):
<sys_rt_sigprocmask>:
jmp    1030 <exec_by_all_variants@plt>

LLVM IR (-O0):
%struct.user_regs_struct = type { i32 }
define void @sys_rt_sigprocmask(i32 %0, i32* %1, %struct.user_regs_struct* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca %struct.user_regs_struct*
store i32 %0, i32* %4
store i32* %1, i32** %5
store %struct.user_regs_struct* %2, %struct.user_regs_struct** %6
%7 = load i32, i32* %4
%8 = load i32*, i32** %5
%9 = call i32 @exec_by_all_variants(i32 %7, i32* %8)
ret void
}

LLVM IR (-O2):
%struct.user_regs_struct = type { i32 }
define void @sys_rt_sigprocmask(i32 %0, i32* %1, %struct.user_regs_struct* nocapture readnone %2) {
%4 = tail call i32 @exec_by_all_variants(i32 %0, i32* %1)
ret void
}
void foo372(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo372(i32 %0) {
ret void
}
/* Variables and functions */
void *mem_alloc(size_t, char *, int);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *mem_calloc(size_t nelem, size_t size, char *fil, int lin) {
  void *p;
  p = mem_alloc(size * nelem, fil, lin);
  if (p == NULL) {
    return NULL;
  }
  memset(p, 0, size * nelem);
  return p;
}


x86 assembly (clang, -O0):
<mem_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
imul   -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1040 <mem_alloc@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    1168 <mem_calloc+0x48>
movq   $0x0,-0x8(%rbp)
jmp    1184 <mem_calloc+0x64>
mov    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rdx
imul   -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x30(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
call   1040 <mem_alloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     114d <mem_calloc+0x2d>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @mem_calloc(i64 %0, i64 %1, i8* %2, i32 %3) {
%5 = mul i64 %1, %0
%6 = tail call i8* @mem_alloc(i64 %5, i8* %2, i32 %3)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = tail call i32 @memset(i8* %6, i32 0, i64 %5)
br label %10
10: ; preds = %4, %8
ret i8* %6
}
/* Variables and functions */
scalar_t__ malloc(int);
void allocList(int n, int *ptr) { ptr = (int *)malloc(sizeof(int) * n); }


x86 assembly (clang, -O0):
<allocList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocList>:
shl    $0x2,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define void @allocList(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 = sext i32 %5 to i64
%7 = mul i64 4, %6
%8 = trunc i64 %7 to i32
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to i32*
store i32* %10, i32** %4
ret void
}

LLVM IR (-O2):
define void @allocList(i32 %0, i32* nocapture readnone %1) {
%3 = shl i32 %0, 2
%4 = tail call i64 @malloc(i32 %3)
ret void
}
/* Variables and functions */
char const *vp_file_write(char *);
const char *vp_pty_write(char *args) { return vp_file_write(args); }


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

x86 assembly (clang, -O2):
<vp_pty_write>:
jmp    1030 <vp_file_write@plt>

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

LLVM IR (-O2):
define i8* @vp_pty_write(i8* %0) {
%2 = tail call i8* @vp_file_write(i8* %0)
ret i8* %2
}
int bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid) {
  return 0;
}


x86 assembly (clang, -O0):
<bla_tx>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.bat_priv = type opaque
%struct.sk_buff = type opaque
define i32 @bla_tx(%struct.bat_priv* %0, %struct.sk_buff* %1, i16 signext %2) {
%4 = alloca %struct.bat_priv*
%5 = alloca %struct.sk_buff*
%6 = alloca i16
store %struct.bat_priv* %0, %struct.bat_priv** %4
store %struct.sk_buff* %1, %struct.sk_buff** %5
store i16 %2, i16* %6
ret i32 0
}

LLVM IR (-O2):
%struct.bat_priv = type opaque
%struct.sk_buff = type opaque
define i32 @bla_tx(%struct.bat_priv* nocapture readnone %0, %struct.sk_buff* nocapture readnone %1, i16 signext %2) {
ret i32 0
}
/* Variables and functions */
char *_agstrcanon(char *, int /*<<< orphan*/);
int /*<<< orphan*/ getoutputbuffer(char *);
char *agcanon(char *str) { return _agstrcanon(str, getoutputbuffer(str)); }


x86 assembly (clang, -O0):
<agcanon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getoutputbuffer@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1030 <_agstrcanon@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<agcanon>:
push   %rbx
mov    %rdi,%rbx
call   1040 <getoutputbuffer@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <_agstrcanon@plt>

LLVM IR (-O0):
define i8* @agcanon(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @getoutputbuffer(i8* %4)
%6 = call i8* @_agstrcanon(i8* %3, i32 %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @agcanon(i8* %0) {
%2 = tail call i32 @getoutputbuffer(i8* %0)
%3 = tail call i8* @_agstrcanon(i8* %0, i32 %2)
ret i8* %3
}
int test_imm_EAuint8_mem(unsigned char *val) {
  return ((*val) & (-0xEA << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_EAuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 22
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int, int);
int /*<<< orphan*/ stderr;
void smotion(int x, int y, int z) {
  fprintf(stderr, "Spaceball motion %d %d %d\n", x, y, z);
}


x86 assembly (clang, -O0):
<smotion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r8d
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smotion>:
mov    %edx,%r8d
mov    %esi,%ecx
mov    %edi,%edx
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
lea    0xed9(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"Spaceball motion %d %d %d\0A\00"
define void @smotion(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"Spaceball motion %d %d %d\0A\00"
define void @smotion(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
ret void
}
void search_init() { ; }


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

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

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

LLVM IR (-O2):
define void @search_init() {
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
double sslCalcTimevalDiff(struct timeval *pT1, struct timeval *pT2) {
  return ((double)(pT1->tv_sec - pT2->tv_sec) +
          ((double)(pT1->tv_usec - pT2->tv_usec)) / 1000000.0);
}


x86 assembly (clang, -O0):
<sslCalcTimevalDiff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    -0x10(%rbp),%rcx
sub    0x8(%rcx),%rax
cvtsi2sd %rax,%xmm0
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%rax
cvtsi2sd %rax,%xmm1
movsd  0xec4(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sslCalcTimevalDiff>:
mov    (%rdi),%rax
mov    0x8(%rdi),%rcx
sub    0x8(%rsi),%rcx
cvtsi2sd %rcx,%xmm1
sub    (%rsi),%rax
cvtsi2sd %rax,%xmm0
divsd  0xee0(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @sslCalcTimevalDiff(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load %struct.timeval*, %struct.timeval** %3
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
%7 = load i64, i64* %6
%8 = load %struct.timeval*, %struct.timeval** %4
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 1
%10 = load i64, i64* %9
%11 = sub nsw i64 %7, %10
%12 = sitofp i64 %11 to double
%13 = load %struct.timeval*, %struct.timeval** %3
%14 = getelementptr inbounds %struct.timeval, %struct.timeval* %13, i32 0, i32 0
%15 = load i64, i64* %14
%16 = load %struct.timeval*, %struct.timeval** %4
%17 = getelementptr inbounds %struct.timeval, %struct.timeval* %16, i32 0, i32 0
%18 = load i64, i64* %17
%19 = sub nsw i64 %15, %18
%20 = sitofp i64 %19 to double
%21 = fdiv double %20, 1.000000e+06
%22 = fadd double %12, %21
ret double %22
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @sslCalcTimevalDiff(%struct.timeval* nocapture %0, %struct.timeval* nocapture %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%4 = load i64, i64* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%6 = load i64, i64* %5
%7 = sub nsw i64 %4, %6
%8 = sitofp i64 %7 to double
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%10 = load i64, i64* %9
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%12 = load i64, i64* %11
%13 = sub nsw i64 %10, %12
%14 = sitofp i64 %13 to double
%15 = fdiv double %14, 1.000000e+06
%16 = fadd double %15, %8
ret double %16
}
/* Variables and functions */
int /*<<< orphan*/ blinkdash();
int /*<<< orphan*/ blinkdot();
int /*<<< orphan*/ sleep(double);
int blinkN() {
  blinkdash();
  blinkdot();
  sleep(1.5);
  return 0;
}


x86 assembly (clang, -O0):
<blinkN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <blinkdash@plt>
mov    $0x0,%al
call   1030 <blinkdot@plt>
movsd  0xeb6(%rip),%xmm0
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blinkN>:
push   %rax
xor    %eax,%eax
call   1040 <blinkdash@plt>
xor    %eax,%eax
call   1030 <blinkdot@plt>
movsd  0xeb9(%rip),%xmm0
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @blinkN() {
%1 = call i32 (...) @blinkdash()
%2 = call i32 (...) @blinkdot()
%3 = call i32 @sleep(double 1.500000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @blinkN() {
%1 = tail call i32 (...) @blinkdash()
%2 = tail call i32 (...) @blinkdot()
%3 = tail call i32 @sleep(double 1.500000e+00)
ret i32 0
}
const char *rte_version(void) {
  static char version[32];
  if (version[0] != 0)
    return version;
  if (strlen("") == 0)
    snprintf(version, sizeof(version), "%s %d.%02d.%d", "DPDK", 17, 8, 0);
  else
    snprintf(version, sizeof(version), "%s %d.%02d.%d%s%d", "DPDK", 17, 8, 0,
             "", 16 < 16 ? 16 : 16 - 16);
  return version;
}


x86 assembly (clang, -O0):
<rte_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsbl 0x2f21(%rip),%eax
cmp    $0x0,%eax
je     1138 <rte_version+0x28>
lea    0x2f11(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1179 <rte_version+0x69>
lea    0x2f01(%rip),%rdi
mov    $0x20,%esi
lea    0xeb5(%rip),%rdx
lea    0xebc(%rip),%rcx
mov    $0x11,%r8d
mov    $0x8,%r9d
xor    %eax,%eax
movl   $0x0,(%rsp)
mov    $0x0,%al
call   1030 <snprintf@plt>
lea    0x2ecb(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rte_version>:
push   %rax
cmpb   $0x0,0x2f28(%rip)
jne    114e <rte_version+0x3e>
movl   $0x0,(%rsp)
lea    0x2f18(%rip),%rdi
lea    0xed1(%rip),%rdx
lea    0xed8(%rip),%rcx
mov    $0x20,%esi
mov    $0x11,%r8d
mov    $0x8,%r9d
xor    %eax,%eax
call   1030 <snprintf@plt>
lea    0x2eeb(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@rte_version.version = internal global [32 x i8] zeroinitializer
@.str = [14 x i8] c"%s %d.%02d.%d\00"
@.str.1 = [5 x i8] c"DPDK\00"
define i8* @rte_version() {
%1 = alloca i8*
%2 = load i8, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @rte_version.version, i64 0, i64 0)
%3 = sext i8 %2 to i32
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i8* getelementptr inbounds ([32 x i8], [32 x i8]* @rte_version.version, i64 0, i64 0), i8** %1
br label %8
6: ; preds = %0
%7 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @rte_version.version, i64 0, i64 0), i64 32, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 17, i32 8, i32 0)
store i8* getelementptr inbounds ([32 x i8], [32 x i8]* @rte_version.version, i64 0, i64 0), i8** %1
br label %8
8: ; preds = %6, %5
%9 = load i8*, i8** %1
ret i8* %9
}

LLVM IR (-O2):
@rte_version.version = internal global [32 x i8] zeroinitializer
@.str = [14 x i8] c"%s %d.%02d.%d\00"
@.str.1 = [5 x i8] c"DPDK\00"
define i8* @rte_version() {
%1 = load i8, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @rte_version.version, i64 0, i64 0)
%2 = icmp eq i8 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (i8*, i64, i8*, ...) @snprintf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @rte_version.version, i64 0, i64 0), i64 32, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 17, i32 8, i32 0)
br label %5
5: ; preds = %0, %3
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @rte_version.version, i64 0, i64 0)
}
void FlashIntEnable(unsigned long ulIntFlags) {
  (*((volatile unsigned long *)(0x400FD010))) |= ulIntFlags;
}


x86 assembly (clang, -O0):
<FlashIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x400fd010,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0x400fd010,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlashIntEnable>:
or     %rdi,0x400fd010
40
ret

LLVM IR (-O0):
define void @FlashIntEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1074778128 to i64*)
%5 = or i64 %4, %3
store volatile i64 %5, i64* inttoptr (i64 1074778128 to i64*)
ret void
}

LLVM IR (-O2):
define void @FlashIntEnable(i64 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1074778128 to i64*)
%3 = or i64 %2, %0
store volatile i64 %3, i64* inttoptr (i64 1074778128 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_action(char *, char *);
void init() { add_action("do_enter", "enter"); }


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

x86 assembly (clang, -O2):
<init>:
lea    0xee9(%rip),%rdi
lea    0xee5(%rip),%rsi
jmp    1030 <add_action@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"do_enter\00"
@.str.1 = [6 x i8] c"enter\00"
define void @init() {
%1 = call i32 @add_action(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"do_enter\00"
@.str.1 = [6 x i8] c"enter\00"
define void @init() {
%1 = tail call i32 @add_action(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *const);
void p_free(void *const ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @p_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void jit_flush_code(void *dest, void *end) {}


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

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

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

LLVM IR (-O2):
define void @jit_flush_code(i8* nocapture %0, i8* nocapture %1) {
ret void
}
unsigned int get_16(unsigned char const *p) {
  return ((unsigned int)p[1] | (((unsigned int)p[0]) << 8));
}


x86 assembly (clang, -O0):
<get_16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_16>:
movzwl (%rdi),%eax
shl    $0x10,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @get_16(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
%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 = shl i32 %10, 8
%12 = or i32 %6, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @get_16(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = load i8, i8* %0
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %4
ret i32 %8
}
/* Type definitions */
struct shash_node {
  int dummy;
};
struct shash {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ hash_name(char const *);
struct shash_node *shash_find__(struct shash const *, char const *,
                                int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
struct shash_node *shash_find(const struct shash *sh, const char *name) {
  return shash_find__(sh, name, strlen(name), hash_name(name));
}


x86 assembly (clang, -O0):
<shash_find>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <hash_name@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    %eax,%ecx
call   1040 <shash_find__@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shash_find>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <hash_name@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <shash_find__@plt>

LLVM IR (-O0):
%struct.shash_node = type { i32 }
%struct.shash = type { i32 }
define %struct.shash_node* @shash_find(%struct.shash* %0, i8* %1) {
%3 = alloca %struct.shash*
%4 = alloca i8*
store %struct.shash* %0, %struct.shash** %3
store i8* %1, i8** %4
%5 = load %struct.shash*, %struct.shash** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = load i8*, i8** %4
%10 = call i32 @hash_name(i8* %9)
%11 = call %struct.shash_node* @shash_find__(%struct.shash* %5, i8* %6, i32 %8, i32 %10)
ret %struct.shash_node* %11
}

LLVM IR (-O2):
%struct.shash_node = type { i32 }
%struct.shash = type { i32 }
define %struct.shash_node* @shash_find(%struct.shash* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @hash_name(i8* %1)
%5 = tail call %struct.shash_node* @shash_find__(%struct.shash* %0, i8* %1, i32 %3, i32 %4)
ret %struct.shash_node* %5
}
int main() {
  volatile int a = 0;
  long long b = 2147483648LL;
  int c = a % 2;
  int x = ((int)-b + c) % -2147483647;
  if (x != -1)
    __builtin_abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x80000000,%eax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
sub    -0x10(%rbp),%rax
add    -0x14(%rbp),%eax
mov    $0x80000001,%ecx
cltd
idiv   %ecx
mov    %edx,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
je     1160 <main+0x50>
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
mov    0x4(%rsp),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0x7ffffffe,%ecx
sub    %ecx,%eax
mov    %eax,%ecx
or     $0x80000000,%ecx
shl    $0x1f,%eax
sub    %eax,%ecx
add    $0x80000001,%ecx
cmp    $0x3,%ecx
jae    1148 <main+0x38>
xor    %eax,%eax
pop    %rcx
ret
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store volatile i32 0, i32* %2
store i64 2147483648, i64* %3
%6 = load volatile i32, i32* %2
%7 = srem i32 %6, 2
store i32 %7, i32* %4
%8 = load i64, i64* %3
%9 = sub nsw i64 0, %8
%10 = trunc i64 %9 to i32
%11 = load i32, i32* %4
%12 = add nsw i32 %10, %11
%13 = srem i32 %12, -2147483647
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = icmp ne i32 %14, -1
br i1 %15, label %16, label %17
16: ; preds = %0
unreachable
17: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 0, i32* %1
%3 = load volatile i32, i32* %1
%4 = srem i32 %3, 2
%5 = or i32 %4, -2147483648
%6 = sub i32 0, %5
%7 = urem i32 %6, 2147483647
%8 = icmp eq i32 %7, 1
br i1 %8, label %10, label %9
9: ; preds = %0
tail call void @abort()
unreachable
10: ; preds = %0
ret i32 0
}
/* Variables and functions */
int LZ5_decompress_usingDict_generic(char const *, char *, int, int, int,
                                     char const *, int);
int LZ5_decompress_safe_usingDict(const char *source, char *dest,
                                  int compressedSize, int maxOutputSize,
                                  const char *dictStart, int dictSize) {
  return LZ5_decompress_usingDict_generic(
      source, dest, compressedSize, maxOutputSize, 1, dictStart, dictSize);
}


x86 assembly (clang, -O0):
<LZ5_decompress_safe_usingDict>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x20(%rbp),%r9
mov    -0x24(%rbp),%eax
mov    $0x1,%r8d
mov    %eax,(%rsp)
call   1030 <LZ5_decompress_usingDict_generic@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LZ5_decompress_safe_usingDict>:
push   %rax
mov    %r8,%rax
mov    %r9d,(%rsp)
mov    $0x1,%r8d
mov    %rax,%r9
call   1030 <LZ5_decompress_usingDict_generic@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @LZ5_decompress_safe_usingDict(i8* %0, i8* %1, i32 %2, i32 %3, i8* %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
store i8* %0, i8** %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i8* %4, i8** %11
store i32 %5, i32* %12
%13 = load i8*, i8** %7
%14 = load i8*, i8** %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = load i8*, i8** %11
%18 = load i32, i32* %12
%19 = call i32 @LZ5_decompress_usingDict_generic(i8* %13, i8* %14, i32 %15, i32 %16, i32 1, i8* %17, i32 %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @LZ5_decompress_safe_usingDict(i8* %0, i8* %1, i32 %2, i32 %3, i8* %4, i32 %5) {
%7 = tail call i32 @LZ5_decompress_usingDict_generic(i8* %0, i8* %1, i32 %2, i32 %3, i32 1, i8* %4, i32 %5)
ret i32 %7
}
/* Variables and functions */
const char **_glxapi_get_extensions(void) {
  static const char *extensions[] = {NULL};
  return extensions;
}


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

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

LLVM IR (-O0):
@_glxapi_get_extensions.extensions = internal global [1 x i8*] zeroinitializer
define i8** @_glxapi_get_extensions() {
ret i8** getelementptr inbounds ([1 x i8*], [1 x i8*]* @_glxapi_get_extensions.extensions, i64 0, i64 0)
}

LLVM IR (-O2):
@_glxapi_get_extensions.extensions = internal global [1 x i8*] zeroinitializer
define i8** @_glxapi_get_extensions() {
ret i8** getelementptr inbounds ([1 x i8*], [1 x i8*]* @_glxapi_get_extensions.extensions, i64 0, i64 0)
}
/* Variables and functions */
int plat_midi_get_num_devs();
int system_midi_available(void) { return plat_midi_get_num_devs(); }


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

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

LLVM IR (-O0):
define i32 @system_midi_available() {
%1 = call i32 (...) @plat_midi_get_num_devs()
ret i32 %1
}

LLVM IR (-O2):
define i32 @system_midi_available() {
%1 = tail call i32 (...) @plat_midi_get_num_devs()
ret i32 %1
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
scalar_t__ fork();
int main() {
  pid_t child_pid;
  child_pid = fork();
  if (child_pid > 0) {
    return 0;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <fork@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    1141 <main+0x31>
movl   $0x0,-0x4(%rbp)
jmp    1148 <main+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @fork()
ret i32 0
}
void test_address_space_condition(int volatile
                                  __attribute__((address_space(256))) *
                                  cpu_data) {
  if (cpu_data == 0) {
    *cpu_data = 3;
  }
}


x86 assembly (clang, -O0):
<test_address_space_condition>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    111e <test_address_space_condition+0x1e>
mov    -0x8(%rbp),%rax
movl   $0x3,%gs:(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_address_space_condition>:
test   %rdi,%rdi
je     1106 <test_address_space_condition+0x6>
ret
movl   $0x3,%gs:0x0
ret

LLVM IR (-O0):
define void @test_address_space_condition(i32 addrspace(256)* %0) {
%2 = alloca i32 addrspace(256)*
store i32 addrspace(256)* %0, i32 addrspace(256)** %2
%3 = load i32 addrspace(256)*, i32 addrspace(256)** %2
%4 = icmp eq i32 addrspace(256)* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32 addrspace(256)*, i32 addrspace(256)** %2
store volatile i32 3, i32 addrspace(256)* %6
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @test_address_space_condition(i32 addrspace(256)* readnone %0) {
%2 = icmp eq i32 addrspace(256)* %0, null
br i1 %2, label %3, label %4
3: ; preds = %1
store volatile i32 3, i32 addrspace(256)* null
br label %4
4: ; preds = %3, %1
ret void
}
unsigned int HibernateIsActive(void) {
  return ((*((volatile unsigned long *)(0x400FC010))) & 0x00000040 ? 1 : 0);
}


x86 assembly (clang, -O0):
<HibernateIsActive>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fc010,%eax
mov    (%rax),%rdx
and    $0x40,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateIsActive>:
mov    0x400fc010,%rax
40
shr    $0x6,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @HibernateIsActive() {
%1 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%2 = and i64 %1, 64
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 1, i32 0
ret i32 %5
}

LLVM IR (-O2):
define i32 @HibernateIsActive() {
%1 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%2 = trunc i64 %1 to i32
%3 = lshr i32 %2, 6
%4 = and i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int MenuFontToHandle(int);
int trap_R_Font_StrLenPixels(char const *, int, float);
int CG_Text_Width(const char *text, float scale, int iMenuFont) {
  int iFontIndex = MenuFontToHandle(iMenuFont);
  return trap_R_Font_StrLenPixels(text, iFontIndex, scale);
}


x86 assembly (clang, -O0):
<CG_Text_Width>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <MenuFontToHandle@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
movss  -0xc(%rbp),%xmm0
call   1040 <trap_R_Font_StrLenPixels@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_Text_Width>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <MenuFontToHandle@plt>
mov    %rbx,%rdi
mov    %eax,%esi
movss  0xc(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
jmp    1040 <trap_R_Font_StrLenPixels@plt>

LLVM IR (-O0):
define i32 @CG_Text_Width(i8* %0, float %1, i32 %2) {
%4 = alloca i8*
%5 = alloca float
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store float %1, float* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @MenuFontToHandle(i32 %8)
store i32 %9, i32* %7
%10 = load i8*, i8** %4
%11 = load i32, i32* %7
%12 = load float, float* %5
%13 = call i32 @trap_R_Font_StrLenPixels(i8* %10, i32 %11, float %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @CG_Text_Width(i8* %0, float %1, i32 %2) {
%4 = tail call i32 @MenuFontToHandle(i32 %2)
%5 = tail call i32 @trap_R_Font_StrLenPixels(i8* %0, i32 %4, float %1)
ret i32 %5
}
int header_size() { return 13; }


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

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

LLVM IR (-O0):
define i32 @header_size() {
ret i32 13
}

LLVM IR (-O2):
define i32 @header_size() {
ret i32 13
}
/* Variables and functions */
int /*<<< orphan*/ proxyLogSetThreadName(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
void setIOThreadName(int ioThreadNumber) {
  char threadNameBuffer[80];
  snprintf(threadNameBuffer, 80, "io-%d", ioThreadNumber);
  proxyLogSetThreadName(threadNameBuffer);
}


x86 assembly (clang, -O0):
<setIOThreadName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x50,%esi
lea    0xec2(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x60(%rbp),%rdi
call   1030 <proxyLogSetThreadName@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setIOThreadName>:
push   %rbx
sub    $0x50,%rsp
mov    %edi,%ecx
lea    0xed2(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <proxyLogSetThreadName@plt>
add    $0x50,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"io-%d\00"
define void @setIOThreadName(i32 %0) {
%2 = alloca [80 x i8]
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 80, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @proxyLogSetThreadName(i8* %3)
ret void
}
/* Type definitions */
struct mdoc_node {
  int dummy;
};
struct mdoc_meta {
  int dummy;
};
struct html {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ print_text(struct html *, char *);
int mdoc_bt_pre(const struct mdoc_meta *m, const struct mdoc_node *n,
                struct html *h) {
  print_text(h, "is currently in beta test.");
  return (0);
}


x86 assembly (clang, -O0):
<mdoc_bt_pre>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xed1(%rip),%rsi
call   1030 <print_text@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdoc_bt_pre>:
push   %rax
mov    %rdx,%rdi
lea    0xee5(%rip),%rsi
call   1030 <print_text@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.mdoc_meta = type { i32 }
%struct.mdoc_node = type { i32 }
%struct.html = type { i32 }
@.str = [27 x i8] c"is currently in beta test.\00"
define i32 @mdoc_bt_pre(%struct.mdoc_meta* %0, %struct.mdoc_node* %1, %struct.html* %2) {
%4 = alloca %struct.mdoc_meta*
%5 = alloca %struct.mdoc_node*
%6 = alloca %struct.html*
store %struct.mdoc_meta* %0, %struct.mdoc_meta** %4
store %struct.mdoc_node* %1, %struct.mdoc_node** %5
store %struct.html* %2, %struct.html** %6
%7 = load %struct.html*, %struct.html** %6
%8 = call i32 @print_text(%struct.html* %7, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.mdoc_meta = type { i32 }
%struct.mdoc_node = type { i32 }
%struct.html = type { i32 }
@.str = [27 x i8] c"is currently in beta test.\00"
define i32 @mdoc_bt_pre(%struct.mdoc_meta* nocapture readnone %0, %struct.mdoc_node* nocapture readnone %1, %struct.html* %2) {
%4 = tail call i32 @print_text(%struct.html* %2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void f1(int a) {
  _Bool v1 = (a == 3);
  _Bool v2 = (a == 1);
  _Bool v3 = (a == 4);
  _Bool v4 = (a == 2);
  if (v1 || v2 || v3 || v4)
    foo();
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
sete   %al
and    $0x1,%al
mov    %al,-0x5(%rbp)
cmpl   $0x1,-0x4(%rbp)
sete   %al
and    $0x1,%al
mov    %al,-0x6(%rbp)
cmpl   $0x4,-0x4(%rbp)
sete   %al
and    $0x1,%al
mov    %al,-0x7(%rbp)
cmpl   $0x2,-0x4(%rbp)
sete   %al
and    $0x1,%al
mov    %al,-0x8(%rbp)
testb  $0x1,-0x5(%rbp)
jne    1173 <f1+0x63>
testb  $0x1,-0x6(%rbp)
jne    1173 <f1+0x63>
testb  $0x1,-0x7(%rbp)
jne    1173 <f1+0x63>
testb  $0x1,-0x8(%rbp)
je     117a <f1+0x6a>
mov    $0x0,%al
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
add    $0xffffffff,%edi
cmp    $0x3,%edi
ja     111f <f1+0xf>
xor    %eax,%eax
jmp    1030 <foo@plt>
ret

LLVM IR (-O0):
define void @f1(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i32 %0, i32* %2
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 3
%9 = zext i1 %8 to i8
store i8 %9, i8* %3
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 1
%12 = zext i1 %11 to i8
store i8 %12, i8* %4
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 4
%15 = zext i1 %14 to i8
store i8 %15, i8* %5
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 2
%18 = zext i1 %17 to i8
store i8 %18, i8* %6
%19 = load i8, i8* %3
%20 = trunc i8 %19 to i1
br i1 %20, label %30, label %21
21: ; preds = %1
%22 = load i8, i8* %4
%23 = trunc i8 %22 to i1
br i1 %23, label %30, label %24
24: ; preds = %21
%25 = load i8, i8* %5
%26 = trunc i8 %25 to i1
br i1 %26, label %30, label %27
27: ; preds = %24
%28 = load i8, i8* %6
%29 = trunc i8 %28 to i1
br i1 %29, label %30, label %32
30: ; preds = %27, %24, %21, %1
%31 = call i32 (...) @foo()
br label %32
32: ; preds = %30, %27
ret void
}

LLVM IR (-O2):
define void @f1(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 4
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @foo()
br label %6
6: ; preds = %1, %4
ret void
}