xunge/DecIR huggingface dataset:
/* Variables and functions */
int getpid();
int getppid();
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ wait(int /*<<< orphan*/);
void my_isr(int n) {
  printf("in isr pid=%d ppid=%d\n", getpid(), getppid());
  wait(0);
}


x86 assembly (clang, -O0):
<my_isr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <getppid@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <wait@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_isr>:
push   %rbx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <getppid@plt>
lea    0xea8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %edi,%edi
pop    %rbx
jmp    1060 <wait@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"in isr pid=%d ppid=%d\0A\00"
define void @my_isr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @getpid()
%4 = call i32 (...) @getppid()
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = call i32 @wait(i32 0)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"in isr pid=%d ppid=%d\0A\00"
define void @my_isr(i32 %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 (...) @getppid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
%5 = tail call i32 @wait(i32 0)
ret void
}
/* Type definitions */
struct forth_instance {
  int dummy;
};

/* Variables and functions */
int st_pop(struct forth_instance *);
int /*<<< orphan*/ st_push(struct forth_instance *, int);
void mult(struct forth_instance *fi) { st_push(fi, st_pop(fi) * st_pop(fi)); }


x86 assembly (clang, -O0):
<mult>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <st_pop@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <st_pop@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdi
imul   %eax,%esi
call   1040 <st_push@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mult>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <st_pop@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <st_pop@plt>
imul   %eax,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <st_push@plt>

LLVM IR (-O0):
%struct.forth_instance = type { i32 }
define void @mult(%struct.forth_instance* %0) {
%2 = alloca %struct.forth_instance*
store %struct.forth_instance* %0, %struct.forth_instance** %2
%3 = load %struct.forth_instance*, %struct.forth_instance** %2
%4 = load %struct.forth_instance*, %struct.forth_instance** %2
%5 = call i32 @st_pop(%struct.forth_instance* %4)
%6 = load %struct.forth_instance*, %struct.forth_instance** %2
%7 = call i32 @st_pop(%struct.forth_instance* %6)
%8 = mul nsw i32 %5, %7
%9 = call i32 @st_push(%struct.forth_instance* %3, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.forth_instance = type { i32 }
define void @mult(%struct.forth_instance* %0) {
%2 = tail call i32 @st_pop(%struct.forth_instance* %0)
%3 = tail call i32 @st_pop(%struct.forth_instance* %0)
%4 = mul nsw i32 %3, %2
%5 = tail call i32 @st_push(%struct.forth_instance* %0, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _SC_CLK_TCK;
long sysconf(int /*<<< orphan*/);
long ticks_per_second(void) { return sysconf(_SC_CLK_TCK); }


x86 assembly (clang, -O0):
<ticks_per_second>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ticks_per_second>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sysconf@plt>

LLVM IR (-O0):
@_SC_CLK_TCK = global i32 0
define i64 @ticks_per_second() {
%1 = load i32, i32* @_SC_CLK_TCK
%2 = call i64 @sysconf(i32 %1)
ret i64 %2
}

LLVM IR (-O2):
@_SC_CLK_TCK = global i32 0
define i64 @ticks_per_second() {
%1 = load i32, i32* @_SC_CLK_TCK
%2 = tail call i64 @sysconf(i32 %1)
ret i64 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t crc_reflect(uint32_t data, size_t data_len) {
  unsigned int i;
  uint32_t ret;
  ret = data & 0x01;
  for (i = 1; i < data_len; i++) {
    data >>= 1;
    ret = (ret << 1) | (data & 0x01);
  }
  return ret;
}


x86 assembly (clang, -O0):
<crc_reflect>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x18(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jae    1150 <crc_reflect+0x50>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x18(%rbp),%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
and    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111b <crc_reflect+0x1b>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc_reflect>:
mov    %edi,%eax
and    $0x1,%eax
cmp    $0x2,%rsi
jb     1124 <crc_reflect+0x24>
mov    $0x2,%ecx
sar    %edi
mov    %edi,%edx
and    $0x1,%edx
lea    (%rdx,%rax,2),%eax
mov    %ecx,%edx
add    $0x1,%ecx
cmp    %rsi,%rdx
jb     1110 <crc_reflect+0x10>
ret

LLVM IR (-O0):
define i32 @crc_reflect(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i64 %1, i64* %4
%7 = load i32, i32* %3
%8 = and i32 %7, 1
store i32 %8, i32* %6
store i32 1, i32* %5
br label %9
9: ; preds = %22, %2
%10 = load i32, i32* %5
%11 = zext i32 %10 to i64
%12 = load i64, i64* %4
%13 = icmp ult i64 %11, %12
br i1 %13, label %14, label %25
14: ; preds = %9
%15 = load i32, i32* %3
%16 = ashr i32 %15, 1
store i32 %16, i32* %3
%17 = load i32, i32* %6
%18 = shl i32 %17, 1
%19 = load i32, i32* %3
%20 = and i32 %19, 1
%21 = or i32 %18, %20
store i32 %21, i32* %6
br label %22
22: ; preds = %14
%23 = load i32, i32* %5
%24 = add i32 %23, 1
store i32 %24, i32* %5
br label %9
25: ; preds = %9
%26 = load i32, i32* %6
ret i32 %26
}

LLVM IR (-O2):
define i32 @crc_reflect(i32 %0, i64 %1) {
%3 = and i32 %0, 1
%4 = icmp ugt i64 %1, 1
br i1 %4, label %5, label %16
5: ; preds = %2, %5
%6 = phi i32 [ %12, %5 ], [ %3, %2 ]
%7 = phi i32 [ %13, %5 ], [ 1, %2 ]
%8 = phi i32 [ %9, %5 ], [ %0, %2 ]
%9 = ashr i32 %8, 1
%10 = shl i32 %6, 1
%11 = and i32 %9, 1
%12 = or i32 %10, %11
%13 = add i32 %7, 1
%14 = zext i32 %13 to i64
%15 = icmp ult i64 %14, %1
br i1 %15, label %5, label %16
16: ; preds = %5, %2
%17 = phi i32 [ %3, %2 ], [ %12, %5 ]
ret i32 %17
}
void _tr_align(void) {}


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

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

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

LLVM IR (-O2):
define void @_tr_align() {
ret void
}
void rop3_181_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = S | *D;
  stk2 = T & stk3;
  stk1 = *D ^ stk2;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_181_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_181_0_0>:
mov    (%rdi),%al
or     %al,%sil
and    %dl,%sil
xor    %al,%sil
not    %sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_181_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = or i32 %11, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %6
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = and i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8*, i8** %4
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = load i8, i8* %8
%27 = zext i8 %26 to i32
%28 = xor i32 %25, %27
%29 = trunc i32 %28 to i8
store i8 %29, i8* %7
%30 = load i8, i8* %7
%31 = zext i8 %30 to i32
%32 = xor i32 %31, -1
%33 = trunc i32 %32 to i8
store i8 %33, i8* %7
%34 = load i8, i8* %7
%35 = load i8*, i8** %4
store i8 %34, i8* %35
ret void
}

LLVM IR (-O2):
define void @rop3_181_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %1
%6 = and i8 %5, %2
%7 = xor i8 %4, %6
%8 = xor i8 %7, -1
store i8 %8, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fn_glutMotionFunc(void *);
void glutMotionFunc(void *fn) { fn_glutMotionFunc(fn); }


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

x86 assembly (clang, -O2):
<glutMotionFunc>:
jmp    1030 <fn_glutMotionFunc@plt>

LLVM IR (-O0):
define void @glutMotionFunc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @fn_glutMotionFunc(i8* %3)
ret void
}

LLVM IR (-O2):
define void @glutMotionFunc(i8* %0) {
%2 = tail call i32 @fn_glutMotionFunc(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ bindtextdomain(char *, char *);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int /*<<< orphan*/ textdomain(char *);
void gettext_init() {
  setlocale(LC_ALL, "");
  bindtextdomain("jacknotifier", "/usr/share/locale");
  textdomain("jacknotifier");
}


x86 assembly (clang, -O0):
<gettext_init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rsi
call   1050 <setlocale@plt>
lea    0xeb0(%rip),%rdi
lea    0xeb6(%rip),%rsi
call   1040 <bindtextdomain@plt>
lea    0xe9d(%rip),%rdi
call   1030 <textdomain@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettext_init>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
call   1050 <setlocale@plt>
lea    0xeb3(%rip),%rbx
lea    0xeb9(%rip),%rsi
mov    %rbx,%rdi
call   1040 <bindtextdomain@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <textdomain@plt>

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [13 x i8] c"jacknotifier\00"
@.str.2 = [18 x i8] c"/usr/share/locale\00"
define void @gettext_init() {
%1 = load i32, i32* @LC_ALL
%2 = call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @bindtextdomain(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @textdomain(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [13 x i8] c"jacknotifier\00"
@.str.2 = [18 x i8] c"/usr/share/locale\00"
define void @gettext_init() {
%1 = load i32, i32* @LC_ALL
%2 = tail call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @bindtextdomain(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @textdomain(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *strcpy_rewrite(char *, char *);
int main() {
  char dst[20];
  printf("%s\n", strcpy_rewrite(dst, "fasdfsdfsdfsfasdfgdfgfdsffsfsdfsddffa!"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
lea    0xeca(%rip),%rsi
call   1040 <strcpy_rewrite@plt>
mov    %rax,%rsi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed9(%rip),%rsi
mov    %rsp,%rdi
call   1040 <strcpy_rewrite@plt>
lea    0xec6(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [39 x i8] c"fasdfsdfsdfsfasdfgdfgfdsffsfsdfsddffa!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%4 = call i8* @strcpy_rewrite(i8* %3, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [39 x i8] c"fasdfsdfsdfsfasdfgdfgfdsffsfsdfsddffa!\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i8* @strcpy_rewrite(i8* %2, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
int x33_process_synack(struct mypacket *packet) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.mypacket = type opaque
define i32 @x33_process_synack(%struct.mypacket* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ consume();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fork();
int /*<<< orphan*/ produce();
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ wait(int /*<<< orphan*/ *);
int main(void) {
  if (fork() == 0) {
    produce();
  }
  sleep(5);
  if (fork() == 0) {
    consume();
  }
  wait(NULL);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1080 <fork@plt>
cmp    $0x0,%rax
jne    1187 <main+0x27>
mov    $0x0,%al
call   1030 <produce@plt>
mov    $0x5,%edi
call   1060 <sleep@plt>
mov    $0x0,%al
call   1080 <fork@plt>
cmp    $0x0,%rax
jne    11a9 <main+0x49>
mov    $0x0,%al
call   1040 <consume@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1070 <wait@plt>
mov    0x2e27(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1080 <fork@plt>
test   %rax,%rax
jne    1174 <main+0x14>
xor    %eax,%eax
call   1030 <produce@plt>
mov    $0x5,%edi
call   1060 <sleep@plt>
xor    %eax,%eax
call   1080 <fork@plt>
test   %rax,%rax
jne    1191 <main+0x31>
xor    %eax,%eax
call   1040 <consume@plt>
xor    %edi,%edi
call   1070 <wait@plt>
mov    0x2e41(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @fork()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @produce()
br label %6
6: ; preds = %4, %0
%7 = call i32 @sleep(i32 5)
%8 = call i64 (...) @fork()
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = call i32 (...) @consume()
br label %12
12: ; preds = %10, %6
%13 = call i32 @wait(i32* null)
%14 = load i32, i32* @EXIT_SUCCESS
%15 = call i32 @exit(i32 %14)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i64 (...) @fork()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @produce()
br label %5
5: ; preds = %3, %0
%6 = tail call i32 @sleep(i32 5)
%7 = tail call i64 (...) @fork()
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = tail call i32 (...) @consume()
br label %11
11: ; preds = %9, %5
%12 = tail call i32 @wait(i32* null)
%13 = load i32, i32* @EXIT_SUCCESS
%14 = tail call i32 @exit(i32 %13)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int);
void cglit(int v) { ngen("%s\t$%d,%%eax", "movl", v); }


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

x86 assembly (clang, -O2):
<cglit>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xeed(%rip),%rsi
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%s\09$%d,%%eax\00"
@.str.1 = [5 x i8] c"movl\00"
define void @cglit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ngen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s\09$%d,%%eax\00"
@.str.1 = [5 x i8] c"movl\00"
define void @cglit(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int errno;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ parse(int /*<<< orphan*/ *);
int names_init(char *n) {
  FILE *f;
  f = fopen(n, "r");
  if (!f)
    return errno;
  parse(f);
  fclose(f);
  return 0;
}


x86 assembly (clang, -O0):
<names_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116c <names_init+0x3c>
mov    0x2e7e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1185 <names_init+0x55>
mov    -0x18(%rbp),%rdi
call   1050 <parse@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<names_init>:
push   %rbx
lea    0xec8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1159 <names_init+0x29>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <parse@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    0x2e80(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@errno = global i32 0
define i32 @names_init(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = icmp ne i32* %7, null
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = load i32, i32* @errno
store i32 %10, i32* %2
br label %16
11: ; preds = %1
%12 = load i32*, i32** %4
%13 = call i32 @parse(i32* %12)
%14 = load i32*, i32** %4
%15 = call i32 @fclose(i32* %14)
store i32 0, i32* %2
br label %16
16: ; preds = %11, %9
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@errno = global i32 0
define i32 @names_init(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = load i32, i32* @errno
br label %9
6: ; preds = %1
%7 = tail call i32 @parse(i32* %2)
%8 = tail call i32 @fclose(i32* %2)
br label %9
9: ; preds = %6, %4
%10 = phi i32 [ 0, %6 ], [ %5, %4 ]
ret i32 %10
}
void foo_2_2_1_1_2_1_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_1_2_1_1_2_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ leddrv_ll_error(int);
int leddrv_geterrors(unsigned char leds_error[80]) {
  int i;
  for (i = 0; i < 80; ++i) {
    leds_error[i] = !!leddrv_ll_error(i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<leddrv_geterrors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x50,-0xc(%rbp)
jge    115f <leddrv_geterrors+0x4f>
mov    -0xc(%rbp),%edi
call   1030 <leddrv_ll_error@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <leddrv_geterrors+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leddrv_geterrors>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %ebx,%edi
call   1030 <leddrv_ll_error@plt>
test   %eax,%eax
setne  (%r14,%rbx,1)
add    $0x1,%rbx
cmp    $0x50,%rbx
jne    1120 <leddrv_geterrors+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @leddrv_geterrors(i8* nocapture writeonly %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %9, %2 ]
%4 = trunc i64 %3 to i32
%5 = tail call i32 @leddrv_ll_error(i32 %4)
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i8
%8 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 %7, i8* %8
%9 = add nuw nsw i64 %3, 1
%10 = icmp eq i64 %9, 80
br i1 %10, label %11, label %2
11: ; preds = %2
ret i32 0
}
void *elf_lookup_symbol(const char *name) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @elf_lookup_symbol(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int foo();
int main() {
  char *x = "!";
  assert(x[0] == 33);
  assert(foo() == 32);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
call   1040 <foo@plt>
xor    %edi,%edi
cmp    $0x20,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 33
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = call i32 (...) @foo()
%11 = icmp eq i32 %10, 32
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 (...) @foo()
%3 = icmp eq i32 %2, 32
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret i32 0
}
void rct_set_sd_ioctrl(void) {}


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

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

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

LLVM IR (-O2):
define void @rct_set_sd_ioctrl() {
ret void
}
OP(dd, a0) {
  illegal_1();
  op_a0();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_a0@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_a0()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_a0()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, float *);
main() {
  float cm;
  scanf("%f", &cm);
  printf("%f", cm / 2.54);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb0(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xedc(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
divsd  0xeb5(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fdiv double %5, 2.540000e+00
%7 = fptrunc double %6 to float
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = fpext float %4 to double
%6 = fdiv double %5, 2.540000e+00
%7 = fptrunc double %6 to float
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %7)
ret i32 0
}
/* Variables and functions */
unsigned long atoi(char *);
int main(int argc, char *argv[]) {
  unsigned long buffsize = atoi(argv[1]);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() {
  printf("Adeus mundo!\n");
  printf("Testando git\n");
  printf("Testando git\n");
  printf("Testando git\n");
  printf("Testando git\n");
  printf("Testando git\n");
  printf("Testando git\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee9(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Adeus mundo!\0A\00"
@.str.1 = [14 x i8] c"Testando git\0A\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"Adeus mundo!\00"
@str.7 = [13 x i8] c"Testando git\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.7, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.7, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.7, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.7, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.7, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ timer_stop();
void led_timer_stop(void) { timer_stop(); }


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

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

LLVM IR (-O0):
define void @led_timer_stop() {
%1 = call i32 (...) @timer_stop()
ret void
}

LLVM IR (-O2):
define void @led_timer_stop() {
%1 = tail call i32 (...) @timer_stop()
ret void
}
int fn4(unsigned int a, int b) { return a - (unsigned)((a / b) * b); }


x86 assembly (clang, -O0):
<fn4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn4>:
mov    %edi,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @fn4(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 = load i32, i32* %4
%8 = udiv i32 %6, %7
%9 = load i32, i32* %4
%10 = mul i32 %8, %9
%11 = sub i32 %5, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @fn4(i32 %0, i32 %1) {
%3 = urem i32 %0, %1
ret i32 %3
}
/* Type definitions */
struct wl_proxy {
  int dummy;
};
struct wl_display_listener {
  int dummy;
};
struct wl_display {
  int dummy;
};

/* Variables and functions */
int wl_proxy_add_listener(struct wl_proxy *, void (*)(), void *);
int wl_display_add_listener(struct wl_display *wl_display,
                            const struct wl_display_listener *listener,
                            void *data) {
  return wl_proxy_add_listener((struct wl_proxy *)wl_display,
                               (void (**)(void))listener, data);
}


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

x86 assembly (clang, -O2):
<wl_display_add_listener>:
jmp    1030 <wl_proxy_add_listener@plt>

LLVM IR (-O0):
%struct.wl_display = type { i32 }
%struct.wl_display_listener = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @wl_display_add_listener(%struct.wl_display* %0, %struct.wl_display_listener* %1, i8* %2) {
%4 = alloca %struct.wl_display*
%5 = alloca %struct.wl_display_listener*
%6 = alloca i8*
store %struct.wl_display* %0, %struct.wl_display** %4
store %struct.wl_display_listener* %1, %struct.wl_display_listener** %5
store i8* %2, i8** %6
%7 = load %struct.wl_display*, %struct.wl_display** %4
%8 = bitcast %struct.wl_display* %7 to %struct.wl_proxy*
%9 = load %struct.wl_display_listener*, %struct.wl_display_listener** %5
%10 = bitcast %struct.wl_display_listener* %9 to void ()**
%11 = bitcast void ()** %10 to void (...)*
%12 = load i8*, i8** %6
%13 = call i32 @wl_proxy_add_listener(%struct.wl_proxy* %8, void (...)* %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.wl_display = type { i32 }
%struct.wl_display_listener = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @wl_display_add_listener(%struct.wl_display* %0, %struct.wl_display_listener* %1, i8* %2) {
%4 = bitcast %struct.wl_display* %0 to %struct.wl_proxy*
%5 = bitcast %struct.wl_display_listener* %1 to void (...)*
%6 = tail call i32 @wl_proxy_add_listener(%struct.wl_proxy* %4, void (...)* %5, i8* %2)
ret i32 %6
}
/* Variables and functions */
void *memalign(size_t, size_t);
void *__libc_memalign(size_t alignment, size_t size) {
  return memalign(alignment, size);
}


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

x86 assembly (clang, -O2):
<__libc_memalign>:
jmp    1030 <memalign@plt>

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

LLVM IR (-O2):
define noalias i8* @__libc_memalign(i64 %0, i64 %1) {
%3 = tail call i8* @memalign(i64 %0, i64 %1)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fread(void *, unsigned int const, int, int /*<<< orphan*/ *);
void *malloc(unsigned int const);
void *sb_file_load(char const *filename, unsigned const size) {
  FILE *f;
  void *ptr;
  ptr = malloc(size);
  f = fopen(filename, "rb");
  fread(ptr, size, 1, f);
  fclose(f);
  return ptr;
}


x86 assembly (clang, -O0):
<sb_file_load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe9a(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fread@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sb_file_load>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%edi
call   1050 <malloc@plt>
mov    %rax,%r15
lea    0xea3(%rip),%rsi
mov    %r14,%rdi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %ebp,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1030 <fread@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
define i8* @sb_file_load(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = call i8* @malloc(i32 %7)
store i8* %8, i8** %6
%9 = load i8*, i8** %3
%10 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %10, i32** %5
%11 = load i8*, i8** %6
%12 = load i32, i32* %4
%13 = load i32*, i32** %5
%14 = call i32 @fread(i8* %11, i32 %12, i32 1, i32* %13)
%15 = load i32*, i32** %5
%16 = call i32 @fclose(i32* %15)
%17 = load i8*, i8** %6
ret i8* %17
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
define noalias i8* @sb_file_load(i8* nocapture %0, i32 %1) {
%3 = tail call i8* @malloc(i32 %1)
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @fread(i8* %3, i32 %1, i32 1, i32* %4)
%6 = tail call i32 @fclose(i32* %4)
ret i8* %3
}
int f() {
  struct S {
    int a;
    int b;
  } i;
  for (int i; i < 10; i++)
    i = i + 1;
  i.a = 3;
  for (int i; i < 10; i++) {
    i = i + 1;
  }
  i.b = 4;
  for (int; 0; 0) {
    0;
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0xa,-0x14(%rbp)
jge    1125 <f+0x25>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1104 <f+0x4>
movl   $0x3,-0x10(%rbp)
cmpl   $0xa,-0x18(%rbp)
jge    114d <f+0x4d>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112c <f+0x2c>
movl   $0x4,-0xc(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    1163 <f+0x63>
jmp    116d <f+0x6d>
jmp    1168 <f+0x68>
jmp    1154 <f+0x54>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void testB(int a, float b, float c) { printf("testB int\n"); }


x86 assembly (clang, -O0):
<testB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"testB int\0A\00"
define void @testB(i32 %0, float %1, float %2) {
%4 = alloca i32
%5 = alloca float
%6 = alloca float
store i32 %0, i32* %4
store float %1, float* %5
store float %2, float* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [10 x i8] c"testB int\00"
define void @testB(i32 %0, float %1, float %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int f298(int *);
int f299(int *p) { return f298(p); }


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

x86 assembly (clang, -O2):
<f299>:
jmp    1030 <f298@plt>

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

LLVM IR (-O2):
define i32 @f299(i32* %0) {
%2 = tail call i32 @f298(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_usage(char *name) {
  printf("Usage:\n");
  printf("%s <nodma | dma>\n", name);
}


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

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [18 x i8] c"%s <nodma | dma>\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str.1 = [18 x i8] c"%s <nodma | dma>\0A\00"
@str = [7 x i8] c"Usage:\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int /*<<< orphan*/ free(int *);
int *malloc(int);
int CMPRegionHeapToHeap2() {
  int x = 0;
  int *x1 = malloc(8);
  int *x2 = malloc(8);
  int *x4 = x1;
  int *x5 = x2;
  clang_analyzer_eval(x4 == x5);
  free(x1);
  free(x2);
  return x;
}


x86 assembly (clang, -O0):
<CMPRegionHeapToHeap2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <clang_analyzer_eval@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CMPRegionHeapToHeap2>:
push   %r14
push   %rbx
push   %rax
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
cmp    %rax,%r14
sete   %dil
call   1050 <clang_analyzer_eval@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @CMPRegionHeapToHeap2() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32*
store i32 0, i32* %1
%6 = call i32* @malloc(i32 8)
store i32* %6, i32** %2
%7 = call i32* @malloc(i32 8)
store i32* %7, i32** %3
%8 = load i32*, i32** %2
store i32* %8, i32** %4
%9 = load i32*, i32** %3
store i32* %9, i32** %5
%10 = load i32*, i32** %4
%11 = load i32*, i32** %5
%12 = icmp eq i32* %10, %11
%13 = zext i1 %12 to i32
%14 = call i32 @clang_analyzer_eval(i32 %13)
%15 = load i32*, i32** %2
%16 = call i32 @free(i32* %15)
%17 = load i32*, i32** %3
%18 = call i32 @free(i32* %17)
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
define i32 @CMPRegionHeapToHeap2() {
%1 = tail call i32* @malloc(i32 8)
%2 = tail call i32* @malloc(i32 8)
%3 = icmp eq i32* %1, %2
%4 = zext i1 %3 to i32
%5 = tail call i32 @clang_analyzer_eval(i32 %4)
%6 = tail call i32 @free(i32* %1)
%7 = tail call i32 @free(i32* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ popNarray(char *, unsigned int);
void popinteger4array(int *x, int n) {
  popNarray((char *)x, (unsigned int)(n * 4));
}


x86 assembly (clang, -O0):
<popinteger4array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
shl    $0x2,%esi
call   1030 <popNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<popinteger4array>:
shl    $0x2,%esi
jmp    1030 <popNarray@plt>

LLVM IR (-O0):
define void @popinteger4array(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 = bitcast i32* %5 to i8*
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 4
%9 = call i32 @popNarray(i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
define void @popinteger4array(i32* %0, i32 %1) {
%3 = bitcast i32* %0 to i8*
%4 = shl nsw i32 %1, 2
%5 = tail call i32 @popNarray(i8* %3, i32 %4)
ret void
}
/* Type definitions */
struct mpd_pair {
  int dummy;
};
struct mpd_connection {
  int dummy;
};

/* Variables and functions */
struct mpd_pair *mpd_recv_pair_named(struct mpd_connection *, char *);
__attribute__((malloc)) struct mpd_pair *
mpd_recv_tag_type_pair(struct mpd_connection *connection) {
  return mpd_recv_pair_named(connection, "tagtype");
}


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

x86 assembly (clang, -O2):
<mpd_recv_tag_type_pair>:
lea    0xee9(%rip),%rsi
jmp    1030 <mpd_recv_pair_named@plt>

LLVM IR (-O0):
%struct.mpd_pair = type { i32 }
%struct.mpd_connection = type { i32 }
@.str = [8 x i8] c"tagtype\00"
define noalias %struct.mpd_pair* @mpd_recv_tag_type_pair(%struct.mpd_connection* %0) {
%2 = alloca %struct.mpd_connection*
store %struct.mpd_connection* %0, %struct.mpd_connection** %2
%3 = load %struct.mpd_connection*, %struct.mpd_connection** %2
%4 = call %struct.mpd_pair* @mpd_recv_pair_named(%struct.mpd_connection* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret %struct.mpd_pair* %4
}

LLVM IR (-O2):
%struct.mpd_pair = type { i32 }
%struct.mpd_connection = type { i32 }
@.str = [8 x i8] c"tagtype\00"
define noalias %struct.mpd_pair* @mpd_recv_tag_type_pair(%struct.mpd_connection* %0) {
%2 = tail call %struct.mpd_pair* @mpd_recv_pair_named(%struct.mpd_connection* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret %struct.mpd_pair* %2
}