xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ n;

/* Variables and functions */
uint32_t reverseBits(uint32_t n) {
  uint32_t result = 0;
  uint32_t src_bit = 1;
  uint32_t dest_bit = 1 << (sizeof(n) * 8 - 1);
  while (dest_bit > 0) {
    if (n & src_bit) {
      result |= dest_bit;
    }
    dest_bit >>= 1;
    src_bit <<= 1;
  }
  return result;
}


x86 assembly (clang, -O0):
<reverseBits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x80000000,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    1155 <reverseBits+0x55>
mov    -0x4(%rbp),%eax
and    -0xc(%rbp),%eax
cmp    $0x0,%eax
je     113e <reverseBits+0x3e>
mov    -0x10(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111c <reverseBits+0x1c>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @reverseBits(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free_bloc(unsigned int);
void free_blocs(unsigned int *tab, unsigned int size) {
  unsigned int i;
  for (i = 0; i < size; i++) {
    free_bloc(tab[i]);
  }
}


x86 assembly (clang, -O0):
<free_blocs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    114f <free_blocs+0x3f>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,4),%edi
call   1030 <free_bloc@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_blocs+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_blocs>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1142 <free_blocs+0x32>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edi
call   1030 <free_bloc@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_blocs+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @free_blocs(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @free_bloc(i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int getc0();
int getkey() { return getc0(); }


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

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

LLVM IR (-O0):
define i32 @getkey() {
%1 = call i32 (...) @getc0()
ret i32 %1
}

LLVM IR (-O2):
define i32 @getkey() {
%1 = tail call i32 (...) @getc0()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xb8() {
  Assert_real((islower(184) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              925, ("islower should be 0 for 0xb8"));
}


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

x86 assembly (clang, -O2):
<t_islower_0xb8>:
push   %rax
mov    $0xb8,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x39d,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xb8\00"
define void @t_islower_0xb8() {
%1 = call i64 @islower(i32 184)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 925, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xb8\00"
define void @t_islower_0xb8() {
%1 = tail call i64 @islower(i32 184)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 925, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int safe_target() { return 42; }


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

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

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

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

/* Variables and functions */
int __fxstat(int, int, struct stat *);
__attribute__((__weak__, __always___)) int
softboundmpx___fxstat(int ver, int file_des, struct stat *stat_struct) {
  return __fxstat(ver, file_des, stat_struct);
}


x86 assembly (clang, -O0):
<softboundmpx___fxstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <__fxstat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundmpx___fxstat>:
jmp    1030 <__fxstat@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define weak i32 @softboundmpx___fxstat(i32 %0, i32 %1, %struct.stat* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.stat*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.stat* %2, %struct.stat** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load %struct.stat*, %struct.stat** %6
%10 = call i32 @__fxstat(i32 %7, i32 %8, %struct.stat* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define weak i32 @softboundmpx___fxstat(i32 %0, i32 %1, %struct.stat* %2) {
%4 = tail call i32 @__fxstat(i32 %0, i32 %1, %struct.stat* %2)
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void h265nal_init(uint8_t *p_h265nal) {
  p_h265nal[0] = 0x0;
  p_h265nal[1] = 0x0;
  p_h265nal[2] = 0x1;
  p_h265nal[3] = 0;
  p_h265nal[4] = 0;
}


x86 assembly (clang, -O0):
<h265nal_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0x8(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,0xc(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<h265nal_init>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movl   $0x0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @h265nal_init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
store i32 0, i32* %4
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 0, i32* %6
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 2
store i32 1, i32* %8
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 3
store i32 0, i32* %10
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 4
store i32 0, i32* %12
ret void
}

LLVM IR (-O2):
define void @h265nal_init(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 0, i32 0, i32 1, i32 0>, <4 x i32>* %2
%3 = getelementptr inbounds i32, i32* %0, i64 4
store i32 0, i32* %3
ret void
}
/* Type definitions */
struct drm_mm_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ drm_mm_put_block(struct drm_mm_node *);
void drm_sman_mm_free(void *private, void *ref) {
  struct drm_mm_node *node = (struct drm_mm_node *)ref;
  drm_mm_put_block(node);
}


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

x86 assembly (clang, -O2):
<drm_sman_mm_free>:
mov    %rsi,%rdi
jmp    1030 <drm_mm_put_block@plt>

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

LLVM IR (-O2):
%struct.drm_mm_node = type { i32 }
define void @drm_sman_mm_free(i8* nocapture readnone %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.drm_mm_node*
%4 = tail call i32 @drm_mm_put_block(%struct.drm_mm_node* %3)
ret void
}
int color_offset_f4(int x, int y) {
  return (((y << 10) + (((x << 10) * 333) / 107) - (12396 << 10)) >> 10);
}


x86 assembly (clang, -O0):
<color_offset_f4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xa,%eax
imul   $0x14d,%eax,%eax
mov    $0x6b,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
sub    $0xc1b000,%eax
sar    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<color_offset_f4>:
shl    $0xa,%esi
imul   $0x53400,%edi,%eax
cltq
imul   $0x4c8f8d29,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
add    %esi,%eax
add    $0xff3e5000,%eax
sar    $0xa,%eax
ret

LLVM IR (-O0):
define i32 @color_offset_f4(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 %5, 10
%7 = load i32, i32* %3
%8 = shl i32 %7, 10
%9 = mul nsw i32 %8, 333
%10 = sdiv i32 %9, 107
%11 = add nsw i32 %6, %10
%12 = sub nsw i32 %11, 12693504
%13 = ashr i32 %12, 10
ret i32 %13
}

LLVM IR (-O2):
define i32 @color_offset_f4(i32 %0, i32 %1) {
%3 = shl i32 %1, 10
%4 = mul i32 %0, 340992
%5 = sdiv i32 %4, 107
%6 = add nsw i32 %5, -12693504
%7 = add i32 %6, %3
%8 = ashr i32 %7, 10
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ core3_print(char *, char *, char const *);
void U_EMRSETMAPMODE_print(const char *contents) {
  core3_print("U_EMRSETMAPMODE", "iMode:", contents);
}


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

x86 assembly (clang, -O2):
<U_EMRSETMAPMODE_print>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeef(%rip),%rsi
jmp    1030 <core3_print@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"U_EMRSETMAPMODE\00"
@.str.1 = [7 x i8] c"iMode:\00"
define void @U_EMRSETMAPMODE_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @core3_print(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"U_EMRSETMAPMODE\00"
@.str.1 = [7 x i8] c"iMode:\00"
define void @U_EMRSETMAPMODE_print(i8* %0) {
%2 = tail call i32 @core3_print(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
void gtk_window_activate_focus() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_activate_focus() {
ret void
}
__attribute__((no)) void a(char *ptr, char *ptr2) {
  (*ptr)++;
  (*ptr2)++;
}


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

x86 assembly (clang, -O2):
<a>:
addb   $0x1,(%rdi)
addb   $0x1,(%rsi)
ret

LLVM IR (-O0):
define void @a(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = add i8 %6, 1
store i8 %7, i8* %5
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = add i8 %9, 1
store i8 %10, i8* %8
ret void
}

LLVM IR (-O2):
define void @a(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = add i8 %3, 1
store i8 %4, i8* %0
%5 = load i8, i8* %1
%6 = add i8 %5, 1
store i8 %6, i8* %1
ret void
}
/* Type definitions */
struct yaffs_obj {
  int dummy;
};

/* Variables and functions */
int yaffs_do_setxattr_reldir(struct yaffs_obj *, char const *, char const *,
                             void const *, int, int, int);
int yaffs_setxattr_reldir(struct yaffs_obj *reldir, const char *path,
                          const char *name, const void *data, int size,
                          int flags) {
  return yaffs_do_setxattr_reldir(reldir, path, name, data, size, flags, 1);
}


x86 assembly (clang, -O0):
<yaffs_setxattr_reldir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
mov    -0x28(%rbp),%r9d
movl   $0x1,(%rsp)
call   1030 <yaffs_do_setxattr_reldir@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yaffs_setxattr_reldir>:
push   %rax
movl   $0x1,(%rsp)
call   1030 <yaffs_do_setxattr_reldir@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.yaffs_obj = type { i32 }
define i32 @yaffs_setxattr_reldir(%struct.yaffs_obj* %0, i8* %1, i8* %2, i8* %3, i32 %4, i32 %5) {
%7 = alloca %struct.yaffs_obj*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
store %struct.yaffs_obj* %0, %struct.yaffs_obj** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load %struct.yaffs_obj*, %struct.yaffs_obj** %7
%14 = load i8*, i8** %8
%15 = load i8*, i8** %9
%16 = load i8*, i8** %10
%17 = load i32, i32* %11
%18 = load i32, i32* %12
%19 = call i32 @yaffs_do_setxattr_reldir(%struct.yaffs_obj* %13, i8* %14, i8* %15, i8* %16, i32 %17, i32 %18, i32 1)
ret i32 %19
}

LLVM IR (-O2):
%struct.yaffs_obj = type { i32 }
define i32 @yaffs_setxattr_reldir(%struct.yaffs_obj* %0, i8* %1, i8* %2, i8* %3, i32 %4, i32 %5) {
%7 = tail call i32 @yaffs_do_setxattr_reldir(%struct.yaffs_obj* %0, i8* %1, i8* %2, i8* %3, i32 %4, i32 %5, i32 1)
ret i32 %7
}
/* Variables and functions */
void *ft_memset(void *b, int c, size_t len) {
  unsigned char *t;
  t = b;
  while (len--) {
    *t = (unsigned char)c;
    t++;
  }
  return (b);
}


x86 assembly (clang, -O0):
<ft_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     114c <ft_memset+0x4c>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1117 <ft_memset+0x17>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memset>:
push   %rbx
mov    %rdi,%rbx
test   %rdx,%rdx
je     1121 <ft_memset+0x11>
mov    %rbx,%rdi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @ft_memset(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %3
ret i8* %0
}
unsigned int flip_bit_uint(unsigned int pos, unsigned int val) {
  return ((val) ^ (1 << (pos)));
}


x86 assembly (clang, -O0):
<flip_bit_uint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @flip_bit_uint(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = shl i32 1, %6
%8 = xor i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @flip_bit_uint(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %0
%4 = xor i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void imprimirAtrasoMaximo(int hora, int minuto) {
  hora += 1;
  if (hora >= 8) {
    printf("Atraso maximo: %d\n", (hora - 8) * 60 + minuto);
  } else {
    printf("Atraso maximo: 0\n");
  }
}


x86 assembly (clang, -O0):
<imprimirAtrasoMaximo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x8,-0x4(%rbp)
jl     1150 <imprimirAtrasoMaximo+0x40>
mov    -0x4(%rbp),%eax
sub    $0x8,%eax
imul   $0x3c,%eax,%esi
add    -0x8(%rbp),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    115e <imprimirAtrasoMaximo+0x4e>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimirAtrasoMaximo>:
cmp    $0x7,%edi
jl     113e <imprimirAtrasoMaximo+0x1e>
imul   $0x3c,%edi,%eax
add    %eax,%esi
add    $0xfffffe5c,%esi
lea    0xec9(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>
lea    0xece(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Atraso maximo: %d\0A\00"
@.str.1 = [18 x i8] c"Atraso maximo: 0\0A\00"
define void @imprimirAtrasoMaximo(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 = add nsw i32 %5, 1
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp sge i32 %7, 8
br i1 %8, label %9, label %16
9: ; preds = %2
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 8
%12 = mul nsw i32 %11, 60
%13 = load i32, i32* %4
%14 = add nsw i32 %12, %13
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %18
16: ; preds = %2
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16, %9
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Atraso maximo: %d\0A\00"
@str = [17 x i8] c"Atraso maximo: 0\00"
define void @imprimirAtrasoMaximo(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 6
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = mul i32 %0, 60
%6 = add i32 %5, -420
%7 = add nsw i32 %6, %1
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %11
9: ; preds = %2
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
br label %11
11: ; preds = %9, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printArray(int *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ quickSort(int *, int /*<<< orphan*/, int);
int main() {
  int arr[] = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1};
  int n = 10;
  quickSort(arr, 0, n - 1);
  printf("Sorted array: n");
  printArray(arr, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xea6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
movl   $0xa,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1050 <quickSort@plt>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1060 <printArray@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xee4(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeac(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x9,%edx
call   1040 <quickSort@plt>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1050 <printArray@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr = [10 x i32] [i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1]
@.str = [16 x i8] c"Sorted array: n\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [10 x i32]* %2 to i8*
store i32 10, i32* %3
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = sub nsw i32 %6, 1
%8 = call i32 @quickSort(i32* %5, i32 0, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%11 = load i32, i32* %3
%12 = call i32 @printArray(i32* %10, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [10 x i32] [i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1]
@.str = [16 x i8] c"Sorted array: n\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @quickSort(i32* %3, i32 0, i32 9)
%5 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printArray(i32* %3, i32 10)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ once_flag;

/* Variables and functions */
int /*<<< orphan*/ pthread_once(int /*<<< orphan*/ *, void (*)());
void call_once(once_flag *flag, void (*func)(void)) {
  pthread_once(flag, func);
}


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

x86 assembly (clang, -O2):
<call_once>:
jmp    1030 <pthread_once@plt>

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

LLVM IR (-O2):
define void @call_once(i32* %0, void ()* %1) {
%3 = bitcast void ()* %1 to void (...)*
%4 = tail call i32 @pthread_once(i32* %0, void (...)* %3)
ret void
}
int periodic_wake_create() {}


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

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

LLVM IR (-O0):
define i32 @periodic_wake_create() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @periodic_wake_create() {
ret i32 undef
}
/* Variables and functions */
int shm_wr();
int main(int argc, char *argv[]) { return shm_wr(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <shm_wr@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @shm_wr()
ret i32 %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @shm_wr()
ret i32 %3
}
void izero(start) unsigned char *start;
{
  int i;
  for (i = 0; i < 64; i++)
    start[i] = 0;
}


x86 assembly (clang, -O0):
<izero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x40,-0xc(%rbp)
jge    1133 <izero+0x33>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <izero+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<izero>:
xorps  %xmm0,%xmm0
movups %xmm0,0x30(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @izero(i8* nocapture writeonly %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
wchar_t *wcscpy(wchar_t *d, const wchar_t *s) {
  wchar_t *a = d;
  while ((*d++ = *s++))
    ;
  return a;
}


x86 assembly (clang, -O0):
<wcscpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %eax,(%rcx)
cmp    $0x0,%eax
je     1144 <wcscpy+0x44>
jmp    1114 <wcscpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcscpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rsi,%rcx,1),%edx
mov    %edx,(%rax,%rcx,1)
add    $0x4,%rcx
test   %edx,%edx
jne    1110 <wcscpy+0x10>
ret

LLVM IR (-O0):
define i32* @wcscpy(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
store i32* %6, i32** %5
br label %7
7: ; preds = %14, %2
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i32 1
store i32* %9, i32** %4
%10 = load i32, i32* %8
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i32 1
store i32* %12, i32** %3
store i32 %10, i32* %11
%13 = icmp ne i32 %10, 0
br i1 %13, label %14, label %15
14: ; preds = %7
br label %7
15: ; preds = %7
%16 = load i32*, i32** %5
ret i32* %16
}

LLVM IR (-O2):
define i32* @wcscpy(i32* returned writeonly %0, i32* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32* [ %1, %2 ], [ %6, %3 ]
%5 = phi i32* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i32, i32* %4, i64 1
%7 = load i32, i32* %4
%8 = getelementptr inbounds i32, i32* %5, i64 1
store i32 %7, i32* %5
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i32* %0
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ xalloc_die();
void *xcalloc(size_t n, size_t s) {
  void *p;
  p = calloc(n, s);
  if (p == 0)
    xalloc_die();
  return p;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <xcalloc+0x33>
mov    $0x0,%al
call   1040 <xalloc_die@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rbx
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <xcalloc+0x15>
xor    %eax,%eax
call   1040 <xalloc_die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (...) @xalloc_die()
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @xalloc_die()
br label %7
7: ; preds = %5, %2
ret i8* %3
}
struct A {
  int a, b, c;
  float d;
} af() {
  return (struct A){1, 2, 3, 4};
}


x86 assembly (clang, -O0):
<af>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x10(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x40800000,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<af>:
movabs $0x200000001,%rax
movabs $0x4080000000000003,%rdx
ret

LLVM IR (-O0):
%struct.A = type { i32, i32, i32, float }
define { i64, i64 } @af() {
%1 = alloca %struct.A
%2 = getelementptr inbounds %struct.A, %struct.A* %1, i32 0, i32 0
store i32 1, i32* %2
%3 = getelementptr inbounds %struct.A, %struct.A* %1, i32 0, i32 1
store i32 2, i32* %3
%4 = getelementptr inbounds %struct.A, %struct.A* %1, i32 0, i32 2
store i32 3, i32* %4
%5 = getelementptr inbounds %struct.A, %struct.A* %1, i32 0, i32 3
store float 4.000000e+00, float* %5
%6 = bitcast %struct.A* %1 to { i64, i64 }*
%7 = load { i64, i64 }, { i64, i64 }* %6
ret { i64, i64 } %7
}

LLVM IR (-O2):
define { i64, i64 } @af() {
ret { i64, i64 } { i64 8589934593, i64 4647714815446351875 }
}
void test0() {}


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

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

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

LLVM IR (-O2):
define void @test0() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int i1, i2;
  i1 = 4;
  i2 = 2;
  if ((i1 != 0) && (i2 != 0))
    printf("Both are not zero\n");
  if (i1 && i2)
    printf("Both are not zero\n");
  if (i1 & i2)
    printf("Both are not zero\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114d <main+0x3d>
cmpl   $0x0,-0xc(%rbp)
je     114d <main+0x3d>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x8(%rbp)
je     116d <main+0x5d>
cmpl   $0x0,-0xc(%rbp)
je     116d <main+0x5d>
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
cmp    $0x0,%eax
je     1188 <main+0x78>
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str.1 = [18 x i8] c"Both are not zero\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.1, i64 0, i64 0))
ret i32 0
}
void insert_delay_ms(int ms) {
  int i = 0;
  int j = 0;
  for (i = 0; i < ms; ++i) {
    for (j = 0; j < 32000; ++j) {
      ++j;
    }
  }
}


x86 assembly (clang, -O0):
<insert_delay_ms>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1166 <insert_delay_ms+0x66>
movl   $0x0,-0xc(%rbp)
cmpl   $0x7d00,-0xc(%rbp)
jge    1153 <insert_delay_ms+0x53>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112f <insert_delay_ms+0x2f>
jmp    1158 <insert_delay_ms+0x58>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111c <insert_delay_ms+0x1c>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @insert_delay_ms(i32 %0) {
ret void
}
/* Variables and functions */
int mg_match_prefix_n(char const *, int, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int mg_match_prefix(const char *pattern, int pattern_len, const char *str) {
  return mg_match_prefix_n(pattern, pattern_len, str, strlen(str));
}


x86 assembly (clang, -O0):
<mg_match_prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    %eax,%ecx
call   1040 <mg_match_prefix_n@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mg_match_prefix>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
mov    %rdx,%rdi
call   1030 <strlen@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
mov    %rbx,%rdx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <mg_match_prefix_n@plt>

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

LLVM IR (-O2):
define i32 @mg_match_prefix(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %2)
%5 = tail call i32 @mg_match_prefix_n(i8* %0, i32 %1, i8* %2, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ show_dec_locator_events(char const *, int,
                                           int /*<<< orphan*/);
int test_dec_locator_rectangle(const char *the_title) {
  show_dec_locator_events(the_title, -2, (0));
  return 1;
}


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

x86 assembly (clang, -O2):
<test_dec_locator_rectangle>:
push   %rax
mov    $0xfffffffe,%esi
xor    %edx,%edx
call   1030 <show_dec_locator_events@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @test_dec_locator_rectangle(i8* %0) {
%2 = tail call i32 @show_dec_locator_events(i8* %0, i32 -2, i32 0)
ret i32 1
}
/* Variables and functions */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
float *float_calloc(int n) {
  float *v;
  if ((v = (float *)calloc(n, sizeof(float))) == NULL) {
    fprintf(stderr, "FATAL ERROR: Out of memory\n");
    exit(1);
  }
  return v;
}


x86 assembly (clang, -O0):
<float_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1175 <float_calloc+0x45>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
lea    0xe9a(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_calloc>:
push   %rax
mov    $0x4,%esi
call   1030 <calloc@plt>
test   %rax,%rax
je     1142 <float_calloc+0x12>
pop    %rcx
ret
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"FATAL ERROR: Out of memory\0A\00"
define float* @float_calloc(i32 %0) {
%2 = alloca i32
%3 = alloca float*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @calloc(i32 %4, i32 4)
%6 = inttoptr i64 %5 to float*
store float* %6, float** %3
%7 = icmp eq float* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load float*, float** %3
ret float* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"FATAL ERROR: Out of memory\0A\00"
define float* @float_calloc(i32 %0) {
%2 = tail call i64 @calloc(i32 %0, i32 4)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
%9 = inttoptr i64 %2 to float*
ret float* %9
}
/* Variables and functions */
unsigned int strlen(const char *str) {
  unsigned int i = 0;
  while (str[i] != '\0') {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1131 <strlen+0x31>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi,%rax,1)
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %8, %2 ]
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add i32 %3, 1
br i1 %7, label %9, label %2
9: ; preds = %2
ret i32 %3
}
int bitmap_get(const unsigned char *bitmap, unsigned int idx) {
  unsigned int byte = idx / 8;
  unsigned int bit = idx & 7;
  return bitmap[byte] & 1 << bit;
}


x86 assembly (clang, -O0):
<bitmap_get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x3,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    $0x7,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movzbl (%rax,%rcx,1),%eax
mov    -0x14(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_get>:
mov    %esi,%ecx
mov    %esi,%eax
shr    $0x3,%rax
movzbl (%rdi,%rax,1),%edx
and    $0x7,%cl
mov    $0x1,%eax
shl    %cl,%eax
and    %edx,%eax
ret

LLVM IR (-O0):
define i32 @bitmap_get(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = udiv i32 %7, 8
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = and i32 %9, 7
store i32 %10, i32* %6
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = load i32, i32* %6
%18 = shl i32 1, %17
%19 = and i32 %16, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @bitmap_get(i8* nocapture %0, i32 %1) {
%3 = lshr i32 %1, 3
%4 = and i32 %1, 7
%5 = zext i32 %3 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl nuw nsw i32 1, %4
%10 = and i32 %9, %8
ret i32 %10
}
/* Type definitions */
typedef int uint8_t;
typedef int int64_t;

/* Variables and functions */
int64_t arithmetic_shift_right(int64_t value, uint8_t shift) {
  int64_t sign_ext;
  if (shift == 0) {
    return value;
  }
  sign_ext = (value >> 63) & 1;
  sign_ext = -sign_ext;
  return (value >> shift) | (sign_ext << (64 - shift));
}


x86 assembly (clang, -O0):
<arithmetic_shift_right>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    111f <arithmetic_shift_right+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <arithmetic_shift_right+0x53>
mov    -0x8(%rbp),%eax
mov    $0x3f,%ecx
sar    %cl,%eax
and    $0x1,%eax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
mov    -0x10(%rbp),%edx
mov    $0x40,%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @arithmetic_shift_right(i32 returned %0, i32 %1) {
ret i32 %0
}
void Debug_Timer_RestoreConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @Debug_Timer_RestoreConfig() {
ret void
}