xunge/DecIR huggingface dataset:
int delay(int m) {
  int i;
  for (i = 0; i < m * 50; i++) {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   $0x32,-0x4(%rbp),%ecx
cmp    %ecx,%eax
jge    1134 <delay+0x34>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <delay+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
imul   $0x32,%edi,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovg  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @delay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = mul nsw i32 %6, 50
%8 = icmp slt i32 %5, %7
br i1 %8, label %9, label %15
9: ; preds = %4
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = add nsw 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 @delay(i32 %0) {
%2 = mul i32 %0, 50
%3 = call i32 @llvm.smax.i32(i32 %2, i32 0)
ret i32 %3
}
int ft_strfind(char *str, char c) {
  int res = 0;
  while (str[res]) {
    if (str[res] == c)
      return (res);
    res++;
  }
  return (-1);
}


x86 assembly (clang, -O0):
<ft_strfind>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1158 <ft_strfind+0x58>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    114a <ft_strfind+0x4a>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115f <ft_strfind+0x5f>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <ft_strfind+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strfind>:
mov    (%rdi),%dl
mov    $0xffffffff,%eax
test   %dl,%dl
je     1122 <ft_strfind+0x22>
xor    %ecx,%ecx
nopl   (%rax)
cmp    %sil,%dl
je     1123 <ft_strfind+0x23>
movzbl 0x1(%rdi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <ft_strfind+0x10>
ret
mov    %ecx,%eax
ret

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

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

/* Variables and functions */
struct wine_rb_entry *wine_rb_get(struct wine_rb_tree *, void const *);
int /*<<< orphan*/ wine_rb_remove(struct wine_rb_tree *,
                                  struct wine_rb_entry *);
void wine_rb_remove_key(struct wine_rb_tree *tree, const void *key) {
  struct wine_rb_entry *entry = wine_rb_get(tree, key);
  if (entry)
    wine_rb_remove(tree, entry);
}


x86 assembly (clang, -O0):
<wine_rb_remove_key>:
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   1040 <wine_rb_get@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1159 <wine_rb_remove_key+0x39>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <wine_rb_remove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wine_rb_remove_key>:
push   %rbx
mov    %rdi,%rbx
call   1040 <wine_rb_get@plt>
test   %rax,%rax
je     113a <wine_rb_remove_key+0x1a>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <wine_rb_remove@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.wine_rb_tree = type { i32 }
%struct.wine_rb_entry = type { i32 }
define void @wine_rb_remove_key(%struct.wine_rb_tree* %0, i8* %1) {
%3 = alloca %struct.wine_rb_tree*
%4 = alloca i8*
%5 = alloca %struct.wine_rb_entry*
store %struct.wine_rb_tree* %0, %struct.wine_rb_tree** %3
store i8* %1, i8** %4
%6 = load %struct.wine_rb_tree*, %struct.wine_rb_tree** %3
%7 = load i8*, i8** %4
%8 = call %struct.wine_rb_entry* @wine_rb_get(%struct.wine_rb_tree* %6, i8* %7)
store %struct.wine_rb_entry* %8, %struct.wine_rb_entry** %5
%9 = load %struct.wine_rb_entry*, %struct.wine_rb_entry** %5
%10 = icmp ne %struct.wine_rb_entry* %9, null
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load %struct.wine_rb_tree*, %struct.wine_rb_tree** %3
%13 = load %struct.wine_rb_entry*, %struct.wine_rb_entry** %5
%14 = call i32 @wine_rb_remove(%struct.wine_rb_tree* %12, %struct.wine_rb_entry* %13)
br label %15
15: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
%struct.wine_rb_tree = type { i32 }
%struct.wine_rb_entry = type { i32 }
define void @wine_rb_remove_key(%struct.wine_rb_tree* %0, i8* %1) {
%3 = tail call %struct.wine_rb_entry* @wine_rb_get(%struct.wine_rb_tree* %0, i8* %1)
%4 = icmp eq %struct.wine_rb_entry* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @wine_rb_remove(%struct.wine_rb_tree* %0, %struct.wine_rb_entry* %3)
br label %7
7: ; preds = %5, %2
ret void
}
/* Type definitions */
struct mm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ srandom(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int random_init(struct mm *mm) {
  srandom(time(NULL));
  return 0;
}


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

x86 assembly (clang, -O2):
<random_init>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srandom@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.mm = type { i32 }
define i32 @random_init(%struct.mm* %0) {
%2 = alloca %struct.mm*
store %struct.mm* %0, %struct.mm** %2
%3 = call i32 @time(i32* null)
%4 = call i32 @srandom(i32 %3)
ret i32 0
}

LLVM IR (-O2):
%struct.mm = type { i32 }
define i32 @random_init(%struct.mm* nocapture readnone %0) {
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srandom(i32 %2)
ret i32 0
}
void mf_write_header_chunk(format, ntracks, division) int format, ntracks,
    division;
{
  long ident, length;
  void write16bit(), write32bit();
  ident = 0x4d546864;
  length = 6;
  write32bit(ident);
  write32bit(length);
  write16bit(format);
  write16bit(ntracks);
  write16bit(division);
}


x86 assembly (clang, -O0):
<mf_write_header_chunk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movq   $0x4d546864,-0x18(%rbp)
4d
movq   $0x6,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1040 <write32bit@plt>
mov    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1040 <write32bit@plt>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <write16bit@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <write16bit@plt>
mov    -0xc(%rbp),%edi
mov    $0x0,%al
call   1030 <write16bit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mf_write_header_chunk>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0x4d546864,%edi
xor    %eax,%eax
call   1040 <write32bit@plt>
mov    $0x6,%edi
xor    %eax,%eax
call   1040 <write32bit@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <write16bit@plt>
mov    %ebp,%edi
xor    %eax,%eax
call   1030 <write16bit@plt>
mov    %r14d,%edi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <write16bit@plt>

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

LLVM IR (-O2):
define void @mf_write_header_chunk(i32 %0, i32 %1, i32 %2) {
tail call void (i64, ...) bitcast (void (...)* @write32bit to void (i64, ...)*)(i64 1297377380)
tail call void (i64, ...) bitcast (void (...)* @write32bit to void (i64, ...)*)(i64 6)
tail call void (i32, ...) bitcast (void (...)* @write16bit to void (i32, ...)*)(i32 %0)
tail call void (i32, ...) bitcast (void (...)* @write16bit to void (i32, ...)*)(i32 %1)
tail call void (i32, ...) bitcast (void (...)* @write16bit to void (i32, ...)*)(i32 %2)
ret void
}
int check_all() {
  int result = 0;
  return result;
}


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

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

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

LLVM IR (-O2):
define i32 @check_all() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ say(char *, int);
void talk(void) { say("Wow, they have a dish.", 1); }


x86 assembly (clang, -O0):
<talk>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
call   1030 <say@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<talk>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <say@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Wow, they have a dish.\00"
define void @talk() {
%1 = call i32 @say(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Wow, they have a dish.\00"
define void @talk() {
%1 = tail call i32 @say(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fseek(int /*<<< orphan*/ *, long, int);
__attribute__((__weak__, __always___)) int
softboundcets_fseek(FILE *stream, long offset, int whence) {
  return fseek(stream, offset, whence);
}


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

x86 assembly (clang, -O2):
<softboundcets_fseek>:
jmp    1030 <fseek@plt>

LLVM IR (-O0):
define weak i32 @softboundcets_fseek(i32* %0, i64 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i32
store i32* %0, i32** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i64, i64* %5
%9 = load i32, i32* %6
%10 = call i32 @fseek(i32* %7, i64 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define weak i32 @softboundcets_fseek(i32* %0, i64 %1, i32 %2) {
%4 = tail call i32 @fseek(i32* %0, i64 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void DefaultFreeTable(void *pool, void *item) { free(item); }


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

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

LLVM IR (-O0):
define void @DefaultFreeTable(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @DefaultFreeTable(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
void vaciar(char temp[]) {
  int i;
  for (i = 0; i < 50; i++) {
    temp[i] = '\0';
  }
}


x86 assembly (clang, -O0):
<vaciar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x32,-0xc(%rbp)
jge    1133 <vaciar+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 <vaciar+0xf>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @vaciar(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, 50
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 @vaciar(i8* nocapture writeonly %0) {
ret void
}
void ble_rsp_gap_connect_selective(
    const struct ble_msg_gap_connect_selective_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_gap_connect_selective_rsp_t = type opaque
define void @ble_rsp_gap_connect_selective(%struct.ble_msg_gap_connect_selective_rsp_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(char);
void printBytes(char *buffer, size_t numBytes) {
  size_t i = 0;
  for (i = 0; i < numBytes; i++)
    putchar(buffer[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<printBytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1170 <printBytes+0x50>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1140 <printBytes+0x20>
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printBytes>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1143 <printBytes+0x33>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <printBytes+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @printBytes(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call i32 @putchar(i8 signext %7)
%9 = add nuw i64 %5, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 10)
ret void
}
int chk_sum(char sen[]) {
  int i, xor;
  for (i = 2, xor = sen[1]; sen[i] != '*'; i++) {
    xor ^= sen[i];
  }
  xor %= 65536;
  return xor;
}


x86 assembly (clang, -O0):
<chk_sum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2a,%eax
je     114f <chk_sum+0x4f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111a <chk_sum+0x1a>
mov    -0x10(%rbp),%eax
mov    $0x10000,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chk_sum>:
movsbl 0x1(%rdi),%eax
mov    0x2(%rdi),%cl
cmp    $0x2a,%cl
je     1121 <chk_sum+0x21>
add    $0x3,%rdi
movsbl %cl,%ecx
xor    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
cmp    $0x2a,%cl
jne    1110 <chk_sum+0x10>
lea    0xffff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffff0000,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @chk_sum(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 42
br i1 %7, label %18, label %8
8: ; preds = %1, %8
%9 = phi i64 [ %14, %8 ], [ 2, %1 ]
%10 = phi i8 [ %16, %8 ], [ %6, %1 ]
%11 = phi i32 [ %13, %8 ], [ %4, %1 ]
%12 = sext i8 %10 to i32
%13 = xor i32 %11, %12
%14 = add nuw nsw i64 %9, 1
%15 = getelementptr inbounds i8, i8* %0, i64 %14
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 42
br i1 %17, label %18, label %8
18: ; preds = %8, %1
%19 = phi i32 [ %4, %1 ], [ %13, %8 ]
%20 = srem i32 %19, 65536
ret i32 %20
}
/* Variables and functions */
int atoiv2(char *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  char *s = "1234";
  int ret;
  ret = atoiv2(s);
  printf("%d", ret);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"1234\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @atoiv2(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
int tx_begin(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @tx_begin() {
ret i32 0
}

LLVM IR (-O2):
define i32 @tx_begin() {
ret i32 0
}
float select4(const float *src, unsigned int control) {
  switch (control) {
  case 0:
    return src[0];
  case 1:
    return src[1];
  case 2:
    return src[2];
  case 3:
    return src[3];
  }
  return -1;
}


x86 assembly (clang, -O0):
<select4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %rax,-0x20(%rbp)
sub    $0x3,%rax
ja     117b <select4+0x7b>
mov    -0x20(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1188 <select4+0x88>
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1188 <select4+0x88>
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1188 <select4+0x88>
mov    -0x10(%rbp),%rax
movss  0xc(%rax),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1188 <select4+0x88>
movss  0xe7d(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<select4>:
cmp    $0x3,%esi
ja     1120 <select4+0x20>
mov    %esi,%eax
lea    0xef6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
add    $0x4,%rdi
movss  (%rdi),%xmm0
ret
movss  0xed8(%rip),%xmm0
ret
add    $0x8,%rdi
movss  (%rdi),%xmm0
ret
add    $0xc,%rdi
movss  (%rdi),%xmm0
ret

LLVM IR (-O0):
define float @select4(float* %0, i32 %1) {
%3 = alloca float
%4 = alloca float*
%5 = alloca i32
store float* %0, float** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
switch i32 %6, label %23 [
i32 0, label %7
i32 1, label %11
i32 2, label %15
i32 3, label %19
]
7: ; preds = %2
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
%10 = load float, float* %9
store float %10, float* %3
br label %24
11: ; preds = %2
%12 = load float*, float** %4
%13 = getelementptr inbounds float, float* %12, i64 1
%14 = load float, float* %13
store float %14, float* %3
br label %24
15: ; preds = %2
%16 = load float*, float** %4
%17 = getelementptr inbounds float, float* %16, i64 2
%18 = load float, float* %17
store float %18, float* %3
br label %24
19: ; preds = %2
%20 = load float*, float** %4
%21 = getelementptr inbounds float, float* %20, i64 3
%22 = load float, float* %21
store float %22, float* %3
br label %24
23: ; preds = %2
store float -1.000000e+00, float* %3
br label %24
24: ; preds = %23, %19, %15, %11, %7
%25 = load float, float* %3
ret float %25
}

LLVM IR (-O2):
define float @select4(float* nocapture %0, i32 %1) {
switch i32 %1, label %12 [
i32 0, label %9
i32 1, label %3
i32 2, label %5
i32 3, label %7
]
3: ; preds = %2
%4 = getelementptr inbounds float, float* %0, i64 1
br label %9
5: ; preds = %2
%6 = getelementptr inbounds float, float* %0, i64 2
br label %9
7: ; preds = %2
%8 = getelementptr inbounds float, float* %0, i64 3
br label %9
9: ; preds = %2, %3, %5, %7
%10 = phi float* [ %8, %7 ], [ %6, %5 ], [ %4, %3 ], [ %0, %2 ]
%11 = load float, float* %10
br label %12
12: ; preds = %9, %2
%13 = phi float [ -1.000000e+00, %2 ], [ %11, %9 ]
ret float %13
}
/* Type definitions */
struct prefix_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct prefix_list *);
void free_prefix_list(struct prefix_list *l) { free(l); }


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

x86 assembly (clang, -O2):
<free_prefix_list>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.prefix_list = type { i32 }
define void @free_prefix_list(%struct.prefix_list* nocapture %0) {
%2 = tail call i32 @free(%struct.prefix_list* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ stest(int);
int /*<<< orphan*/ utest(int);
void testTortureExecute(void) {
  utest(9);
  utest(0);
  stest(9);
  stest(0);
  return;
}


x86 assembly (clang, -O0):
<testTortureExecute>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9,%edi
call   1040 <utest@plt>
xor    %edi,%edi
call   1040 <utest@plt>
mov    $0x9,%edi
call   1030 <stest@plt>
xor    %edi,%edi
call   1030 <stest@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testTortureExecute>:
push   %rax
mov    $0x9,%edi
call   1040 <utest@plt>
xor    %edi,%edi
call   1040 <utest@plt>
mov    $0x9,%edi
call   1030 <stest@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <stest@plt>

LLVM IR (-O0):
define void @testTortureExecute() {
%1 = call i32 @utest(i32 9)
%2 = call i32 @utest(i32 0)
%3 = call i32 @stest(i32 9)
%4 = call i32 @stest(i32 0)
ret void
}

LLVM IR (-O2):
define void @testTortureExecute() {
%1 = tail call i32 @utest(i32 9)
%2 = tail call i32 @utest(i32 0)
%3 = tail call i32 @stest(i32 9)
%4 = tail call i32 @stest(i32 0)
ret void
}
/* Variables and functions */
char *int_to_base64(int);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
char *make_ext_salt_para(int rounds, char *saltpara) {
  static char salt[10];
  sprintf(salt, "_%s%s", int_to_base64(rounds), saltpara);
  return salt;
}


x86 assembly (clang, -O0):
<make_ext_salt_para>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <int_to_base64@plt>
mov    %rax,%rdx
mov    -0x10(%rbp),%rcx
lea    0x2eec(%rip),%rdi
lea    0xeb4(%rip),%rsi
call   1040 <sprintf@plt>
lea    0x2ed9(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_ext_salt_para>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <int_to_base64@plt>
lea    0x2efe(%rip),%r14
lea    0xec6(%rip),%rsi
mov    %r14,%rdi
mov    %rax,%rdx
mov    %rbx,%rcx
call   1040 <sprintf@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@make_ext_salt_para.salt = internal global [10 x i8] zeroinitializer
@.str = [6 x i8] c"_%s%s\00"
define i8* @make_ext_salt_para(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = call i8* @int_to_base64(i32 %5)
%7 = load i8*, i8** %4
%8 = call i32 @sprintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @make_ext_salt_para.salt, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @make_ext_salt_para.salt, i64 0, i64 0)
}

LLVM IR (-O2):
@make_ext_salt_para.salt = internal global [10 x i8] zeroinitializer
@.str = [6 x i8] c"_%s%s\00"
define i8* @make_ext_salt_para(i32 %0, i8* %1) {
%3 = tail call i8* @int_to_base64(i32 %0)
%4 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @make_ext_salt_para.salt, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %1)
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @make_ext_salt_para.salt, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ disp_int(int /*<<< orphan*/);
int /*<<< orphan*/ disp_str(char *);
void TestB() {
  int i = 0x1000;
  while (1) {
    disp_str("B");
    disp_int(i++);
    disp_str(".");
    delay(1);
  }
}


x86 assembly (clang, -O0):
<TestB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1000,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <disp_str@plt>
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
call   1050 <disp_int@plt>
lea    0xe9d(%rip),%rdi
call   1030 <disp_str@plt>
mov    $0x1,%edi
call   1040 <delay@plt>
jmp    113f <TestB+0xf>

x86 assembly (clang, -O2):
<TestB>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x1000,%ebx
lea    0xebd(%rip),%r14
lea    0xeb8(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <disp_str@plt>
lea    0x1(%rbx),%ebp
mov    %ebx,%edi
call   1050 <disp_int@plt>
mov    %r15,%rdi
call   1030 <disp_str@plt>
mov    $0x1,%edi
call   1040 <delay@plt>
mov    %ebp,%ebx
jmp    1150 <TestB+0x20>

LLVM IR (-O0):
@.str = [2 x i8] c"B\00"
@.str.1 = [2 x i8] c".\00"
define void @TestB() {
%1 = alloca i32
store i32 4096, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @disp_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
store i32 %5, i32* %1
%6 = call i32 @disp_int(i32 %4)
%7 = call i32 @disp_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @delay(i32 1)
br label %2
}

LLVM IR (-O2):
@.str = [2 x i8] c"B\00"
@.str.1 = [2 x i8] c".\00"
define void @TestB() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 4096, %0 ], [ %4, %1 ]
%3 = tail call i32 @disp_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = add nuw nsw i32 %2, 1
%5 = tail call i32 @disp_int(i32 %2)
%6 = tail call i32 @disp_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @delay(i32 1)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ displayBits(int);
int /*<<< orphan*/ printf(char *, int);
void power2(int number, int pow) {
  number <<= pow - 1;
  printf("%u\n", number);
  displayBits(number);
}


x86 assembly (clang, -O0):
<power2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x4(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <displayBits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<power2>:
push   %rbx
mov    %edi,%ebx
lea    -0x1(%rsi),%ecx
shl    %cl,%ebx
lea    0xed1(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <displayBits@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%u\0A\00"
define void @power2(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 = sub nsw i32 %5, 1
%7 = load i32, i32* %3
%8 = shl i32 %7, %6
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %3
%12 = call i32 @displayBits(i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%u\0A\00"
define void @power2(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = shl i32 %0, %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @displayBits(i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int exampleProgram();
int main() {
  assert(sizeof(uint32_t) == 4);
  return exampleProgram();
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <exampleProgram@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @assert(i32 1)
%3 = call i32 (...) @exampleProgram()
ret i32 %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 (...) @exampleProgram()
ret i32 %2
}
void SplitUVRow_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @SplitUVRow_AVX2() {
ret void
}
/* Variables and functions */
int random_in_range(int /*<<< orphan*/, int);
int random_get(int max) { return random_in_range(0, max); }


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

x86 assembly (clang, -O2):
<random_get>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <random_in_range@plt>

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

LLVM IR (-O2):
define i32 @random_get(i32 %0) {
%2 = tail call i32 @random_in_range(i32 0, i32 %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ isfinite(float);
int __ocl_isfinite_float(float src) { return isfinite(src) ? 1 : 0; }


x86 assembly (clang, -O0):
<__ocl_isfinite_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <isfinite@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_isfinite_float>:
push   %rax
call   1030 <isfinite@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @__ocl_isfinite_float(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @isfinite(float %3)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
ret i32 %7
}

LLVM IR (-O2):
define i32 @__ocl_isfinite_float(float %0) {
%2 = tail call i64 @isfinite(float %0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;

/* Variables and functions */
int /*<<< orphan*/ mpz_xor(int /*<<< orphan*/, int /*<<< orphan*/ const,
                           int /*<<< orphan*/ const);
void field_add(mpz_t z, const mpz_t x, const mpz_t y) { mpz_xor(z, x, y); }


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

x86 assembly (clang, -O2):
<field_add>:
jmp    1030 <mpz_xor@plt>

LLVM IR (-O0):
define void @field_add(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @mpz_xor(i32 %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @field_add(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @mpz_xor(i32 %0, i32 %1, i32 %2)
ret void
}
int fputs_unlocked(str, fp) const char *str;
int *fp;
{}


x86 assembly (clang, -O0):
<fputs_unlocked>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fputs_unlocked(i8* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int pow(double, int);
double g1(double x) { return ((2 * pow(x, 3) + 1) / (3 * pow(x, 2) - 1)); }


x86 assembly (clang, -O0):
<g1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x3,%edi
call   1030 <pow@plt>
shl    $0x1,%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   $0x3,%ecx,%ecx
sub    $0x1,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g1>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    $0x3,%edi
call   1030 <pow@plt>
lea    (%rax,%rax,1),%ebx
add    $0x1,%ebx
movsd  0x8(%rsp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
lea    (%rax,%rax,2),%ecx
add    $0xffffffff,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @g1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @pow(double %3, i32 3)
%5 = mul nsw i32 2, %4
%6 = add nsw i32 %5, 1
%7 = load double, double* %2
%8 = call i32 @pow(double %7, i32 2)
%9 = mul nsw i32 3, %8
%10 = sub nsw i32 %9, 1
%11 = sdiv i32 %6, %10
%12 = sitofp i32 %11 to double
ret double %12
}

LLVM IR (-O2):
define double @g1(double %0) {
%2 = tail call i32 @pow(double %0, i32 3)
%3 = shl nsw i32 %2, 1
%4 = or i32 %3, 1
%5 = tail call i32 @pow(double %0, i32 2)
%6 = mul nsw i32 %5, 3
%7 = add nsw i32 %6, -1
%8 = sdiv i32 %4, %7
%9 = sitofp i32 %8 to double
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ Prexit(char *, int);
void *malloc(int);
void *Malloc(int b) {
  void *p;
  if (!(p = malloc(b)))
    Prexit("%d", b);
  return p;
}


x86 assembly (clang, -O0):
<Malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1150 <Malloc+0x30>
mov    -0x4(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1030 <Prexit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Malloc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1140 <Malloc+0x20>
lea    0xec7(%rip),%rdi
mov    %ebp,%esi
call   1030 <Prexit@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i8* @Malloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 @Prexit(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %7, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define noalias i8* @Malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @Prexit(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void rand_init(void) { srand(time(NULL)); }


x86 assembly (clang, -O0):
<rand_init>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rand_init() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
ret void
}

LLVM IR (-O2):
define void @rand_init() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
ret void
}
void g_type_value_table_peek() {}


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

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

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

LLVM IR (-O2):
define void @g_type_value_table_peek() {
ret void
}
int lowercase(int c) {
  if (c >= 'A' && c <= 'Z') {
    c += 32;
  }
  return c;
}


x86 assembly (clang, -O0):
<lowercase>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1124 <lowercase+0x24>
cmpl   $0x5a,-0x4(%rbp)
jg     1124 <lowercase+0x24>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lowercase>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @lowercase(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 32
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %5, %1
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @lowercase(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_read_dobldobl_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(330, a, b, c, 0);
  return fail;
}


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

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

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

LLVM IR (-O2):
define i32 @syscon_read_dobldobl_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 330, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
void XGetWMProtocols() {}


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

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

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

LLVM IR (-O2):
define void @XGetWMProtocols() {
ret void
}
/* Variables and functions */
scalar_t__ getplanes();
int getplanes_() { return ((int)getplanes()); }


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

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

LLVM IR (-O0):
define i32 @getplanes_() {
%1 = call i64 (...) @getplanes()
%2 = trunc i64 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @getplanes_() {
%1 = tail call i64 (...) @getplanes()
%2 = trunc i64 %1 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ asprintf(char **, char *, int, char *, int, char *);
int rand();
char *strrchr(char *, char);
char *get_temp(char *base) {
  int salt = rand();
  char *temp = NULL;
  char *ext = strrchr(base, '.');
  asprintf(&temp, "%.*s-%x%s", (int)(ext - base), base, salt, ext);
  return temp;
}


x86 assembly (clang, -O0):
<get_temp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <rand@plt>
mov    %eax,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%edx
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%r8d
mov    -0x20(%rbp),%r9
lea    -0x18(%rbp),%rdi
lea    0xe7c(%rip),%rsi
call   1040 <asprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_temp>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <rand@plt>
mov    %eax,%ebp
movq   $0x0,(%rsp)
mov    %rbx,%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %eax,%edx
sub    %ebx,%edx
lea    0xea1(%rip),%rsi
mov    %rsp,%rdi
mov    %rbx,%rcx
mov    %ebp,%r8d
mov    %rax,%r9
call   1040 <asprintf@plt>
mov    (%rsp),%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%.*s-%x%s\00"
define i8* @get_temp(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %2
%6 = call i32 (...) @rand()
store i32 %6, i32* %3
store i8* null, i8** %4
%7 = load i8*, i8** %2
%8 = call i8* @strrchr(i8* %7, i8 signext 46)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i8*, i8** %2
%11 = ptrtoint i8* %9 to i64
%12 = ptrtoint i8* %10 to i64
%13 = sub i64 %11, %12
%14 = trunc i64 %13 to i32
%15 = load i8*, i8** %2
%16 = load i32, i32* %3
%17 = load i8*, i8** %5
%18 = call i32 @asprintf(i8** %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %14, i8* %15, i32 %16, i8* %17)
%19 = load i8*, i8** %4
ret i8* %19
}

LLVM IR (-O2):
@.str = [10 x i8] c"%.*s-%x%s\00"
define i8* @get_temp(i8* %0) {
%2 = alloca i8*
%3 = tail call i32 (...) @rand()
%4 = bitcast i8** %2 to i8*
store i8* null, i8** %2
%5 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%6 = ptrtoint i8* %5 to i64
%7 = ptrtoint i8* %0 to i64
%8 = sub i64 %6, %7
%9 = trunc i64 %8 to i32
%10 = call i32 @asprintf(i8** %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %0, i32 %3, i8* %5)
%11 = load i8*, i8** %2
ret i8* %11
}