xunge/DecIR huggingface dataset:
int test_imm_73int64_lowword_reg(long long val) {
  return ((val) & (0x73 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_73int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 115
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *malloc(size_t);
void *xmalloc(size_t l) {
  void *p = malloc(l);
  if (p == NULL) {
    abort();
  }
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <xmalloc+0x2b>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     112d <xmalloc+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int strcmp(char const *, char const *);
int list_comparator_string(const void *a, const void *b) {
  return strcmp((const char *)b, (const char *)a);
}


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

x86 assembly (clang, -O2):
<list_comparator_string>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @list_comparator_string(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @strcmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @list_comparator_string(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %1, i8* dereferenceable(1) %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *x_getkey();
void process_keystrokes(void) {
  char *cp;
  while ((cp = x_getkey())) {
    printf("X: Keys pressed: %s\n", cp);
  }
}


x86 assembly (clang, -O0):
<process_keystrokes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <x_getkey@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     1152 <process_keystrokes+0x32>
mov    -0x8(%rbp),%rsi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
jmp    1128 <process_keystrokes+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_keystrokes>:
push   %rbx
xor    %eax,%eax
call   1040 <x_getkey@plt>
test   %rax,%rax
je     1157 <process_keystrokes+0x37>
lea    0xecc(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <x_getkey@plt>
test   %rax,%rax
jne    1140 <process_keystrokes+0x20>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"X: Keys pressed: %s\0A\00"
define void @process_keystrokes() {
%1 = alloca i8*
br label %2
2: ; preds = %5, %0
%3 = call i8* (...) @x_getkey()
store i8* %3, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i8*, i8** %1
%7 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %2
8: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"X: Keys pressed: %s\0A\00"
define void @process_keystrokes() {
%1 = tail call i8* (...) @x_getkey()
%2 = icmp eq i8* %1, null
br i1 %2, label %8, label %3
3: ; preds = %0, %3
%4 = phi i8* [ %6, %3 ], [ %1, %0 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = tail call i8* (...) @x_getkey()
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %3
8: ; preds = %3, %0
ret void
}
unsigned xrop3_38_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = T & S;
  stk2 = D | stk3;
  stk1 = S ^ stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_38_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_38_1_1>:
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %edi,%esi
mov    %edi,%ecx
not    %cl
movzbl %cl,%ecx
not    %eax
and    %ecx,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_38_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = load i32, i32* %6
%25 = and i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %5
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %6
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = xor i32 %33, -1
%35 = and i32 %32, %34
%36 = load i32, i32* %7
%37 = xor i32 %36, -1
%38 = and i32 %35, %37
%39 = load i32, i32* %5
%40 = load i32, i32* %6
%41 = and i32 %39, %40
%42 = or i32 %38, %41
%43 = load i32, i32* %5
%44 = load i32, i32* %7
%45 = and i32 %43, %44
%46 = or i32 %42, %45
ret i32 %46
}

LLVM IR (-O2):
define i32 @xrop3_38_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %1 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = xor i8 %0, -1
%6 = zext i8 %5 to i32
%7 = xor i32 %4, -1
%8 = and i32 %6, %7
%9 = or i8 %1, %0
%10 = zext i8 %9 to i32
%11 = or i32 %8, %10
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int be16dec(int /*<<< orphan*/ const *);
uint32_t be32dec(const void *buf) {
  const uint8_t *p = buf;
  return (((uint32_t)be16dec(p)) << 16) | be16dec(p + 2);
}


x86 assembly (clang, -O0):
<be32dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <be16dec@plt>
shl    $0x10,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x8,%rdi
call   1030 <be16dec@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
or     %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<be32dec>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <be16dec@plt>
mov    %eax,%ebp
shl    $0x10,%ebp
add    $0x8,%rbx
mov    %rbx,%rdi
call   1030 <be16dec@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @be32dec(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @be16dec(i32* %6)
%8 = shl i32 %7, 16
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 2
%11 = call i32 @be16dec(i32* %10)
%12 = or i32 %8, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @be32dec(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @be16dec(i32* %2)
%4 = shl i32 %3, 16
%5 = getelementptr inbounds i8, i8* %0, i64 8
%6 = bitcast i8* %5 to i32*
%7 = tail call i32 @be16dec(i32* %6)
%8 = or i32 %4, %7
ret i32 %8
}
/* Variables and functions */
scalar_t__ GL_TRUE;
scalar_t__ glIsEnabled(unsigned int);
unsigned char IsEnabled(unsigned int cap) {
  return glIsEnabled(cap) == GL_TRUE ? 0x1 : 0x0;
}


x86 assembly (clang, -O0):
<IsEnabled>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <glIsEnabled@plt>
mov    %rax,%rdx
mov    0x2eb3(%rip),%rax
mov    (%rax),%rsi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsEnabled>:
push   %rax
call   1030 <glIsEnabled@plt>
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
@GL_TRUE = global i64 0
define zeroext i8 @IsEnabled(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @glIsEnabled(i32 %3)
%5 = load i64, i64* @GL_TRUE
%6 = icmp eq i64 %4, %5
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 1, i32 0
%9 = trunc i32 %8 to i8
ret i8 %9
}

LLVM IR (-O2):
@GL_TRUE = global i64 0
define zeroext i8 @IsEnabled(i32 %0) {
%2 = tail call i64 @glIsEnabled(i32 %0)
%3 = load i64, i64* @GL_TRUE
%4 = icmp eq i64 %2, %3
%5 = zext i1 %4 to i8
ret i8 %5
}
/* Type definitions */
struct opt_args {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct opt_args *);
void opt_args_free(struct opt_args *args) { free(args); }


x86 assembly (clang, -O0):
<opt_args_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):
<opt_args_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.opt_args = type { i32 }
define void @opt_args_free(%struct.opt_args* nocapture %0) {
%2 = tail call i32 @free(%struct.opt_args* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *realloc(void *, size_t);
void *checked_realloc(void *ptr, size_t nmemb, size_t size) {
  void *p;
  if (size > ((size_t)-1) / nmemb)
    abort();
  p = realloc(ptr, nmemb * size);
  if (!p)
    abort();
  return p;
}


x86 assembly (clang, -O0):
<checked_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0xffffffffffffffff,%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
jbe    1162 <checked_realloc+0x42>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
imul   -0x18(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    118a <checked_realloc+0x6a>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checked_realloc>:
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rax
mul    %rdx
jo     113f <checked_realloc+0x1f>
imul   %rsi,%rcx
mov    %rcx,%rsi
call   1040 <realloc@plt>
test   %rax,%rax
je     113f <checked_realloc+0x1f>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @checked_realloc(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64, i64* %6
%9 = load i64, i64* %5
%10 = udiv i64 -1, %9
%11 = icmp ugt i64 %8, %10
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %3
%15 = load i8*, i8** %4
%16 = load i64, i64* %5
%17 = load i64, i64* %6
%18 = mul i64 %16, %17
%19 = call i8* @realloc(i8* %15, i64 %18)
store i8* %19, i8** %7
%20 = load i8*, i8** %7
%21 = icmp ne i8* %20, null
br i1 %21, label %24, label %22
22: ; preds = %14
%23 = call i32 (...) @abort()
unreachable
24: ; preds = %14
%25 = load i8*, i8** %7
ret i8* %25
}

LLVM IR (-O2):
define noalias i8* @checked_realloc(i8* nocapture %0, i64 %1, i64 %2) {
%4 = tail call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %1, i64 %2)
%5 = extractvalue { i64, i1 } %4, 1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %3
%9 = mul i64 %2, %1
%10 = tail call i8* @realloc(i8* %0, i64 %9)
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = tail call i32 (...) @abort()
unreachable
14: ; preds = %8
ret i8* %10
}
int less_than_5(int x) { return x < 5; }


x86 assembly (clang, -O0):
<less_than_5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<less_than_5>:
xor    %eax,%eax
cmp    $0x5,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @less_than_5(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 5
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @less_than_5(i32 %0) {
%2 = icmp slt i32 %0, 5
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exits(char *, int);
void exits1(char *s) { exits(s, -1); }


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

x86 assembly (clang, -O2):
<exits1>:
mov    $0xffffffff,%esi
jmp    1030 <exits@plt>

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

LLVM IR (-O2):
define void @exits1(i8* %0) {
%2 = tail call i32 @exits(i8* %0, i32 -1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pcibios_write_config_byte(int /*<<< orphan*/, scalar_t__,
                                             int, int);
void set_mbfs(void) {
  pcibios_write_config_byte(0, ((0x00 << 3) + 0), 0xca, 0xff);
  pcibios_write_config_byte(0, ((0x00 << 3) + 0), 0xcb, 0xff);
  pcibios_write_config_byte(0, ((0x00 << 3) + 0), 0xcc, 0x7f);
}


x86 assembly (clang, -O0):
<set_mbfs>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xca,%edx
mov    $0xff,%ecx
call   1030 <pcibios_write_config_byte@plt>
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xcb,%edx
mov    $0xff,%ecx
call   1030 <pcibios_write_config_byte@plt>
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xcc,%edx
mov    $0x7f,%ecx
call   1030 <pcibios_write_config_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_mbfs>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
mov    $0xca,%edx
mov    $0xff,%ecx
call   1030 <pcibios_write_config_byte@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    $0xcb,%edx
mov    $0xff,%ecx
call   1030 <pcibios_write_config_byte@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    $0xcc,%edx
mov    $0x7f,%ecx
pop    %rax
jmp    1030 <pcibios_write_config_byte@plt>

LLVM IR (-O0):
define void @set_mbfs() {
%1 = call i32 @pcibios_write_config_byte(i32 0, i64 0, i32 202, i32 255)
%2 = call i32 @pcibios_write_config_byte(i32 0, i64 0, i32 203, i32 255)
%3 = call i32 @pcibios_write_config_byte(i32 0, i64 0, i32 204, i32 127)
ret void
}

LLVM IR (-O2):
define void @set_mbfs() {
%1 = tail call i32 @pcibios_write_config_byte(i32 0, i64 0, i32 202, i32 255)
%2 = tail call i32 @pcibios_write_config_byte(i32 0, i64 0, i32 203, i32 255)
%3 = tail call i32 @pcibios_write_config_byte(i32 0, i64 0, i32 204, i32 127)
ret void
}
double test_linear_model(float a, float h) { return a * h; }


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

x86 assembly (clang, -O2):
<test_linear_model>:
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @test_linear_model(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fmul float %5, %6
%8 = fpext float %7 to double
ret double %8
}

LLVM IR (-O2):
define double @test_linear_model(float %0, float %1) {
%3 = fmul float %0, %1
%4 = fpext float %3 to double
ret double %4
}
/* Variables and functions */
scalar_t__ strncasecmp(char *, char *, int);
void strncasecmp_0() {
  char *x = "abc";
  char *y = "Abc";
  if (strncasecmp(x, y, 3) != 0)
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<strncasecmp_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x3,%edx
call   1030 <strncasecmp@plt>
cmp    $0x0,%rax
je     114a <strncasecmp_0+0x3a>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
@.str.1 = [4 x i8] c"Abc\00"
define void @strncasecmp_0() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i64 @strncasecmp(i8* %3, i8* %4, i32 3)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = load i8, i8* null
br label %9
9: ; preds = %7, %0
ret void
}

LLVM IR (-O2):
define void @strncasecmp_0() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put_char(char);
void putc(char c) { put_char(c); }


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <put_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
jmp    1030 <put_char@plt>

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

LLVM IR (-O2):
define void @putc(i8 signext %0) {
%2 = tail call i32 @put_char(i8 signext %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ u_short;
struct TYPE_2__ {
  int /*<<< orphan*/ s_addr;
};
struct ip {
  TYPE_1__ ip_src;
};

/* Variables and functions */
scalar_t__ dontchksum(int /*<<< orphan*/);
int /*<<< orphan*/ ip_check_ext(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
u_short ip_fast_csum(u_short *addr, int len) {
  if (dontchksum(((struct ip *)addr)->ip_src.s_addr))
    return 0;
  return ip_check_ext(addr, len << 2, 0);
}


x86 assembly (clang, -O0):
<ip_fast_csum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <dontchksum@plt>
cmp    $0x0,%rax
je     1150 <ip_fast_csum+0x30>
movl   $0x0,-0x4(%rbp)
jmp    1164 <ip_fast_csum+0x44>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
shl    $0x2,%esi
xor    %edx,%edx
call   1040 <ip_check_ext@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip_fast_csum>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <dontchksum@plt>
test   %rax,%rax
je     113d <ip_fast_csum+0x1d>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
shl    $0x2,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %edx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <ip_check_ext@plt>

LLVM IR (-O0):
%struct.ip = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32 }
define i32 @ip_fast_csum(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%6 = load i32*, i32** %4
%7 = bitcast i32* %6 to %struct.ip*
%8 = getelementptr inbounds %struct.ip, %struct.ip* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i64 @dontchksum(i32 %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 0, i32* %3
br label %19
14: ; preds = %2
%15 = load i32*, i32** %4
%16 = load i32, i32* %5
%17 = shl i32 %16, 2
%18 = call i32 @ip_check_ext(i32* %15, i32 %17, i32 0)
store i32 %18, i32* %3
br label %19
19: ; preds = %14, %13
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @ip_fast_csum(i32* %0, i32 %1) {
%3 = load i32, i32* %0
%4 = tail call i64 @dontchksum(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = shl i32 %1, 2
%8 = tail call i32 @ip_check_ext(i32* %0, i32 %7, i32 0)
br label %9
9: ; preds = %2, %6
%10 = phi i32 [ %8, %6 ], [ 0, %2 ]
ret i32 %10
}
/* Type definitions */
struct download_buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct download_buffer *);
void free_buffer(struct download_buffer *buf) { free(buf); }


x86 assembly (clang, -O0):
<free_buffer>:
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):
<free_buffer>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.download_buffer = type { i32 }
define void @free_buffer(%struct.download_buffer* nocapture %0) {
%2 = tail call i32 @free(%struct.download_buffer* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ex1();
int /*<<< orphan*/ system(char *);
int main(void) {
  ex1();
  system("pause");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @ex1()
%3 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"pause\00"
define i32 @main() {
%1 = tail call i32 (...) @ex1()
%2 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int foo1(void) {
  union {
    char a[sizeof(unsigned)];
    unsigned b;
  } u;
  u.b = 0x01;
  return u.a[0];
}


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

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

LLVM IR (-O0):
%union.anon = type { i32 }
define i32 @foo1() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i32*
store i32 1, i32* %2
%3 = bitcast %union.anon* %1 to [4 x i8]*
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
ret i32 %6
}

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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *);
int get_matrix_size(const char *filename) {
  FILE *file;
  int tam = 0;
  file = fopen(filename, "r");
  fscanf(file, "%d", &tam);
  fclose(file);
  return tam;
}


x86 assembly (clang, -O0):
<get_matrix_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xea0(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <fscanf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_matrix_size>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xebc(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
lea    0xeaf(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rax,%rdi
call   1040 <fscanf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @get_matrix_size(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = call i32 @fclose(i32* %4)
%7 = load i32, i32* %2
ret i32 %7
}
char *foo2(char *p, unsigned int x) { return p - (x & 6); }


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
and    $0x6,%ecx
mov    %ecx,%ecx
mov    %ecx,%edx
xor    %ecx,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo2>:
mov    %rdi,%rax
and    $0x6,%esi
sub    %rsi,%rax
ret

LLVM IR (-O0):
define i8* @foo2(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = and i32 %6, 6
%8 = zext i32 %7 to i64
%9 = sub i64 0, %8
%10 = getelementptr inbounds i8, i8* %5, i64 %9
ret i8* %10
}

LLVM IR (-O2):
define i8* @foo2(i8* readnone %0, i32 %1) {
%3 = and i32 %1, 6
%4 = zext i32 %3 to i64
%5 = sub nsw i64 0, %4
%6 = getelementptr inbounds i8, i8* %0, i64 %5
ret i8* %6
}
void ff_hevc_put_hevc_bi_w_qpel_hv24_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_qpel_hv24_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ auth_set_prefix(char *, char *);
void auth_init() { auth_set_prefix("ov", "@+"); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"ov\00"
@.str.1 = [3 x i8] c"@+\00"
define void @auth_init() {
%1 = call i32 @auth_set_prefix(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"ov\00"
@.str.1 = [3 x i8] c"@+\00"
define void @auth_init() {
%1 = tail call i32 @auth_set_prefix(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int cairo_code_draw_envfollowerbg_get_height() { return 420; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_envfollowerbg_get_height() {
ret i32 420
}

LLVM IR (-O2):
define i32 @cairo_code_draw_envfollowerbg_get_height() {
ret i32 420
}
/* Variables and functions */
char *RLE(char *);
int /*<<< orphan*/ printf(char *, char *, char *);
int main() {
  char test_str1[] = "ABBBBCCCCCBBBDDDDDDDDDDDDDDD";
  char *result = RLE(test_str1);
  printf("input %s\noutput %s\n", test_str1, result);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec9(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    0xec4(%rip),%al
mov    %al,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <RLE@plt>
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movups 0xee1(%rip),%xmm0
movups %xmm0,0xd(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <RLE@plt>
lea    0xecf(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.test_str1 = [29 x i8] c"ABBBBCCCCCBBBDDDDDDDDDDDDDDD\00"
@.str = [20 x i8] c"input %s\0Aoutput %s\0A\00"
define i32 @main() {
%1 = alloca [29 x i8]
%2 = alloca i8*
%3 = bitcast [29 x i8]* %1 to i8*
%4 = getelementptr inbounds [29 x i8], [29 x i8]* %1, i64 0, i64 0
%5 = call i8* @RLE(i8* %4)
store i8* %5, i8** %2
%6 = getelementptr inbounds [29 x i8], [29 x i8]* %1, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.test_str1 = [29 x i8] c"ABBBBCCCCCBBBDDDDDDDDDDDDDDD\00"
@.str = [20 x i8] c"input %s\0Aoutput %s\0A\00"
define i32 @main() {
%1 = alloca [29 x i8]
%2 = getelementptr inbounds [29 x i8], [29 x i8]* %1, i64 0, i64 0
%3 = call i8* @RLE(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
int main(void) {
  printf("float的长度: %u\n", (unsigned)sizeof(1.0F));
  printf("double的长度: %u\n", (unsigned)sizeof(1.0));
  printf("long double的长度: %u\n", (unsigned)sizeof(1.0L));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"float\E7\9A\84\E9\95\BF\E5\BA\A6: %u\0A\00"
@.str.1 = [21 x i8] c"double\E7\9A\84\E9\95\BF\E5\BA\A6: %u\0A\00"
@.str.2 = [26 x i8] c"long double\E7\9A\84\E9\95\BF\E5\BA\A6: %u\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 4)
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 8)
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 16)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"float\E7\9A\84\E9\95\BF\E5\BA\A6: %u\0A\00"
@.str.1 = [21 x i8] c"double\E7\9A\84\E9\95\BF\E5\BA\A6: %u\0A\00"
@.str.2 = [26 x i8] c"long double\E7\9A\84\E9\95\BF\E5\BA\A6: %u\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 8)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 16)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bench();
int main() {
  bench();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bench()
ret i32 0
}
void sched_autogroup_exit_task(struct task_struct *p) {}


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

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

LLVM IR (-O0):
%struct.task_struct = type opaque
define void @sched_autogroup_exit_task(%struct.task_struct* %0) {
%2 = alloca %struct.task_struct*
store %struct.task_struct* %0, %struct.task_struct** %2
ret void
}

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @sched_autogroup_exit_task(%struct.task_struct* nocapture %0) {
ret void
}
void rop3_31_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D | S;
  stk1 = T & stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_31_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_31_1_1>:
mov    (%rdi),%al
mov    %edx,%ecx
or     %sil,%cl
not    %cl
and    %al,%sil
or     %cl,%sil
and    %dl,%al
or     %sil,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_31_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = and i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = and i32 %27, %30
%32 = load i8, i8* %6
%33 = zext i8 %32 to i32
%34 = xor i32 %33, -1
%35 = and i32 %31, %34
%36 = load i8*, i8** %4
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = load i8, i8* %5
%40 = zext i8 %39 to i32
%41 = and i32 %38, %40
%42 = or i32 %35, %41
%43 = load i8*, i8** %4
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = load i8, i8* %6
%47 = zext i8 %46 to i32
%48 = and i32 %45, %47
%49 = or i32 %42, %48
%50 = trunc i32 %49 to i8
%51 = load i8*, i8** %4
store i8 %50, i8* %51
ret void
}

LLVM IR (-O2):
define void @rop3_31_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = xor i8 %5, -1
%7 = and i8 %4, %1
%8 = or i8 %7, %6
%9 = and i8 %4, %2
%10 = or i8 %8, %9
store i8 %10, i8* %0
ret void
}
/* Type definitions */
struct Var {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pA(char *, char const *, char const *, char const *);
void __func_lshift_sint(struct Var *avar, const char *areg, const char *lreg,
                        const char *rreg) {
  pA("%s = %s << %s;", areg, lreg, rreg);
}


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

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

LLVM IR (-O0):
%struct.Var = type { i32 }
@.str = [15 x i8] c"%s = %s << %s;\00"
define void @__func_lshift_sint(%struct.Var* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca %struct.Var*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store %struct.Var* %0, %struct.Var** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %6
%10 = load i8*, i8** %7
%11 = load i8*, i8** %8
%12 = call i32 @pA(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i8* %11)
ret void
}

LLVM IR (-O2):
%struct.Var = type { i32 }
@.str = [15 x i8] c"%s = %s << %s;\00"
define void @__func_lshift_sint(%struct.Var* nocapture readnone %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @pA(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3)
ret void
}
void pcie_aspm_powersave_config_link(struct pci_dev *pdev) {}


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

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

LLVM IR (-O0):
%struct.pci_dev = type opaque
define void @pcie_aspm_powersave_config_link(%struct.pci_dev* %0) {
%2 = alloca %struct.pci_dev*
store %struct.pci_dev* %0, %struct.pci_dev** %2
ret void
}

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pcie_aspm_powersave_config_link(%struct.pci_dev* nocapture %0) {
ret void
}
void foo159(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo159(i32 %0) {
ret void
}
int test_imm_20int64_highword_reg(long long val) {
  return ((val >> 32) & (0x20 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_20int64_highword_reg>:
bt     $0x25,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_20int64_highword_reg(i64 %0) {
%2 = and i64 %0, 137438953472
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void V5H_VMI_End(void) {}


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

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

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

LLVM IR (-O2):
define void @V5H_VMI_End() {
ret void
}
unsigned short toVDPColor(unsigned char b, unsigned char g, unsigned char r) {
  r = (r >> 4) & 0xE;
  g = (g >> 4) & 0xE;
  b = (b >> 4) & 0xE;
  return (r << 0) | (g << 4) | (b << 8);
}


x86 assembly (clang, -O0):
<toVDPColor>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
sar    $0x4,%eax
and    $0xe,%eax
mov    %al,-0x3(%rbp)
movzbl -0x2(%rbp),%eax
sar    $0x4,%eax
and    $0xe,%eax
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x4,%eax
and    $0xe,%eax
mov    %al,-0x1(%rbp)
movzbl -0x3(%rbp),%eax
shl    $0x0,%eax
movzbl -0x2(%rbp),%ecx
shl    $0x4,%ecx
or     %ecx,%eax
movzbl -0x1(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toVDPColor>:
shr    $0x4,%dl
and    $0xe,%dl
and    $0xe0,%sil
or     %dl,%sil
shr    $0x4,%dil
and    $0xe,%dil
movzbl %sil,%ecx
movzbl %dil,%eax
shl    $0x8,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i16 @toVDPColor(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = ashr i32 %8, 4
%10 = and i32 %9, 14
%11 = trunc i32 %10 to i8
store i8 %11, i8* %6
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = ashr i32 %13, 4
%15 = and i32 %14, 14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %5
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = ashr i32 %18, 4
%20 = and i32 %19, 14
%21 = trunc i32 %20 to i8
store i8 %21, i8* %4
%22 = load i8, i8* %6
%23 = zext i8 %22 to i32
%24 = shl i32 %23, 0
%25 = load i8, i8* %5
%26 = zext i8 %25 to i32
%27 = shl i32 %26, 4
%28 = or i32 %24, %27
%29 = load i8, i8* %4
%30 = zext i8 %29 to i32
%31 = shl i32 %30, 8
%32 = or i32 %28, %31
%33 = trunc i32 %32 to i16
ret i16 %33
}

LLVM IR (-O2):
define zeroext i16 @toVDPColor(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = lshr i8 %2, 4
%5 = and i8 %4, 14
%6 = and i8 %1, -32
%7 = lshr i8 %0, 4
%8 = and i8 %7, 14
%9 = or i8 %5, %6
%10 = zext i8 %9 to i16
%11 = zext i8 %8 to i16
%12 = shl nuw nsw i16 %11, 8
%13 = or i16 %12, %10
ret i16 %13
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int first_event;
};
typedef TYPE_1__ XExtCodes;

/* Variables and functions */
void set_XExtCodes_first_event(void *_p, int _v) {
  ((XExtCodes *)_p)->first_event = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XExtCodes_first_event>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XExtCodes_first_event(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XExtCodes_first_event(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int write_standard_start_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(14, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<write_standard_start_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xe,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_standard_start_system>:
mov    $0xe,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @write_standard_start_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 14, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @write_standard_start_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 14, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int prc_a1(int a) {
  a = a + 10;
  printf("a+10 [%d]\n", a);
  return a;
}


x86 assembly (clang, -O0):
<prc_a1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prc_a1>:
push   %rbx
lea    0xa(%rdi),%ebx
lea    0xee5(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"a+10 [%d]\0A\00"
define i32 @prc_a1(i32 %0) {
%2 = add nsw i32 %0, 10
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 %2
}