xunge/DecIR huggingface dataset:
/* Variables and functions */
bool san_is_file(char chr) { return 'a' <= chr && chr <= 'h'; }


x86 assembly (clang, -O0):
<san_is_file>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x61,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
jg     112d <san_is_file+0x2d>
movsbl -0x1(%rbp),%eax
cmp    $0x68,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<san_is_file>:
add    $0x9f,%dil
xor    %eax,%eax
cmp    $0x8,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @san_is_file(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 97, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 104
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @san_is_file(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 8
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *alloc(int);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *);
void test_3(void) {
  char *p;
  printf("test_3 - start\n");
  p = alloc(256);
  free(p);
  printf("test_3 - try to free invalid area...\n");
  free(p);
  printf("test_3 - done!?\n");
}


x86 assembly (clang, -O0):
<test_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x100,%edi
call   1050 <alloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
lea    0xebf(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_3>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
mov    $0x100,%edi
call   1050 <alloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <free@plt>
lea    0xeb6(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xec7(%rip),%rdi
pop    %rbx
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"test_3 - start\0A\00"
@.str.1 = [38 x i8] c"test_3 - try to free invalid area...\0A\00"
@.str.2 = [17 x i8] c"test_3 - done!?\0A\00"
define void @test_3() {
%1 = alloca i8*
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i8* @alloc(i32 256)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @free(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%7 = load i8*, i8** %1
%8 = call i32 @free(i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"test_3 - start\00"
@str.3 = [37 x i8] c"test_3 - try to free invalid area...\00"
@str.4 = [16 x i8] c"test_3 - done!?\00"
define void @test_3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i8* @alloc(i32 256)
%3 = tail call i32 @free(i8* %2)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.3, i64 0, i64 0))
%5 = tail call i32 @free(i8* %2)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int memcmp(void const *, void const *, size_t);
int my_cmp(const void *a, const void *b, size_t n, void *udata) {
  (void)udata;
  return memcmp(a, b, n);
}


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

x86 assembly (clang, -O2):
<my_cmp>:
jmp    1030 <memcmp@plt>

LLVM IR (-O0):
define i32 @my_cmp(i8* %0, i8* %1, i64 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %8
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = call i32 @memcmp(i8* %10, i8* %11, i64 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @my_cmp(i8* nocapture %0, i8* nocapture %1, i64 %2, i8* nocapture readnone %3) {
%5 = tail call i32 @memcmp(i8* %0, i8* %1, i64 %2)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ Saturatef(float, float, float);
int32_t ScaleAndBound(float x) {
  return (int32_t)Saturatef(x * (4096.0f / 3.0f), 0.0f, 4095.0f);
}


x86 assembly (clang, -O0):
<ScaleAndBound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedf(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
movss  0xecb(%rip),%xmm2
call   1030 <Saturatef@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ScaleAndBound>:
mulss  0xee8(%rip),%xmm0
movss  0xee4(%rip),%xmm2
xorps  %xmm1,%xmm1
jmp    1030 <Saturatef@plt>

LLVM IR (-O0):
define i32 @ScaleAndBound(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 0x4095555560000000
%5 = call i32 @Saturatef(float %4, float 0.000000e+00, float 4.095000e+03)
ret i32 %5
}

LLVM IR (-O2):
define i32 @ScaleAndBound(float %0) {
%2 = fmul float %0, 0x4095555560000000
%3 = tail call i32 @Saturatef(float %2, float 0.000000e+00, float 4.095000e+03)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void send(char *str) {
  for (int i = 0; str[i] != '\n'; ++i) {
    printf("%c", str[i]);
  }
  printf("\n");
  return;
}


x86 assembly (clang, -O0):
<send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
je     1160 <send+0x50>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <send+0x13>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send>:
push   %rbx
mov    (%rdi),%al
cmp    $0xa,%al
je     1133 <send+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
cmp    $0xa,%al
jne    1120 <send+0x10>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @send(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %20, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 10
br i1 %11, label %12, label %23
12: ; preds = %4
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %12
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %4
23: ; preds = %4
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @send(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 10
br i1 %3, label %4, label %6
4: ; preds = %6, %1
%5 = tail call i32 @putchar(i32 10)
ret void
6: ; preds = %1, %6
%7 = phi i64 [ %11, %6 ], [ 0, %1 ]
%8 = phi i8 [ %13, %6 ], [ %2, %1 ]
%9 = sext i8 %8 to i32
%10 = tail call i32 @putchar(i32 %9)
%11 = add nuw i64 %7, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 10
br i1 %14, label %4, label %6
}
/* Type definitions */
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int64_t utime_now() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec;
}


x86 assembly (clang, -O0):
<utime_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
imul   $0xf4240,%eax,%eax
add    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utime_now>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x10(%rsp),%eax
add    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i32 @utime_now() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i32 @utime_now() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i32, i32* %8
%10 = add nsw i32 %7, %9
ret i32 %10
}
unsigned int m64p_swap32(unsigned int x) {
  return ((x & 0x000000FF) << 24) | ((x & 0x0000FF00) << 8) |
         ((x & 0x00FF0000) >> 8) | ((x & 0xFF000000) >> 24);
}


x86 assembly (clang, -O0):
<m64p_swap32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
shr    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff000000,%ecx
shr    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @m64p_swap32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 24
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 16711680
%12 = lshr i32 %11, 8
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, -16777216
%16 = lshr i32 %15, 24
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @m64p_swap32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Type definitions */
struct ac_buffer {
  int dummy;
};

/* Variables and functions */
int _read_remain(struct ac_buffer *);
int buffer_read_remain_len(struct ac_buffer *buffer) {
  return _read_remain(buffer);
}


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

x86 assembly (clang, -O2):
<buffer_read_remain_len>:
jmp    1030 <_read_remain@plt>

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

LLVM IR (-O2):
%struct.ac_buffer = type { i32 }
define i32 @buffer_read_remain_len(%struct.ac_buffer* %0) {
%2 = tail call i32 @_read_remain(%struct.ac_buffer* %0)
ret i32 %2
}
void plotutils_make_info(void) {}


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

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

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

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


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

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

LLVM IR (-O0):
define i32 @test_imm_57uint16_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, -87
%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_57uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -87
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int time(int /*<<< orphan*/ *);
void on_close() { printf("lid closed, %d\n", time(NULL)); }


x86 assembly (clang, -O0):
<on_close>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%esi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<on_close>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"lid closed, %d\0A\00"
define void @on_close() {
%1 = call i32 @time(i32* null)
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"lid closed, %d\0A\00"
define void @on_close() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
void foo_2_1_2_1_2_1_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_2_1_2_1_2_2_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void rtpp_stream_guess_addr_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_stream@%p::guess_addr (rtpp_stream_guess_addr) is "
          "invoked after destruction\x0a",
          pub);
  abort();
}


x86 assembly (clang, -O0):
<rtpp_stream_guess_addr_fin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<rtpp_stream_guess_addr_fin>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [89 x i8] c"Method rtpp_stream@%p::guess_addr (rtpp_stream_guess_addr) is invoked after destruction\0A\00"
define void @rtpp_stream_guess_addr_fin(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 ([89 x i8], [89 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [89 x i8] c"Method rtpp_stream@%p::guess_addr (rtpp_stream_guess_addr) is invoked after destruction\0A\00"
define void @rtpp_stream_guess_addr_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int jtag_write_bit(int);
int tap_exit_to_idle(void) {
  int err = 0x0;
  err |= jtag_write_bit((0x02));
  err |= jtag_write_bit(0);
  return err;
}


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

x86 assembly (clang, -O2):
<tap_exit_to_idle>:
push   %rbx
mov    $0x2,%edi
call   1030 <jtag_write_bit@plt>
mov    %eax,%ebx
xor    %edi,%edi
call   1030 <jtag_write_bit@plt>
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @tap_exit_to_idle() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @jtag_write_bit(i32 2)
%3 = load i32, i32* %1
%4 = or i32 %3, %2
store i32 %4, i32* %1
%5 = call i32 @jtag_write_bit(i32 0)
%6 = load i32, i32* %1
%7 = or i32 %6, %5
store i32 %7, i32* %1
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @tap_exit_to_idle() {
%1 = tail call i32 @jtag_write_bit(i32 2)
%2 = tail call i32 @jtag_write_bit(i32 0)
%3 = or i32 %2, %1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_CRL;

/* Variables and functions */
scalar_t__ ASN1_item_new(int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_CRL_it;
X509_CRL *X509_CRL_new(void) { return (X509_CRL *)ASN1_item_new(&X509_CRL_it); }


x86 assembly (clang, -O0):
<X509_CRL_new>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rdi
call   1030 <ASN1_item_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<X509_CRL_new>:
mov    0x2ec9(%rip),%rdi
jmp    1030 <ASN1_item_new@plt>

LLVM IR (-O0):
@X509_CRL_it = global i32 0
define i32* @X509_CRL_new() {
%1 = call i64 @ASN1_item_new(i32* @X509_CRL_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
@X509_CRL_it = global i32 0
define i32* @X509_CRL_new() {
%1 = tail call i64 @ASN1_item_new(i32* @X509_CRL_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ dump_data_impl(void const *, size_t);
void dump_data(const void *data, size_t size) { dump_data_impl(data, size); }


x86 assembly (clang, -O0):
<dump_data>:
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 <dump_data_impl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_data>:
jmp    1030 <dump_data_impl@plt>

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

LLVM IR (-O2):
define void @dump_data(i8* %0, i64 %1) {
%3 = tail call i32 @dump_data_impl(i8* %0, i64 %1)
ret void
}
/* Type definitions */
struct rb_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ rb_verify_1(struct rb_node *);
int /*<<< orphan*/ rb_verify_2(struct rb_node *);
int /*<<< orphan*/ rb_verify_3(struct rb_node *, int /*<<< orphan*/, int);
void rb_verify(struct rb_node *n) {
  rb_verify_1(n);
  rb_verify_2(n);
  rb_verify_3(n, 0, -1);
}


x86 assembly (clang, -O0):
<rb_verify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <rb_verify_1@plt>
mov    -0x8(%rbp),%rdi
call   1050 <rb_verify_2@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0xffffffff,%edx
call   1030 <rb_verify_3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rb_verify>:
push   %rbx
mov    %rdi,%rbx
call   1040 <rb_verify_1@plt>
mov    %rbx,%rdi
call   1050 <rb_verify_2@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xffffffff,%edx
pop    %rbx
jmp    1030 <rb_verify_3@plt>

LLVM IR (-O0):
%struct.rb_node = type { i32 }
define void @rb_verify(%struct.rb_node* %0) {
%2 = alloca %struct.rb_node*
store %struct.rb_node* %0, %struct.rb_node** %2
%3 = load %struct.rb_node*, %struct.rb_node** %2
%4 = call i32 @rb_verify_1(%struct.rb_node* %3)
%5 = load %struct.rb_node*, %struct.rb_node** %2
%6 = call i32 @rb_verify_2(%struct.rb_node* %5)
%7 = load %struct.rb_node*, %struct.rb_node** %2
%8 = call i32 @rb_verify_3(%struct.rb_node* %7, i32 0, i32 -1)
ret void
}

LLVM IR (-O2):
%struct.rb_node = type { i32 }
define void @rb_verify(%struct.rb_node* %0) {
%2 = tail call i32 @rb_verify_1(%struct.rb_node* %0)
%3 = tail call i32 @rb_verify_2(%struct.rb_node* %0)
%4 = tail call i32 @rb_verify_3(%struct.rb_node* %0, i32 0, i32 -1)
ret void
}
/* Type definitions */
struct rb3_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ rb3_replace_and_maybe_augment(struct rb3_head *,
                                                 struct rb3_head *,
                                                 int /*<<< orphan*/ *);
void rb3_replace(struct rb3_head *head, struct rb3_head *newhead) {
  rb3_replace_and_maybe_augment(head, newhead, NULL);
}


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

x86 assembly (clang, -O2):
<rb3_replace>:
xor    %edx,%edx
jmp    1030 <rb3_replace_and_maybe_augment@plt>

LLVM IR (-O0):
%struct.rb3_head = type { i32 }
define void @rb3_replace(%struct.rb3_head* %0, %struct.rb3_head* %1) {
%3 = alloca %struct.rb3_head*
%4 = alloca %struct.rb3_head*
store %struct.rb3_head* %0, %struct.rb3_head** %3
store %struct.rb3_head* %1, %struct.rb3_head** %4
%5 = load %struct.rb3_head*, %struct.rb3_head** %3
%6 = load %struct.rb3_head*, %struct.rb3_head** %4
%7 = call i32 @rb3_replace_and_maybe_augment(%struct.rb3_head* %5, %struct.rb3_head* %6, i32* null)
ret void
}

LLVM IR (-O2):
%struct.rb3_head = type { i32 }
define void @rb3_replace(%struct.rb3_head* %0, %struct.rb3_head* %1) {
%3 = tail call i32 @rb3_replace_and_maybe_augment(%struct.rb3_head* %0, %struct.rb3_head* %1, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sort(int *, int *, int /*<<< orphan*/, int);
void mergeSort(int a[], int size) {
  int aux[size];
  sort(a, aux, 0, size - 1);
}


x86 assembly (clang, -O0):
<mergeSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rsi
sub    %rcx,%rsi
mov    %rsi,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
xor    %edx,%edx
call   1030 <sort@plt>
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergeSort>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%ecx
mov    %rsp,%rax
lea    0xf(,%rcx,4),%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%rax
mov    %rax,%rsp
lea    -0x1(%rsi),%ecx
mov    %rax,%rsi
xor    %edx,%edx
call   1030 <sort@plt>
mov    %rbp,%rsp
pop    %rbp
ret

LLVM IR (-O0):
define void @mergeSort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %5
%10 = alloca i32, i64 %8
store i64 %8, i64* %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %4
%13 = sub nsw i32 %12, 1
%14 = call i32 @sort(i32* %11, i32* %10, i32 0, i32 %13)
%15 = load i8*, i8** %5
ret void
}

LLVM IR (-O2):
define void @mergeSort(i32* %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = alloca i32, i64 %3
%5 = add nsw i32 %1, -1
%6 = call i32 @sort(i32* %0, i32* %4, i32 0, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ esc(char *);
decaln() { esc("#8"); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"\00"
define i32 @decaln() {
%1 = tail call i32 @esc(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ pthread_rwlock_t;

/* Variables and functions */
int /*<<< orphan*/ *hybris_set_realrwlock(int /*<<< orphan*/ *);
int pthread_rwlock_timedwrlock(int /*<<< orphan*/ *, struct timespec const *);
int my_pthread_rwlock_timedwrlock(pthread_rwlock_t *__rwlock,
                                  __const struct timespec *abs_timeout) {
  pthread_rwlock_t *realrwlock = hybris_set_realrwlock(__rwlock);
  return pthread_rwlock_timedwrlock(realrwlock, abs_timeout);
}


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

x86 assembly (clang, -O2):
<my_pthread_rwlock_timedwrlock>:
push   %rbx
mov    %rsi,%rbx
call   1040 <hybris_set_realrwlock@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <pthread_rwlock_timedwrlock@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i32 @my_pthread_rwlock_timedwrlock(i32* %0, %struct.timespec* %1) {
%3 = alloca i32*
%4 = alloca %struct.timespec*
%5 = alloca i32*
store i32* %0, i32** %3
store %struct.timespec* %1, %struct.timespec** %4
%6 = load i32*, i32** %3
%7 = call i32* @hybris_set_realrwlock(i32* %6)
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = load %struct.timespec*, %struct.timespec** %4
%10 = call i32 @pthread_rwlock_timedwrlock(i32* %8, %struct.timespec* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i32 @my_pthread_rwlock_timedwrlock(i32* %0, %struct.timespec* %1) {
%3 = tail call i32* @hybris_set_realrwlock(i32* %0)
%4 = tail call i32 @pthread_rwlock_timedwrlock(i32* %3, %struct.timespec* %1)
ret i32 %4
}
/* Variables and functions */
scalar_t__ islower(char);
char toupper(char);
char *makeupper(char *buf) {
  char *p = buf;
  while (*p) {
    if (islower(*p))
      *p = toupper(*p);
    p++;
  }
  return buf;
}


x86 assembly (clang, -O0):
<makeupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     117c <makeupper+0x5c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     116b <makeupper+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1134 <makeupper+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeupper>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1165 <makeupper+0x45>
mov    %r14,%rbx
jmp    114c <makeupper+0x2c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1165 <makeupper+0x45>
movsbl %al,%edi
call   1030 <islower@plt>
test   %rax,%rax
je     1140 <makeupper+0x20>
movsbl (%rbx),%edi
call   1040 <toupper@plt>
mov    %al,(%rbx)
jmp    1140 <makeupper+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @makeupper(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %19, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %22
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = call i64 @islower(i8 signext %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %9
%15 = load i8*, i8** %3
%16 = load i8, i8* %15
%17 = call signext i8 @toupper(i8 signext %16)
%18 = load i8*, i8** %3
store i8 %17, i8* %18
br label %19
19: ; preds = %14, %9
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %3
br label %5
22: ; preds = %5
%23 = load i8*, i8** %2
ret i8* %23
}

LLVM IR (-O2):
define i8* @makeupper(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %12
%5 = phi i8 [ %14, %12 ], [ %2, %1 ]
%6 = phi i8* [ %13, %12 ], [ %0, %1 ]
%7 = tail call i64 @islower(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = load i8, i8* %6
%11 = tail call signext i8 @toupper(i8 signext %10)
store i8 %11, i8* %6
br label %12
12: ; preds = %9, %4
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %12, %1
ret i8* %0
}
int main() {
  volatile int *p = 0;
  *p = 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movl   $0x0,0x0
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
store i32* null, i32** %2
%3 = load i32*, i32** %2
store volatile i32 0, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
store volatile i32 0, i32* null
ret i32 0
}
/* Type definitions */
struct tgdb_response {
  int dummy;
};
struct tgdb_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tgdb_list_append(struct tgdb_list *, struct tgdb_response *);
void tgdb_types_append_command(struct tgdb_list *command_list,
                               struct tgdb_response *response) {
  tgdb_list_append(command_list, response);
}


x86 assembly (clang, -O0):
<tgdb_types_append_command>:
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 <tgdb_list_append@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tgdb_types_append_command>:
jmp    1030 <tgdb_list_append@plt>

LLVM IR (-O0):
%struct.tgdb_list = type { i32 }
%struct.tgdb_response = type { i32 }
define void @tgdb_types_append_command(%struct.tgdb_list* %0, %struct.tgdb_response* %1) {
%3 = alloca %struct.tgdb_list*
%4 = alloca %struct.tgdb_response*
store %struct.tgdb_list* %0, %struct.tgdb_list** %3
store %struct.tgdb_response* %1, %struct.tgdb_response** %4
%5 = load %struct.tgdb_list*, %struct.tgdb_list** %3
%6 = load %struct.tgdb_response*, %struct.tgdb_response** %4
%7 = call i32 @tgdb_list_append(%struct.tgdb_list* %5, %struct.tgdb_response* %6)
ret void
}

LLVM IR (-O2):
%struct.tgdb_list = type { i32 }
%struct.tgdb_response = type { i32 }
define void @tgdb_types_append_command(%struct.tgdb_list* %0, %struct.tgdb_response* %1) {
%3 = tail call i32 @tgdb_list_append(%struct.tgdb_list* %0, %struct.tgdb_response* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ajXmlinExit();
int /*<<< orphan*/ ajXmloutExit();
void ajXmlExit(void) {
  ajXmlinExit();
  ajXmloutExit();
  return;
}


x86 assembly (clang, -O0):
<ajXmlExit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <ajXmlinExit@plt>
mov    $0x0,%al
call   1030 <ajXmloutExit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ajXmlExit>:
push   %rax
xor    %eax,%eax
call   1040 <ajXmlinExit@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ajXmloutExit@plt>

LLVM IR (-O0):
define void @ajXmlExit() {
%1 = call i32 (...) @ajXmlinExit()
%2 = call i32 (...) @ajXmloutExit()
ret void
}

LLVM IR (-O2):
define void @ajXmlExit() {
%1 = tail call i32 (...) @ajXmlinExit()
%2 = tail call i32 (...) @ajXmloutExit()
ret void
}
void purge_string(char *buffer, int length) {
  static int i;
  for (i = 0; i < length; i++) {
    buffer[i] = '\0';
  }
}


x86 assembly (clang, -O0):
<purge_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,0x2f0f(%rip)
mov    0x2f09(%rip),%eax
cmp    -0xc(%rbp),%eax
jge    1147 <purge_string+0x47>
mov    -0x8(%rbp),%rax
movslq 0x2ef5(%rip),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    0x2eeb(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ee2(%rip)
jmp    1115 <purge_string+0x15>
pop    %rbp
ret

x86 assembly (clang, -O2):
<purge_string>:
test   %esi,%esi
jle    1122 <purge_string+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
@purge_string.i = internal global i32 0
define void @purge_string(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* @purge_string.i
br label %5
5: ; preds = %14, %2
%6 = load i32, i32* @purge_string.i
%7 = load i32, i32* %4
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %17
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = load i32, i32* @purge_string.i
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
store i8 0, i8* %13
br label %14
14: ; preds = %9
%15 = load i32, i32* @purge_string.i
%16 = add nsw i32 %15, 1
store i32 %16, i32* @purge_string.i
br label %5
17: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @purge_string(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int ILibString_IndexOfEx(char const *, int, char const *, int, int);
int ILibString_IndexOf(const char *inString, int inStringLength,
                       const char *indexOf, int indexOfLength) {
  return (ILibString_IndexOfEx(inString, inStringLength, indexOf, indexOfLength,
                               1));
}


x86 assembly (clang, -O0):
<ILibString_IndexOf>:
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),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x1,%r8d
call   1030 <ILibString_IndexOfEx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ILibString_IndexOf>:
mov    $0x1,%r8d
jmp    1030 <ILibString_IndexOfEx@plt>

LLVM IR (-O0):
define i32 @ILibString_IndexOf(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @ILibString_IndexOfEx(i8* %9, i32 %10, i8* %11, i32 %12, i32 1)
ret i32 %13
}

LLVM IR (-O2):
define i32 @ILibString_IndexOf(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @ILibString_IndexOfEx(i8* %0, i32 %1, i8* %2, i32 %3, i32 1)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main(int argc, char *argv[]) { printf("hello, world\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"hello, world\0A\00"
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"hello, world\00"
define void @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
const char *get_file_extensions(void) { return ".wv;.wvc"; }


x86 assembly (clang, -O0):
<get_file_extensions>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_extensions>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [9 x i8] c".wv;.wvc\00"
define i8* @get_file_extensions() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [9 x i8] c".wv;.wvc\00"
define i8* @get_file_extensions() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int strlen(char const *);
char *fs_filename(const char *path) {
  char *name = path + strlen(path);
  while (*name != '/' && name != path) {
    name--;
  }
  return name + 1;
}


x86 assembly (clang, -O0):
<fs_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2f,%ecx
mov    %al,-0x19(%rbp)
je     1160 <fs_filename+0x50>
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1170 <fs_filename+0x60>
jmp    1181 <fs_filename+0x71>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    113d <fs_filename+0x2d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_filename>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
movslq %eax,%rcx
lea    (%rcx,%rbx,1),%rdx
add    $0x2,%rdx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x1(%rdx),%rax
test   %rcx,%rcx
je     1146 <fs_filename+0x36>
add    $0xffffffffffffffff,%rcx
cmpb   $0x2f,-0x2(%rdx)
mov    %rax,%rdx
jne    1130 <fs_filename+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define i8* @fs_filename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %4, i64 %7
store i8* %8, i8** %3
br label %9
9: ; preds = %20, %1
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 47
br i1 %13, label %14, label %18
14: ; preds = %9
%15 = load i8*, i8** %3
%16 = load i8*, i8** %2
%17 = icmp ne i8* %15, %16
br label %18
18: ; preds = %14, %9
%19 = phi i1 [ false, %9 ], [ %17, %14 ]
br i1 %19, label %20, label %23
20: ; preds = %18
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 -1
store i8* %22, i8** %3
br label %9
23: ; preds = %18
%24 = load i8*, i8** %3
%25 = getelementptr inbounds i8, i8* %24, i64 1
ret i8* %25
}

LLVM IR (-O2):
define i8* @fs_filename(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
br label %5
5: ; preds = %5, %1
%6 = phi i8* [ %4, %1 ], [ %11, %5 ]
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 47
%9 = icmp ne i8* %6, %0
%10 = and i1 %9, %8
%11 = getelementptr inbounds i8, i8* %6, i64 -1
br i1 %10, label %5, label %12
12: ; preds = %5
%13 = getelementptr inbounds i8, i8* %6, i64 1
ret i8* %13
}
int main() {
  int x = 0;
  while (x != 20 && (x != 30 || x != 40))
    x += 1;
  for (int i = 9, j = 11;;) {
    x = i + x;
  }
  x |= 3;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x14,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     1140 <main+0x40>
mov    $0x1,%al
cmpl   $0x1e,-0x8(%rbp)
mov    %al,-0x12(%rbp)
jne    113a <main+0x3a>
cmpl   $0x28,-0x8(%rbp)
setne  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1150 <main+0x50>
jmp    115e <main+0x5e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
movl   $0x9,-0xc(%rbp)
movl   $0xb,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    %eax,-0x8(%rbp)
jmp    116c <main+0x6c>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %5
5: ; preds = %18, %0
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 20
br i1 %7, label %8, label %16
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 30
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp ne i32 %12, 40
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ true, %8 ], [ %13, %11 ]
br label %16
16: ; preds = %14, %5
%17 = phi i1 [ false, %5 ], [ %15, %14 ]
br i1 %17, label %18, label %21
18: ; preds = %16
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %5
21: ; preds = %16
store i32 9, i32* %3
store i32 11, i32* %4
br label %22
22: ; preds = %22, %21
%23 = load i32, i32* %3
%24 = load i32, i32* %2
%25 = add nsw i32 %23, %24
store i32 %25, i32* %2
br label %22
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
uint32_t *u32(const unsigned char *buffer, unsigned address) {
  assert((address & 3) == 0);
  return (uint32_t *)(buffer + address);
}


x86 assembly (clang, -O0):
<u32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x3,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u32>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
xor    %edi,%edi
test   $0x3,%bl
sete   %dil
call   1030 <assert@plt>
mov    %ebx,%eax
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32* @u32(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 3
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = bitcast i8* %13 to i32*
ret i32* %14
}

LLVM IR (-O2):
define i32* @u32(i8* readnone %0, i32 %1) {
%3 = and i32 %1, 3
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = zext i32 %1 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = bitcast i8* %8 to i32*
ret i32* %9
}
int and1(int a, int b) { return (a & b) != 0; }


x86 assembly (clang, -O0):
<and1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<and1>:
xor    %eax,%eax
test   %edi,%esi
setne  %al
ret

LLVM IR (-O0):
define i32 @and1(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 = and i32 %5, %6
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @and1(i32 %0, i32 %1) {
%3 = and i32 %1, %0
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
long long int longlongint_ignoring_signedlonglongint(long long int x,
                                                     signed long long int y) {
  return x;
}


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

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

LLVM IR (-O0):
define i64 @longlongint_ignoring_signedlonglongint(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
ret i64 %5
}

LLVM IR (-O2):
define i64 @longlongint_ignoring_signedlonglongint(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ dlib_errmsg(char *, char *);
int echo(int argc, char **argv) {
  for (int i = 1; i < argc; i++)
    dlib_errmsg("%s\n", argv[i]);
  return 0;
}


x86 assembly (clang, -O0):
<echo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1158 <echo+0x48>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xebb(%rip),%rdi
call   1030 <dlib_errmsg@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <echo+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<echo>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     1145 <echo+0x35>
mov    %rsi,%r15
mov    %edi,%r12d
mov    $0x1,%ebx
lea    0xed1(%rip),%r14
nop
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <dlib_errmsg@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <echo+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @echo(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 1, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i8**, i8*** %4
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8*, i8** %11, i64 %13
%15 = load i8*, i8** %14
%16 = call i32 @dlib_errmsg(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @echo(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %2
ret i32 0
7: ; preds = %4, %7
%8 = phi i64 [ 1, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @dlib_errmsg(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ DMX_STOP;
int ioctl(int, int /*<<< orphan*/);
int dvbdemux_stop(int fd) { return ioctl(fd, DMX_STOP); }


x86 assembly (clang, -O0):
<dvbdemux_stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dvbdemux_stop>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
@DMX_STOP = global i32 0
define i32 @dvbdemux_stop(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @DMX_STOP
%5 = call i32 @ioctl(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@DMX_STOP = global i32 0
define i32 @dvbdemux_stop(i32 %0) {
%2 = load i32, i32* @DMX_STOP
%3 = tail call i32 @ioctl(i32 %0, i32 %2)
ret i32 %3
}