xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned int enablePin(unsigned int const, unsigned int const,
                       unsigned int const);
unsigned int enableADCPin(const unsigned int port, const unsigned int pin,
                          const unsigned int mode) {
  if (port != 2) {
    return 1;
  }
  return enablePin(port, pin, mode);
}


x86 assembly (clang, -O0):
<enableADCPin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1137 <enableADCPin+0x27>
movl   $0x1,-0x4(%rbp)
jmp    1148 <enableADCPin+0x38>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <enablePin@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enableADCPin>:
cmp    $0x2,%edi
jne    111f <enableADCPin+0xf>
mov    $0x2,%edi
jmp    1030 <enablePin@plt>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @enableADCPin(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 2
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @enablePin(i32 2, i32 %1, i32 %2)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ 1, %3 ]
ret i32 %8
}
void omap_vout_free_vrfb_buffers(struct omap_vout_device *vout) {}


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

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

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

LLVM IR (-O2):
%struct.omap_vout_device = type opaque
define void @omap_vout_free_vrfb_buffers(%struct.omap_vout_device* nocapture %0) {
ret void
}
/* Type definitions */
struct list_node {
  int dummy;
};
struct list {
  int dummy;
};

/* Variables and functions */
struct list_node *list_insert(struct list *, int /*<<< orphan*/, void *);
int /*<<< orphan*/ list_size(struct list *);
struct list_node *list_push_back(struct list *self, void *data) {
  return list_insert(self, list_size(self), data);
}


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

x86 assembly (clang, -O2):
<list_push_back>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <list_size@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <list_insert@plt>

LLVM IR (-O0):
%struct.list_node = type { i32 }
%struct.list = type { i32 }
define %struct.list_node* @list_push_back(%struct.list* %0, i8* %1) {
%3 = alloca %struct.list*
%4 = alloca i8*
store %struct.list* %0, %struct.list** %3
store i8* %1, i8** %4
%5 = load %struct.list*, %struct.list** %3
%6 = load %struct.list*, %struct.list** %3
%7 = call i32 @list_size(%struct.list* %6)
%8 = load i8*, i8** %4
%9 = call %struct.list_node* @list_insert(%struct.list* %5, i32 %7, i8* %8)
ret %struct.list_node* %9
}

LLVM IR (-O2):
%struct.list_node = type { i32 }
%struct.list = type { i32 }
define %struct.list_node* @list_push_back(%struct.list* %0, i8* %1) {
%3 = tail call i32 @list_size(%struct.list* %0)
%4 = tail call %struct.list_node* @list_insert(%struct.list* %0, i32 %3, i8* %1)
ret %struct.list_node* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
struct tm *time___new_Tm_localtime_from_timet___impl(time_t t) {
  struct tm *tm;
  tm = localtime(&t);
  return tm;
}


x86 assembly (clang, -O0):
<time___new_Tm_localtime_from_timet___impl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time___new_Tm_localtime_from_timet___impl>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @time___new_Tm_localtime_from_timet___impl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call %struct.tm* @localtime(i32* %2)
ret %struct.tm* %3
}
/* Variables and functions */
int /*<<< orphan*/ si46xx_read(char *, int);
void si46xx_periodic() {
  char buf[4];
  si46xx_read(buf, 4);
}


x86 assembly (clang, -O0):
<si46xx_periodic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
mov    $0x4,%esi
call   1030 <si46xx_read@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<si46xx_periodic>:
push   %rax
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <si46xx_read@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @si46xx_periodic() {
%1 = alloca [4 x i8]
%2 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%3 = call i32 @si46xx_read(i8* %2, i32 4)
ret void
}

LLVM IR (-O2):
define void @si46xx_periodic() {
%1 = alloca [4 x i8]
%2 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%3 = call i32 @si46xx_read(i8* %2, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: z80dasm [options] <filename>\n"
         "Available options are:\n"
         " -begin  - Specify begin offset in file to disassemble [0]\n"
         " -end    - Specify end offset in file to disassemble [none]\n"
         " -offset - Specify address to load program [0]\n"
         "All values should be entered in hexadecimal\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [270 x i8] c"Usage: z80dasm [options] <filename>\0AAvailable options are:\0A -begin - Specify begin offset in file to disassemble [0]\0A -end - Specify end offset in file to disassemble [none]\0A -offset - Specify address to load program [0]\0AAll values should be entered in hexadecimal\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([270 x i8], [270 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [269 x i8] c"Usage: z80dasm [options] <filename>\0AAvailable options are:\0A -begin - Specify begin offset in file to disassemble [0]\0A -end - Specify end offset in file to disassemble [none]\0A -offset - Specify address to load program [0]\0AAll values should be entered in hexadecimal\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([269 x i8], [269 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
void add_sources_el_sim_type_2_or_3_(long *Mesh_pointer, int *iphasef, int *it,
                                     int *nadj_rec_local, int *NSTEP) {}


x86 assembly (clang, -O0):
<add_sources_el_sim_type_2_or_3_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @add_sources_el_sim_type_2_or_3_(i64* %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i64*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i64* %0, i64** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
ret void
}

LLVM IR (-O2):
define void @add_sources_el_sim_type_2_or_3_(i64* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3, i32* nocapture %4) {
ret void
}
int func2(void) { return (1); }


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

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

LLVM IR (-O0):
define i32 @func2() {
ret i32 1
}

LLVM IR (-O2):
define i32 @func2() {
ret i32 1
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solcon_read_quaddobl_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(390, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_read_quaddobl_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x186,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_read_quaddobl_solutions>:
mov    $0x186,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @solcon_read_quaddobl_solutions() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 390, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @solcon_read_quaddobl_solutions() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 390, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void exitfunc17(void) {
  printf("Executing exitfunc17.\n");
  exit(0);
}


x86 assembly (clang, -O0):
<exitfunc17>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitfunc17>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Executing exitfunc17.\0A\00"
define void @exitfunc17() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [22 x i8] c"Executing exitfunc17.\00"
define void @exitfunc17() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void perror(const char *s) {
  fprintf(stderr, "Barrelfish: error occured, perror() called.\n%s\n", s);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"Barrelfish: error occured, perror() called.\0A%s\0A\00"
define void @perror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"Barrelfish: error occured, perror() called.\0A%s\0A\00"
define void @perror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ st103_get_tx_addr(int);
int /*<<< orphan*/ usb_lld_to_pmabuf(void const *, scalar_t__, size_t);
void usb_lld_txcpy(const void *src, int ep_num, int offset, size_t len) {
  usb_lld_to_pmabuf(src, st103_get_tx_addr(ep_num) + offset, len);
}


x86 assembly (clang, -O0):
<usb_lld_txcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <st103_get_tx_addr@plt>
mov    -0x20(%rbp),%rdi
mov    %rax,%rsi
movslq -0x10(%rbp),%rax
add    %rax,%rsi
mov    -0x18(%rbp),%rdx
call   1030 <usb_lld_to_pmabuf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_lld_txcpy>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %edx,%ebp
mov    %rdi,%rbx
mov    %esi,%edi
call   1040 <st103_get_tx_addr@plt>
movslq %ebp,%rsi
add    %rax,%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <usb_lld_to_pmabuf@plt>

LLVM IR (-O0):
define void @usb_lld_txcpy(i8* %0, i32 %1, i32 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i64 @st103_get_tx_addr(i32 %10)
%12 = load i32, i32* %7
%13 = sext i32 %12 to i64
%14 = add nsw i64 %11, %13
%15 = load i64, i64* %8
%16 = call i32 @usb_lld_to_pmabuf(i8* %9, i64 %14, i64 %15)
ret void
}

LLVM IR (-O2):
define void @usb_lld_txcpy(i8* %0, i32 %1, i32 %2, i64 %3) {
%5 = tail call i64 @st103_get_tx_addr(i32 %1)
%6 = sext i32 %2 to i64
%7 = add nsw i64 %5, %6
%8 = tail call i32 @usb_lld_to_pmabuf(i8* %0, i64 %7, i64 %3)
ret void
}
/* Variables and functions */
int get_line(char *, int);
int /*<<< orphan*/ printf(char *, int, char *);
int main() {
  int length = 0;
  char line[1000];
  while ((length = get_line(line, 1000)) > 0) {
    printf("%d Chars: %s\n", length, line);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1030 <get_line@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1171 <main+0x51>
mov    -0x8(%rbp),%esi
lea    -0x3f0(%rbp),%rdx
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
jmp    1139 <main+0x19>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1030 <get_line@plt>
test   %eax,%eax
jle    116e <main+0x4e>
lea    0xebe(%rip),%r14
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %eax,%esi
mov    %rbx,%rdx
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1030 <get_line@plt>
test   %eax,%eax
jg     1150 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"%d Chars: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x i8]
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %8, %0
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%6 = call i32 @get_line(i8* %5, i32 1000)
store i32 %6, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i32, i32* %2
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %10)
br label %4
12: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"%d Chars: %s\0A\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_line(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = phi i32 [ %8, %5 ], [ %3, %0 ]
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %2)
%8 = call i32 @get_line(i8* %2, i32 1000)
%9 = icmp sgt i32 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ return_struct_i2();
int /*<<< orphan*/ take_struct_i2(int /*<<< orphan*/);
void test_struct_i2() { take_struct_i2(return_struct_i2()); }


x86 assembly (clang, -O0):
<test_struct_i2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <return_struct_i2@plt>
mov    %eax,%edi
call   1040 <take_struct_i2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_struct_i2>:
push   %rax
xor    %eax,%eax
call   1030 <return_struct_i2@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <take_struct_i2@plt>

LLVM IR (-O0):
define void @test_struct_i2() {
%1 = call i32 (...) @return_struct_i2()
%2 = call i32 @take_struct_i2(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_struct_i2() {
%1 = tail call i32 (...) @return_struct_i2()
%2 = tail call i32 @take_struct_i2(i32 %1)
ret void
}
unsigned char inbyte(void) { return *(unsigned char *)0xFF02; }


x86 assembly (clang, -O0):
<inbyte>:
push   %rbp
mov    %rsp,%rbp
mov    $0xff02,%eax
movzbl (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inbyte>:
mov    0xff02,%al
ret

LLVM IR (-O0):
define zeroext i8 @inbyte() {
%1 = load i8, i8* inttoptr (i64 65282 to i8*)
ret i8 %1
}

LLVM IR (-O2):
define zeroext i8 @inbyte() {
%1 = load i8, i8* inttoptr (i64 65282 to i8*)
ret i8 %1
}
long __ocl_max_long_long(long src1, long src2) {
  return (src1 > src2) ? src1 : src2;
}


x86 assembly (clang, -O0):
<__ocl_max_long_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <__ocl_max_long_long+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <__ocl_max_long_long+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_max_long_long>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @__ocl_max_long_long(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp sgt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @__ocl_max_long_long(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
int xmlUCSIsLao(int code) { return (((code >= 0x0E80) && (code <= 0x0EFF))); }


x86 assembly (clang, -O0):
<xmlUCSIsLao>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xe80,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsLao+0x26>
cmpl   $0xeff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsLao>:
and    $0xffffff80,%edi
xor    %eax,%eax
cmp    $0xe80,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsLao(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 3712
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 3839
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsLao(i32 %0) {
%2 = and i32 %0, -128
%3 = icmp eq i32 %2, 3712
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ENOENT;
int /*<<< orphan*/ errno;
int remove(const char *filename) {
  errno = ENOENT;
  return -1;
}


x86 assembly (clang, -O0):
<remove>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOENT = global i32 0
@errno = global i32 0
define i32 @remove(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @ENOENT
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOENT = global i32 0
@errno = global i32 0
define i32 @remove(i8* nocapture readnone %0) {
%2 = load i32, i32* @ENOENT
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ glRotated(int, int /*<<< orphan*/, int /*<<< orphan*/, int);
void update(void) { glRotated(5, 0, 0, -1); }


x86 assembly (clang, -O0):
<update>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
xor    %edx,%edx
mov    $0xffffffff,%ecx
mov    %edx,%esi
call   1030 <glRotated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<update>:
mov    $0x5,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0xffffffff,%ecx
jmp    1030 <glRotated@plt>

LLVM IR (-O0):
define void @update() {
%1 = call i32 @glRotated(i32 5, i32 0, i32 0, i32 -1)
ret void
}

LLVM IR (-O2):
define void @update() {
%1 = tail call i32 @glRotated(i32 5, i32 0, i32 0, i32 -1)
ret void
}
mydelay(n) register n;
{
  register i, z;
  while (--n >= 0)
    for (z = i = 200; --i >= 0; z *= z)
      ;
}


x86 assembly (clang, -O0):
<mydelay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jl     1152 <mydelay+0x52>
movl   $0xc8,-0xc(%rbp)
movl   $0xc8,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jl     114d <mydelay+0x4d>
jmp    113e <mydelay+0x3e>
mov    -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1127 <mydelay+0x27>
jmp    1107 <mydelay+0x7>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @mydelay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
br label %6
6: ; preds = %20, %1
%7 = load i32, i32* %3
%8 = add nsw i32 %7, -1
store i32 %8, i32* %3
%9 = icmp sge i32 %8, 0
br i1 %9, label %10, label %21
10: ; preds = %6
store i32 200, i32* %4
store i32 200, i32* %5
br label %11
11: ; preds = %16, %10
%12 = load i32, i32* %4
%13 = add nsw i32 %12, -1
store i32 %13, i32* %4
%14 = icmp sge i32 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %11
br label %16
16: ; preds = %15
%17 = load i32, i32* %5
%18 = load i32, i32* %5
%19 = mul nsw i32 %18, %17
store i32 %19, i32* %5
br label %11
20: ; preds = %11
br label %6
21: ; preds = %6
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @mydelay(i32 %0) {
ret i32 undef
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int64_t min64(int64_t x, int64_t y) { return (x <= y) ? x : y; }


x86 assembly (clang, -O0):
<min64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jg     1127 <min64+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <min64+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min64>:
mov    %rdi,%rax
cmp    %rsi,%rdi
cmovg  %rsi,%rax
ret

LLVM IR (-O0):
define i64 @min64(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp sle i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @min64(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %1, i64 %0
ret i64 %4
}
/* Variables and functions */
void *malloc_get_state(void) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @malloc_get_state() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @malloc_get_state() {
ret i8* null
}
int crIsDigit(char c) { return c >= '0' && c <= '9'; }


x86 assembly (clang, -O0):
<crIsDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <crIsDigit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<crIsDigit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @crIsDigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
long fib(long num) {
  if (num == 0 || num == 1)
    return num;
  return (fib(num - 1) + fib(num - 2));
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1132 <fib+0x22>
cmpq   $0x1,-0x10(%rbp)
jne    113f <fib+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116b <fib+0x5b>
mov    -0x10(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <fib@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
sub    $0x2,%rdi
call   1030 <fib@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %r14d,%r14d
cmp    $0x2,%rdi
jb     1136 <fib+0x26>
lea    -0x1(%rbx),%rdi
call   1030 <fib@plt>
add    $0xfffffffffffffffe,%rbx
add    %rax,%r14
cmp    $0x1,%rbx
ja     1120 <fib+0x10>
add    %rbx,%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @fib(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i64, i64* %3
%8 = icmp eq i64 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %6, %1
%10 = load i64, i64* %3
store i64 %10, i64* %2
br label %19
11: ; preds = %6
%12 = load i64, i64* %3
%13 = sub nsw i64 %12, 1
%14 = call i64 @fib(i64 %13)
%15 = load i64, i64* %3
%16 = sub nsw i64 %15, 2
%17 = call i64 @fib(i64 %16)
%18 = add nsw i64 %14, %17
store i64 %18, i64* %2
br label %19
19: ; preds = %11, %9
%20 = load i64, i64* %2
ret i64 %20
}

LLVM IR (-O2):
define i64 @fib(i64 %0) {
%2 = icmp ult i64 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ %0, %1 ]
%5 = phi i64 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i64 %4, -1
%7 = tail call i64 @fib(i64 %6)
%8 = add nsw i64 %4, -2
%9 = add nsw i64 %7, %5
%10 = icmp ult i64 %8, 2
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i64 [ 0, %1 ], [ %9, %3 ]
%13 = phi i64 [ %0, %1 ], [ %8, %3 ]
%14 = add nsw i64 %13, %12
ret i64 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int strlcpy(char *, char *, int);
int main(void) {
  char buf[2] = "";
  return (!(1 == strlcpy(buf, "a", sizeof(buf)) && 'a' == buf[0] &&
            '\0' == buf[1]));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x6(%rbp),%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <memset@plt>
lea    -0x6(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x2,%edx
call   1040 <strlcpy@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %edx,%ecx
mov    %al,-0x7(%rbp)
jne    118c <main+0x6c>
movsbl -0x6(%rbp),%edx
xor    %eax,%eax
mov    $0x61,%ecx
cmp    %edx,%ecx
mov    %al,-0x7(%rbp)
jne    118c <main+0x6c>
movsbl -0x5(%rbp),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x7(%rbp)
mov    -0x7(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0x0,0x6(%rsp)
lea    0xee1(%rip),%rsi
lea    0x6(%rsp),%rdi
mov    $0x2,%edx
call   1030 <strlcpy@plt>
cmp    $0x1,%eax
setne  %al
cmpb   $0x61,0x6(%rsp)
setne  %cl
or     %al,%cl
cmpb   $0x0,0x7(%rsp)
setne  %al
or     %cl,%al
movzbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i8]
store i32 0, i32* %1
%3 = bitcast [2 x i8]* %2 to i8*
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%5 = call i32 @strlcpy(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 2)
%6 = icmp eq i32 1, %5
br i1 %6, label %7, label %17
7: ; preds = %0
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 97, %10
br i1 %11, label %12, label %17
12: ; preds = %7
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 0, %15
br label %17
17: ; preds = %12, %7, %0
%18 = phi i1 [ false, %7 ], [ false, %0 ], [ %16, %12 ]
%19 = xor i1 %18, true
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
define i32 @main() {
%1 = alloca i16
%2 = bitcast i16* %1 to i8*
store i16 0, i16* %1
%3 = call i32 @strlcpy(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 2)
%4 = icmp ne i32 %3, 1
%5 = load i8, i8* %2
%6 = icmp ne i8 %5, 97
%7 = select i1 %4, i1 true, i1 %6
%8 = bitcast i16* %1 to [2 x i8]*
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %8, i64 0, i64 1
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
%12 = select i1 %7, i1 true, i1 %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int MaxSubSum(int const *, int /*<<< orphan*/, int);
int MaxSubSequenceSum3(const int A[], int N) { return MaxSubSum(A, 0, N - 1); }


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

x86 assembly (clang, -O2):
<MaxSubSequenceSum3>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <MaxSubSum@plt>

LLVM IR (-O0):
define i32 @MaxSubSequenceSum3(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 = sub nsw i32 %6, 1
%8 = call i32 @MaxSubSum(i32* %5, i32 0, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @MaxSubSequenceSum3(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @MaxSubSum(i32* %0, i32 0, i32 %3)
ret i32 %4
}
unsigned int estimate_base64(unsigned int lin, int newline) {
  int r = ((lin / 3) + 1) * 4;
  if (newline) {
    r += r / 72 + ((r % 72) ? 1 : 0);
  }
  return r + 1;
}


x86 assembly (clang, -O0):
<estimate_base64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
xor    %edx,%edx
div    %ecx
add    $0x1,%eax
shl    $0x2,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     115c <estimate_base64+0x5c>
mov    -0xc(%rbp),%eax
mov    $0x48,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x48,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
mov    %edx,%esi
xor    %ecx,%ecx
mov    $0x1,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<estimate_base64>:
mov    %edi,%eax
mov    $0xaaaaaaab,%ecx
imul   %rax,%rcx
shr    $0x20,%rcx
and    $0xfffffffe,%ecx
lea    (%rcx,%rcx,1),%eax
add    $0x4,%eax
test   %esi,%esi
je     114d <estimate_base64+0x4d>
movslq %eax,%rcx
imul   $0x38e38e39,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x24,%rax
add    %edx,%eax
imul   $0x38e38e39,%ecx,%edx
add    $0xe38e388,%edx
ror    $0x3,%edx
add    %ecx,%eax
cmp    $0x38e38e3,%edx
sbb    $0xffffffff,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @estimate_base64(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = udiv i32 %6, 3
%8 = add i32 %7, 1
%9 = mul i32 %8, 4
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %23
12: ; preds = %2
%13 = load i32, i32* %5
%14 = sdiv i32 %13, 72
%15 = load i32, i32* %5
%16 = srem i32 %15, 72
%17 = icmp ne i32 %16, 0
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 1, i32 0
%20 = add nsw i32 %14, %19
%21 = load i32, i32* %5
%22 = add nsw i32 %21, %20
store i32 %22, i32* %5
br label %23
23: ; preds = %12, %2
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
ret i32 %25
}

LLVM IR (-O2):
define i32 @estimate_base64(i32 %0, i32 %1) {
%3 = udiv i32 %0, 3
%4 = shl i32 %3, 2
%5 = add i32 %4, 4
%6 = icmp eq i32 %1, 0
br i1 %6, label %14, label %7
7: ; preds = %2
%8 = sdiv i32 %5, 72
%9 = srem i32 %5, 72
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
%12 = add i32 %8, %5
%13 = add i32 %12, %11
br label %14
14: ; preds = %7, %2
%15 = phi i32 [ %13, %7 ], [ %5, %2 ]
%16 = add nsw i32 %15, 1
ret i32 %16
}
int foo(void) {
  volatile int a = -1;
  long long b = (1LL << (sizeof(b) * 8 - 1));
  long long x = (a & b);
  if (x < 1LL) {
    ;
  } else {
    __builtin_abort();
  }
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xffffffff,-0x4(%rbp)
movabs $0x8000000000000000,%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cltq
and    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x1,-0x18(%rbp)
jge    114a <foo+0x3a>
jmp    114f <foo+0x3f>
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0xffffffff,-0x4(%rsp)
ff
mov    -0x4(%rsp),%eax
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store volatile i32 -1, i32* %1
store i64 -9223372036854775808, i64* %2
%4 = load volatile i32, i32* %1
%5 = sext i32 %4 to i64
%6 = load i64, i64* %2
%7 = and i64 %5, %6
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = icmp slt i64 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %0
br label %12
11: ; preds = %0
unreachable
12: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
define i32 @foo() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 -1, i32* %1
%3 = load volatile i32, i32* %1
ret i32 0
}
int int_max(register int x, register int y) {
  if (x > y)
    return x;
  return y;
}


x86 assembly (clang, -O0):
<int_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <int_max+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <int_max+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @int_max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ expr();
int /*<<< orphan*/ mustbe(int, int);
int /*<<< orphan*/ scaner();
void exprinbrkts() {
  mustbe(103, 220);
  scaner();
  expr();
  mustbe(104, 220);
}


x86 assembly (clang, -O0):
<exprinbrkts>:
push   %rbp
mov    %rsp,%rbp
mov    $0x67,%edi
mov    $0xdc,%esi
call   1030 <mustbe@plt>
mov    $0x0,%al
call   1050 <scaner@plt>
mov    $0x0,%al
call   1040 <expr@plt>
mov    $0x68,%edi
mov    $0xdc,%esi
call   1030 <mustbe@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<exprinbrkts>:
push   %rax
mov    $0x67,%edi
mov    $0xdc,%esi
call   1030 <mustbe@plt>
xor    %eax,%eax
call   1050 <scaner@plt>
xor    %eax,%eax
call   1040 <expr@plt>
mov    $0x68,%edi
mov    $0xdc,%esi
pop    %rax
jmp    1030 <mustbe@plt>

LLVM IR (-O0):
define void @exprinbrkts() {
%1 = call i32 @mustbe(i32 103, i32 220)
%2 = call i32 (...) @scaner()
%3 = call i32 (...) @expr()
%4 = call i32 @mustbe(i32 104, i32 220)
ret void
}

LLVM IR (-O2):
define void @exprinbrkts() {
%1 = tail call i32 @mustbe(i32 103, i32 220)
%2 = tail call i32 (...) @scaner()
%3 = tail call i32 (...) @expr()
%4 = tail call i32 @mustbe(i32 104, i32 220)
ret void
}
unsigned sizefloat(float n) { return 8; }


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

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

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

LLVM IR (-O2):
define i32 @sizefloat(float %0) {
ret i32 8
}
void rb_thread_start_timer_thread(void) {}


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

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

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

LLVM IR (-O2):
define void @rb_thread_start_timer_thread() {
ret void
}
int of_iommu_attach(struct device *dev) { return 0; }


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

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

LLVM IR (-O0):
%struct.device = type opaque
define i32 @of_iommu_attach(%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 @of_iommu_attach(%struct.device* nocapture readnone %0) {
ret i32 0
}
void memRelease_initially(const void *dPtr) {}


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

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

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

LLVM IR (-O2):
define void @memRelease_initially(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void **);
void destroy_matrix(void **matrix) {
  if (matrix) {
    free(matrix[0]);
  }
  free(matrix);
}


x86 assembly (clang, -O0):
<destroy_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1133 <destroy_matrix+0x23>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_matrix>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     1121 <destroy_matrix+0x11>
mov    (%rbx),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @destroy_matrix(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = bitcast i8** %0 to i8***
%5 = load i8**, i8*** %4
%6 = tail call i32 @free(i8** %5)
br label %7
7: ; preds = %3, %1
%8 = tail call i32 @free(i8** %0)
ret void
}
/* Variables and functions */
float atanf(float);
float __ocl_atan_float(float src) { return atanf(src); }


x86 assembly (clang, -O0):
<__ocl_atan_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <atanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_atan_float>:
jmp    1030 <atanf@plt>

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

LLVM IR (-O2):
define float @__ocl_atan_float(float %0) {
%2 = tail call float @atanf(float %0)
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int pthread_mutex_unlock(int /*<<< orphan*/ *);
void __safe_p_mutex_unlock(pthread_mutex_t *mtx) {
  int en = pthread_mutex_unlock(mtx);
  if (en) {
    abort();
  }
}


x86 assembly (clang, -O0):
<__safe_p_mutex_unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pthread_mutex_unlock@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1149 <__safe_p_mutex_unlock+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__safe_p_mutex_unlock>:
push   %rax
call   1040 <pthread_mutex_unlock@plt>
test   %eax,%eax
jne    112c <__safe_p_mutex_unlock+0xc>
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define void @__safe_p_mutex_unlock(i32* %0) {
%2 = tail call i32 @pthread_mutex_unlock(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret void
}
void vmwPlot(int x, int y, int color, unsigned char *buffer) {
  int output_pointer;
  output_pointer = (y * 640) + x;
  buffer[output_pointer] = color;
}


x86 assembly (clang, -O0):
<vmwPlot>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
imul   $0x280,-0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmwPlot>:
lea    (%rsi,%rsi,4),%eax
shl    $0x7,%eax
add    %edi,%eax
cltq
mov    %dl,(%rcx,%rax,1)
ret

LLVM IR (-O0):
define void @vmwPlot(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%10 = load i32, i32* %6
%11 = mul nsw i32 %10, 640
%12 = load i32, i32* %5
%13 = add nsw i32 %11, %12
store i32 %13, i32* %9
%14 = load i32, i32* %7
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %8
%17 = load i32, i32* %9
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
store i8 %15, i8* %19
ret void
}

LLVM IR (-O2):
define void @vmwPlot(i32 %0, i32 %1, i32 %2, i8* nocapture writeonly %3) {
%5 = mul nsw i32 %1, 640
%6 = add nsw i32 %5, %0
%7 = trunc i32 %2 to i8
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds i8, i8* %3, i64 %8
store i8 %7, i8* %9
ret void
}
int ninja(int num) {
  int result = 0;
  if (num != 2 && num != 7 && num != 3) {
    result = 3;
  } else {
    if (num == 2)
      result = 2;
    if (num == 7)
      result = 3;
    if (num == 3)
      result = 4;
  }
  return result * ninja(num - 1);
}


x86 assembly (clang, -O0):
<ninja>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x4(%rbp)
je     114c <ninja+0x3c>
cmpl   $0x7,-0x4(%rbp)
je     114c <ninja+0x3c>
cmpl   $0x3,-0x4(%rbp)
je     114c <ninja+0x3c>
movl   $0x3,-0x8(%rbp)
jmp    1184 <ninja+0x74>
cmpl   $0x2,-0x4(%rbp)
jne    115d <ninja+0x4d>
movl   $0x2,-0x8(%rbp)
cmpl   $0x7,-0x4(%rbp)
jne    116e <ninja+0x5e>
movl   $0x3,-0x8(%rbp)
cmpl   $0x3,-0x4(%rbp)
jne    117f <ninja+0x6f>
movl   $0x4,-0x8(%rbp)
jmp    1184 <ninja+0x74>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <ninja@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ninja(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 2
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 7
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp ne i32 %10, 3
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 3, i32* %3
br label %26
13: ; preds = %9, %6, %1
%14 = load i32, i32* %2
%15 = icmp eq i32 %14, 2
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 2, i32* %3
br label %17
17: ; preds = %16, %13
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 7
br i1 %19, label %20, label %21
20: ; preds = %17
store i32 3, i32* %3
br label %21
21: ; preds = %20, %17
%22 = load i32, i32* %2
%23 = icmp eq i32 %22, 3
br i1 %23, label %24, label %25
24: ; preds = %21
store i32 4, i32* %3
br label %25
25: ; preds = %24, %21
br label %26
26: ; preds = %25, %12
%27 = load i32, i32* %3
%28 = load i32, i32* %2
%29 = sub nsw i32 %28, 1
%30 = call i32 @ninja(i32 %29)
%31 = mul nsw i32 %27, %30
ret i32 %31
}

LLVM IR (-O2):
define i32 @ninja(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
void XSharpFreeFontXft(void *dpy, void *fontSet) {}


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

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

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

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