xunge/DecIR huggingface dataset:
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_gid;
};
struct group {
  char *gr_name;
};

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
struct group *getgrgid(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
char *get_groupname(struct stat file_stat) {
  struct group *group;
  if ((group = getgrgid(file_stat.st_gid)) == NULL) {
    perror("getgrgid");
    exit(EXIT_FAILURE);
  }
  return group->gr_name;
}


x86 assembly (clang, -O0):
<get_groupname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <getgrgid@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    116b <get_groupname+0x3b>
lea    0xea8(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_groupname>:
push   %rax
call   1030 <getgrgid@plt>
test   %rax,%rax
je     1140 <get_groupname+0x10>
mov    (%rax),%rax
pop    %rcx
ret
lea    0xeb9(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
%struct.group = type { i8* }
@.str = [9 x i8] c"getgrgid\00"
@EXIT_FAILURE = global i32 0
define i8* @get_groupname(i32 %0) {
%2 = alloca %struct.stat
%3 = alloca %struct.group*
%4 = getelementptr inbounds %struct.stat, %struct.stat* %2, i32 0, i32 0
store i32 %0, i32* %4
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i32 0, i32 0
%6 = load i32, i32* %5
%7 = call %struct.group* @getgrgid(i32 %6)
store %struct.group* %7, %struct.group** %3
%8 = icmp eq %struct.group* %7, null
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %1
%14 = load %struct.group*, %struct.group** %3
%15 = getelementptr inbounds %struct.group, %struct.group* %14, i32 0, i32 0
%16 = load i8*, i8** %15
ret i8* %16
}

LLVM IR (-O2):
%struct.group = type { i8* }
@.str = [9 x i8] c"getgrgid\00"
@EXIT_FAILURE = global i32 0
define i8* @get_groupname(i32 %0) {
%2 = tail call %struct.group* @getgrgid(i32 %0)
%3 = icmp eq %struct.group* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
%9 = getelementptr inbounds %struct.group, %struct.group* %2, i64 0, i32 0
%10 = load i8*, i8** %9
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ xfree(void *);
void gen_deleter(void **data) {
  do {
    xfree(*data);
    (*data) = NULL;
  } while (0);
}


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

x86 assembly (clang, -O2):
<gen_deleter>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <xfree@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @gen_deleter(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @xfree(i8* %2)
store i8* null, i8** %0
ret void
}
/* Variables and functions */
long sockInit();
long NETinit() { return sockInit(); }


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

x86 assembly (clang, -O2):
<NETinit>:
xor    %eax,%eax
jmp    1030 <sockInit@plt>

LLVM IR (-O0):
define i64 @NETinit() {
%1 = call i64 (...) @sockInit()
ret i64 %1
}

LLVM IR (-O2):
define i64 @NETinit() {
%1 = tail call i64 (...) @sockInit()
ret i64 %1
}
/* Type definitions */
typedef scalar_t__ uint64_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ free(void *);
int ri_mem_free_aligned(void *ptr) {
  void *free_addr;
  if (ptr == NULL) {
    return -1;
  }
  free_addr = (void *)(uint32_t)(*((uint64_t *)ptr - 1));
  if (free_addr == NULL)
    return -1;
  free(free_addr);
  return 0;
}


x86 assembly (clang, -O0):
<ri_mem_free_aligned>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <ri_mem_free_aligned+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    1166 <ri_mem_free_aligned+0x56>
mov    -0x10(%rbp),%rax
mov    -0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1156 <ri_mem_free_aligned+0x46>
movl   $0xffffffff,-0x4(%rbp)
jmp    1166 <ri_mem_free_aligned+0x56>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ri_mem_free_aligned>:
push   %rax
mov    $0xffffffff,%eax
test   %rdi,%rdi
je     112b <ri_mem_free_aligned+0x1b>
mov    -0x8(%rdi),%rdi
test   %rdi,%rdi
je     112b <ri_mem_free_aligned+0x1b>
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ri_mem_free_aligned(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
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 -1, i32* %2
br label %20
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to i64*
%11 = getelementptr inbounds i64, i64* %10, i64 -1
%12 = load i64, i64* %11
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %4
%14 = load i8*, i8** %4
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %17
16: ; preds = %8
store i32 -1, i32* %2
br label %20
17: ; preds = %8
%18 = load i8*, i8** %4
%19 = call i32 @free(i8* %18)
store i32 0, i32* %2
br label %20
20: ; preds = %17, %16, %7
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @ri_mem_free_aligned(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 -8
%5 = bitcast i8* %4 to i64*
%6 = load i64, i64* %5
%7 = icmp eq i64 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = inttoptr i64 %6 to i8*
%10 = tail call i32 @free(i8* %9)
br label %11
11: ; preds = %3, %1, %8
%12 = phi i32 [ 0, %8 ], [ -1, %1 ], [ -1, %3 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int16_t htol_16(int16_t hostval) { return hostval; }


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

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

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

LLVM IR (-O2):
define i32 @htol_16(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void mat_range_is_valid(int range, int max_possible, int line_number,
                        int *syntax_errors) {
  if (range < 0 || range > max_possible) {
    fprintf(stderr, "Error in line %d - data can\'t end with a comma\n",
            line_number);
    *syntax_errors = 1;
  }
  return;
}


x86 assembly (clang, -O0):
<mat_range_is_valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     113b <mat_range_is_valid+0x2b>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    115d <mat_range_is_valid+0x4d>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
lea    0xeb2(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat_range_is_valid>:
push   %rbx
mov    %rcx,%rbx
test   %edi,%edi
js     111e <mat_range_is_valid+0xe>
cmp    %esi,%edi
jg     111e <mat_range_is_valid+0xe>
pop    %rbx
ret
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x1,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"Error in line %d - data can't end with a comma\0A\00"
define void @mat_range_is_valid(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = icmp sgt i32 %12, %13
br i1 %14, label %15, label %20
15: ; preds = %11, %4
%16 = load i32, i32* @stderr
%17 = load i32, i32* %7
%18 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = load i32*, i32** %8
store i32 1, i32* %19
br label %20
20: ; preds = %15, %11
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"Error in line %d - data can't end with a comma\0A\00"
define void @mat_range_is_valid(i32 %0, i32 %1, i32 %2, i32* nocapture writeonly %3) {
%5 = icmp slt i32 %0, 0
%6 = icmp sgt i32 %0, %1
%7 = or i1 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32, i32* @stderr
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %2)
store i32 1, i32* %3
br label %11
11: ; preds = %4, %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void done() {
  endwin();
  exit(0);
}


x86 assembly (clang, -O0):
<done>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <endwin@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<done>:
push   %rax
xor    %eax,%eax
call   1030 <endwin@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @done() {
%1 = call i32 (...) @endwin()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @done() {
%1 = tail call i32 (...) @endwin()
%2 = tail call i32 @exit(i32 0)
unreachable
}
void get_string(char *line) {}


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

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

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

LLVM IR (-O2):
define void @get_string(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __DSB();
int /*<<< orphan*/ __ICACHE_IALL();
int /*<<< orphan*/ __ISB();
void csi_icache_invalid(void) {
  __DSB();
  __ISB();
  __ICACHE_IALL();
  __DSB();
  __ISB();
}


x86 assembly (clang, -O0):
<csi_icache_invalid>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <__DSB@plt>
mov    $0x0,%al
call   1030 <__ISB@plt>
mov    $0x0,%al
call   1050 <__ICACHE_IALL@plt>
mov    $0x0,%al
call   1040 <__DSB@plt>
mov    $0x0,%al
call   1030 <__ISB@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<csi_icache_invalid>:
push   %rax
xor    %eax,%eax
call   1040 <__DSB@plt>
xor    %eax,%eax
call   1030 <__ISB@plt>
xor    %eax,%eax
call   1050 <__ICACHE_IALL@plt>
xor    %eax,%eax
call   1040 <__DSB@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <__ISB@plt>

LLVM IR (-O0):
define void @csi_icache_invalid() {
%1 = call i32 (...) @__DSB()
%2 = call i32 (...) @__ISB()
%3 = call i32 (...) @__ICACHE_IALL()
%4 = call i32 (...) @__DSB()
%5 = call i32 (...) @__ISB()
ret void
}

LLVM IR (-O2):
define void @csi_icache_invalid() {
%1 = tail call i32 (...) @__DSB()
%2 = tail call i32 (...) @__ISB()
%3 = tail call i32 (...) @__ICACHE_IALL()
%4 = tail call i32 (...) @__DSB()
%5 = tail call i32 (...) @__ISB()
ret void
}
/* Variables and functions */
int rand();
int random_operator(int definition[3][6]) {
  int operator_index;
  int _operator;
  operator_index = rand() % *definition[1];
  _operator = definition[0][operator_index];
  return _operator;
}


x86 assembly (clang, -O0):
<random_operator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%rcx
cltd
idivl  0x18(%rcx)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_operator>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idivl  0x18(%rbx)
movslq %edx,%rax
mov    (%rbx,%rax,4),%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @random_operator([6 x i32]* nocapture %0) {
%2 = tail call i32 (...) @rand()
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %0, i64 1, i64 0
%4 = load i32, i32* %3
%5 = srem i32 %2, %4
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [6 x i32], [6 x i32]* %0, i64 0, i64 %6
%8 = load i32, i32* %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ __fpurge(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdin;
void wait_a_time() {
  int number;
  printf("Type a number and next enter to continue...");
  __fpurge(stdin);
  scanf("%d", &number);
}


x86 assembly (clang, -O0):
<wait_a_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1030 <__fpurge@plt>
lea    0xed3(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_a_time>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1030 <__fpurge@plt>
lea    0xeda(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [44 x i8] c"Type a number and next enter to continue...\00"
@stdin = global i32 0
@.str.1 = [3 x i8] c"%d\00"
define void @wait_a_time() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdin
%4 = call i32 @__fpurge(i32 %3)
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"Type a number and next enter to continue...\00"
@stdin = global i32 0
@.str.1 = [3 x i8] c"%d\00"
define void @wait_a_time() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = tail call i32 @__fpurge(i32 %4)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
ret void
}
void LOS_EvbUartWriteByte(char c) { return; }


x86 assembly (clang, -O0):
<LOS_EvbUartWriteByte>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @LOS_EvbUartWriteByte(i8 signext %0) {
ret void
}
/* Type definitions */
struct file {
  int dummy;
};

/* Variables and functions */
struct file *au_h_fptr_i(struct file *, int /*<<< orphan*/);
int /*<<< orphan*/ fbstart(struct file *);
struct file *au_h_fptr(struct file *file) {
  return au_h_fptr_i(file, fbstart(file));
}


x86 assembly (clang, -O0):
<au_h_fptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fbstart@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <au_h_fptr_i@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<au_h_fptr>:
push   %rbx
mov    %rdi,%rbx
call   1030 <fbstart@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <au_h_fptr_i@plt>

LLVM IR (-O0):
%struct.file = type { i32 }
define %struct.file* @au_h_fptr(%struct.file* %0) {
%2 = alloca %struct.file*
store %struct.file* %0, %struct.file** %2
%3 = load %struct.file*, %struct.file** %2
%4 = load %struct.file*, %struct.file** %2
%5 = call i32 @fbstart(%struct.file* %4)
%6 = call %struct.file* @au_h_fptr_i(%struct.file* %3, i32 %5)
ret %struct.file* %6
}

LLVM IR (-O2):
%struct.file = type { i32 }
define %struct.file* @au_h_fptr(%struct.file* %0) {
%2 = tail call i32 @fbstart(%struct.file* %0)
%3 = tail call %struct.file* @au_h_fptr_i(%struct.file* %0, i32 %2)
ret %struct.file* %3
}
int toascii(c)
int c;
{ return ((c)&0x7F); }


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

x86 assembly (clang, -O2):
<toascii>:
mov    %edi,%eax
and    $0x7f,%eax
ret

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

LLVM IR (-O2):
define i32 @toascii(i32 %0) {
%2 = and i32 %0, 127
ret i32 %2
}
/* Type definitions */
struct FNTD {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ DirectoryEntryToDidl(char *, struct FNTD *);
void DirectoryEntryToDidl2(char *pathName, void *fntd) {
  DirectoryEntryToDidl(pathName, (struct FNTD *)fntd);
}


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

x86 assembly (clang, -O2):
<DirectoryEntryToDidl2>:
jmp    1030 <DirectoryEntryToDidl@plt>

LLVM IR (-O0):
%struct.FNTD = type { i32 }
define void @DirectoryEntryToDidl2(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to %struct.FNTD*
%8 = call i32 @DirectoryEntryToDidl(i8* %5, %struct.FNTD* %7)
ret void
}

LLVM IR (-O2):
%struct.FNTD = type { i32 }
define void @DirectoryEntryToDidl2(i8* %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.FNTD*
%4 = tail call i32 @DirectoryEntryToDidl(i8* %0, %struct.FNTD* %3)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ *display;
};
typedef TYPE_1__ XEDataObject;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
void set_XEDataObject_display(void *_p, void *_v) {
  ((XEDataObject *)_p)->display = (Display *)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32* }
define void @set_XEDataObject_display(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 = bitcast i8* %5 to i32*
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.TYPE_2__*
%9 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %8, i32 0, i32 0
store i32* %6, i32** %9
ret void
}

LLVM IR (-O2):
define void @set_XEDataObject_display(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
/* Variables and functions */
float pow(int, int);
int /*<<< orphan*/ printf(char *, float);
int main() {
  float a = pow(2, 16);
  printf("a = %f\n", a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
mov    $0x10,%esi
call   1040 <pow@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"a = %f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = call float @pow(i32 2, i32 16)
store float %2, float* %1
%3 = load float, float* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"a = %f\0A\00"
define i32 @main() {
%1 = tail call float @pow(i32 2, i32 16)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float %1)
ret i32 0
}
/* Variables and functions */
double findMedianSortedArrays(int *, int, int *, int);
int /*<<< orphan*/ printf(char *, double);
int main(void) {
  int a[] = {1, 2, 3};
  int b[] = {4};
  double result = findMedianSortedArrays(a, 3, b, 1);
  printf("result=%f\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    0xec3(%rip),%eax
mov    %eax,-0x14(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rdx
mov    $0x3,%esi
mov    $0x1,%ecx
call   1040 <findMedianSortedArrays@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xede(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xecb(%rip),%rax
mov    %rax,0x8(%rsp)
movl   $0x4,0x4(%rsp)
lea    0x8(%rsp),%rdi
lea    0x4(%rsp),%rdx
mov    $0x3,%esi
mov    $0x1,%ecx
call   1040 <findMedianSortedArrays@plt>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [3 x i32] [i32 1, i32 2, i32 3]
@__const.main.b = [1 x i32] [i32 4]
@.str = [11 x i8] c"result=%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = alloca [1 x i32]
%4 = alloca double
store i32 0, i32* %1
%5 = bitcast [3 x i32]* %2 to i8*
%6 = bitcast [1 x i32]* %3 to i8*
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%8 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
%9 = call double @findMedianSortedArrays(i32* %7, i32 3, i32* %8, i32 1)
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [3 x i32] [i32 1, i32 2, i32 3]
@.str = [11 x i8] c"result=%f\0A\00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = alloca [1 x i32]
%3 = bitcast [3 x i32]* %1 to i8*
%4 = bitcast [1 x i32]* %2 to i8*
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32 4, i32* %5
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%7 = call double @findMedianSortedArrays(i32* %6, i32 3, i32* %5, i32 1)
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clear_free_list();
int /*<<< orphan*/ end_memory();
void end_value(void) {
  clear_free_list();
  end_memory();
}


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

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

LLVM IR (-O0):
define void @end_value() {
%1 = call i32 (...) @clear_free_list()
%2 = call i32 (...) @end_memory()
ret void
}

LLVM IR (-O2):
define void @end_value() {
%1 = tail call i32 (...) @clear_free_list()
%2 = tail call i32 (...) @end_memory()
ret void
}
int getc_char_ptr(void *ctx) {
  unsigned char **c = (unsigned char **)ctx;
  return *(*c)++;
}


x86 assembly (clang, -O0):
<getc_char_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
movzbl (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getc_char_ptr>:
mov    (%rdi),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rdi)
movzbl (%rax),%eax
ret

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

LLVM IR (-O2):
define i32 @getc_char_ptr(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
store i8* %4, i8** %2
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ ListMove(int);
void ListDown() { ListMove(1); }


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

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

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

LLVM IR (-O2):
define void @ListDown() {
%1 = tail call i32 @ListMove(i32 1)
ret void
}
/* Variables and functions */
int printUsage(char *);
int run(char *);
int main(int argc, char *argv[]) {
  if (argc != 2)
    return printUsage(argv[0]);
  return run(argv[1]);
}


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)
cmpl   $0x2,-0x8(%rbp)
je     1154 <main+0x34>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <printUsage@plt>
mov    %eax,-0x4(%rbp)
jmp    1164 <main+0x44>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <run@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jne    112e <main+0xe>
mov    0x8(%rsi),%rdi
jmp    1030 <run@plt>
mov    (%rsi),%rdi
jmp    1040 <printUsage@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printUsage(i8* %5)
br label %11
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @run(i8* %9)
br label %11
11: ; preds = %7, %4
%12 = phi i32 [ %6, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ device_type(char const *);
int pcap_devtype_to_linktype(int /*<<< orphan*/);
int pcap_dev_to_linktype(const char *ifname) {
  return pcap_devtype_to_linktype(device_type(ifname));
}


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

x86 assembly (clang, -O2):
<pcap_dev_to_linktype>:
push   %rax
call   1040 <device_type@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <pcap_devtype_to_linktype@plt>

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

LLVM IR (-O2):
define i32 @pcap_dev_to_linktype(i8* %0) {
%2 = tail call i32 @device_type(i8* %0)
%3 = tail call i32 @pcap_devtype_to_linktype(i32 %2)
ret i32 %3
}
int od_qm_get_index(int bs, int band) {
  ;
  return bs * (bs + 1) + band - band / 3;
}


x86 assembly (clang, -O0):
<od_qm_get_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<od_qm_get_index>:
lea    0x1(%rdi),%ecx
imul   %edi,%ecx
add    %esi,%ecx
movslq %esi,%rdx
imul   $0x55555555,%rdx,%rax
shr    $0x20,%rax
sub    %edx,%eax
mov    %eax,%edx
shr    $0x1f,%edx
sar    %eax
add    %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @od_qm_get_index(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* %3
%7 = add nsw i32 %6, 1
%8 = mul nsw i32 %5, %7
%9 = load i32, i32* %4
%10 = add nsw i32 %8, %9
%11 = load i32, i32* %4
%12 = sdiv i32 %11, 3
%13 = sub nsw i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @od_qm_get_index(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 1
%4 = mul nsw i32 %3, %0
%5 = add nsw i32 %4, %1
%6 = sdiv i32 %1, -3
%7 = add i32 %5, %6
ret i32 %7
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int _isvalidutf8ext(uint8_t byte) {
  return ((byte & (0b11 << 6)) == (0b10 << 6));
}


x86 assembly (clang, -O0):
<_isvalidutf8ext>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_isvalidutf8ext>:
and    $0xc0,%edi
xor    %eax,%eax
cmp    $0x80,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @_isvalidutf8ext(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 192
%5 = icmp eq i32 %4, 128
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @_isvalidutf8ext(i32 %0) {
%2 = and i32 %0, 192
%3 = icmp eq i32 %2, 128
%4 = zext i1 %3 to i32
ret i32 %4
}
void *test_anti_range_102(int n) {
  extern void *alloc_anti_range_102(int) __attribute__((alloc_size(1)));
  if (0 <= n && n <= 2)
    n = 0 - 1;
  return alloc_anti_range_102(n);
}


x86 assembly (clang, -O0):
<test_anti_range_102>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
jg     1137 <test_anti_range_102+0x27>
cmpl   $0x2,-0x4(%rbp)
jg     1137 <test_anti_range_102+0x27>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <alloc_anti_range_102@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_102>:
cmp    $0x3,%edi
mov    $0xffffffff,%eax
cmovb  %eax,%edi
jmp    1030 <alloc_anti_range_102@plt>

LLVM IR (-O0):
define i8* @test_anti_range_102(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 0, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 -1, i32* %2
br label %9
9: ; preds = %8, %5, %1
%10 = load i32, i32* %2
%11 = call i8* @alloc_anti_range_102(i32 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @test_anti_range_102(i32 %0) {
%2 = icmp ult i32 %0, 3
%3 = select i1 %2, i32 -1, i32 %0
%4 = tail call i8* @alloc_anti_range_102(i32 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ aprsis_beacon();
int /*<<< orphan*/ aprsis_connect();
int /*<<< orphan*/ aprsis_rcvr();
int /*<<< orphan*/ aprsis_xmit();
int /*<<< orphan*/ sleep(int);
void *aprsis_client(void *arg) {
  int rc;
  aprsis_connect();
  while (1) {
    sleep(1);
    aprsis_rcvr();
    aprsis_xmit();
    aprsis_beacon();
  }
  return NULL;
}


x86 assembly (clang, -O0):
<aprsis_client>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <aprsis_connect@plt>
mov    $0x1,%edi
call   1070 <sleep@plt>
mov    $0x0,%al
call   1030 <aprsis_rcvr@plt>
mov    $0x0,%al
call   1040 <aprsis_xmit@plt>
mov    $0x0,%al
call   1060 <aprsis_beacon@plt>
jmp    1163 <aprsis_client+0x13>

x86 assembly (clang, -O2):
<aprsis_client>:
push   %rax
xor    %eax,%eax
call   1050 <aprsis_connect@plt>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1070 <sleep@plt>
xor    %eax,%eax
call   1030 <aprsis_rcvr@plt>
xor    %eax,%eax
call   1040 <aprsis_xmit@plt>
xor    %eax,%eax
call   1060 <aprsis_beacon@plt>
jmp    1160 <aprsis_client+0x10>

LLVM IR (-O0):
define i8* @aprsis_client(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 (...) @aprsis_connect()
br label %5
5: ; preds = %1, %5
%6 = call i32 @sleep(i32 1)
%7 = call i32 (...) @aprsis_rcvr()
%8 = call i32 (...) @aprsis_xmit()
%9 = call i32 (...) @aprsis_beacon()
br label %5
}

LLVM IR (-O2):
define noalias i8* @aprsis_client(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @aprsis_connect()
br label %3
3: ; preds = %3, %1
%4 = tail call i32 @sleep(i32 1)
%5 = tail call i32 (...) @aprsis_rcvr()
%6 = tail call i32 (...) @aprsis_xmit()
%7 = tail call i32 (...) @aprsis_beacon()
br label %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(float *, int /*<<< orphan*/ *, int);
float UsefulBufUtil_CopyUint32ToFloat(uint32_t u32) {
  float f;
  memcpy(&f, &u32, sizeof(uint32_t));
  return f;
}


x86 assembly (clang, -O0):
<UsefulBufUtil_CopyUint32ToFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UsefulBufUtil_CopyUint32ToFloat>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %rsp,%rdi
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movss  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @UsefulBufUtil_CopyUint32ToFloat(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
%4 = call i32 @memcpy(float* %3, i32* %2, i32 4)
%5 = load float, float* %3
ret float %5
}

LLVM IR (-O2):
define float @UsefulBufUtil_CopyUint32ToFloat(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
%4 = bitcast float* %3 to i8*
%5 = call i32 @memcpy(float* %3, i32* %2, i32 4)
%6 = load float, float* %3
ret float %6
}
/* Type definitions */
struct mloop_signal {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mloop__ref_any(struct mloop_signal *);
__attribute__((visibility("default"))) void
mloop_signal_ref(struct mloop_signal *self) {
  mloop__ref_any(self);
}


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

x86 assembly (clang, -O2):
<mloop_signal_ref>:
jmp    1030 <mloop__ref_any@plt>

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

LLVM IR (-O2):
%struct.mloop_signal = type { i32 }
define void @mloop_signal_ref(%struct.mloop_signal* %0) {
%2 = tail call i32 @mloop__ref_any(%struct.mloop_signal* %0)
ret void
}
int cap() { return 42; }


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

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

LLVM IR (-O0):
define i32 @cap() {
ret i32 42
}

LLVM IR (-O2):
define i32 @cap() {
ret i32 42
}
/* Type definitions */
struct fb_videomode {
  int dummy;
};

/* Variables and functions */
void fb_destroy_modedb(struct fb_videomode *modedb) {}


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

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

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

LLVM IR (-O2):
%struct.fb_videomode = type { i32 }
define void @fb_destroy_modedb(%struct.fb_videomode* nocapture %0) {
ret void
}
/* Variables and functions */
int ParseCompareDoubles(char const **, char const **);
int ParseReverseCompareDoubles(const char **ptrs1, const char **ptrs2) {
  return -ParseCompareDoubles(ptrs1, ptrs2);
}


x86 assembly (clang, -O0):
<ParseReverseCompareDoubles>:
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 <ParseCompareDoubles@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ParseReverseCompareDoubles>:
push   %rax
call   1030 <ParseCompareDoubles@plt>
neg    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ParseReverseCompareDoubles(i8** %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i8**
store i8** %0, i8*** %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %3
%6 = load i8**, i8*** %4
%7 = call i32 @ParseCompareDoubles(i8** %5, i8** %6)
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @ParseReverseCompareDoubles(i8** %0, i8** %1) {
%3 = tail call i32 @ParseCompareDoubles(i8** %0, i8** %1)
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t spiGetByte(void) {
  uint8_t result;
  uint32_t to;
  to = 0;
  (*(volatile unsigned long *)((0xE0020008))) = (uint32_t)0x000000FF & 0xFF;
  while (!((*(volatile unsigned long *)((0xE0020004))) & 0x00000080))
    ;
  result = (uint8_t)(*(volatile unsigned long *)((0xE0020008))) &
           (uint32_t)0x000000FF;
  return result;
}


x86 assembly (clang, -O0):
<spiGetByte>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
mov    $0xe0020008,%eax
movq   $0xff,(%rax)
mov    $0xe0020004,%eax
mov    (%rax),%rax
and    $0x80,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    113b <spiGetByte+0x3b>
jmp    1140 <spiGetByte+0x40>
jmp    1117 <spiGetByte+0x17>
mov    $0xe0020008,%eax
mov    (%rax),%rax
and    $0xff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<spiGetByte>:
mov    $0xe0020008,%eax
movq   $0xff,(%rax)
nopl   0x0(%rax)
testq  $0x80,-0x4(%rax)
je     1110 <spiGetByte+0x10>
mov    (%rax),%rax
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @spiGetByte() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
store volatile i64 255, i64* inttoptr (i64 3758227464 to i64*)
br label %3
3: ; preds = %8, %0
%4 = load volatile i64, i64* inttoptr (i64 3758227460 to i64*)
%5 = and i64 %4, 128
%6 = icmp ne i64 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
%10 = load volatile i64, i64* inttoptr (i64 3758227464 to i64*)
%11 = trunc i64 %10 to i32
%12 = and i32 %11, 255
store i32 %12, i32* %1
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @spiGetByte() {
store volatile i64 255, i64* inttoptr (i64 3758227464 to i64*)
br label %1
1: ; preds = %1, %0
%2 = load volatile i64, i64* inttoptr (i64 3758227460 to i64*)
%3 = and i64 %2, 128
%4 = icmp eq i64 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load volatile i64, i64* inttoptr (i64 3758227464 to i64*)
%7 = trunc i64 %6 to i32
%8 = and i32 %7, 255
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(int /*<<< orphan*/);
int strisdigit(const char *ptr) {
  while (*ptr != 0)
    if (!isdigit(*ptr++))
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<strisdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115d <strisdigit+0x4d>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1158 <strisdigit+0x48>
movl   $0x0,-0x4(%rbp)
jmp    1164 <strisdigit+0x54>
jmp    111c <strisdigit+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strisdigit>:
movsbl (%rdi),%eax
test   %eax,%eax
je     1116 <strisdigit+0x16>
add    $0x1,%rdi
add    $0xffffffd0,%eax
cmp    $0xa,%eax
jb     1100 <strisdigit>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @strisdigit(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %8, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = sext i8 %4 to i32
%8 = getelementptr inbounds i8, i8* %3, i64 1
%9 = add nsw i32 %7, -48
%10 = icmp ult i32 %9, 10
br i1 %10, label %2, label %11
11: ; preds = %2, %6
%12 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int strlen(char *);
void printReverse(char *word) {
  int i;
  for (i = strlen(word); i >= 0; i--) {
    printf("%c", word[i]);
  }
}


x86 assembly (clang, -O0):
<printReverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1168 <printReverse+0x48>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
lea    0xeaf(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1138 <printReverse+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printReverse>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1030 <strlen@plt>
test   %eax,%eax
js     1153 <printReverse+0x33>
mov    %eax,%ebx
lea    0xec6(%rip),%r14
nopw   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0xffffffffffffffff,%rbx
jb     1140 <printReverse+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @printReverse(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, -1
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %9)
%11 = add nsw i64 %7, -1
%12 = icmp eq i64 %7, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %1
ret void
}
/* Variables and functions */
scalar_t__ pow(double, double);
int iPow(int x, int y) { return (int)(pow((double)x, (double)y)); }


x86 assembly (clang, -O0):
<iPow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iPow>:
cvtsi2sd %edi,%xmm0
cvtsi2sd %esi,%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define i32 @iPow(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 = sitofp i32 %5 to double
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to double
%9 = call i64 @pow(double %6, double %8)
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @iPow(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to double
%4 = sitofp i32 %1 to double
%5 = tail call i64 @pow(double %3, double %4)
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ abs_test();
int /*<<< orphan*/ fib_test();
int /*<<< orphan*/ gcd_test();
void main(void) {
  fib_test();
  gcd_test();
  abs_test();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <fib_test@plt>
mov    $0x0,%al
call   1030 <gcd_test@plt>
mov    $0x0,%al
call   1050 <abs_test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <fib_test@plt>
xor    %eax,%eax
call   1030 <gcd_test@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <abs_test@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @fib_test()
%2 = call i32 (...) @gcd_test()
%3 = call i32 (...) @abs_test()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @fib_test()
%2 = tail call i32 (...) @gcd_test()
%3 = tail call i32 (...) @abs_test()
ret void
}
int b() { return 52; }


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

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

LLVM IR (-O0):
define i32 @b() {
ret i32 52
}

LLVM IR (-O2):
define i32 @b() {
ret i32 52
}
void _M2_COROUTINES_finish(__attribute__((unused)) int argc,
                           __attribute__((unused)) char *argv[]) {}


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

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

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

LLVM IR (-O2):
define void @_M2_COROUTINES_finish(i32 %0, i8** nocapture %1) {
ret void
}