xunge/DecIR huggingface dataset:
int pr43638(int *a) {
  a = __builtin_assume_aligned(a, 4294967296);
  return a[0];
}


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

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

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

LLVM IR (-O2):
define i32 @pr43638(i32* %0) {
%2 = bitcast i32* %0 to i8*
%3 = load i32, i32* %0
ret i32 %3
}
/* Variables and functions */
char *malloc(int);
int strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, int);
char *str_slice(const char *str, int offset) {
  int source_len = strlen(str);
  int result_len = source_len - offset;
  int bytes = (result_len + 1) * sizeof(char);
  char *result = malloc(bytes);
  strncpy(result, str, result_len);
  return result;
}


x86 assembly (clang, -O0):
<str_slice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_slice>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%r15
call   1040 <strlen@plt>
mov    %eax,%ebp
sub    %r14d,%ebp
lea    0x1(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
call   1030 <strncpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @str_slice(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%9 = load i8*, i8** %3
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = sub nsw i32 %11, %12
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = add nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = mul i64 %16, 1
%18 = trunc i64 %17 to i32
store i32 %18, i32* %7
%19 = load i32, i32* %7
%20 = call i8* @malloc(i32 %19)
store i8* %20, i8** %8
%21 = load i8*, i8** %8
%22 = load i8*, i8** %3
%23 = load i32, i32* %6
%24 = call i32 @strncpy(i8* %21, i8* %22, i32 %23)
%25 = load i8*, i8** %8
ret i8* %25
}

LLVM IR (-O2):
define i8* @str_slice(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sub nsw i32 %3, %1
%5 = add nsw i32 %4, 1
%6 = tail call i8* @malloc(i32 %5)
%7 = tail call i32 @strncpy(i8* %6, i8* %0, i32 %4)
ret i8* %6
}
void gtk_image_get_image() {}


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

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

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

LLVM IR (-O2):
define void @gtk_image_get_image() {
ret void
}
void gtk_text_iter_get_char() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_get_char() {
ret void
}
int entity_new(void) {
  static int entity_count = 0;
  return entity_count++;
}


x86 assembly (clang, -O0):
<entity_new>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f0f(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<entity_new>:
mov    0x2f1e(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f15(%rip)
ret

LLVM IR (-O0):
@entity_new.entity_count = internal global i32 0
define i32 @entity_new() {
%1 = load i32, i32* @entity_new.entity_count
%2 = add nsw i32 %1, 1
store i32 %2, i32* @entity_new.entity_count
ret i32 %1
}

LLVM IR (-O2):
@entity_new.entity_count = internal unnamed_addr global i32 0
define i32 @entity_new() {
%1 = load i32, i32* @entity_new.entity_count
%2 = add nsw i32 %1, 1
store i32 %2, i32* @entity_new.entity_count
ret i32 %1
}
tio(a, f) {
  a = open(a, f);
  if (a >= 0) {
    close(a);
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<tio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1040 <open@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     115e <tio+0x3e>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <close@plt>
movl   $0x1,-0x4(%rbp)
jmp    1165 <tio+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tio>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <open@plt>
test   %eax,%eax
js     113c <tio+0x1c>
mov    %eax,%edi
xor    %eax,%eax
call   1030 <close@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @tio(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = call i32 (i32, i32, ...) bitcast (i32 (...)* @open to i32 (i32, i32, ...)*)(i32 %6, i32 %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32, i32* %4
%13 = call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %12)
store i32 1, i32* %3
br label %15
14: ; preds = %2
store i32 0, i32* %3
br label %15
15: ; preds = %14, %11
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @tio(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @open to i32 (i32, i32, ...)*)(i32 %0, i32 %1)
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %3)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 1, %5 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void pause() { sleep(1); }


x86 assembly (clang, -O0):
<pause>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <sleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pause>:
mov    $0x1,%edi
jmp    1030 <sleep@plt>

LLVM IR (-O0):
define void @pause() {
%1 = call i32 @sleep(i32 1)
ret void
}

LLVM IR (-O2):
define void @pause() {
%1 = tail call i32 @sleep(i32 1)
ret void
}
unsigned long long
unsignedlonglong_ignoring_unsignedshortint(unsigned long long x,
                                           unsigned short int y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i64 @unsignedlonglong_ignoring_unsignedshortint(i64 returned %0, i16 zeroext %1) {
ret i64 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t htob_u16(uint16_t hostval) {
  union {
    uint16_t s;
    uint8_t b[2];
  } u1, u2;
  u1.s = hostval;
  u2.b[0] = u1.b[1];
  u2.b[1] = u1.b[0];
  return u2.s;
}


x86 assembly (clang, -O0):
<htob_u16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { [2 x i32] }
define i32 @htob_u16(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
%4 = alloca %union.anon
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = bitcast %union.anon* %3 to i32*
store i32 %5, i32* %6
%7 = bitcast %union.anon* %3 to [2 x i32]*
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%9 = load i32, i32* %8
%10 = bitcast %union.anon* %4 to [2 x i32]*
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
store i32 %9, i32* %11
%12 = bitcast %union.anon* %3 to [2 x i32]*
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 0
%14 = load i32, i32* %13
%15 = bitcast %union.anon* %4 to [2 x i32]*
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %15, i64 0, i64 1
store i32 %14, i32* %16
%17 = bitcast %union.anon* %4 to i32*
%18 = load i32, i32* %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @htob_u16(i32 %0) {
ret i32 undef
}
void *to_addr(unsigned int index, unsigned int chunk_offset, void *base) {
  return (void *)((unsigned int *)base + index * (32 * (1 << 4)) +
                  chunk_offset * (1 << 4));
}


x86 assembly (clang, -O0):
<to_addr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
shl    $0x9,%ecx
mov    %ecx,%ecx
shl    $0x2,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%ecx
shl    $0x4,%ecx
mov    %ecx,%ecx
shl    $0x2,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_addr>:
shl    $0x9,%edi
lea    (%rdx,%rdi,4),%rax
shl    $0x4,%esi
lea    (%rax,%rsi,4),%rax
ret

LLVM IR (-O0):
define i8* @to_addr(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %4
%10 = mul i32 %9, 512
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %8, i64 %11
%13 = load i32, i32* %5
%14 = mul i32 %13, 16
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %12, i64 %15
%17 = bitcast i32* %16 to i8*
ret i8* %17
}

LLVM IR (-O2):
define i8* @to_addr(i32 %0, i32 %1, i8* readnone %2) {
%4 = bitcast i8* %2 to i32*
%5 = shl i32 %0, 9
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %4, i64 %6
%8 = shl i32 %1, 4
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
%11 = bitcast i32* %10 to i8*
ret i8* %11
}
/* Type definitions */
struct v4l_fd {
  int dummy;
};

/* Variables and functions */
int open(char const *, int);
int v4l_wrap_open(struct v4l_fd *f, const char *file, int oflag, ...) {
  return open(file, oflag);
}


x86 assembly (clang, -O0):
<v4l_wrap_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <open@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v4l_wrap_open>:
mov    %rsi,%rdi
mov    %edx,%esi
jmp    1030 <open@plt>

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

LLVM IR (-O2):
%struct.v4l_fd = type { i32 }
define i32 @v4l_wrap_open(%struct.v4l_fd* nocapture readnone %0, i8* nocapture %1, i32 %2, ...) {
%4 = tail call i32 @open(i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x38() {
  Assert_real((isupper(56) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              285, ("isupper should be 0 for 8"));
}


x86 assembly (clang, -O0):
<t_isupper_0x38>:
push   %rbp
mov    %rsp,%rbp
mov    $0x38,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x11d,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x38>:
push   %rax
mov    $0x38,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x11d,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for 8\00"
define void @t_isupper_0x38() {
%1 = call i64 @isupper(i32 56)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 285, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for 8\00"
define void @t_isupper_0x38() {
%1 = tail call i64 @isupper(i32 56)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 285, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_A1int16_mem(short *val) {
  return ((*val) & (0xA1 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A1int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 161
%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_A1int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 161
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ strcmp(char *, char *);
int main(void) {
  assert(strcmp("AB", "AB") == 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rsi
mov    %rsi,%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rdi,%rsi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"AB\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"AB\00"
define i32 @main() {
%1 = tail call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_MD_CTX;

/* Variables and functions */
int update(EVP_MD_CTX *ctx, const void *data, size_t count) { return 1; }


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

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

LLVM IR (-O0):
define i32 @update(i32* %0, i8* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i64
store i32* %0, i32** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
ret i32 1
}

LLVM IR (-O2):
define i32 @update(i32* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i32 1
}
void g_node_depth() {}


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

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

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

LLVM IR (-O2):
define void @g_node_depth() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_node_data_amr(int, int, int, char *, char *, char *,
                                          char *, char *, char *);
void fgmvwrite_node_data_amr_(int *nxc, int *nyc, int *nzc, char *x0, char *y0,
                              char *z0, char *dx, char *dy, char *dz) {
  gmvwrite_node_data_amr(*nxc, *nyc, *nzc, x0, y0, z0, dx, dy, dz);
}


x86 assembly (clang, -O0):
<fgmvwrite_node_data_amr_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%r11
mov    0x18(%rbp),%r10
mov    0x20(%rbp),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <gmvwrite_node_data_amr@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgmvwrite_node_data_amr_>:
mov    (%rdi),%edi
mov    (%rsi),%esi
mov    (%rdx),%edx
jmp    1030 <gmvwrite_node_data_amr@plt>

LLVM IR (-O0):
define void @fgmvwrite_node_data_amr_(i32* %0, i32* %1, i32* %2, i8* %3, i8* %4, i8* %5, i8* %6, i8* %7, i8* %8) {
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i8*
store i32* %0, i32** %10
store i32* %1, i32** %11
store i32* %2, i32** %12
store i8* %3, i8** %13
store i8* %4, i8** %14
store i8* %5, i8** %15
store i8* %6, i8** %16
store i8* %7, i8** %17
store i8* %8, i8** %18
%19 = load i32*, i32** %10
%20 = load i32, i32* %19
%21 = load i32*, i32** %11
%22 = load i32, i32* %21
%23 = load i32*, i32** %12
%24 = load i32, i32* %23
%25 = load i8*, i8** %13
%26 = load i8*, i8** %14
%27 = load i8*, i8** %15
%28 = load i8*, i8** %16
%29 = load i8*, i8** %17
%30 = load i8*, i8** %18
%31 = call i32 @gmvwrite_node_data_amr(i32 %20, i32 %22, i32 %24, i8* %25, i8* %26, i8* %27, i8* %28, i8* %29, i8* %30)
ret void
}

LLVM IR (-O2):
define void @fgmvwrite_node_data_amr_(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, i8* %3, i8* %4, i8* %5, i8* %6, i8* %7, i8* %8) {
%10 = load i32, i32* %0
%11 = load i32, i32* %1
%12 = load i32, i32* %2
%13 = tail call i32 @gmvwrite_node_data_amr(i32 %10, i32 %11, i32 %12, i8* %3, i8* %4, i8* %5, i8* %6, i8* %7, i8* %8)
ret void
}
void RTPathStripFilename(void) {}


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

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

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

LLVM IR (-O2):
define void @RTPathStripFilename() {
ret void
}
void XNextEvent() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ lc_in(struct lc_dev *);
void *lc_reader(void *arg) {
  struct lc_dev *dev = arg;
  while (1)
    lc_in(dev);
  return NULL;
}


x86 assembly (clang, -O0):
<lc_reader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <lc_in@plt>
jmp    1124 <lc_reader+0x14>

x86 assembly (clang, -O2):
<lc_reader>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <lc_in@plt>
jmp    1120 <lc_reader+0x10>

LLVM IR (-O0):
%struct.lc_dev = type { i32 }
define i8* @lc_reader(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.lc_dev*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.lc_dev*
store %struct.lc_dev* %5, %struct.lc_dev** %3
br label %6
6: ; preds = %1, %6
%7 = load %struct.lc_dev*, %struct.lc_dev** %3
%8 = call i32 @lc_in(%struct.lc_dev* %7)
br label %6
}

LLVM IR (-O2):
%struct.lc_dev = type { i32 }
define noalias i8* @lc_reader(i8* %0) {
%2 = bitcast i8* %0 to %struct.lc_dev*
br label %3
3: ; preds = %3, %1
%4 = tail call i32 @lc_in(%struct.lc_dev* %2)
br label %3
}
int intel_msic_restore_config_data(const char *name, void *data, int len) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @intel_msic_restore_config_data(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
ret i32 0
}

LLVM IR (-O2):
define i32 @intel_msic_restore_config_data(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
double atan(double);
double ath_freq2bark(double freq) {
  if (freq < 0)
    freq = 0;
  freq = freq * 0.001;
  return 13.0 * atan(.76 * freq) + 3.5 * atan(freq * freq / (7.5 * 7.5));
}


x86 assembly (clang, -O0):
<ath_freq2bark>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1133 <ath_freq2bark+0x23>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xee5(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xecb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <atan@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xea2(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <atan@plt>
movaps %xmm0,%xmm2
movsd  -0x10(%rbp),%xmm0
movsd  0xe81(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe6d(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ath_freq2bark>:
sub    $0x18,%rsp
xorpd  %xmm1,%xmm1
maxsd  %xmm0,%xmm1
mulsd  0xedc(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0xed6(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <atan@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  %xmm0,%xmm0
divsd  0xebd(%rip),%xmm0
call   1030 <atan@plt>
mulsd  0xeb8(%rip),%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  0xeb2(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @ath_freq2bark(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
store double 0.000000e+00, double* %2
br label %6
6: ; preds = %5, %1
%7 = load double, double* %2
%8 = fmul double %7, 1.000000e-03
store double %8, double* %2
%9 = load double, double* %2
%10 = fmul double 7.600000e-01, %9
%11 = call double @atan(double %10)
%12 = load double, double* %2
%13 = load double, double* %2
%14 = fmul double %12, %13
%15 = fdiv double %14, 5.625000e+01
%16 = call double @atan(double %15)
%17 = fmul double 3.500000e+00, %16
%18 = call double @llvm.fmuladd.f64(double 1.300000e+01, double %11, double %17)
ret double %18
}

LLVM IR (-O2):
define double @ath_freq2bark(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = select i1 %2, double 0.000000e+00, double %0
%4 = fmul double %3, 1.000000e-03
%5 = fmul double %4, 7.600000e-01
%6 = tail call double @atan(double %5)
%7 = fmul double %4, %4
%8 = fdiv double %7, 5.625000e+01
%9 = tail call double @atan(double %8)
%10 = fmul double %9, 3.500000e+00
%11 = tail call double @llvm.fmuladd.f64(double %6, double 1.300000e+01, double %10)
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ process_votes(int, int *);
int *read_votes(int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int p, d;
  scanf("%d %d", &p, &d);
  int *votes = read_votes(p, d);
  process_votes(d, votes);
  free(votes);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1060 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <read_votes@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1040 <process_votes@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1060 <scanf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1050 <read_votes@plt>
mov    %rax,%rbx
mov    0x8(%rsp),%edi
mov    %rax,%rsi
call   1040 <process_votes@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32* @read_votes(i32 %6, i32 %7)
store i32* %8, i32** %4
%9 = load i32, i32* %3
%10 = load i32*, i32** %4
%11 = call i32 @process_votes(i32 %9, i32* %10)
%12 = load i32*, i32** %4
%13 = call i32 @free(i32* %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32* @read_votes(i32 %6, i32 %7)
%9 = load i32, i32* %2
%10 = call i32 @process_votes(i32 %9, i32* %8)
%11 = call i32 @free(i32* %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
void *malloc(size_t);
void *xmalloc(size_t len) {
  void *p;
  if ((p = malloc(len)) == NULL) {
    error("out of memory");
  };
  return (p);
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    114f <xmalloc+0x2f>
lea    0xeb6(%rip),%rdi
call   1040 <error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xmalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
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 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
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 @error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
void foo(char **pp) {
  *pp = (char *)malloc(10 * sizeof(char));
  strcpy(*pp, "abcd");
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    0xeb2(%rip),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,(%rbx)
lea    0xec8(%rip),%rsi
mov    %rax,%rdi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"abcd\00"
define void @foo(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i64 @malloc(i32 10)
%4 = inttoptr i64 %3 to i8*
%5 = load i8**, i8*** %2
store i8* %4, i8** %5
%6 = load i8**, i8*** %2
%7 = load i8*, i8** %6
%8 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"abcd\00"
define void @foo(i8** nocapture writeonly %0) {
%2 = tail call i64 @malloc(i32 10)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %0
%4 = tail call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void bad_usage(char *name) {
  fprintf(stderr, "Try '%s --help' for more information.\n", name);
}


x86 assembly (clang, -O0):
<bad_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bad_usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"Try '%s --help' for more information.\0A\00"
define void @bad_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"Try '%s --help' for more information.\0A\00"
define void @bad_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int neg32(int a) { return 0 - a; }


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

x86 assembly (clang, -O2):
<neg32>:
mov    %edi,%eax
neg    %eax
ret

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

LLVM IR (-O2):
define i32 @neg32(i32 %0) {
%2 = sub nsw i32 0, %0
ret i32 %2
}
void Msat_ReadNotWhitespace(char **pIn) {
  while (!((**pIn >= 9 && **pIn <= 13) || **pIn == 32))
    (*pIn)++;
}


x86 assembly (clang, -O0):
<Msat_ReadNotWhitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
jl     1133 <Msat_ReadNotWhitespace+0x33>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x9(%rbp)
jle    1146 <Msat_ReadNotWhitespace+0x46>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
xor    $0xff,%al
test   $0x1,%al
jne    1158 <Msat_ReadNotWhitespace+0x58>
jmp    116b <Msat_ReadNotWhitespace+0x6b>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1108 <Msat_ReadNotWhitespace+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Msat_ReadNotWhitespace>:
mov    (%rdi),%rax
add    $0x1,%rax
movabs $0x100003e00,%rcx
jmp    1127 <Msat_ReadNotWhitespace+0x27>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rax,(%rdi)
add    $0x1,%rax
movzbl -0x1(%rax),%edx
cmp    $0x20,%rdx
ja     1120 <Msat_ReadNotWhitespace+0x20>
bt     %rdx,%rcx
jae    1120 <Msat_ReadNotWhitespace+0x20>
ret

LLVM IR (-O0):
define void @Msat_ReadNotWhitespace(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
br label %3
3: ; preds = %24, %1
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp sge i32 %7, 9
br i1 %8, label %9, label %15
9: ; preds = %3
%10 = load i8**, i8*** %2
%11 = load i8*, i8** %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp sle i32 %13, 13
br i1 %14, label %21, label %15
15: ; preds = %9, %3
%16 = load i8**, i8*** %2
%17 = load i8*, i8** %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 32
br label %21
21: ; preds = %15, %9
%22 = phi i1 [ true, %9 ], [ %20, %15 ]
%23 = xor i1 %22, true
br i1 %23, label %24, label %28
24: ; preds = %21
%25 = load i8**, i8*** %2
%26 = load i8*, i8** %25
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %25
br label %3
28: ; preds = %21
ret void
}

LLVM IR (-O2):
define void @Msat_ReadNotWhitespace(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %6, %1
%4 = phi i8* [ %7, %6 ], [ %2, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 32, label %8
i8 13, label %8
i8 12, label %8
i8 11, label %8
i8 10, label %8
i8 9, label %8
]
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %7, i8** %0
br label %3
8: ; preds = %3, %3, %3, %3, %3, %3
ret void
}
/* Type definitions */
typedef double uint64_t;

/* Variables and functions */
double to_res53(uint64_t v) { return v * (1.0 / 18446744073709551616.0L); }


x86 assembly (clang, -O0):
<to_res53>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
fldl   -0x8(%rbp)
flds   0xeee(%rip)
fmulp  %st,%st(1)
fstpl  -0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_res53>:
movsd  %xmm0,-0x8(%rsp)
fldl   -0x8(%rsp)
fmuls  0xef0(%rip)
fstpl  -0x10(%rsp)
movsd  -0x10(%rsp),%xmm0
ret

LLVM IR (-O0):
define double @to_res53(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fpext double %3 to x86_fp80
%5 = fmul x86_fp80 %4, 0xK3FBF8000000000000000
%6 = fptrunc x86_fp80 %5 to double
ret double %6
}

LLVM IR (-O2):
define double @to_res53(double %0) {
%2 = fpext double %0 to x86_fp80
%3 = fmul x86_fp80 %2, 0xK3FBF8000000000000000
%4 = fptrunc x86_fp80 %3 to double
ret double %4
}
g(int i) { return 6; }


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

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

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

LLVM IR (-O2):
define i32 @g(i32 %0) {
ret i32 6
}
int test_imm_C7uint16_mem(unsigned short *val) {
  return ((*val) & (0xC7 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_C7uint16_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, 199
%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_C7uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 199
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISLNK(int /*<<< orphan*/);
scalar_t__ S_ISREG(int /*<<< orphan*/);
int /*<<< orphan*/ stat(char const *, struct stat *);
int file_loadable(const char *file) {
  struct stat statf;
  stat(file, &statf);
  return S_ISREG(statf.st_mode) || S_ISLNK(statf.st_mode);
}


x86 assembly (clang, -O0):
<file_loadable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
mov    -0x10(%rbp),%edi
call   1050 <S_ISREG@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    1175 <file_loadable+0x45>
mov    -0x10(%rbp),%edi
call   1030 <S_ISLNK@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_loadable>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rsi
call   1040 <stat@plt>
mov    0x8(%rsp),%ebx
mov    %ebx,%edi
call   1050 <S_ISREG@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    1169 <file_loadable+0x39>
mov    %ebx,%edi
call   1030 <S_ISLNK@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @file_loadable(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%7 = load i32, i32* %6
%8 = call i64 @S_ISREG(i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %1
%11 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i64 @S_ISLNK(i32 %12)
%14 = icmp ne i64 %13, 0
br label %15
15: ; preds = %10, %1
%16 = phi i1 [ true, %1 ], [ %14, %10 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_loadable(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i64 @S_ISREG(i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = tail call i64 @S_ISLNK(i32 %6)
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %9, %1
%14 = phi i32 [ 1, %1 ], [ %12, %9 ]
ret i32 %14
}
puts(as) char *as;
{
  register char *s;
  s = as;
  while (*s)
    write(1, s++, 1);
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1153 <puts+0x43>
mov    -0x18(%rbp),%rsi
mov    %rsi,%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    $0x1,%edx
mov    %edx,%edi
mov    $0x0,%al
call   1030 <write@plt>
jmp    1124 <puts+0x14>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %r14
push   %rbx
push   %rax
cmpb   $0x0,(%rdi)
je     1141 <puts+0x31>
mov    %rdi,%rbx
nopl   0x0(%rax)
lea    0x1(%rbx),%r14
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <write@plt>
cmpb   $0x0,0x1(%rbx)
mov    %r14,%rbx
jne    1120 <puts+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @puts(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %6, %4 ], [ %0, %1 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 1, i8* %5, i32 1)
%8 = load i8, i8* %6
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %1
ret i32 undef
}
/* Variables and functions */
long long smod64(long long, long long);
long long __moddi3(long long n, long long d) { return smod64(n, d); }


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

x86 assembly (clang, -O2):
<__moddi3>:
jmp    1030 <smod64@plt>

LLVM IR (-O0):
define i64 @__moddi3(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i64 @smod64(i64 %5, i64 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @__moddi3(i64 %0, i64 %1) {
%3 = tail call i64 @smod64(i64 %0, i64 %1)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ keyboard_parse_keymap(char *);
char *strtok(int /*<<< orphan*/ *, char *);
void keyboard_keyword_include(void) {
  char *key;
  key = strtok(NULL, " \t");
  keyboard_parse_keymap(key);
}


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

x86 assembly (clang, -O2):
<keyboard_keyword_include>:
push   %rax
lea    0xed8(%rip),%rsi
xor    %edi,%edi
call   1040 <strtok@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <keyboard_parse_keymap@plt>

LLVM IR (-O0):
@.str = [3 x i8] c" \09\00"
define void @keyboard_keyword_include() {
%1 = alloca i8*
%2 = call i8* @strtok(i32* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @keyboard_parse_keymap(i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c" \09\00"
define void @keyboard_keyword_include() {
%1 = tail call i8* @strtok(i32* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @keyboard_parse_keymap(i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ xcb_get_property_reply_t;
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ xcb_ewmh_get_cardinal_from_reply(int /*<<< orphan*/ *,
                                                    int /*<<< orphan*/ *);
uint8_t xcb_ewmh_get_wm_pid_from_reply(uint32_t *pid,
                                       xcb_get_property_reply_t *r) {
  return xcb_ewmh_get_cardinal_from_reply(pid, r);
}


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

x86 assembly (clang, -O2):
<xcb_ewmh_get_wm_pid_from_reply>:
jmp    1030 <xcb_ewmh_get_cardinal_from_reply@plt>

LLVM IR (-O0):
define i32 @xcb_ewmh_get_wm_pid_from_reply(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 = load i32*, i32** %4
%7 = call i32 @xcb_ewmh_get_cardinal_from_reply(i32* %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @xcb_ewmh_get_wm_pid_from_reply(i32* %0, i32* %1) {
%3 = tail call i32 @xcb_ewmh_get_cardinal_from_reply(i32* %0, i32* %1)
ret i32 %3
}
void default_idle() { asm volatile("sti;hlt"); }


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

x86 assembly (clang, -O2):
<default_idle>:
sti
hlt
ret

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

LLVM IR (-O2):
define void @default_idle() {
tail call void asm sideeffect "sti;hlt", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
g(int len, char data[len][len]) {}


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

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

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

LLVM IR (-O2):
define i32 @g(i32 %0, i8* nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char str[1000];
  scanf("%s", str);
  reverse(str);
  printf("%s\n", str);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x3f0,%rsp
lea    0xec1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <reverse@plt>
lea    0xeaa(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @reverse(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}