xunge/DecIR huggingface dataset:
unsigned int is_white_space(unsigned char ch) {
  return ((' ' == ch) || ('\n' == ch) || ('\t' == ch) || ('\r' == ch));
}


x86 assembly (clang, -O0):
<is_white_space>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
mov    $0x1,%al
mov    $0x20,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
je     115d <is_white_space+0x5d>
movzbl -0x1(%rbp),%edx
mov    $0x1,%al
mov    $0xa,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
je     115d <is_white_space+0x5d>
movzbl -0x1(%rbp),%edx
mov    $0x1,%al
mov    $0x9,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
je     115d <is_white_space+0x5d>
movzbl -0x1(%rbp),%ecx
mov    $0xd,%eax
cmp    %ecx,%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_white_space>:
cmp    $0x20,%dil
ja     111e <is_white_space+0x1e>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100000600,%rdx
bt     %rcx,%rdx
jae    111e <is_white_space+0x1e>
ret
xor    %eax,%eax
cmp    $0xd,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_white_space(i8 zeroext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 10, 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, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
void old_style_handler_old(int signo) {}


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

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

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

LLVM IR (-O2):
define void @old_style_handler_old(i32 %0) {
ret void
}
void debug_fini(void) {}


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

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

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

LLVM IR (-O2):
define void @debug_fini() {
ret void
}
int test_imm_6Cuint16_mem(unsigned short *val) {
  return ((*val) & (-0x6C << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_6Cuint16_mem>:
movzwl (%rdi),%eax
test   $0xff94,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_6Cuint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -108
%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_6Cuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -108
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int open(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int open_eeprom(const char *file) {
  int fd;
  fd = open(file, O_RDONLY);
  if (fd < 0)
    fprintf(stderr, "Cannot open eeprom file %d\n", errno);
  return fd;
}


x86 assembly (clang, -O0):
<open_eeprom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1169 <open_eeprom+0x49>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
mov    0x2e75(%rip),%rax
mov    (%rax),%edx
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_eeprom>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1153 <open_eeprom+0x33>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
mov    0x2e8b(%rip),%rax
mov    (%rax),%edx
lea    0xeb2(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
@stderr = global i32 0
@.str = [28 x i8] c"Cannot open eeprom file %d\0A\00"
@errno = global i32 0
define i32 @open_eeprom(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_RDONLY
%6 = call i32 @open(i8* %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = load i32, i32* @errno
%12 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %9, %1
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
@stderr = global i32 0
@.str = [28 x i8] c"Cannot open eeprom file %d\0A\00"
@errno = global i32 0
define i32 @open_eeprom(i8* nocapture %0) {
%2 = load i32, i32* @O_RDONLY
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = load i32, i32* @errno
%8 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %5, %1
ret i32 %3
}
int isBigEndian() {
  int no = 1;
  char *chk = (char *)&no;
  if (chk[0] == 1)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<isBigEndian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x1,%eax
jne    112f <isBigEndian+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1136 <isBigEndian+0x36>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @isBigEndian() {
ret i32 0
}
/* Variables and functions */
char *Op_div(char *, char *);
char *strchr(char *, char);
char *Op_idiv(char *arg1, char *arg2) {
  char *result = Op_div(arg1, arg2);
  char *tmp = NULL;
  if ((tmp = strchr(result, '.')) != NULL) {
    *tmp = '\0';
  }
  return result;
}


x86 assembly (clang, -O0):
<Op_idiv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <Op_div@plt>
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     116c <Op_idiv+0x4c>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op_idiv>:
push   %rbx
call   1040 <Op_div@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x2e,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     113e <Op_idiv+0x1e>
movb   $0x0,(%rax)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @Op_idiv(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i8* @Op_div(i8* %7, i8* %8)
store i8* %9, i8** %5
store i8* null, i8** %6
%10 = load i8*, i8** %5
%11 = call i8* @strchr(i8* %10, i8 signext 46)
store i8* %11, i8** %6
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = load i8*, i8** %6
store i8 0, i8* %14
br label %15
15: ; preds = %13, %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
define i8* @Op_idiv(i8* %0, i8* %1) {
%3 = tail call i8* @Op_div(i8* %0, i8* %1)
%4 = tail call i8* @strchr(i8* dereferenceable(1) %3, i8 signext 46)
%5 = icmp eq i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %2
store i8 0, i8* %4
br label %7
7: ; preds = %6, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *ptr = malloc(size);
  if (ptr == NULL)
    abort();
  else
    return ptr;
}


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 */
unsigned int ntohl(unsigned int);
unsigned int len24_toh(unsigned int be_24_bits_len) {
  be_24_bits_len <<= 8;
  return ntohl(be_24_bits_len & 0xffffff00);
}


x86 assembly (clang, -O0):
<len24_toh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xffffff00,%edi
call   1030 <ntohl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<len24_toh>:
shl    $0x8,%edi
jmp    1030 <ntohl@plt>

LLVM IR (-O0):
define i32 @len24_toh(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = and i32 %5, -256
%7 = call i32 @ntohl(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @len24_toh(i32 %0) {
%2 = shl i32 %0, 8
%3 = tail call i32 @ntohl(i32 %2)
ret i32 %3
}
void fd88(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  a : {
    typedef int(*d)[n];
  P013A:
    goto P013A;
    0;
  }
  p01C:
    goto p01C;
    goto a;
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  P02A:
    goto P02A;
    {
      typedef int(*g)[n];
    P024A:
      goto P024A;
      0;
    };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    P025A:
      goto P025A;
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd88>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd88+0x7>

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

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

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


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

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

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

LLVM IR (-O2):
define void @RTDbgSymbolDup() {
ret void
}
void f11b(unsigned i) {
  int *x = 0;
  if (i <= ~(unsigned)0) {
  } else {
    *x = 42;
  }
}


x86 assembly (clang, -O0):
<f11b>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
ja     111e <f11b+0x1e>
jmp    1128 <f11b+0x28>
mov    -0x10(%rbp),%rax
movl   $0x2a,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f11b(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
store i32* null, i32** %3
%4 = load i32, i32* %2
%5 = icmp ule i32 %4, -1
br i1 %5, label %6, label %7
6: ; preds = %1
br label %9
7: ; preds = %1
%8 = load i32*, i32** %3
store i32 42, i32* %8
br label %9
9: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
define void @f11b(i32 %0) {
ret void
}
void halIntOn(void) { ; }


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

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

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

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

/* Variables and functions */
scalar_t__ UINT8_MAX;
uint8_t __hsail_sat_mul_u8(uint8_t a, uint8_t b) {
  uint16_t c = (uint16_t)a * (uint16_t)b;
  if (c > UINT8_MAX)
    return UINT8_MAX;
  else
    return c;
}


x86 assembly (clang, -O0):
<__hsail_sat_mul_u8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    0x2ebc(%rip),%rcx
cmp    (%rcx),%rax
jle    1140 <__hsail_sat_mul_u8+0x40>
mov    0x2eac(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1148 <__hsail_sat_mul_u8+0x48>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hsail_sat_mul_u8>:
imul   %rsi,%rdi
mov    0x2ed5(%rip),%rax
mov    (%rax),%rax
cmp    %rax,%rdi
cmovle %rdi,%rax
ret

LLVM IR (-O0):
@UINT8_MAX = global i64 0
define i64 @__hsail_sat_mul_u8(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = mul nsw i64 %7, %8
store i64 %9, i64* %6
%10 = load i64, i64* %6
%11 = load i64, i64* @UINT8_MAX
%12 = icmp sgt i64 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = load i64, i64* @UINT8_MAX
store i64 %14, i64* %3
br label %17
15: ; preds = %2
%16 = load i64, i64* %6
store i64 %16, i64* %3
br label %17
17: ; preds = %15, %13
%18 = load i64, i64* %3
ret i64 %18
}

LLVM IR (-O2):
@UINT8_MAX = global i64 0
define i64 @__hsail_sat_mul_u8(i64 %0, i64 %1) {
%3 = mul nsw i64 %1, %0
%4 = load i64, i64* @UINT8_MAX
%5 = icmp sgt i64 %3, %4
%6 = select i1 %5, i64 %4, i64 %3
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ lacrimae();
int main(int argc, char **argv) {
  lacrimae();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @lacrimae()
ret i32 0
}
void r_default(struct network *net, struct irc_reply *rpl) {}


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

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

LLVM IR (-O0):
%struct.network = type opaque
%struct.irc_reply = type opaque
define void @r_default(%struct.network* %0, %struct.irc_reply* %1) {
%3 = alloca %struct.network*
%4 = alloca %struct.irc_reply*
store %struct.network* %0, %struct.network** %3
store %struct.irc_reply* %1, %struct.irc_reply** %4
ret void
}

LLVM IR (-O2):
%struct.network = type opaque
%struct.irc_reply = type opaque
define void @r_default(%struct.network* nocapture %0, %struct.irc_reply* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ executeSql(char *, int /*<<< orphan*/ *);
void emptyDb() {
  executeSql("delete from data", NULL);
  executeSql("delete from alert;", NULL);
  executeSql("delete from alert_interval;", NULL);
  executeSql("delete from interval;", NULL);
}


x86 assembly (clang, -O0):
<emptyDb>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <executeSql@plt>
lea    0xee6(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <executeSql@plt>
lea    0xee9(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <executeSql@plt>
lea    0xef5(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <executeSql@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<emptyDb>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %esi,%esi
call   1030 <executeSql@plt>
lea    0xeeb(%rip),%rdi
xor    %esi,%esi
call   1030 <executeSql@plt>
lea    0xef0(%rip),%rdi
xor    %esi,%esi
call   1030 <executeSql@plt>
lea    0xefe(%rip),%rdi
xor    %esi,%esi
pop    %rax
jmp    1030 <executeSql@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"delete from data\00"
@.str.1 = [19 x i8] c"delete from alert;\00"
@.str.2 = [28 x i8] c"delete from alert_interval;\00"
@.str.3 = [22 x i8] c"delete from interval;\00"
define void @emptyDb() {
%1 = call i32 @executeSql(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32* null)
%2 = call i32 @executeSql(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32* null)
%3 = call i32 @executeSql(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32* null)
%4 = call i32 @executeSql(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"delete from data\00"
@.str.1 = [19 x i8] c"delete from alert;\00"
@.str.2 = [28 x i8] c"delete from alert_interval;\00"
@.str.3 = [22 x i8] c"delete from interval;\00"
define void @emptyDb() {
%1 = tail call i32 @executeSql(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32* null)
%2 = tail call i32 @executeSql(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32* null)
%3 = tail call i32 @executeSql(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32* null)
%4 = tail call i32 @executeSql(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32* null)
ret void
}
int R_modeShapeHexDrv(int p, int i, double *L, double mdrv[3]) { return 0; }


x86 assembly (clang, -O0):
<R_modeShapeHexDrv>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @R_modeShapeHexDrv(i32 %0, i32 %1, double* nocapture readnone %2, double* nocapture readnone %3) {
ret i32 0
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __list_del_entry(struct list_head *);
int /*<<< orphan*/ list_add_tail(struct list_head *, struct list_head *);
void list_move_tail(struct list_head *list, struct list_head *head) {
  __list_del_entry(list);
  list_add_tail(list, head);
}


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

x86 assembly (clang, -O2):
<list_move_tail>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <__list_del_entry@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <list_add_tail@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_move_tail(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = call i32 @__list_del_entry(%struct.list_head* %5)
%7 = load %struct.list_head*, %struct.list_head** %3
%8 = load %struct.list_head*, %struct.list_head** %4
%9 = call i32 @list_add_tail(%struct.list_head* %7, %struct.list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_move_tail(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @__list_del_entry(%struct.list_head* %0)
%4 = tail call i32 @list_add_tail(%struct.list_head* %0, %struct.list_head* %1)
ret void
}
int vfs_dq_off(struct super_block *sb, int remount) { return 0; }


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

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

LLVM IR (-O0):
%struct.super_block = type opaque
define i32 @vfs_dq_off(%struct.super_block* %0, i32 %1) {
%3 = alloca %struct.super_block*
%4 = alloca i32
store %struct.super_block* %0, %struct.super_block** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.super_block = type opaque
define i32 @vfs_dq_off(%struct.super_block* nocapture readnone %0, i32 %1) {
ret i32 0
}
void w1(void *x, long long y) { *(long long *)(x + 32767) = y; }


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

x86 assembly (clang, -O2):
<w1>:
mov    %rsi,0x7fff(%rdi)
ret

LLVM IR (-O0):
define void @w1(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = getelementptr i8, i8* %6, i64 32767
%8 = bitcast i8* %7 to i64*
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @w1(i8* nocapture writeonly %0, i64 %1) {
%3 = getelementptr i8, i8* %0, i64 32767
%4 = bitcast i8* %3 to i64*
store i64 %1, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
char *reverse_string(char *);
scalar_t__ strcmp(char *, char *);
void test_reverse_string() {
  char *s = "123";
  char *t = reverse_string(s);
  if (strcmp(t, "321") == 0) {
    printf("reverse_string passed\n");
  } else {
    printf("reverse_string failed\n");
  }
}


x86 assembly (clang, -O0):
<test_reverse_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <reverse_string@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    117b <test_reverse_string+0x4b>
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
jmp    1187 <test_reverse_string+0x57>
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_reverse_string>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <reverse_string@plt>
lea    0xec0(%rip),%rsi
mov    %rax,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
lea    0xec8(%rip),%rax
lea    0xeab(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"123\00"
@.str.1 = [4 x i8] c"321\00"
@.str.2 = [23 x i8] c"reverse_string passed\0A\00"
@.str.3 = [23 x i8] c"reverse_string failed\0A\00"
define void @test_reverse_string() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = load i8*, i8** %1
%4 = call i8* @reverse_string(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"123\00"
@.str.1 = [4 x i8] c"321\00"
@str = [22 x i8] c"reverse_string failed\00"
@str.4 = [22 x i8] c"reverse_string passed\00"
define void @test_reverse_string() {
%1 = tail call i8* @reverse_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0)
%5 = tail call i32 @puts(i8* dereferenceable(1) %4)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ x;
};
typedef TYPE_1__ XExposeEvent;

/* Variables and functions */
int get_XExposeEvent_x(void *_p) { return (int)((XExposeEvent *)_p)->x; }


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

x86 assembly (clang, -O2):
<get_XExposeEvent_x>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_XExposeEvent_x(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ lengthOfLongestSubstring(char *);
int main() {
  char s[9] = {'a', 'b', 'c', 'a', 'b', 'c', 'b', 'b', '\0'};
  lengthOfLongestSubstring(s);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x6262636261636261,%rax
63 62 62
mov    %rax,0x8(%rsp)
movb   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <lengthOfLongestSubstring@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.s = [9 x i8] c"abcabcbb\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i8]
store i32 0, i32* %1
%3 = bitcast [9 x i8]* %2 to i8*
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%5 = call i32 @lengthOfLongestSubstring(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [9 x i8] c"abcabcbb\00"
define i32 @main() {
%1 = alloca [9 x i8]
%2 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%3 = call i32 @lengthOfLongestSubstring(i8* %2)
ret i32 0
}
void XtConfigureWidget() {}


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

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

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

LLVM IR (-O2):
define void @XtConfigureWidget() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint;

/* Variables and functions */
int /*<<< orphan*/ memmove(void *, void *, int /*<<< orphan*/);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int /*<<< orphan*/);
void amove(void *dst, void *src, uint n) {
  if (dst) {
    if (src == NULL)
      memset(dst, 0, n);
    else
      memmove(dst, src, n);
  }
}


x86 assembly (clang, -O0):
<amove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1171 <amove+0x51>
cmpq   $0x0,-0x10(%rbp)
jne    115c <amove+0x3c>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
jmp    116c <amove+0x4c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memmove@plt>
jmp    1171 <amove+0x51>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<amove>:
test   %rdi,%rdi
je     112f <amove+0xf>
test   %rsi,%rsi
je     1130 <amove+0x10>
jmp    1040 <memmove@plt>
ret
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @amove(i8* %0, i8* %1, i32 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %11, label %5
5: ; preds = %3
%6 = icmp eq i8* %1, null
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = tail call i32 @memset(i8* %0, i32 0, i32 %2)
br label %11
9: ; preds = %5
%10 = tail call i32 @memmove(i8* %0, i8* %1, i32 %2)
br label %11
11: ; preds = %7, %9, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ pthread_exit(void *);
void *thr_fn2(void *arg) {
  printf("thread 2 exiting\n");
  pthread_exit((void *)2);
}


x86 assembly (clang, -O0):
<thr_fn2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thr_fn2>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"thread 2 exiting\0A\00"
define i8* @thr_fn2(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @pthread_exit(i8* inttoptr (i64 2 to i8*))
%6 = load i8*, i8** %2
ret i8* %6
}

LLVM IR (-O2):
@str = [17 x i8] c"thread 2 exiting\00"
define noalias i8* @thr_fn2(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @pthread_exit(i8* inttoptr (i64 2 to i8*))
ret i8* undef
}
extern unsigned char __inb(unsigned short port) {
  unsigned char _v;
  __asm__ __volatile__("in"
                       "b"
                       " %"
                       "w"
                       "1,%"
                       ""
                       "0"
                       : "=a"(_v)
                       : "d"(port));
  return _v;
}


x86 assembly (clang, -O0):
<__inb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__inb>:
mov    %edi,%edx
in     (%dx),%al
ret

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

LLVM IR (-O2):
define zeroext i8 @__inb(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb ${1:w},$0", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *reverse(char *);
int main() {
  printf("%s", reverse("Rohit"));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedb(%rip),%rdi
call   1030 <reverse@plt>
lea    0xecc(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [6 x i8] c"Rohit\00"
define i32 @main() {
%1 = tail call i8* @reverse(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void info() {
  printf("Usage: cross_platform_test [options]\n");
  printf("  -p : process bytes at STDIN and return result\n");
  printf("  -g : generate bytes and write to STDOUT\n");
}


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

x86 assembly (clang, -O2):
<info>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf01(%rip),%rdi
call   1030 <puts@plt>
lea    0xf25(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Usage: cross_platform_test [options]\0A\00"
@.str.1 = [49 x i8] c" -p : process bytes at STDIN and return result\0A\00"
@.str.2 = [43 x i8] c" -g : generate bytes and write to STDOUT\0A\00"
define void @info() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [37 x i8] c"Usage: cross_platform_test [options]\00"
@str.3 = [48 x i8] c" -p : process bytes at STDIN and return result\00"
@str.4 = [42 x i8] c" -g : generate bytes and write to STDOUT\00"
define void @info() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.4, i64 0, i64 0))
ret void
}
int test_imm_5Fuint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x5F << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_5Fuint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 95
%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_5Fuint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 408021893120
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
long SIO1test() { return 0; }


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

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

LLVM IR (-O0):
define i64 @SIO1test() {
ret i64 0
}

LLVM IR (-O2):
define i64 @SIO1test() {
ret i64 0
}
/* Variables and functions */
scalar_t__ strcasecmp(unsigned char *, char *);
int ParseStreamMain(unsigned char *arg) {
  if (strcasecmp(arg, "yes") == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<ParseStreamMain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1142 <ParseStreamMain+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1149 <ParseStreamMain+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ParseStreamMain>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcasecmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"yes\00"
define i32 @ParseStreamMain(i8* nocapture %0) {
%2 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_resolve_query_is_done(void *q) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_resolve_query_is_done>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_resolve_query_is_done>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_resolve_query_is_done(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_resolve_query_is_done(i8* nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int util_file_exists(const char *name) {
  FILE *f;
  f = fopen(name, "r");
  if (f != NULL) {
    fclose(f);
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<util_file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1160 <util_file_exists+0x40>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    1167 <util_file_exists+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_file_exists>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <util_file_exists+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @util_file_exists(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = icmp ne i32* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32*, i32** %4
%11 = call i32 @fclose(i32* %10)
store i32 1, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @util_file_exists(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char const *, char const *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
FILE *_open_file(const char *filename, const char *mode) {
  FILE *fp = fopen(filename, mode);
  if (fp == NULL) {
    fprintf(stderr, "Could not open file %s", filename);
    exit(EXIT_FAILURE);
  }
  return fp;
}


x86 assembly (clang, -O0):
<_open_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1183 <_open_file+0x53>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe90(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_open_file>:
push   %rbx
mov    %rdi,%rbx
call   1040 <fopen@plt>
test   %rax,%rax
je     1140 <_open_file+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"Could not open file %s\00"
@EXIT_FAILURE = global i32 0
define i32* @_open_file(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %3
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = load i32, i32* @EXIT_FAILURE
%16 = call i32 @exit(i32 %15)
unreachable
17: ; preds = %2
%18 = load i32*, i32** %5
ret i32* %18
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"Could not open file %s\00"
@EXIT_FAILURE = global i32 0
define noalias i32* @_open_file(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret i32* %3
}
long double __cimagl(long double _Complex z) { return __imag__ z; }


x86 assembly (clang, -O0):
<__cimagl>:
push   %rbp
mov    %rsp,%rbp
lea    0x10(%rbp),%rax
fldt   0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cimagl>:
fldt   0x18(%rsp)
ret

LLVM IR (-O0):
define x86_fp80 @__cimagl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 1
%3 = load x86_fp80, x86_fp80* %2
ret x86_fp80 %3
}

LLVM IR (-O2):
define x86_fp80 @__cimagl({ x86_fp80, x86_fp80 }* nocapture byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 1
%3 = load x86_fp80, x86_fp80* %2
ret x86_fp80 %3
}
/* Type definitions */
struct ir_remote {
  int dummy;
};
struct ir_ncode {
  int dummy;
};

/* Variables and functions */
int init_send_or_sim(struct ir_remote *, struct ir_ncode *, int /*<<< orphan*/,
                     int /*<<< orphan*/);
int send_buffer_put(struct ir_remote *remote, struct ir_ncode *code) {
  return init_send_or_sim(remote, code, 0, 0);
}


x86 assembly (clang, -O0):
<send_buffer_put>:
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    %ecx,%ecx
mov    %ecx,%edx
call   1030 <init_send_or_sim@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_buffer_put>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <init_send_or_sim@plt>

LLVM IR (-O0):
%struct.ir_remote = type { i32 }
%struct.ir_ncode = type { i32 }
define i32 @send_buffer_put(%struct.ir_remote* %0, %struct.ir_ncode* %1) {
%3 = alloca %struct.ir_remote*
%4 = alloca %struct.ir_ncode*
store %struct.ir_remote* %0, %struct.ir_remote** %3
store %struct.ir_ncode* %1, %struct.ir_ncode** %4
%5 = load %struct.ir_remote*, %struct.ir_remote** %3
%6 = load %struct.ir_ncode*, %struct.ir_ncode** %4
%7 = call i32 @init_send_or_sim(%struct.ir_remote* %5, %struct.ir_ncode* %6, i32 0, i32 0)
ret i32 %7
}

LLVM IR (-O2):
%struct.ir_remote = type { i32 }
%struct.ir_ncode = type { i32 }
define i32 @send_buffer_put(%struct.ir_remote* %0, %struct.ir_ncode* %1) {
%3 = tail call i32 @init_send_or_sim(%struct.ir_remote* %0, %struct.ir_ncode* %1, i32 0, i32 0)
ret i32 %3
}
int c037(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c037() {
ret i32 0
}