xunge/DecIR huggingface dataset:
int test_imm_E6uint16_reg(unsigned short val) {
  return ((val) & (0xE6 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_E6uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 230
%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_E6uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 230
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ gl_log(char const *, char *, int);
int /*<<< orphan*/ stderr;
void glfw_error_callback(int error, const char *description) {
  fputs(description, stderr);
  gl_log(
      description,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/ashray/oculushello/refs/heads/master/help.h",
      50);
}


x86 assembly (clang, -O0):
<glfw_error_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    -0x10(%rbp),%rdi
lea    0xeb4(%rip),%rsi
mov    $0x32,%edx
call   1040 <gl_log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glfw_error_callback>:
push   %rbx
mov    %rsi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1030 <fputs@plt>
lea    0xec4(%rip),%rsi
mov    %rbx,%rdi
mov    $0x32,%edx
pop    %rbx
jmp    1040 <gl_log@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ashray/oculushello/refs/heads/master/help.h\00"
define void @glfw_error_callback(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i32, i32* @stderr
%7 = call i32 @fputs(i8* %5, i32 %6)
%8 = load i8*, i8** %4
%9 = call i32 @gl_log(i8* %8, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 50)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ashray/oculushello/refs/heads/master/help.h\00"
define void @glfw_error_callback(i32 %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* %1, i32 %3)
%5 = tail call i32 @gl_log(i8* %1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 50)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
char const *fmt_time_r(int /*<<< orphan*/, int const, int /*<<< orphan*/);
int /*<<< orphan*/ get_fmt_buf(int const);
const char *fmt_time(uint64_t t) {
  static const int BUF_SZ = 64;
  return fmt_time_r(get_fmt_buf(BUF_SZ), BUF_SZ, t);
}


x86 assembly (clang, -O0):
<fmt_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x40,%edi
call   1040 <get_fmt_buf@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%edx
mov    $0x40,%esi
call   1030 <fmt_time_r@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmt_time>:
push   %rbx
mov    %edi,%ebx
mov    $0x40,%edi
call   1040 <get_fmt_buf@plt>
mov    %eax,%edi
mov    $0x40,%esi
mov    %ebx,%edx
pop    %rbx
jmp    1030 <fmt_time_r@plt>

LLVM IR (-O0):
@fmt_time.BUF_SZ = internal constant i32 64
define i8* @fmt_time(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @get_fmt_buf(i32 64)
%4 = load i32, i32* %2
%5 = call i8* @fmt_time_r(i32 %3, i32 64, i32 %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @fmt_time(i32 %0) {
%2 = tail call i32 @get_fmt_buf(i32 64)
%3 = tail call i8* @fmt_time_r(i32 %2, i32 64, i32 %0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ pr_ext(char *, int);
int main(void) {
  pr_ext("foo %i\n", 42);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"foo %i\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @pr_ext(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 42)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"foo %i\0A\00"
define i32 @main() {
%1 = tail call i32 @pr_ext(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 42)
ret i32 0
}
void XGContextFromGC() {}


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

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

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

LLVM IR (-O2):
define void @XGContextFromGC() {
ret void
}
void *__Pyx_FetchCommonPointer(void *pointer, const char *name) {
  return pointer;
}


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

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

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

LLVM IR (-O2):
define i8* @__Pyx_FetchCommonPointer(i8* readnone returned %0, i8* nocapture readnone %1) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void unknown_command_line(char *exe) {
  printf("Unknown command line option...\n");
  printf("Try: %s [-i input file] [-o output file]\n", exe);
  printf("For more informations, type: %s -help\n", exe);
}


x86 assembly (clang, -O0):
<unknown_command_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xeeb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf03(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unknown_command_line>:
push   %rbx
mov    %rdi,%rbx
lea    0xf26(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee2(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Unknown command line option...\0A\00"
@.str.1 = [42 x i8] c"Try: %s [-i input file] [-o output file]\0A\00"
@.str.2 = [39 x i8] c"For more informations, type: %s -help\0A\00"
define void @unknown_command_line(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str.1 = [42 x i8] c"Try: %s [-i input file] [-o output file]\0A\00"
@.str.2 = [39 x i8] c"For more informations, type: %s -help\0A\00"
@str = [31 x i8] c"Unknown command line option...\00"
define void @unknown_command_line(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int snprintf(char *, int, char *, long);
int json_emit_int(char *buf, int buf_len, long int value) {
  return buf_len <= 0 ? 0 : snprintf(buf, buf_len, "%ld", value);
}


x86 assembly (clang, -O0):
<json_emit_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     1137 <json_emit_int+0x27>
xor    %eax,%eax
mov    %eax,-0x1c(%rbp)
jmp    1151 <json_emit_int+0x41>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rcx
lea    0xeb7(%rip),%rdx
call   1030 <snprintf@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<json_emit_int>:
test   %esi,%esi
jle    1123 <json_emit_int+0x13>
mov    %rdx,%rcx
lea    0xee2(%rip),%rdx
jmp    1030 <snprintf@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define i32 @json_emit_int(i8* %0, i32 %1, i64 %2) {
%4 = icmp slt i32 %1, 1
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %2)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ 0, %3 ]
ret i32 %8
}
/* Variables and functions */
int DesactiverRelai(int);
int /*<<< orphan*/ printf(char *);
void testDesactiverRelai() {
  int index;
  int result = DesactiverRelai(index);
  if (1) {
    printf("%%TEST_FAILED%% time=0 testname=testDesactiverRelai "
           "(Test_gestiongpio) message=error message sample\n");
  }
}


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

x86 assembly (clang, -O2):
<testDesactiverRelai>:
push   %rax
call   1040 <DesactiverRelai@plt>
lea    0xed3(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [101 x i8] c"%%TEST_FAILED%% time=0 testname=testDesactiverRelai (Test_gestiongpio) message=error message sample\0A\00"
define void @testDesactiverRelai() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %1
%4 = call i32 @DesactiverRelai(i32 %3)
store i32 %4, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [101 x i8] c"%%TEST_FAILED%% time=0 testname=testDesactiverRelai (Test_gestiongpio) message=error message sample\0A\00"
define void @testDesactiverRelai() {
%1 = tail call i32 @DesactiverRelai(i32 undef)
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([101 x i8], [101 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int __semihost(int, scalar_t__ *);
int semihost_seek(int fh, long position) {
  uint32_t args[2];
  args[0] = (uint32_t)fh;
  args[1] = (uint32_t)position;
  return __semihost((0xa), args);
}


x86 assembly (clang, -O0):
<semihost_seek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rsi
mov    $0xa,%edi
call   1030 <__semihost@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<semihost_seek>:
sub    $0x18,%rsp
movslq %edi,%rax
mov    %rax,(%rsp)
mov    %rsi,0x8(%rsp)
mov    %rsp,%rsi
mov    $0xa,%edi
call   1030 <__semihost@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @semihost_seek(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca [2 x i64]
store i32 %0, i32* %3
store i64 %1, i64* %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [2 x i64], [2 x i64]* %5, i64 0, i64 0
store i64 %7, i64* %8
%9 = load i64, i64* %4
%10 = getelementptr inbounds [2 x i64], [2 x i64]* %5, i64 0, i64 1
store i64 %9, i64* %10
%11 = getelementptr inbounds [2 x i64], [2 x i64]* %5, i64 0, i64 0
%12 = call i32 @__semihost(i32 10, i64* %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @semihost_seek(i32 %0, i64 %1) {
%3 = alloca [2 x i64]
%4 = bitcast [2 x i64]* %3 to i8*
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0, i64 0
store i64 %5, i64* %6
%7 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0, i64 1
store i64 %1, i64* %7
%8 = call i32 @__semihost(i32 10, i64* %6)
ret i32 %8
}
int test_imm_C1uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xC1 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_C1uint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 193
%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_C1uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 193
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int _chdir(char const *);
int sys_chdir(const char *path) { return _chdir(path); }


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

x86 assembly (clang, -O2):
<sys_chdir>:
jmp    1030 <_chdir@plt>

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

LLVM IR (-O2):
define i32 @sys_chdir(i8* %0) {
%2 = tail call i32 @_chdir(i8* %0)
ret i32 %2
}
/* Type definitions */
struct gpio_led {
  int dummy;
};

/* Variables and functions */
int ENOSYS;
int led_gpio_register(struct gpio_led *led) { return -ENOSYS; }


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

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

LLVM IR (-O0):
%struct.gpio_led = type { i32 }
@ENOSYS = global i32 0
define i32 @led_gpio_register(%struct.gpio_led* %0) {
%2 = alloca %struct.gpio_led*
store %struct.gpio_led* %0, %struct.gpio_led** %2
%3 = load i32, i32* @ENOSYS
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
%struct.gpio_led = type { i32 }
@ENOSYS = global i32 0
define i32 @led_gpio_register(%struct.gpio_led* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
%3 = sub nsw i32 0, %2
ret i32 %3
}
void nfs3_forget_cached_acls(struct inode *inode) {}


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

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

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

LLVM IR (-O2):
%struct.inode = type opaque
define void @nfs3_forget_cached_acls(%struct.inode* nocapture %0) {
ret void
}
int mlockall(int __flags) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mlockall(i32 %0) {
ret i32 0
}
int test_12c(void) {
  int i;
  int j;
  j = i;
  return j;
}


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

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

LLVM IR (-O0):
define i32 @test_12c() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %1
store i32 %3, i32* %2
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
define i32 @test_12c() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test();
int main() {
  printf("C\n");
  int i = 1;
  if (i == 2)
    test();
  printf("test not used func\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    1153 <main+0x33>
mov    $0x0,%al
call   1040 <test@plt>
lea    0xea9(%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    0xede(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"C\0A\00"
@.str.1 = [20 x i8] c"test not used func\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 2
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @test()
br label %8
8: ; preds = %6, %0
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [2 x i8] c"C\00"
@str.2 = [19 x i8] c"test not used func\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ tracee_read(int /*<<< orphan*/, char *, char const *,
                               size_t);
size_t tracee_strlen(int /*<<< orphan*/, char const *);
char *tracee_strdup(pid_t tid, const char *str) {
  size_t length = tracee_strlen(tid, str);
  char *res = malloc(length + 1);
  tracee_read(tid, res, str, length);
  res[length] = '\0';
  return res;
}


x86 assembly (clang, -O0):
<tracee_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <tracee_strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1050 <tracee_read@plt>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tracee_strdup>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%r15d
call   1030 <tracee_strlen@plt>
mov    %rax,%rbx
lea    0x1(%rax),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbp
mov    %r15d,%edi
mov    %rax,%rsi
mov    %r14,%rdx
mov    %rbx,%rcx
call   1050 <tracee_read@plt>
movb   $0x0,0x0(%rbp,%rbx,1)
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @tracee_strdup(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = call i64 @tracee_strlen(i32 %7, i8* %8)
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = add i64 %10, 1
%12 = call i8* @malloc(i64 %11)
store i8* %12, i8** %6
%13 = load i32, i32* %3
%14 = load i8*, i8** %6
%15 = load i8*, i8** %4
%16 = load i64, i64* %5
%17 = call i32 @tracee_read(i32 %13, i8* %14, i8* %15, i64 %16)
%18 = load i8*, i8** %6
%19 = load i64, i64* %5
%20 = getelementptr inbounds i8, i8* %18, i64 %19
store i8 0, i8* %20
%21 = load i8*, i8** %6
ret i8* %21
}

LLVM IR (-O2):
define i8* @tracee_strdup(i32 %0, i8* %1) {
%3 = tail call i64 @tracee_strlen(i32 %0, i8* %1)
%4 = add i64 %3, 1
%5 = tail call i8* @malloc(i64 %4)
%6 = tail call i32 @tracee_read(i32 %0, i8* %5, i8* %1, i64 %3)
%7 = getelementptr inbounds i8, i8* %5, i64 %3
store i8 0, i8* %7
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
main() {
  char v;
  char ch = 'a';
  putchar(v);
  putchar(ch);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x61,-0x2(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
movsbl -0x2(%rbp),%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <putchar@plt>
mov    $0x61,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i8 signext undef)
%2 = tail call i32 @putchar(i8 signext 97)
ret i32 0
}
/* Variables and functions */
int os_daemonize(const char *pid_file) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @os_daemonize(i8* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ PopSource();
int /*<<< orphan*/ PushSource(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ diagnostics(int, char *, char *, int);
int getDimension();
int getStringDimension(char *s) {
  int size = 0;
  if (s != NULL) {
    PushSource(NULL, s);
    size = getDimension();
    PopSource();
  }
  diagnostics(5, "getStringDimension fore '%s' is %d twips", s, size);
  return size;
}


x86 assembly (clang, -O0):
<getStringDimension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     117c <getStringDimension+0x3c>
mov    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1030 <PushSource@plt>
mov    $0x0,%al
call   1060 <getDimension@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <PopSource@plt>
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    $0x5,%edi
lea    0xe71(%rip),%rsi
call   1040 <diagnostics@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getStringDimension>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
test   %rdi,%rdi
je     1167 <getStringDimension+0x27>
xor    %edi,%edi
mov    %rbx,%rsi
call   1030 <PushSource@plt>
xor    %eax,%eax
call   1060 <getDimension@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <PopSource@plt>
jmp    1169 <getStringDimension+0x29>
xor    %ebp,%ebp
lea    0xe90(%rip),%rsi
mov    $0x5,%edi
mov    %rbx,%rdx
mov    %ebp,%ecx
call   1040 <diagnostics@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [41 x i8] c"getStringDimension fore '%s' is %d twips\00"
define i32 @getStringDimension(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @PushSource(i32* null, i8* %7)
%9 = call i32 (...) @getDimension()
store i32 %9, i32* %3
%10 = call i32 (...) @PopSource()
br label %11
11: ; preds = %6, %1
%12 = load i8*, i8** %2
%13 = load i32, i32* %3
%14 = call i32 @diagnostics(i32 5, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %12, i32 %13)
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@.str = [41 x i8] c"getStringDimension fore '%s' is %d twips\00"
define i32 @getStringDimension(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @PushSource(i32* null, i8* %0)
%5 = tail call i32 (...) @getDimension()
%6 = tail call i32 (...) @PopSource()
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ %5, %3 ], [ 0, %1 ]
%9 = tail call i32 @diagnostics(i32 5, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %8)
ret i32 %8
}
/* Variables and functions */
bool speculating() { return false; }


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

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

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

LLVM IR (-O2):
define i32 @speculating() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ lseek(int, int, int /*<<< orphan*/);
int write(int, void *, int);
int mywrite(int fd, void *data, int datalen, int offset) {
  lseek(fd, offset, SEEK_SET);
  return write(fd, data, datalen);
}


x86 assembly (clang, -O0):
<mywrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    0x2e9e(%rip),%rax
mov    (%rax),%edx
call   1040 <lseek@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mywrite>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
mov    %ecx,%esi
call   1040 <lseek@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @mywrite(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %8
%11 = load i32, i32* @SEEK_SET
%12 = call i32 @lseek(i32 %9, i32 %10, i32 %11)
%13 = load i32, i32* %5
%14 = load i8*, i8** %6
%15 = load i32, i32* %7
%16 = call i32 @write(i32 %13, i8* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @mywrite(i32 %0, i8* nocapture %1, i32 %2, i32 %3) {
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @lseek(i32 %0, i32 %3, i32 %5)
%7 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
struct cart_unif_data {
  int dummy;
};

/* Variables and functions */
struct cart_unif_data *cart_unif_add_chunk(struct cart_unif_data *, char *,
                                           int /*<<< orphan*/,
                                           int /*<<< orphan*/ *);
struct cart_unif_data *cart_unif_add_prg_chunk(struct cart_unif_data *chunks,
                                               uint32_t size, uint8_t *prg_data,
                                               int chip_number) {
  return cart_unif_add_chunk(chunks, "PRG0", size, prg_data);
}


x86 assembly (clang, -O0):
<cart_unif_add_prg_chunk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xec8(%rip),%rsi
call   1030 <cart_unif_add_chunk@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cart_unif_add_prg_chunk>:
mov    %rdx,%rcx
mov    %esi,%edx
lea    0xee4(%rip),%rsi
jmp    1030 <cart_unif_add_chunk@plt>

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

LLVM IR (-O2):
%struct.cart_unif_data = type { i32 }
@.str = [5 x i8] c"PRG0\00"
define %struct.cart_unif_data* @cart_unif_add_prg_chunk(%struct.cart_unif_data* %0, i32 %1, i32* %2, i32 %3) {
%5 = tail call %struct.cart_unif_data* @cart_unif_add_chunk(%struct.cart_unif_data* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1, i32* %2)
ret %struct.cart_unif_data* %5
}
int test_imm_62uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x62 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_62uint64_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, 98
%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_62uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 420906795008
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct tx_broadcast {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ peergroup_free_tx_broadcast_entry(struct tx_broadcast *);
void peergroup_free_tx_broadcast_cb(const void *key, size_t keylen,
                                    void *clientData) {
  struct tx_broadcast *txb = (struct tx_broadcast *)clientData;
  peergroup_free_tx_broadcast_entry(txb);
}


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

x86 assembly (clang, -O2):
<peergroup_free_tx_broadcast_cb>:
mov    %rdx,%rdi
jmp    1030 <peergroup_free_tx_broadcast_entry@plt>

LLVM IR (-O0):
%struct.tx_broadcast = type { i32 }
define void @peergroup_free_tx_broadcast_cb(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
%7 = alloca %struct.tx_broadcast*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = bitcast i8* %8 to %struct.tx_broadcast*
store %struct.tx_broadcast* %9, %struct.tx_broadcast** %7
%10 = load %struct.tx_broadcast*, %struct.tx_broadcast** %7
%11 = call i32 @peergroup_free_tx_broadcast_entry(%struct.tx_broadcast* %10)
ret void
}

LLVM IR (-O2):
%struct.tx_broadcast = type { i32 }
define void @peergroup_free_tx_broadcast_cb(i8* nocapture readnone %0, i64 %1, i8* %2) {
%4 = bitcast i8* %2 to %struct.tx_broadcast*
%5 = tail call i32 @peergroup_free_tx_broadcast_entry(%struct.tx_broadcast* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: opt2rst {synopsis|options}\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"Usage: opt2rst {synopsis|options}\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"Usage: opt2rst {synopsis|options}\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int test_imm_BAuint8_mem(unsigned char *val) {
  return ((*val) & (-0xBA << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_BAuint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -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_BAuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 70
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int func4() {}


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

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

LLVM IR (-O0):
define i32 @func4() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @func4() {
ret i32 undef
}
/* Type definitions */
struct imv_console {
  int dummy;
};

/* Variables and functions */
const char *imv_console_backlog(struct imv_console *console) {
  (void)console;
  return NULL;
}


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

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

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

LLVM IR (-O2):
%struct.imv_console = type { i32 }
define noalias i8* @imv_console_backlog(%struct.imv_console* nocapture readnone %0) {
ret i8* null
}
/* Type definitions */
struct rtas_event_hdr {
  int dummy;
};
struct rtas_event {
  int dummy;
};

/* Variables and functions */
scalar_t__ get_re_scn(struct rtas_event *, int);
struct rtas_event_hdr *rtas_get_event_hdr_scn(struct rtas_event *re) {
  return (struct rtas_event_hdr *)get_re_scn(re, 1);
}


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

x86 assembly (clang, -O2):
<rtas_get_event_hdr_scn>:
mov    $0x1,%esi
jmp    1030 <get_re_scn@plt>

LLVM IR (-O0):
%struct.rtas_event_hdr = type { i32 }
%struct.rtas_event = type { i32 }
define %struct.rtas_event_hdr* @rtas_get_event_hdr_scn(%struct.rtas_event* %0) {
%2 = alloca %struct.rtas_event*
store %struct.rtas_event* %0, %struct.rtas_event** %2
%3 = load %struct.rtas_event*, %struct.rtas_event** %2
%4 = call i64 @get_re_scn(%struct.rtas_event* %3, i32 1)
%5 = inttoptr i64 %4 to %struct.rtas_event_hdr*
ret %struct.rtas_event_hdr* %5
}

LLVM IR (-O2):
%struct.rtas_event_hdr = type { i32 }
%struct.rtas_event = type { i32 }
define %struct.rtas_event_hdr* @rtas_get_event_hdr_scn(%struct.rtas_event* %0) {
%2 = tail call i64 @get_re_scn(%struct.rtas_event* %0, i32 1)
%3 = inttoptr i64 %2 to %struct.rtas_event_hdr*
ret %struct.rtas_event_hdr* %3
}
void g_source_remove_by_funcs_user_data() {}


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

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

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

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

/* Variables and functions */
unsigned long get_pageblock_flags_mask(struct page *, int, unsigned long);
unsigned long get_pageblock_flags_group(struct page *page, int start_bitidx,
                                        int end_bitidx) {
  unsigned long nr_flag_bits = end_bitidx - start_bitidx + 1;
  unsigned long mask = (1 << nr_flag_bits) - 1;
  return get_pageblock_flags_mask(page, end_bitidx, mask);
}


x86 assembly (clang, -O0):
<get_pageblock_flags_group>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
cltq
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1030 <get_pageblock_flags_mask@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pageblock_flags_group>:
mov    %edx,%ecx
sub    %esi,%ecx
add    $0x1,%cl
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
cltq
mov    %edx,%esi
mov    %rax,%rdx
jmp    1030 <get_pageblock_flags_mask@plt>

LLVM IR (-O0):
%struct.page = type { i32 }
define i64 @get_pageblock_flags_group(%struct.page* %0, i32 %1, i32 %2) {
%4 = alloca %struct.page*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
store %struct.page* %0, %struct.page** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %6
%10 = load i32, i32* %5
%11 = sub nsw i32 %9, %10
%12 = add nsw i32 %11, 1
%13 = sext i32 %12 to i64
store i64 %13, i64* %7
%14 = load i64, i64* %7
%15 = trunc i64 %14 to i32
%16 = shl i32 1, %15
%17 = sub nsw i32 %16, 1
%18 = sext i32 %17 to i64
store i64 %18, i64* %8
%19 = load %struct.page*, %struct.page** %4
%20 = load i32, i32* %6
%21 = load i64, i64* %8
%22 = call i64 @get_pageblock_flags_mask(%struct.page* %19, i32 %20, i64 %21)
ret i64 %22
}

LLVM IR (-O2):
%struct.page = type { i32 }
define i64 @get_pageblock_flags_group(%struct.page* %0, i32 %1, i32 %2) {
%4 = sub i32 1, %1
%5 = add i32 %4, %2
%6 = shl nsw i32 -1, %5
%7 = xor i32 %6, -1
%8 = sext i32 %7 to i64
%9 = tail call i64 @get_pageblock_flags_mask(%struct.page* %0, i32 %2, i64 %8)
ret i64 %9
}
int *foo4(int **a, int b) { return __sync_fetch_and_sub(a, b); }


x86 assembly (clang, -O0):
<foo4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rax
neg    %rax
lock xadd %rax,(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo4>:
movslq %esi,%rax
neg    %rax
lock xadd %rax,(%rdi)
ret

LLVM IR (-O0):
define i32* @foo4(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 = bitcast i32** %5 to i64*
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = ptrtoint i32* %9 to i64
%11 = atomicrmw sub i64* %6, i64 %10 seq_cst
%12 = inttoptr i64 %11 to i32*
ret i32* %12
}

LLVM IR (-O2):
define i32* @foo4(i32** nocapture %0, i32 %1) {
%3 = bitcast i32** %0 to i64*
%4 = sext i32 %1 to i64
%5 = atomicrmw sub i64* %3, i64 %4 seq_cst
%6 = inttoptr i64 %5 to i32*
ret i32* %6
}
int whitespace(char c) {
  if (c == ' ' || c == '\t' || c == '\n' || c == '\r')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     113e <whitespace+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
je     113e <whitespace+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     113e <whitespace+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0xd,%eax
jne    114a <whitespace+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <whitespace+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<whitespace>:
cmp    $0x20,%dil
ja     1120 <whitespace+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100002600,%rdx
bt     %rcx,%rdx
jae    1120 <whitespace+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @whitespace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %3
i8 13, label %3
i8 10, label %3
i8 9, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
size_t xgetkey(int /*<<< orphan*/, int /*<<< orphan*/);
size_t getkey(void) { return xgetkey(0, 0); }


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

x86 assembly (clang, -O2):
<getkey>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <xgetkey@plt>

LLVM IR (-O0):
define i64 @getkey() {
%1 = call i64 @xgetkey(i32 0, i32 0)
ret i64 %1
}

LLVM IR (-O2):
define i64 @getkey() {
%1 = tail call i64 @xgetkey(i32 0, i32 0)
ret i64 %1
}
void basic(void) { return; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fputs(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ gettext(char *);
void print_usage(FILE *stream) {
  fputs(
      gettext(
          "Usage: ypwhich [-d domain] [[-t] -m [mname]|[-Vn] hostname] | -x\n"),
      stream);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <gettext@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1040 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <gettext@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <fputs@plt>

LLVM IR (-O0):
@.str = [66 x i8] c"Usage: ypwhich [-d domain] [[-t] -m [mname]|[-Vn] hostname] | -x\0A\00"
define void @print_usage(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @gettext(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%4 = load i32*, i32** %2
%5 = call i32 @fputs(i32 %3, i32* %4)
ret void
}

LLVM IR (-O2):
@.str = [66 x i8] c"Usage: ypwhich [-d domain] [[-t] -m [mname]|[-Vn] hostname] | -x\0A\00"
define void @print_usage(i32* %0) {
%2 = tail call i32 @gettext(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @fputs(i32 %2, i32* %0)
ret void
}
void tegra2_sdmmc_tap_delay(struct clk *c, int delay) {}


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

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

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

LLVM IR (-O2):
%struct.clk = type opaque
define void @tegra2_sdmmc_tap_delay(%struct.clk* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ v1;

/* Variables and functions */
int kadane(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int v1[] = {-2, 1, -3, 4, -1, 2, 1, -5, 4};
  printf("%d\n", kadane(v1, (sizeof(v1) / sizeof(v1[0]))));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x24,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0x9,%esi
call   1040 <kadane@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x9,%esi
call   1040 <kadane@plt>
lea    0xecb(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@__const.main.v1 = [9 x i32] [i32 -2, i32 1, i32 -3, i32 4, i32 -1, i32 2, i32 1, i32 -5, i32 4]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @kadane(i32* %3, i32 9)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
void *signal_set(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void *signal_ignore(int signo) { return signal_set(signo, NULL, NULL); }


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

x86 assembly (clang, -O2):
<signal_ignore>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <signal_set@plt>

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

LLVM IR (-O2):
define i8* @signal_ignore(i32 %0) {
%2 = tail call i8* @signal_set(i32 %0, i32* null, i32* null)
ret i8* %2
}