xunge/DecIR huggingface dataset:
unsigned long xor128() {
  static unsigned long x = 123456789, y = 362436069, z = 521288629,
                       w = 88675123;
  unsigned long t;
  t = (x ^ (x << 11));
  x = y;
  y = z;
  z = w;
  return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
}


x86 assembly (clang, -O0):
<xor128>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f15(%rip),%rax
mov    0x2f0e(%rip),%rcx
shl    $0xb,%rcx
xor    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    0x2f04(%rip),%rax
mov    %rax,0x2ef5(%rip)
mov    0x2efe(%rip),%rax
mov    %rax,0x2eef(%rip)
mov    0x2ef8(%rip),%rax
mov    %rax,0x2ee9(%rip)
mov    0x2eea(%rip),%rax
mov    0x2ee3(%rip),%rcx
shr    $0x13,%rcx
xor    %rcx,%rax
mov    -0x8(%rbp),%rcx
mov    -0x8(%rbp),%rdx
shr    $0x8,%rdx
xor    %rdx,%rcx
xor    %rcx,%rax
mov    %rax,0x2ec3(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<xor128>:
mov    0x2f19(%rip),%rcx
mov    %rcx,%rax
shl    $0xb,%rax
xor    %rcx,%rax
mov    0x2f10(%rip),%rcx
mov    %rcx,0x2f01(%rip)
mov    0x2f0a(%rip),%rcx
mov    %rcx,0x2efb(%rip)
mov    0x2f04(%rip),%rcx
mov    %rcx,0x2ef5(%rip)
mov    %rax,%rdx
shr    $0x8,%rdx
xor    %rcx,%rax
shr    $0x13,%rcx
xor    %rdx,%rax
xor    %rcx,%rax
mov    %rax,0x2ee2(%rip)
ret

LLVM IR (-O0):
@xor128.x = internal global i64 123456789
@xor128.y = internal global i64 362436069
@xor128.z = internal global i64 521288629
@xor128.w = internal global i64 88675123
define i64 @xor128() {
%1 = alloca i64
%2 = load i64, i64* @xor128.x
%3 = load i64, i64* @xor128.x
%4 = shl i64 %3, 11
%5 = xor i64 %2, %4
store i64 %5, i64* %1
%6 = load i64, i64* @xor128.y
store i64 %6, i64* @xor128.x
%7 = load i64, i64* @xor128.z
store i64 %7, i64* @xor128.y
%8 = load i64, i64* @xor128.w
store i64 %8, i64* @xor128.z
%9 = load i64, i64* @xor128.w
%10 = load i64, i64* @xor128.w
%11 = lshr i64 %10, 19
%12 = xor i64 %9, %11
%13 = load i64, i64* %1
%14 = load i64, i64* %1
%15 = lshr i64 %14, 8
%16 = xor i64 %13, %15
%17 = xor i64 %12, %16
store i64 %17, i64* @xor128.w
ret i64 %17
}

LLVM IR (-O2):
@xor128.x = internal unnamed_addr global i64 123456789
@xor128.y = internal unnamed_addr global i64 362436069
@xor128.z = internal unnamed_addr global i64 521288629
@xor128.w = internal unnamed_addr global i64 88675123
define i64 @xor128() {
%1 = load i64, i64* @xor128.x
%2 = shl i64 %1, 11
%3 = xor i64 %2, %1
%4 = load i64, i64* @xor128.y
store i64 %4, i64* @xor128.x
%5 = load i64, i64* @xor128.z
store i64 %5, i64* @xor128.y
%6 = load i64, i64* @xor128.w
store i64 %6, i64* @xor128.z
%7 = lshr i64 %6, 19
%8 = lshr i64 %3, 8
%9 = xor i64 %8, %3
%10 = xor i64 %9, %6
%11 = xor i64 %10, %7
store i64 %11, i64* @xor128.w
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argv, char *argc[]) {
  printf("argv is %d \n", argv);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"argv is %d \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"argv is %d \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xdc() {
  Assert_real((isprint(220) == 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_isprint.c",
              1105, ("isprint should be 0 for 0xdc"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0xdc>:
push   %rax
mov    $0xdc,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x451,%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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xdc\00"
define void @t_isprint_0xdc() {
%1 = call i64 @isprint(i32 220)
%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 1105, i8* getelementptr inbounds ([29 x i8], [29 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xdc\00"
define void @t_isprint_0xdc() {
%1 = tail call i64 @isprint(i32 220)
%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 1105, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct stat {
  int st_size;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
int /*<<< orphan*/ fstat(int /*<<< orphan*/, struct stat *);
int file_size(FILE *descriptor) {
  struct stat file_attributes;
  fstat(fileno(descriptor), &file_attributes);
  return file_attributes.st_size;
}


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

x86 assembly (clang, -O2):
<file_size>:
push   %rax
call   1030 <fileno@plt>
mov    %rsp,%rsi
mov    %eax,%edi
call   1040 <fstat@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @file_size(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct.stat
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fileno(i32* %4)
%6 = call i32 @fstat(i32 %5, %struct.stat* %3)
%7 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_size(i32* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = tail call i32 @fileno(i32* %0)
%5 = call i32 @fstat(i32 %4, %struct.stat* %2)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}
int ipc_send(const char whom[], char *data[]) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @ipc_send(i8* nocapture readnone %0, i8** nocapture readnone %1) {
ret i32 1
}
void usc_recressive_func(cnt, max, bstack) int cnt;
int max;
struct usc_bigstack_t *bstack;
{
  if (cnt < max)
    usc_recressive_func(cnt + 1, max, bstack);
}


x86 assembly (clang, -O0):
<usc_recressive_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1140 <usc_recressive_func+0x30>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <usc_recressive_func@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.usc_bigstack_t = type opaque
define void @usc_recressive_func(i32 %0, i32 %1, %struct.usc_bigstack_t* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.usc_bigstack_t*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.usc_bigstack_t* %2, %struct.usc_bigstack_t** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %15
10: ; preds = %3
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
%13 = load i32, i32* %5
%14 = load %struct.usc_bigstack_t*, %struct.usc_bigstack_t** %6
br label %15
15: ; preds = %10, %3
ret void
}

LLVM IR (-O2):
%struct.usc_bigstack_t = type opaque
define void @usc_recressive_func(i32 %0, i32 %1, %struct.usc_bigstack_t* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ V_DrawPatchDirect(int, int, int /*<<< orphan*/,
                                     int /*<<< orphan*/);
int /*<<< orphan*/ W_CacheLumpName(char *, int);
void M_DrawMainMenu(void) {
  V_DrawPatchDirect(94, 2, 0, W_CacheLumpName("M_DOOM", 101));
}


x86 assembly (clang, -O0):
<M_DrawMainMenu>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x65,%esi
call   1040 <W_CacheLumpName@plt>
mov    %eax,%ecx
mov    $0x5e,%edi
mov    $0x2,%esi
xor    %edx,%edx
call   1030 <V_DrawPatchDirect@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<M_DrawMainMenu>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x65,%esi
call   1040 <W_CacheLumpName@plt>
mov    $0x5e,%edi
mov    $0x2,%esi
xor    %edx,%edx
mov    %eax,%ecx
pop    %rax
jmp    1030 <V_DrawPatchDirect@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"M_DOOM\00"
define void @M_DrawMainMenu() {
%1 = call i32 @W_CacheLumpName(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 101)
%2 = call i32 @V_DrawPatchDirect(i32 94, i32 2, i32 0, i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"M_DOOM\00"
define void @M_DrawMainMenu() {
%1 = tail call i32 @W_CacheLumpName(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 101)
%2 = tail call i32 @V_DrawPatchDirect(i32 94, i32 2, i32 0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void term_restore_cursor(void) { fprintf(stdout, "\033[u\033[K"); }


x86 assembly (clang, -O0):
<term_restore_cursor>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_restore_cursor>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [7 x i8] c"\1B[u\1B[K\00"
define void @term_restore_cursor() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [7 x i8] c"\1B[u\1B[K\00"
define void @term_restore_cursor() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
void test(int x) {
#pragma omp target exit data map(from : x)
}


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

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

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

LLVM IR (-O2):
define void @test(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ _SC_NPROCESSORS_CONF;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sysconf(int /*<<< orphan*/);
int main() {
  printf("number of CPUs = %ld\n", sysconf(_SC_NPROCESSORS_CONF));
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
mov    %eax,%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
lea    0xeba(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"number of CPUs = %ld\0A\00"
@_SC_NPROCESSORS_CONF = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @_SC_NPROCESSORS_CONF
%3 = call i32 @sysconf(i32 %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @EXIT_SUCCESS
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [22 x i8] c"number of CPUs = %ld\0A\00"
@_SC_NPROCESSORS_CONF = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = load i32, i32* @_SC_NPROCESSORS_CONF
%2 = tail call i32 @sysconf(i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
void nseel_asm_stack_peek_top_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_stack_peek_top_end() {
ret void
}
/* Type definitions */
typedef int u_int32_t;

/* Variables and functions */
scalar_t__ extract_32bits(char *);
int ntohl(int);
char *rtkl_nfs3_status(char *head, u_int32_t len, u_int32_t *status) {
  char *p = head;
  if (len < sizeof(u_int32_t)) {
    return NULL;
  }
  *status = ntohl((u_int32_t)extract_32bits(p));
  p += sizeof(u_int32_t);
  return p;
}


x86 assembly (clang, -O0):
<rtkl_nfs3_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
movslq -0x14(%rbp),%rax
cmp    $0x4,%rax
jae    1156 <rtkl_nfs3_status+0x36>
movq   $0x0,-0x8(%rbp)
jmp    1182 <rtkl_nfs3_status+0x62>
mov    -0x28(%rbp),%rdi
call   1030 <extract_32bits@plt>
mov    %eax,%edi
call   1040 <ntohl@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtkl_nfs3_status>:
push   %r14
push   %rbx
push   %rax
cmp    $0x4,%esi
jae    112d <rtkl_nfs3_status+0xd>
xor    %ebx,%ebx
jmp    1146 <rtkl_nfs3_status+0x26>
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <extract_32bits@plt>
mov    %eax,%edi
call   1040 <ntohl@plt>
mov    %eax,(%r14)
add    $0x4,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @rtkl_nfs3_status(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
%9 = load i8*, i8** %5
store i8* %9, i8** %8
%10 = load i32, i32* %6
%11 = sext i32 %10 to i64
%12 = icmp ult i64 %11, 4
br i1 %12, label %13, label %14
13: ; preds = %3
store i8* null, i8** %4
br label %23
14: ; preds = %3
%15 = load i8*, i8** %8
%16 = call i64 @extract_32bits(i8* %15)
%17 = trunc i64 %16 to i32
%18 = call i32 @ntohl(i32 %17)
%19 = load i32*, i32** %7
store i32 %18, i32* %19
%20 = load i8*, i8** %8
%21 = getelementptr inbounds i8, i8* %20, i64 4
store i8* %21, i8** %8
%22 = load i8*, i8** %8
store i8* %22, i8** %4
br label %23
23: ; preds = %14, %13
%24 = load i8*, i8** %4
ret i8* %24
}

LLVM IR (-O2):
define i8* @rtkl_nfs3_status(i8* %0, i32 %1, i32* nocapture writeonly %2) {
%4 = icmp ult i32 %1, 4
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = tail call i64 @extract_32bits(i8* %0)
%7 = trunc i64 %6 to i32
%8 = tail call i32 @ntohl(i32 %7)
store i32 %8, i32* %2
%9 = getelementptr inbounds i8, i8* %0, i64 4
br label %10
10: ; preds = %3, %5
%11 = phi i8* [ %9, %5 ], [ null, %3 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_wifidirect_cfg_intent_usage(void) {
  printf("Usage : wifidirect_cfg_intent [IntentValue]\n");
  printf("If IntentValue parameter is provided, 'set' is performed otherwise "
         "'get' is performed.\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [45 x i8] c"Usage : wifidirect_cfg_intent [IntentValue]\0A\00"
@.str.1 = [88 x i8] c"If IntentValue parameter is provided, 'set' is performed otherwise 'get' is performed.\0A\00"
define void @print_wifidirect_cfg_intent_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [44 x i8] c"Usage : wifidirect_cfg_intent [IntentValue]\00"
@str.2 = [87 x i8] c"If IntentValue parameter is provided, 'set' is performed otherwise 'get' is performed.\00"
define void @print_wifidirect_cfg_intent_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([87 x i8], [87 x i8]* @str.2, i64 0, i64 0))
ret void
}
void dfn_all(ll) long long ll;
{}


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

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

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

LLVM IR (-O2):
define void @dfn_all(i64 %0) {
ret void
}
/* Variables and functions */
int *getPointer();
void testStoreCheck(int *a) {
  a = getPointer();
  if (a) {
    ;
  }
  *a = 1;
}


x86 assembly (clang, -O0):
<testStoreCheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getPointer@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1137 <testStoreCheck+0x27>
jmp    1137 <testStoreCheck+0x27>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testStoreCheck>:
push   %rax
xor    %eax,%eax
call   1030 <getPointer@plt>
movl   $0x1,(%rax)
pop    %rax
ret

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

LLVM IR (-O2):
define void @testStoreCheck(i32* nocapture readnone %0) {
%2 = tail call i32* (...) @getPointer()
store i32 1, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void buddy_offline(void *h, const char *who) {
  printf("<<< %s is now offline\n", who);
  return;
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"<<< %s is now offline\0A\00"
define void @buddy_offline(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"<<< %s is now offline\0A\00"
define void @buddy_offline(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
int test_and_clear_bit(long nr, volatile unsigned long *addr) {
  do {
    char c;
    asm volatile(""
                 "btr"
                 " %2, "
                 "%0"
                 "; set"
                 "c"
                 " %1"
                 : "+m"(*addr), "=qm"(c)
                 : "Ir"(nr)
                 : "memory");
    return c != 0;
  } while (0);
}


x86 assembly (clang, -O0):
<test_and_clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
btr    %rcx,(%rax)
setb   -0x11(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_and_clear_bit>:
btr    %rdi,(%rsi)
setb   -0x1(%rsp)
xor    %eax,%eax
cmpb   $0x0,-0x1(%rsp)
setne  %al
ret

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

LLVM IR (-O2):
define i32 @test_and_clear_bit(i64 %0, i64* %1) {
%3 = alloca i8
%4 = load i8, i8* %3
%5 = icmp ne i8 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
char UARTRxBytesAvail() { return 1; }


x86 assembly (clang, -O0):
<UARTRxBytesAvail>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%al
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @UARTRxBytesAvail() {
ret i8 1
}

LLVM IR (-O2):
define signext i8 @UARTRxBytesAvail() {
ret i8 1
}
int ld_le_mr2(long double *a1, long double a2) { return !(((*a1) <= (a2))); }


x86 assembly (clang, -O0):
<ld_le_mr2>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
mov    %rdi,-0x8(%rbp)
fstpt  -0x20(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
fldt   -0x20(%rbp)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_le_mr2>:
fldt   0x8(%rsp)
fldt   (%rdi)
xor    %eax,%eax
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setb   %al
ret

LLVM IR (-O0):
define i32 @ld_le_mr2(x86_fp80* %0, x86_fp80 %1) {
%3 = alloca x86_fp80*
%4 = alloca x86_fp80
store x86_fp80* %0, x86_fp80** %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80*, x86_fp80** %3
%6 = load x86_fp80, x86_fp80* %5
%7 = load x86_fp80, x86_fp80* %4
%8 = fcmp ole x86_fp80 %6, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ld_le_mr2(x86_fp80* nocapture %0, x86_fp80 %1) {
%3 = load x86_fp80, x86_fp80* %0
%4 = fcmp ugt x86_fp80 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int pigpio_command(int, int, unsigned int, int /*<<< orphan*/, int);
int get_PWM_range(int pi, unsigned user_gpio) {
  return pigpio_command(pi, 22, user_gpio, 0, 1);
}


x86 assembly (clang, -O0):
<get_PWM_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x16,%esi
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <pigpio_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_PWM_range>:
mov    %esi,%edx
mov    $0x16,%esi
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <pigpio_command@plt>

LLVM IR (-O0):
define i32 @get_PWM_range(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 @pigpio_command(i32 %5, i32 22, i32 %6, i32 0, i32 1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_PWM_range(i32 %0, i32 %1) {
%3 = tail call i32 @pigpio_command(i32 %0, i32 22, i32 %1, i32 0, i32 1)
ret i32 %3
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ update_tm(struct tm *, struct tm *, int);
void date_tomorrow(struct tm *tm, struct tm *now, int *num) {
  update_tm(tm, now, 24 * 60 * 60);
}


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

x86 assembly (clang, -O2):
<date_tomorrow>:
mov    $0x15180,%edx
jmp    1030 <update_tm@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define void @date_tomorrow(%struct.tm* %0, %struct.tm* %1, i32* %2) {
%4 = alloca %struct.tm*
%5 = alloca %struct.tm*
%6 = alloca i32*
store %struct.tm* %0, %struct.tm** %4
store %struct.tm* %1, %struct.tm** %5
store i32* %2, i32** %6
%7 = load %struct.tm*, %struct.tm** %4
%8 = load %struct.tm*, %struct.tm** %5
%9 = call i32 @update_tm(%struct.tm* %7, %struct.tm* %8, i32 86400)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define void @date_tomorrow(%struct.tm* %0, %struct.tm* %1, i32* nocapture readnone %2) {
%4 = tail call i32 @update_tm(%struct.tm* %0, %struct.tm* %1, i32 86400)
ret void
}
/* Variables and functions */
int power(int, int);
int /*<<< orphan*/ printf(char *, int);
main() { printf("%d", power(3, 9)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
mov    $0x9,%esi
call   1030 <power@plt>
mov    %eax,%esi
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0x9,%esi
call   1030 <power@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @power(i32 3, i32 9)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
indreg0reg1(r0, r1, x0, x1, p0, p1) signed char r0, r1;
signed char *p0, *p1;
{
  if ((*p0) <= r1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<indreg0reg1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jg     113d <indreg0reg1+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1144 <indreg0reg1+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indreg0reg1>:
movsbl (%r8),%ecx
movsbl %sil,%edx
xor    %eax,%eax
cmp    %ecx,%edx
setge  %al
ret

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

LLVM IR (-O2):
define i32 @indreg0reg1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture %4, i8* nocapture readnone %5) {
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = shl i32 %1, 24
%10 = ashr exact i32 %9, 24
%11 = icmp sge i32 %10, %8
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_alloc__(int);
int /*<<< orphan*/ __coverity_escape__(char const *);
void *cn_cbor_data_create(const char *data, int len, void *context,
                          void *errp) {
  __coverity_alloc__(10);
  __coverity_escape__(data);
}


x86 assembly (clang, -O0):
<cn_cbor_data_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    $0xa,%edi
call   1030 <__coverity_alloc__@plt>
mov    -0x10(%rbp),%rdi
call   1040 <__coverity_escape__@plt>
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cn_cbor_data_create>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%edi
call   1030 <__coverity_alloc__@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <__coverity_escape__@plt>

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

LLVM IR (-O2):
define noalias i8* @cn_cbor_data_create(i8* %0, i32 %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
%5 = tail call i32 @__coverity_alloc__(i32 10)
%6 = tail call i32 @__coverity_escape__(i8* %0)
ret i8* undef
}
int rt5677_hotword_init(struct device *dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define i32 @rt5677_hotword_init(%struct.device* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
scalar_t__ lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void sqImageFileSeekEnd(int f, off_t pos) {
  if (lseek(f, pos, SEEK_END) < 0)
    perror("sqImageFileSeekEnd lseek");
}


x86 assembly (clang, -O0):
<sqImageFileSeekEnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
call   1030 <lseek@plt>
cmp    $0x0,%rax
jge    1158 <sqImageFileSeekEnd+0x38>
lea    0xead(%rip),%rdi
call   1040 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqImageFileSeekEnd>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edx
call   1030 <lseek@plt>
test   %rax,%rax
js     1136 <sqImageFileSeekEnd+0x16>
pop    %rax
ret
lea    0xec3(%rip),%rdi
pop    %rax
jmp    1040 <perror@plt>

LLVM IR (-O0):
@SEEK_END = global i32 0
@.str = [25 x i8] c"sqImageFileSeekEnd lseek\00"
define void @sqImageFileSeekEnd(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 = load i32, i32* @SEEK_END
%8 = call i64 @lseek(i32 %5, i32 %6, i32 %7)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@.str = [25 x i8] c"sqImageFileSeekEnd lseek\00"
define void @sqImageFileSeekEnd(i32 %0, i32 %1) {
%3 = load i32, i32* @SEEK_END
%4 = tail call i64 @lseek(i32 %0, i32 %1, i32 %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ sleep(int);
void do_something_then_free_ptr(int countdown, char *p) {
  sleep(3);
  if (--countdown <= 0) {
    free(p);
  } else {
    do_something_then_free_ptr(countdown, p);
  }
}


x86 assembly (clang, -O0):
<do_something_then_free_ptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x3,%edi
call   1050 <sleep@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jg     1169 <do_something_then_free_ptr+0x39>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
jmp    1175 <do_something_then_free_ptr+0x45>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <do_something_then_free_ptr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_something_then_free_ptr>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x1,%ebp
nopl   0x0(%rax,%rax,1)
mov    $0x3,%edi
call   1040 <sleep@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
jg     1130 <do_something_then_free_ptr+0x10>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @do_something_then_free_ptr(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = call i32 @sleep(i32 3)
%6 = load i32, i32* %3
%7 = add nsw i32 %6, -1
store i32 %7, i32* %3
%8 = icmp sle i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = call i32 @free(i8* %10)
br label %15
12: ; preds = %2
%13 = load i32, i32* %3
%14 = load i8*, i8** %4
br label %15
15: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
define void @do_something_then_free_ptr(i32 %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %7, %3 ]
%5 = tail call i32 @sleep(i32 3)
%6 = icmp slt i32 %4, 2
%7 = add nsw i32 %4, -1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = tail call i32 @free(i8* %1)
ret void
}
int isdesc(const int *a, int n) {
  register int i;
  for (i = 0; i < n - 1; i++) {
    if (*a < *(a + i))
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isdesc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1159 <isdesc+0x59>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jge    1146 <isdesc+0x46>
movl   $0x0,-0x4(%rbp)
jmp    1160 <isdesc+0x60>
jmp    114b <isdesc+0x4b>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <isdesc+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdesc>:
mov    $0x1,%eax
cmp    $0x2,%esi
jl     1134 <isdesc+0x34>
add    $0xffffffff,%esi
mov    (%rdi),%r8d
mov    $0x1,%edx
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %rdx,%rsi
je     1134 <isdesc+0x34>
lea    0x1(%rdx),%rcx
cmp    (%rdi,%rdx,4),%r8d
mov    %rcx,%rdx
jge    1120 <isdesc+0x20>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isdesc(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %23, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = sub nsw i32 %9, 1
%11 = icmp slt i32 %8, %10
br i1 %11, label %12, label %26
12: ; preds = %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = load i32*, i32** %4
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = icmp slt i32 %14, %19
br i1 %20, label %21, label %22
21: ; preds = %12
store i32 0, i32* %3
br label %27
22: ; preds = %12
br label %23
23: ; preds = %22
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
store i32 %25, i32* %6
br label %7
26: ; preds = %7
store i32 1, i32* %3
br label %27
27: ; preds = %26, %21
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @isdesc(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = add nsw i32 %1, -1
%6 = load i32, i32* %0
%7 = zext i32 %5 to i64
br label %8
8: ; preds = %4, %11
%9 = phi i64 [ 1, %4 ], [ %15, %11 ]
%10 = icmp eq i64 %9, %7
br i1 %10, label %16, label %11
11: ; preds = %8
%12 = getelementptr inbounds i32, i32* %0, i64 %9
%13 = load i32, i32* %12
%14 = icmp slt i32 %6, %13
%15 = add nuw nsw i64 %9, 1
br i1 %14, label %16, label %8
16: ; preds = %11, %8, %2
%17 = phi i32 [ 1, %2 ], [ 1, %8 ], [ 0, %11 ]
ret i32 %17
}
int num_cmp(double x, double y) {
  if (x < y)
    return -1;
  if (x > y)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<num_cmp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    112e <num_cmp+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1151 <num_cmp+0x51>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    114a <num_cmp+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <num_cmp+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_cmp>:
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @num_cmp(double %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp olt double %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 -1, i32* %3
br label %16
10: ; preds = %2
%11 = load double, double* %4
%12 = load double, double* %5
%13 = fcmp ogt double %11, %12
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 1, i32* %3
br label %16
15: ; preds = %10
store i32 0, i32* %3
br label %16
16: ; preds = %15, %14, %9
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @num_cmp(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = fcmp ogt double %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
int test_imm_DBuint32_mem(unsigned int *val) {
  return ((*val) & (0xDB << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_DBuint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 219
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void fx(void) { puts("At exit fx"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"At exit fx\00"
define void @fx() {
%1 = call i32 @puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"At exit fx\00"
define void @fx() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ dv_error(char *);
scalar_t__ errno;
long ftell(int /*<<< orphan*/ *);
long dv_ftell(FILE *stream) {
  if (errno) {
    dv_error("");
  }
  long ret = ftell(stream);
  if (ret < 0) {
    dv_error("Failed to fetch current file position.");
  }
  return ret;
}


x86 assembly (clang, -O0):
<dv_ftell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
cmpq   $0x0,(%rax)
je     1149 <dv_ftell+0x29>
lea    0xee2(%rip),%rdi
call   1040 <dv_error@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    116d <dv_ftell+0x4d>
lea    0xe98(%rip),%rdi
call   1040 <dv_error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dv_ftell>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
cmpq   $0x0,(%rax)
je     113d <dv_ftell+0x1d>
lea    0xeee(%rip),%rdi
call   1040 <dv_error@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %rax,%rbx
test   %rax,%rax
jns    1159 <dv_ftell+0x39>
lea    0xeac(%rip),%rdi
call   1040 <dv_error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i64 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [39 x i8] c"Failed to fetch current file position.\00"
define i64 @dv_ftell(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
%4 = load i64, i64* @errno
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @dv_error(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = load i32*, i32** %2
%10 = call i64 @ftell(i32* %9)
store i64 %10, i64* %3
%11 = load i64, i64* %3
%12 = icmp slt i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = call i32 @dv_error(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %8
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
@errno = global i64 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [39 x i8] c"Failed to fetch current file position.\00"
define i64 @dv_ftell(i32* nocapture %0) {
%2 = load i64, i64* @errno
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @dv_error(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = tail call i64 @ftell(i32* %0)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 @dv_error(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %6
ret i64 %7
}
void leaf(void) { int a = 0; }


x86 assembly (clang, -O0):
<leaf>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @leaf() {
ret void
}
letnum(c) register c;
{ return (letter(c) || digit(c)); }


x86 assembly (clang, -O0):
<letnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1040 <letter@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1158 <letnum+0x38>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <digit@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<letnum>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <letter@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
je     1137 <letnum+0x17>
pop    %rbx
ret
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <digit@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @letnum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @letter to i32 (i32, ...)*)(i32 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 (i32, ...) bitcast (i32 (...)* @digit to i32 (i32, ...)*)(i32 %7)
%9 = icmp ne i32 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @letnum(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @letter to i32 (i32, ...)*)(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @digit to i32 (i32, ...)*)(i32 %0)
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int tab_len(char **tab) {
  int i;
  if (tab == NULL)
    return (0);
  i = 0;
  while (tab[i])
    i++;
  return (i);
}


x86 assembly (clang, -O0):
<tab_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <tab_len+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    114d <tab_len+0x4d>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1147 <tab_len+0x47>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <tab_len+0x26>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tab_len>:
test   %rdi,%rdi
je     111e <tab_len+0x1e>
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpq   $0x0,(%rdi)
lea    0x8(%rdi),%rdi
jne    1110 <tab_len+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @tab_len(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ 0, %1 ], [ %10, %9 ]
ret i32 %12
}
/* Type definitions */
struct list_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ flatten_aux(struct list_node *);
struct list_node *flatten(struct list_node *head) {
  flatten_aux(head);
  return head;
}


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

x86 assembly (clang, -O2):
<flatten>:
push   %rbx
mov    %rdi,%rbx
call   1030 <flatten_aux@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.list_node = type { i32 }
define %struct.list_node* @flatten(%struct.list_node* returned %0) {
%2 = tail call i32 @flatten_aux(%struct.list_node* %0)
ret %struct.list_node* %0
}