xunge/DecIR huggingface dataset:
void mspack_destroy_szdd_compressor(struct msszdd_compressor *this) {}


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

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

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

LLVM IR (-O2):
%struct.msszdd_compressor = type opaque
define void @mspack_destroy_szdd_compressor(%struct.msszdd_compressor* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ _ses_str_cpy(int /*<<< orphan*/ *, int, char *,
                                unsigned int);
void ses_config_enclosure_descriptor_product_identifier(uint8_t *data, char *s,
                                                        unsigned slen) {
  _ses_str_cpy(data + 20, 16, s, slen);
}


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

x86 assembly (clang, -O2):
<ses_config_enclosure_descriptor_product_identifier>:
mov    %edx,%ecx
mov    %rsi,%rdx
add    $0x50,%rdi
mov    $0x10,%esi
jmp    1030 <_ses_str_cpy@plt>

LLVM IR (-O0):
define void @ses_config_enclosure_descriptor_product_identifier(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 20
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @_ses_str_cpy(i32* %8, i32 16, i8* %9, i32 %10)
ret void
}

LLVM IR (-O2):
define void @ses_config_enclosure_descriptor_product_identifier(i32* %0, i8* %1, i32 %2) {
%4 = getelementptr inbounds i32, i32* %0, i64 20
%5 = tail call i32 @_ses_str_cpy(i32* %4, i32 16, i8* %1, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct isal_huff_histogram {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ isal_update_histogram_base(int /*<<< orphan*/ *, int,
                                              struct isal_huff_histogram *);
void isal_update_histogram(uint8_t *start_stream, int length,
                           struct isal_huff_histogram *histogram) {
  isal_update_histogram_base(start_stream, length, histogram);
}


x86 assembly (clang, -O0):
<isal_update_histogram>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <isal_update_histogram_base@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isal_update_histogram>:
jmp    1030 <isal_update_histogram_base@plt>

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

LLVM IR (-O2):
%struct.isal_huff_histogram = type { i32 }
define void @isal_update_histogram(i32* %0, i32 %1, %struct.isal_huff_histogram* %2) {
%4 = tail call i32 @isal_update_histogram_base(i32* %0, i32 %1, %struct.isal_huff_histogram* %2)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ height;
};
typedef TYPE_1__ XArc;

/* Variables and functions */
unsigned short get_XArc_height(void *_p) {
  return (unsigned short)((XArc *)_p)->height;
}


x86 assembly (clang, -O0):
<get_XArc_height>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_XArc_height>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define zeroext i16 @get_XArc_height(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i16
ret i16 %7
}

LLVM IR (-O2):
define zeroext i16 @get_XArc_height(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i16
ret i16 %4
}
int add_history(const char *line) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @add_history(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
bool isPowerOf2(unsigned int x) { return x && !(x & (x - 1)); }


x86 assembly (clang, -O0):
<isPowerOf2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112c <isPowerOf2+0x2c>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPowerOf2>:
test   %edi,%edi
je     110f <isPowerOf2+0xf>
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isPowerOf2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = sub i32 %7, 1
%9 = and i32 %6, %8
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br label %12
12: ; preds = %5, %1
%13 = phi i1 [ false, %1 ], [ %11, %5 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @isPowerOf2(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.ctpop.i32(i32 %0)
%5 = icmp ult i32 %4, 2
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int32_t smod32(int32_t a, int32_t b) {
  int32_t r;
  if (b == 0) {
    fprintf(stderr, "Should not happen\n");
    exit(EXIT_FAILURE);
  }
  r = a % b;
  return r;
}


x86 assembly (clang, -O0):
<smod32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    115b <smod32+0x3b>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smod32>:
test   %esi,%esi
je     112c <smod32+0xc>
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret
push   %rax
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"Should not happen\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @smod32(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* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = srem i32 %14, %15
store i32 %16, i32* %5
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"Should not happen\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @smod32(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
%10 = srem i32 %0, %1
ret i32 %10
}
int print_char(int ch, char *str, int index_main) {
  str[index_main++] = ch;
  return 1;
}


x86 assembly (clang, -O0):
<print_char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x14(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_char>:
movslq %edx,%rax
mov    %dil,(%rsi,%rax,1)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @print_char(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = add nsw i32 %10, 1
store i32 %11, i32* %6
%12 = sext i32 %10 to i64
%13 = getelementptr inbounds i8, i8* %9, i64 %12
store i8 %8, i8* %13
ret i32 1
}

LLVM IR (-O2):
define i32 @print_char(i32 %0, i8* nocapture writeonly %1, i32 %2) {
%4 = trunc i32 %0 to i8
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i8, i8* %1, i64 %5
store i8 %4, i8* %6
ret i32 1
}
char *scanstring(p, dir)
register char *p;
register int dir;
{
  for (p += dir;; p += dir)
    if (*p == '"' && p[-dir] != '\\')
      return p + dir;
}


x86 assembly (clang, -O0):
<scanstring>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
jne    1152 <scanstring+0x52>
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5c,%eax
je     1152 <scanstring+0x52>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret
jmp    1157 <scanstring+0x57>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <scanstring+0x1c>

x86 assembly (clang, -O2):
<scanstring>:
movslq %esi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rdi,%rcx
add    %rax,%rdi
cmpb   $0x22,(%rcx,%rax,1)
jne    1110 <scanstring+0x10>
cmpb   $0x5c,(%rcx)
je     1110 <scanstring+0x10>
lea    (%rcx,%rax,2),%rax
ret

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

LLVM IR (-O2):
define i8* @scanstring(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = sub nsw i32 0, %1
%5 = sext i32 %4 to i64
br label %6
6: ; preds = %11, %2
%7 = phi i8* [ %0, %2 ], [ %8, %11 ]
%8 = getelementptr inbounds i8, i8* %7, i64 %3
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 34
br i1 %10, label %12, label %11
11: ; preds = %6, %12
br label %6
12: ; preds = %6
%13 = getelementptr inbounds i8, i8* %8, i64 %5
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 92
br i1 %15, label %11, label %16
16: ; preds = %12
%17 = getelementptr inbounds i8, i8* %8, i64 %3
ret i8* %17
}
int grid_cmp(int *a, int *b, int size) {
  for (int i = 0; i < size; ++i) {
    if (a[i] != b[i]) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<grid_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    115d <grid_cmp+0x5d>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x18(%rbp),%rcx
movslq -0x20(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
je     114a <grid_cmp+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1164 <grid_cmp+0x64>
jmp    114f <grid_cmp+0x4f>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1116 <grid_cmp+0x16>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<grid_cmp>:
test   %edx,%edx
jle    113d <grid_cmp+0x3d>
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
jne    113c <grid_cmp+0x3c>
mov    %edx,%r8d
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rax,%rdx
cmp    %rax,%r8
je     1134 <grid_cmp+0x34>
mov    (%rdi,%rdx,4),%ecx
lea    0x1(%rdx),%rax
cmp    (%rsi,%rdx,4),%ecx
je     1120 <grid_cmp+0x20>
xor    %eax,%eax
cmp    %r8,%rdx
setae  %al
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @grid_cmp(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %24
5: ; preds = %3
%6 = zext i32 %2 to i64
%7 = zext i32 %2 to i64
%8 = load i32, i32* %0
%9 = load i32, i32* %1
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %5, %14
%12 = phi i64 [ %20, %14 ], [ 1, %5 ]
%13 = icmp eq i64 %12, %7
br i1 %13, label %21, label %14
14: ; preds = %11
%15 = getelementptr inbounds i32, i32* %0, i64 %12
%16 = load i32, i32* %15
%17 = getelementptr inbounds i32, i32* %1, i64 %12
%18 = load i32, i32* %17
%19 = icmp eq i32 %16, %18
%20 = add nuw nsw i64 %12, 1
br i1 %19, label %11, label %21
21: ; preds = %11, %14
%22 = icmp uge i64 %12, %6
%23 = zext i1 %22 to i32
br label %24
24: ; preds = %21, %5, %3
%25 = phi i32 [ 1, %3 ], [ 0, %5 ], [ %23, %21 ]
ret i32 %25
}
int cam_inhibit_test(const int c) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @cam_inhibit_test(i32 %0) {
ret i32 1
}
void seq(void) {}


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

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

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

LLVM IR (-O2):
define void @seq() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
#pragma omp parallel
  {
    int ID = 0;
    printf("Hello(%d)", ID);
    printf(" world(%d)\n", ID);
  }
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"Hello(%d)\00"
@.str.1 = [12 x i8] c" world(%d)\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
long mtrandom_int64(long);
long mtrandom_long(long range) { return mtrandom_int64(range); }


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

x86 assembly (clang, -O2):
<mtrandom_long>:
jmp    1030 <mtrandom_int64@plt>

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

LLVM IR (-O2):
define i64 @mtrandom_long(i64 %0) {
%2 = tail call i64 @mtrandom_int64(i64 %0)
ret i64 %2
}
/* Type definitions */
struct wpa_ctrl {
  int dummy;
};

/* Variables and functions */
int wpa_ctrl_command(struct wpa_ctrl *, char *);
int wpa_cli_cmd_reconfigure(struct wpa_ctrl *ctrl, int argc, char *argv[]) {
  return wpa_ctrl_command(ctrl, "RECONFIGURE");
}


x86 assembly (clang, -O0):
<wpa_cli_cmd_reconfigure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
call   1030 <wpa_ctrl_command@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.wpa_ctrl = type { i32 }
@.str = [12 x i8] c"RECONFIGURE\00"
define i32 @wpa_cli_cmd_reconfigure(%struct.wpa_ctrl* %0, i32 %1, i8** %2) {
%4 = alloca %struct.wpa_ctrl*
%5 = alloca i32
%6 = alloca i8**
store %struct.wpa_ctrl* %0, %struct.wpa_ctrl** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load %struct.wpa_ctrl*, %struct.wpa_ctrl** %4
%8 = call i32 @wpa_ctrl_command(%struct.wpa_ctrl* %7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 %8
}

LLVM IR (-O2):
%struct.wpa_ctrl = type { i32 }
@.str = [12 x i8] c"RECONFIGURE\00"
define i32 @wpa_cli_cmd_reconfigure(%struct.wpa_ctrl* %0, i32 %1, i8** nocapture readnone %2) {
%4 = tail call i32 @wpa_ctrl_command(%struct.wpa_ctrl* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cg_io_error(char *);
scalar_t__ cgio_path_add(char const *);
int cg_add_path(const char *path) {
  if (cgio_path_add(path)) {
    cg_io_error("cgio_path_add");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cg_add_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <cgio_path_add@plt>
cmp    $0x0,%rax
je     1157 <cg_add_path+0x37>
lea    0xeba(%rip),%rdi
call   1040 <cg_io_error@plt>
movl   $0x1,-0x4(%rbp)
jmp    115e <cg_add_path+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cg_add_path>:
push   %rax
call   1030 <cgio_path_add@plt>
test   %rax,%rax
je     113e <cg_add_path+0x1e>
lea    0xece(%rip),%rdi
call   1040 <cg_io_error@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"cgio_path_add\00"
define i32 @cg_add_path(i8* %0) {
%2 = tail call i64 @cgio_path_add(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @cg_io_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ clock();
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ mix(int /*<<< orphan*/, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void seed_rand() { srand(mix(clock(), time(NULL), getpid())); }


x86 assembly (clang, -O0):
<seed_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <clock@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1070 <time@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    %eax,%edx
call   1050 <mix@plt>
mov    %eax,%edi
call   1060 <srand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seed_rand>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <clock@plt>
mov    %eax,%ebx
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %eax,%edx
call   1050 <mix@plt>
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <srand@plt>

LLVM IR (-O0):
define void @seed_rand() {
%1 = call i32 (...) @clock()
%2 = call i32 @time(i32* null)
%3 = call i32 (...) @getpid()
%4 = call i32 @mix(i32 %1, i32 %2, i32 %3)
%5 = call i32 @srand(i32 %4)
ret void
}

LLVM IR (-O2):
define void @seed_rand() {
%1 = tail call i32 (...) @clock()
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 @mix(i32 %1, i32 %2, i32 %3)
%5 = tail call i32 @srand(i32 %4)
ret void
}
unsigned long nsec_to_usec(unsigned long nsec) { return nsec / 1000; }


x86 assembly (clang, -O0):
<nsec_to_usec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsec_to_usec>:
mov    %rdi,%rax
shr    $0x3,%rax
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
mul    %rcx
mov    %rdx,%rax
shr    $0x4,%rax
ret

LLVM IR (-O0):
define i64 @nsec_to_usec(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = udiv i64 %3, 1000
ret i64 %4
}

LLVM IR (-O2):
define i64 @nsec_to_usec(i64 %0) {
%2 = udiv i64 %0, 1000
ret i64 %2
}
/* Variables and functions */
unsigned long long get_systime();
void delay(unsigned int ms) {
  unsigned long long int alermTime;
  alermTime = get_systime() + ms * 1000;
  while (get_systime() < alermTime)
    ;
  return;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <get_systime@plt>
imul   $0x3e8,-0x4(%rbp),%ecx
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <get_systime@plt>
cmp    -0x10(%rbp),%rax
jae    1148 <delay+0x38>
jmp    1132 <delay+0x22>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <get_systime@plt>
imul   $0x3e8,%ebx,%ebx
add    %rax,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <get_systime@plt>
cmp    %rbx,%rax
jb     1130 <delay+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define void @delay(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = call i64 (...) @get_systime()
%5 = load i32, i32* %2
%6 = mul i32 %5, 1000
%7 = zext i32 %6 to i64
%8 = add i64 %4, %7
store i64 %8, i64* %3
br label %9
9: ; preds = %13, %1
%10 = call i64 (...) @get_systime()
%11 = load i64, i64* %3
%12 = icmp ult i64 %10, %11
br i1 %12, label %13, label %14
13: ; preds = %9
br label %9
14: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @delay(i32 %0) {
%2 = tail call i64 (...) @get_systime()
%3 = mul i32 %0, 1000
%4 = zext i32 %3 to i64
%5 = add i64 %2, %4
br label %6
6: ; preds = %6, %1
%7 = tail call i64 (...) @get_systime()
%8 = icmp ult i64 %7, %5
br i1 %8, label %6, label %9
9: ; preds = %6
ret void
}
/* Variables and functions */
scalar_t__ isupper(int);
int tolower(int c) {
  if (isupper(c)) {
    c += 'a' - 'A';
  }
  return c;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     1136 <tolower+0x26>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <isupper@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isupper(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 32
store i32 %8, i32* %2
br label %9
9: ; preds = %6, %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
unsigned int _new_capacity(unsigned int capacity) {
  if (capacity == 0)
    capacity = 4;
  else if (capacity < 1024)
    capacity *= 2;
  else
    capacity += 1024;
  return capacity;
}


x86 assembly (clang, -O0):
<_new_capacity>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    111d <_new_capacity+0x1d>
movl   $0x4,-0x4(%rbp)
jmp    1148 <_new_capacity+0x48>
cmpl   $0x400,-0x4(%rbp)
jae    1138 <_new_capacity+0x38>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1143 <_new_capacity+0x43>
mov    -0x4(%rbp),%eax
add    $0x400,%eax
mov    %eax,-0x4(%rbp)
jmp    1148 <_new_capacity+0x48>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_new_capacity>:
test   %edi,%edi
je     1111 <_new_capacity+0x11>
mov    %edi,%eax
cmp    $0x3ff,%edi
ja     1117 <_new_capacity+0x17>
add    %eax,%eax
ret
mov    $0x4,%eax
ret
add    $0x400,%eax
ret

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

LLVM IR (-O2):
define i32 @_new_capacity(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 1024
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = shl nuw nsw i32 %0, 1
br label %9
7: ; preds = %3
%8 = add i32 %0, 1024
br label %9
9: ; preds = %1, %5, %7
%10 = phi i32 [ %6, %5 ], [ %8, %7 ], [ 4, %1 ]
ret i32 %10
}
int test_imm_0Fuint16_reg(unsigned short val) {
  return ((val) & (0x0F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_0Fuint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xf,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_0Fuint16_reg>:
test   $0xf,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_0Fuint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 15
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_0Fuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 15
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ *myfopen(char *);
int main() {
  FILE *fp1;
  FILE *fp2;
  fp1 = myfopen("test1.txt");
  fp2 = myfopen("test2.txt");
  fprintf(fp1, "Testing...\n");
  fclose(fp1);
  fprintf(fp2, "Testing...\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <myfopen@plt>
mov    %rax,-0x8(%rbp)
lea    0xebb(%rip),%rdi
call   1030 <myfopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x10(%rbp),%rdi
lea    0xe98(%rip),%rsi
call   1050 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
lea    0xec4(%rip),%rdi
call   1030 <myfopen@plt>
mov    %rax,%rbx
lea    0xebf(%rip),%rdi
call   1030 <myfopen@plt>
mov    %rax,%r14
lea    0xeba(%rip),%r15
mov    $0xb,%esi
mov    $0x1,%edx
mov    %r15,%rdi
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    $0xb,%esi
mov    $0x1,%edx
mov    %r15,%rdi
mov    %r14,%rcx
call   1050 <fwrite@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [10 x i8] c"test1.txt\00"
@.str.1 = [10 x i8] c"test2.txt\00"
@.str.2 = [12 x i8] c"Testing...\0A\00"
define i32 @main() {
%1 = alloca i32*
%2 = alloca i32*
%3 = call i32* @myfopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i32* %3, i32** %1
%4 = call i32* @myfopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %2
%5 = load i32*, i32** %1
%6 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32*, i32** %1
%8 = call i32 @fclose(i32* %7)
%9 = load i32*, i32** %2
%10 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"test1.txt\00"
@.str.1 = [10 x i8] c"test2.txt\00"
@.str.2 = [12 x i8] c"Testing...\0A\00"
define i32 @main() {
%1 = tail call i32* @myfopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32* @myfopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i64 11, i64 1, i32* %1)
%4 = tail call i32 @fclose(i32* %1)
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i64 11, i64 1, i32* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ lcd_data(char const);
void write(const char *A) {
  while (*A != '\0') {
    lcd_data(*A);
    A++;
    delay(10);
  }
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1163 <write+0x43>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1040 <lcd_data@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    $0xa,%edi
call   1030 <delay@plt>
jmp    112c <write+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     114d <write+0x2d>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1040 <lcd_data@plt>
mov    $0xa,%edi
call   1030 <delay@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <write+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @write(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @lcd_data(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @delay(i32 10)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bfwrite(char *);
void cmdLoopEnd(void) { bfwrite("]"); }


x86 assembly (clang, -O0):
<cmdLoopEnd>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <bfwrite@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"]\00"
define void @cmdLoopEnd() {
%1 = call i32 @bfwrite(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"]\00"
define void @cmdLoopEnd() {
%1 = tail call i32 @bfwrite(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
int ffs(valu)
register int valu;
{
  register int bit;
  if (valu == 0)
    return 0;
  for (bit = 1; !(valu & 1); bit++)
    valu >>= 1;
  return bit;
}


x86 assembly (clang, -O0):
<ffs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <ffs+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    115c <ffs+0x5c>
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    113f <ffs+0x3f>
jmp    1156 <ffs+0x56>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <ffs+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffs>:
test   %edi,%edi
je     112e <ffs+0x2e>
mov    $0x1,%eax
test   $0x1,%dil
jne    112d <ffs+0x2d>
mov    $0x1,%eax
mov    %edi,%ecx
cs nopw 0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
test   $0x2,%dil
mov    %ecx,%edi
je     1120 <ffs+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ffs(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = and i32 %0, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %3, %6
%7 = phi i32 [ %10, %6 ], [ 1, %3 ]
%8 = phi i32 [ %9, %6 ], [ %0, %3 ]
%9 = ashr i32 %8, 1
%10 = add nuw nsw i32 %7, 1
%11 = and i32 %8, 2
%12 = icmp eq i32 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %6, %3, %1
%14 = phi i32 [ 0, %1 ], [ 1, %3 ], [ %10, %6 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, char, int);
char *strncat(char *, char *, int);
void test2(char *to, int to_size, char *from) {
  memset(to, 'z', to_size);
  char *r = strncat(to, from, 1);
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x7a,%esi
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1040 <strncat@plt>
mov    %rax,-0x20(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %esi,%edx
mov    %rdi,%rbx
mov    $0x7a,%esi
call   1030 <memset@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strncat@plt>

LLVM IR (-O0):
define void @test2(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i32 @memset(i8* %8, i8 signext 122, i32 %9)
%11 = load i8*, i8** %4
%12 = load i8*, i8** %6
%13 = call i8* @strncat(i8* %11, i8* %12, i32 1)
store i8* %13, i8** %7
ret void
}

LLVM IR (-O2):
define void @test2(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @memset(i8* %0, i8 signext 122, i32 %1)
%5 = tail call i8* @strncat(i8* %0, i8* %2, i32 1)
ret void
}
void av_strireplace() {}


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

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

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

LLVM IR (-O2):
define void @av_strireplace() {
ret void
}
/* Variables and functions */
int u8islatini(int /*<<< orphan*/);
int /*<<< orphan*/ u8tointc(char *);
int u8islatinc(char *c) { return u8islatini(u8tointc(c)); }


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

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

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

LLVM IR (-O2):
define i32 @u8islatinc(i8* %0) {
%2 = tail call i32 @u8tointc(i8* %0)
%3 = tail call i32 @u8islatini(i32 %2)
ret i32 %3
}
const char *TA_GetVersionString(void) {
  return "0"
         "."
         "4"
         "."
         "0"
         " ("
         "Mar 15 2022"
         " "
         "22:59:09"
         ")";
}


x86 assembly (clang, -O0):
<TA_GetVersionString>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TA_GetVersionString>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [29 x i8] c"0.4.0 (Mar 15 2022 22:59:09)\00"
define i8* @TA_GetVersionString() {
ret i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [29 x i8] c"0.4.0 (Mar 15 2022 22:59:09)\00"
define i8* @TA_GetVersionString() {
ret i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void func() { printf("this is func()\n"); }


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"this is func()\0A\00"
define void @func() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"this is func()\00"
define void @func() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ Widget;

/* Variables and functions */
int /*<<< orphan*/ XFlush(int /*<<< orphan*/);
int /*<<< orphan*/ XUndefineCursor(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ XtDisplay(int /*<<< orphan*/);
int /*<<< orphan*/ XtWindow(int /*<<< orphan*/);
void _DtTurnOffHourGlass(Widget w) {
  XUndefineCursor(XtDisplay(w), XtWindow(w));
  XFlush(XtDisplay(w));
}


x86 assembly (clang, -O0):
<_DtTurnOffHourGlass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <XtDisplay@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <XtWindow@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1050 <XUndefineCursor@plt>
mov    -0x4(%rbp),%edi
call   1040 <XtDisplay@plt>
mov    %eax,%edi
call   1060 <XFlush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_DtTurnOffHourGlass>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1040 <XtDisplay@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <XtWindow@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1050 <XUndefineCursor@plt>
mov    %ebx,%edi
call   1040 <XtDisplay@plt>
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <XFlush@plt>

LLVM IR (-O0):
define void @_DtTurnOffHourGlass(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @XtDisplay(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @XtWindow(i32 %5)
%7 = call i32 @XUndefineCursor(i32 %4, i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @XtDisplay(i32 %8)
%10 = call i32 @XFlush(i32 %9)
ret void
}

LLVM IR (-O2):
define void @_DtTurnOffHourGlass(i32 %0) {
%2 = tail call i32 @XtDisplay(i32 %0)
%3 = tail call i32 @XtWindow(i32 %0)
%4 = tail call i32 @XUndefineCursor(i32 %2, i32 %3)
%5 = tail call i32 @XtDisplay(i32 %0)
%6 = tail call i32 @XFlush(i32 %5)
ret void
}
/* Variables and functions */
char *ultoa_wp(unsigned long, char *, unsigned int, int, char);
char *ultoa_w(unsigned long val, char *buffer, unsigned int base, int width) {
  return ultoa_wp(val, buffer, base, width, ' ');
}


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

x86 assembly (clang, -O2):
<ultoa_w>:
mov    $0x20,%r8d
jmp    1030 <ultoa_wp@plt>

LLVM IR (-O0):
define i8* @ultoa_w(i64 %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i64 %0, i64* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i64, i64* %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i8* @ultoa_wp(i64 %9, i8* %10, i32 %11, i32 %12, i8 signext 32)
ret i8* %13
}

LLVM IR (-O2):
define i8* @ultoa_w(i64 %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i8* @ultoa_wp(i64 %0, i8* %1, i32 %2, i32 %3, i8 signext 32)
ret i8* %5
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long long microseconds(void) {
  struct timeval tv;
  long long mst;
  gettimeofday(&tv, NULL);
  mst = ((long long)tv.tv_sec) * 1000000;
  mst += tv.tv_usec;
  return mst;
}


x86 assembly (clang, -O0):
<microseconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<microseconds>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x10(%rsp),%rax
add    0x8(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @microseconds() {
%1 = alloca %struct.timeval
%2 = alloca i64
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000000
store i64 %6, i64* %2
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i64, i64* %7
%9 = load i64, i64* %2
%10 = add nsw i64 %9, %8
store i64 %10, i64* %2
%11 = load i64, i64* %2
ret i64 %11
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @microseconds() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = add nsw i64 %6, %8
ret i64 %9
}