xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int strtol(char const *, char **, int);
int intconv(const char *parameter, const char *datastr) {
  char *endptr;
  int value = strtol(datastr, &endptr, 10);
  if (*endptr != '\0') {
    fprintf(stderr, "Error: %s: invalid argument\n", parameter);
    exit(1);
  }
  return value;
}


x86 assembly (clang, -O0):
<intconv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1188 <intconv+0x58>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe87(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intconv>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rax
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
mov    %rax,%rdi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    0x8(%rsp),%rcx
cmpb   $0x0,(%rcx)
jne    115d <intconv+0x2d>
add    $0x10,%rsp
pop    %rbx
ret
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
lea    0xe93(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"Error: %s: invalid argument\0A\00"
define i32 @intconv(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strtol(i8* %7, i8** %5, i32 10)
store i32 %8, i32* %6
%9 = load i8*, i8** %5
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %2
%14 = load i32, i32* @stderr
%15 = load i8*, i8** %3
%16 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %2
%19 = load i32, i32* %6
ret i32 %19
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"Error: %s: invalid argument\0A\00"
define i32 @intconv(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @strtol(i8* %1, i8** %3, i32 10)
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0)
%12 = tail call i32 @exit(i32 1)
unreachable
13: ; preds = %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ kexit(int /*<<< orphan*/);
int /*<<< orphan*/ kinit();
int kmain() {
  kinit();
  kexit(0);
}


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

x86 assembly (clang, -O2):
<kmain>:
push   %rax
xor    %eax,%eax
call   1040 <kinit@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <kexit@plt>

LLVM IR (-O0):
define i32 @kmain() {
%1 = alloca i32
%2 = call i32 (...) @kinit()
%3 = call i32 @kexit(i32 0)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @kmain() {
%1 = tail call i32 (...) @kinit()
%2 = tail call i32 @kexit(i32 0)
ret i32 undef
}
int is_whitespace(char x) { return ((x == ' ') || (x == '\t') || (x == '\r')); }


x86 assembly (clang, -O0):
<is_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     113b <is_whitespace+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     113b <is_whitespace+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0xd,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_whitespace>:
mov    $0x1,%eax
cmp    $0x9,%dil
je     1111 <is_whitespace+0x11>
cmp    $0x20,%dil
jne    1112 <is_whitespace+0x12>
ret
xor    %eax,%eax
cmp    $0xd,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_whitespace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 13
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
void tests_config_reader_clean(void) {}


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

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

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

LLVM IR (-O2):
define void @tests_config_reader_clean() {
ret void
}
/* Variables and functions */
double bits_to_double(unsigned long);
unsigned long double_to_bits(double);
double ldexp(double x, int exp) {
  unsigned long bits, exponent;
  bits = double_to_bits(x * 2.0);
  bits &= 0x800FFFFFFFFFUL;
  exponent = exp + 1023;
  exponent &= 0x7f;
  exponent <<= 52;
  bits |= exponent;
  return bits_to_double(bits);
}


x86 assembly (clang, -O0):
<ldexp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  0xec8(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <double_to_bits@plt>
mov    %rax,-0x18(%rbp)
movabs $0x800fffffffff,%rax
and    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x3ff,%eax
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
and    $0x7f,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
shl    $0x34,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
or     -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <bits_to_double@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldexp>:
push   %rbx
mov    %edi,%ebx
addsd  %xmm0,%xmm0
call   1030 <double_to_bits@plt>
movabs $0x800fffffffff,%rcx
and    %rax,%rcx
add    $0xffffffff,%ebx
and    $0x7f,%ebx
shl    $0x34,%rbx
or     %rcx,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <bits_to_double@plt>

LLVM IR (-O0):
define double @ldexp(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
store double %0, double* %3
store i32 %1, i32* %4
%7 = load double, double* %3
%8 = fmul double %7, 2.000000e+00
%9 = call i64 @double_to_bits(double %8)
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = and i64 %10, 140806207832063
store i64 %11, i64* %5
%12 = load i32, i32* %4
%13 = add nsw i32 %12, 1023
%14 = sext i32 %13 to i64
store i64 %14, i64* %6
%15 = load i64, i64* %6
%16 = and i64 %15, 127
store i64 %16, i64* %6
%17 = load i64, i64* %6
%18 = shl i64 %17, 52
store i64 %18, i64* %6
%19 = load i64, i64* %6
%20 = load i64, i64* %5
%21 = or i64 %20, %19
store i64 %21, i64* %5
%22 = load i64, i64* %5
%23 = call double @bits_to_double(i64 %22)
ret double %23
}

LLVM IR (-O2):
define double @ldexp(double %0, i32 %1) {
%3 = fmul double %0, 2.000000e+00
%4 = tail call i64 @double_to_bits(double %3)
%5 = and i64 %4, 140806207832063
%6 = add i32 %1, 127
%7 = and i32 %6, 127
%8 = zext i32 %7 to i64
%9 = shl nuw nsw i64 %8, 52
%10 = or i64 %5, %9
%11 = tail call double @bits_to_double(i64 %10)
ret double %11
}
void msg_ignore(struct TCP_STREAM *stream, struct NetFrame *frame,
                struct StringReassembler *data) {
  data = (data);
  frame = (frame);
  stream = (stream);
}


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

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

LLVM IR (-O0):
%struct.TCP_STREAM = type opaque
%struct.NetFrame = type opaque
%struct.StringReassembler = type opaque
define void @msg_ignore(%struct.TCP_STREAM* %0, %struct.NetFrame* %1, %struct.StringReassembler* %2) {
%4 = alloca %struct.TCP_STREAM*
%5 = alloca %struct.NetFrame*
%6 = alloca %struct.StringReassembler*
store %struct.TCP_STREAM* %0, %struct.TCP_STREAM** %4
store %struct.NetFrame* %1, %struct.NetFrame** %5
store %struct.StringReassembler* %2, %struct.StringReassembler** %6
%7 = load %struct.StringReassembler*, %struct.StringReassembler** %6
store %struct.StringReassembler* %7, %struct.StringReassembler** %6
%8 = load %struct.NetFrame*, %struct.NetFrame** %5
store %struct.NetFrame* %8, %struct.NetFrame** %5
%9 = load %struct.TCP_STREAM*, %struct.TCP_STREAM** %4
store %struct.TCP_STREAM* %9, %struct.TCP_STREAM** %4
ret void
}

LLVM IR (-O2):
%struct.TCP_STREAM = type opaque
%struct.NetFrame = type opaque
%struct.StringReassembler = type opaque
define void @msg_ignore(%struct.TCP_STREAM* nocapture %0, %struct.NetFrame* nocapture %1, %struct.StringReassembler* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int creat(char *, int);
int /*<<< orphan*/ write(int, char *, int);
main() {
  int fd = creat("./fasdfa", 0666);
  char append = '\x0d';
  write(fd, &append, 1);
  close(fd);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x1b6,%esi
call   1050 <creat@plt>
mov    %eax,-0x4(%rbp)
movb   $0xd,-0x5(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
mov    $0x1b6,%esi
call   1050 <creat@plt>
mov    %eax,%ebx
movb   $0xd,0xf(%rsp)
lea    0xf(%rsp),%rsi
mov    %eax,%edi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
call   1040 <close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"./fasdfa\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = call i32 @creat(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 438)
store i32 %3, i32* %1
store i8 13, i8* %2
%4 = load i32, i32* %1
%5 = call i32 @write(i32 %4, i8* %2, i32 1)
%6 = load i32, i32* %1
%7 = call i32 @close(i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"./fasdfa\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 @creat(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 438)
store i8 13, i8* %1
%3 = call i32 @write(i32 %2, i8* %1, i32 1)
%4 = tail call i32 @close(i32 %2)
ret i32 0
}
OP(fd, de) { op_de(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_de@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_de()
ret i32 undef
}
void foo436() {}


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

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

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

LLVM IR (-O2):
define void @foo436() {
ret void
}
/* Variables and functions */
size_t ft_strlen(char const *);
int /*<<< orphan*/ write(int, char const *, size_t);
void ft_putstr(const char *str) {
  size_t len;
  len = ft_strlen(str);
  write(1, str, len);
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
push   %rbx
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @ft_putstr(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @ft_strlen(i8* %4)
store i64 %5, i64* %3
%6 = load i8*, i8** %2
%7 = load i64, i64* %3
%8 = call i32 @write(i32 1, i8* %6, i64 %7)
ret void
}

LLVM IR (-O2):
define void @ft_putstr(i8* %0) {
%2 = tail call i64 @ft_strlen(i8* %0)
%3 = tail call i32 @write(i32 1, i8* %0, i64 %2)
ret void
}
unsigned xrop3_225_0_0(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;
  stk2 = D | S;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_225_0_0>:
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    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_225_0_0>:
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
not    %edi
shl    $0x8,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_225_0_0(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
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = or i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %7
%26 = load i32, i32* %9
%27 = xor i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = xor i32 %28, -1
store i32 %29, i32* %8
%30 = load i32, i32* %8
ret i32 %30
}

LLVM IR (-O2):
define i32 @xrop3_225_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = mul nuw nsw i32 %4, 257
%6 = xor i32 %3, -1
%7 = shl nsw i32 %6, 8
%8 = xor i32 %7, %5
ret i32 %8
}
int ft_isalpha(int c) {
  return ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'));
}


x86 assembly (clang, -O0):
<ft_isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1120 <ft_isalpha+0x20>
mov    $0x1,%al
cmpl   $0x7a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    113f <ft_isalpha+0x3f>
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1139 <ft_isalpha+0x39>
cmpl   $0x5a,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isalpha>:
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %16, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 65
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 90
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ false, %8 ], [ %13, %11 ]
br label %16
16: ; preds = %14, %5
%17 = phi i1 [ true, %5 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @ft_isalpha(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World!\n");
  printf("Creating new branch featurel successfully!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
@.str.1 = [44 x i8] c"Creating new branch featurel successfully!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
@str.2 = [43 x i8] c"Creating new branch featurel successfully!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
int test_imm_A7uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xA7 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_A7uint64_highword_reg>:
movabs $0xa700000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_A7uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 167
%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_A7uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 717259538432
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
unsigned int usr_led_on(unsigned int);
void main() {
  unsigned int val = 0;
  (*(volatile unsigned int *)(0x44e000AC) = (0x02));
  val = (*(volatile unsigned int *)(0x4804C134));
  val &= ~(0xF << 21);
  (*(volatile unsigned int *)(0x4804C134) = (val));
  (*(volatile unsigned int *)(0x4804C190) = (0x0F << 21));
  (*(volatile unsigned int *)(0x4804C194) = (0x01 << 24));
  val = usr_led_on(0);
  usr_led_on(val);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x44e000ac,%eax
movl   $0x2,(%rax)
mov    $0x4804c134,%eax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfe1fffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x4804c134,%eax
mov    %ecx,(%rax)
mov    $0x4804c190,%eax
movl   $0x1e00000,(%rax)
mov    $0x4804c194,%eax
movl   $0x1000000,(%rax)
xor    %edi,%edi
call   1030 <usr_led_on@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <usr_led_on@plt>
jmp    1171 <main+0x61>

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x2,0x44e000ac
andl   $0xfe1fffff,0x4804c134
ff ff 1f fe
movl   $0x1e00000,0x4804c190
movl   $0x1000000,0x4804c194
xor    %edi,%edi
call   1030 <usr_led_on@plt>
mov    %eax,%edi
call   1030 <usr_led_on@plt>
nopl   0x0(%rax,%rax,1)
jmp    1150 <main+0x40>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
store i32 0, i32* %1
store volatile i32 2, i32* inttoptr (i64 1155530924 to i32*)
%2 = load volatile i32, i32* inttoptr (i64 1208271156 to i32*)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, -31457281
store i32 %4, i32* %1
%5 = load i32, i32* %1
store volatile i32 %5, i32* inttoptr (i64 1208271156 to i32*)
store volatile i32 31457280, i32* inttoptr (i64 1208271248 to i32*)
store volatile i32 16777216, i32* inttoptr (i64 1208271252 to i32*)
%6 = call i32 @usr_led_on(i32 0)
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = call i32 @usr_led_on(i32 %7)
br label %9
9: ; preds = %0, %9
br label %9
}

LLVM IR (-O2):
define void @main() {
store volatile i32 2, i32* inttoptr (i64 1155530924 to i32*)
%1 = load volatile i32, i32* inttoptr (i64 1208271156 to i32*)
%2 = and i32 %1, -31457281
store volatile i32 %2, i32* inttoptr (i64 1208271156 to i32*)
store volatile i32 31457280, i32* inttoptr (i64 1208271248 to i32*)
store volatile i32 16777216, i32* inttoptr (i64 1208271252 to i32*)
%3 = tail call i32 @usr_led_on(i32 0)
%4 = tail call i32 @usr_led_on(i32 %3)
br label %5
5: ; preds = %5, %0
br label %5
}
/* Type definitions */
struct hashtable {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ *get_entry(struct hashtable *, void *, int /*<<< orphan*/ *);
char ht_contains(struct hashtable *ht, void *key) {
  return get_entry(ht, key, NULL) != NULL;
}


x86 assembly (clang, -O0):
<ht_contains>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <get_entry@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ht_contains>:
push   %rax
xor    %edx,%edx
call   1030 <get_entry@plt>
test   %rax,%rax
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.hashtable = type { i32 }
define signext i8 @ht_contains(%struct.hashtable* %0, i8* %1) {
%3 = alloca %struct.hashtable*
%4 = alloca i8*
store %struct.hashtable* %0, %struct.hashtable** %3
store i8* %1, i8** %4
%5 = load %struct.hashtable*, %struct.hashtable** %3
%6 = load i8*, i8** %4
%7 = call i32* @get_entry(%struct.hashtable* %5, i8* %6, i32* null)
%8 = icmp ne i32* %7, null
%9 = zext i1 %8 to i32
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
%struct.hashtable = type { i32 }
define signext i8 @ht_contains(%struct.hashtable* %0, i8* %1) {
%3 = tail call i32* @get_entry(%struct.hashtable* %0, i8* %1, i32* null)
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i8
ret i8 %5
}
void *mem_cache_init(void *start, int cache_size, int struct_size,
                     unsigned int alignment) {
  return 0;
}


x86 assembly (clang, -O0):
<mem_cache_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @mem_cache_init(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @mem_cache_init(i8* nocapture readnone %0, i32 %1, i32 %2, i32 %3) {
ret i8* null
}
int test_imm_D6int8_reg(signed char val) {
  return ((val) & (-0xD6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D6int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff2a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_D6int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -214
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fclose(int /*<<< orphan*/ *);
int endmntent(FILE *fp) { return fclose(fp); }


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

x86 assembly (clang, -O2):
<endmntent>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define i32 @endmntent(i32* nocapture %0) {
%2 = tail call i32 @fclose(i32* %0)
ret i32 %2
}
int test_imm_87int32_reg(int val) { return ((val) & (0x87 << 0)) ? -20 : -40; }


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

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

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

LLVM IR (-O2):
define i32 @test_imm_87int32_reg(i32 %0) {
%2 = and i32 %0, 135
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int x;
};
typedef TYPE_1__ XGraphicsExposeEvent;

/* Variables and functions */
void set_XGraphicsExposeEvent_x(void *_p, int _v) {
  ((XGraphicsExposeEvent *)_p)->x = (int)_v;
}


x86 assembly (clang, -O0):
<set_XGraphicsExposeEvent_x>:
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_XGraphicsExposeEvent_x>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XGraphicsExposeEvent_x(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_XGraphicsExposeEvent_x(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
double sin(double);
double lanczos(int n, int N) {
  return ((sin(3.14 * (2 * (double)n) / (double)(N - 1)) /
           (3.14 * (2 * (double)n) / (double)(N - 1))) -
          1);
}


x86 assembly (clang, -O0):
<lanczos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xee5(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xed1(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
call   1030 <sin@plt>
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xeb5(%rip),%xmm2
mulsd  %xmm1,%xmm2
movsd  0xea1(%rip),%xmm1
mulsd  %xmm2,%xmm1
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm2
divsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  0xe7b(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lanczos>:
push   %rax
cvtsi2sd %edi,%xmm0
addsd  %xmm0,%xmm0
mulsd  0xedf(%rip),%xmm0
add    $0xffffffff,%esi
cvtsi2sd %esi,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
call   1030 <sin@plt>
divsd  (%rsp),%xmm0
addsd  0xec5(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @lanczos(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 = sitofp i32 %5 to double
%7 = fmul double 2.000000e+00, %6
%8 = fmul double 3.140000e+00, %7
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 1
%11 = sitofp i32 %10 to double
%12 = fdiv double %8, %11
%13 = call double @sin(double %12)
%14 = load i32, i32* %3
%15 = sitofp i32 %14 to double
%16 = fmul double 2.000000e+00, %15
%17 = fmul double 3.140000e+00, %16
%18 = load i32, i32* %4
%19 = sub nsw i32 %18, 1
%20 = sitofp i32 %19 to double
%21 = fdiv double %17, %20
%22 = fdiv double %13, %21
%23 = fsub double %22, 1.000000e+00
ret double %23
}

LLVM IR (-O2):
define double @lanczos(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to double
%4 = fmul double %3, 2.000000e+00
%5 = fmul double %4, 3.140000e+00
%6 = add nsw i32 %1, -1
%7 = sitofp i32 %6 to double
%8 = fdiv double %5, %7
%9 = tail call double @sin(double %8)
%10 = fdiv double %9, %8
%11 = fadd double %10, -1.000000e+00
ret double %11
}
int test_imm_BAint16_mem(short *val) {
  return ((*val) & (0xBA << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_BAint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 186
%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_BAint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 186
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int AND(int a, int b) {
  int output = a & b;
  return output;
}


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

x86 assembly (clang, -O2):
<AND>:
mov    %edi,%eax
and    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @AND(i32 %0, i32 %1) {
%3 = and i32 %1, %0
ret i32 %3
}
int fun393() { return 393; }


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

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

LLVM IR (-O0):
define i32 @fun393() {
ret i32 393
}

LLVM IR (-O2):
define i32 @fun393() {
ret i32 393
}
/* Variables and functions */
int negate(int);
int test_negate() {
  return -1 == negate(1) && 1 == negate(-1) && 0 == negate(0);
}


x86 assembly (clang, -O0):
<test_negate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <negate@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    1167 <test_negate+0x57>
mov    $0xffffffff,%edi
call   1030 <negate@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    1167 <test_negate+0x57>
xor    %edi,%edi
call   1030 <negate@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_negate>:
push   %rbx
mov    $0x1,%edi
call   1030 <negate@plt>
xor    %ebx,%ebx
cmp    $0xffffffff,%eax
jne    113f <test_negate+0x2f>
mov    $0xffffffff,%edi
call   1030 <negate@plt>
cmp    $0x1,%eax
jne    113f <test_negate+0x2f>
xor    %edi,%edi
call   1030 <negate@plt>
xor    %ebx,%ebx
test   %eax,%eax
sete   %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test_negate() {
%1 = call i32 @negate(i32 1)
%2 = icmp eq i32 -1, %1
br i1 %2, label %3, label %9
3: ; preds = %0
%4 = call i32 @negate(i32 -1)
%5 = icmp eq i32 1, %4
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = call i32 @negate(i32 0)
%8 = icmp eq i32 0, %7
br label %9
9: ; preds = %6, %3, %0
%10 = phi i1 [ false, %3 ], [ false, %0 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @test_negate() {
%1 = tail call i32 @negate(i32 1)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %10
3: ; preds = %0
%4 = tail call i32 @negate(i32 -1)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i32 @negate(i32 0)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %0
%11 = phi i32 [ 0, %3 ], [ 0, %0 ], [ %9, %6 ]
ret i32 %11
}
int test_imm_DAint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xDA << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_DAint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 14286848
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int fun213() { return 213; }


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

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

LLVM IR (-O0):
define i32 @fun213() {
ret i32 213
}

LLVM IR (-O2):
define i32 @fun213() {
ret i32 213
}
/* Variables and functions */
int /*<<< orphan*/ printArgsNoRet(char, char *);
int main() {
  printArgsNoRet('c', "e");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x63,%edi
lea    0xed5(%rip),%rsi
call   1030 <printArgsNoRet@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x63,%edi
call   1030 <printArgsNoRet@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"e\00"
define i32 @main() {
%1 = tail call i32 @printArgsNoRet(i8 signext 99, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void read_integer_literal(const char **pos_ref) {
  const char *pos = *pos_ref;
  char c;
  while ((c = *pos)) {
    if (c < '0' || c > '9') {
      break;
    }
    pos++;
  }
  *pos_ref = pos;
}


x86 assembly (clang, -O0):
<read_integer_literal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
cmp    $0x0,%al
je     1154 <read_integer_literal+0x54>
movsbl -0x11(%rbp),%eax
cmp    $0x30,%eax
jl     113e <read_integer_literal+0x3e>
movsbl -0x11(%rbp),%eax
cmp    $0x39,%eax
jle    1143 <read_integer_literal+0x43>
jmp    1154 <read_integer_literal+0x54>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1113 <read_integer_literal+0x13>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_integer_literal>:
mov    (%rdi),%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
add    $0xc6,%cl
cmp    $0xf5,%cl
ja     1110 <read_integer_literal+0x10>
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @read_integer_literal(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
%4 = alloca i8
store i8** %0, i8*** %2
%5 = load i8**, i8*** %2
%6 = load i8*, i8** %5
store i8* %6, i8** %3
br label %7
7: ; preds = %20, %1
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
store i8 %9, i8* %4
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %23
11: ; preds = %7
%12 = load i8, i8* %4
%13 = sext i8 %12 to i32
%14 = icmp slt i32 %13, 48
br i1 %14, label %19, label %15
15: ; preds = %11
%16 = load i8, i8* %4
%17 = sext i8 %16 to i32
%18 = icmp sgt i32 %17, 57
br i1 %18, label %19, label %20
19: ; preds = %15, %11
br label %23
20: ; preds = %15
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
br label %7
23: ; preds = %19, %7
%24 = load i8*, i8** %3
%25 = load i8**, i8*** %2
store i8* %24, i8** %25
ret void
}

LLVM IR (-O2):
define void @read_integer_literal(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %3, %1
%4 = phi i8* [ %2, %1 ], [ %8, %3 ]
%5 = load i8, i8* %4
%6 = add i8 %5, -58
%7 = icmp ult i8 %6, -10
%8 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %7, label %9, label %3
9: ; preds = %3
store i8* %4, i8** %0
ret void
}
/* Variables and functions */
int close(int);
int libc_close(int fd) { return close(fd); }


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

x86 assembly (clang, -O2):
<libc_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @libc_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ fs_univ_setpath(int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/ const *);
uint8_t fs_settrashpath(uint32_t rootinode, uint8_t sesflags, uint32_t inode,
                        uint32_t pleng, const uint8_t *path) {
  return fs_univ_setpath(rootinode, sesflags, inode, pleng, path);
}


x86 assembly (clang, -O0):
<fs_settrashpath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%r8
call   1030 <fs_univ_setpath@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_settrashpath>:
jmp    1030 <fs_univ_setpath@plt>

LLVM IR (-O0):
define i32 @fs_settrashpath(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32*, i32** %10
%16 = call i32 @fs_univ_setpath(i32 %11, i32 %12, i32 %13, i32 %14, i32* %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @fs_settrashpath(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4) {
%6 = tail call i32 @fs_univ_setpath(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4)
ret i32 %6
}
void XrmLocaleOfDatabase() {}


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

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

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

LLVM IR (-O2):
define void @XrmLocaleOfDatabase() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_lock_lockfile() {
  printf("NOT IMPLEMENTED:"
         "pa_lock_lockfile"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"NOT IMPLEMENTED:pa_lock_lockfile\0A\00"
define i32 @pa_lock_lockfile() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_lock_lockfile\00"
define i32 @pa_lock_lockfile() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int LZ4_compress_HC_extStateHC(void *, char const *, char *, int, int, int);
int LZ4_compressHC2_limitedOutput_withStateHC(void *state, const char *src,
                                              char *dst, int srcSize,
                                              int maxDstSize, int cLevel) {
  return LZ4_compress_HC_extStateHC(state, src, dst, srcSize, maxDstSize,
                                    cLevel);
}


x86 assembly (clang, -O0):
<LZ4_compressHC2_limitedOutput_withStateHC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0x24(%rbp),%r9d
call   1030 <LZ4_compress_HC_extStateHC@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LZ4_compressHC2_limitedOutput_withStateHC>:
jmp    1030 <LZ4_compress_HC_extStateHC@plt>

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

LLVM IR (-O2):
define i32 @LZ4_compressHC2_limitedOutput_withStateHC(i8* %0, i8* %1, i8* %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 @LZ4_compress_HC_extStateHC(i8* %0, i8* %1, i8* %2, i32 %3, i32 %4, i32 %5)
ret i32 %7
}
int foo(unsigned a) {
  int x = 4;
  unsigned i;
  for (a = 1; a < 5; a++)
    for (i = 0; i < a; i++)
      x *= x;
  if (a == 42)
    goto head2;
head:
  x++;
head2:
  if (a >= 5) {
    x += 3;
    goto head;
  } else if (a >= 2) {
    x += 9;
    goto head;
  }
  return x;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
movl   $0x1,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jae    115d <foo+0x5d>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    114a <foo+0x4a>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1126 <foo+0x26>
jmp    114f <foo+0x4f>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1115 <foo+0x15>
cmpl   $0x2a,-0x4(%rbp)
jne    116c <foo+0x6c>
jmp    117a <foo+0x7a>
jmp    1171 <foo+0x71>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x5,-0x4(%rbp)
jb     1192 <foo+0x92>
mov    -0x8(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x8(%rbp)
jmp    1171 <foo+0x71>
cmpl   $0x2,-0x4(%rbp)
jb     11aa <foo+0xaa>
mov    -0x8(%rbp),%eax
add    $0x9,%eax
mov    %eax,-0x8(%rbp)
jmp    1171 <foo+0x71>
jmp    11af <foo+0xaf>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
jmp    1100 <foo>

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 4, i32* %3
store i32 1, i32* %2
br label %5
5: ; preds = %21, %1
%6 = load i32, i32* %2
%7 = icmp ult i32 %6, 5
br i1 %7, label %8, label %24
8: ; preds = %5
store i32 0, i32* %4
br label %9
9: ; preds = %17, %8
%10 = load i32, i32* %4
%11 = load i32, i32* %2
%12 = icmp ult i32 %10, %11
br i1 %12, label %13, label %20
13: ; preds = %9
%14 = load i32, i32* %3
%15 = load i32, i32* %3
%16 = mul nsw i32 %15, %14
store i32 %16, i32* %3
br label %17
17: ; preds = %13
%18 = load i32, i32* %4
%19 = add i32 %18, 1
store i32 %19, i32* %4
br label %9
20: ; preds = %9
br label %21
21: ; preds = %20
%22 = load i32, i32* %2
%23 = add i32 %22, 1
store i32 %23, i32* %2
br label %5
24: ; preds = %5
%25 = load i32, i32* %2
%26 = icmp eq i32 %25, 42
br i1 %26, label %27, label %28
27: ; preds = %24
br label %32
28: ; preds = %24
br label %29
29: ; preds = %41, %35, %28
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
br label %32
32: ; preds = %29, %27
%33 = load i32, i32* %2
%34 = icmp uge i32 %33, 5
br i1 %34, label %35, label %38
35: ; preds = %32
%36 = load i32, i32* %3
%37 = add nsw i32 %36, 3
store i32 %37, i32* %3
br label %29
38: ; preds = %32
%39 = load i32, i32* %2
%40 = icmp uge i32 %39, 2
br i1 %40, label %41, label %44
41: ; preds = %38
%42 = load i32, i32* %3
%43 = add nsw i32 %42, 9
store i32 %43, i32* %3
br label %29
44: ; preds = %38
br label %45
45: ; preds = %44
%46 = load i32, i32* %3
ret i32 %46
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
void ADC_isr() {}


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

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

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

LLVM IR (-O2):
define void @ADC_isr() {
ret void
}
void glSampleCoveragex(void) { return; }


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

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

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

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

/* Variables and functions */
int obus_object_set_user_data(int /*<<< orphan*/, void *);
int /*<<< orphan*/ ps_summary_object(struct ps_summary *);
int ps_summary_set_user_data(struct ps_summary *object, void *user_data) {
  return obus_object_set_user_data(ps_summary_object(object), user_data);
}


x86 assembly (clang, -O0):
<ps_summary_set_user_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ps_summary_object@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <obus_object_set_user_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ps_summary_set_user_data>:
push   %rbx
mov    %rsi,%rbx
call   1030 <ps_summary_object@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <obus_object_set_user_data@plt>

LLVM IR (-O0):
%struct.ps_summary = type { i32 }
define i32 @ps_summary_set_user_data(%struct.ps_summary* %0, i8* %1) {
%3 = alloca %struct.ps_summary*
%4 = alloca i8*
store %struct.ps_summary* %0, %struct.ps_summary** %3
store i8* %1, i8** %4
%5 = load %struct.ps_summary*, %struct.ps_summary** %3
%6 = call i32 @ps_summary_object(%struct.ps_summary* %5)
%7 = load i8*, i8** %4
%8 = call i32 @obus_object_set_user_data(i32 %6, i8* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.ps_summary = type { i32 }
define i32 @ps_summary_set_user_data(%struct.ps_summary* %0, i8* %1) {
%3 = tail call i32 @ps_summary_object(%struct.ps_summary* %0)
%4 = tail call i32 @obus_object_set_user_data(i32 %3, i8* %1)
ret i32 %4
}