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

/* Variables and functions */
int /*<<< orphan*/ CPU_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ CPU_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ sched_setaffinity(int /*<<< orphan*/, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void set_cpu_affinity(int cpu) {
  cpu_set_t coremask;
  CPU_ZERO(&coremask);
  CPU_SET(cpu, &coremask);
  if (sched_setaffinity(0, sizeof(cpu_set_t), &coremask) != 0)
    fprintf(stderr, "Unable to set affinity. %m\n");
}


x86 assembly (clang, -O0):
<set_cpu_affinity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <CPU_ZERO@plt>
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1060 <CPU_SET@plt>
xor    %edi,%edi
mov    $0x4,%esi
lea    -0x8(%rbp),%rdx
call   1030 <sched_setaffinity@plt>
cmp    $0x0,%rax
je     118f <set_cpu_affinity+0x4f>
mov    0x2e5f(%rip),%rax
mov    (%rax),%edi
lea    0xe76(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_cpu_affinity>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1050 <CPU_ZERO@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1060 <CPU_SET@plt>
xor    %edi,%edi
mov    $0x4,%esi
mov    %r14,%rdx
call   1030 <sched_setaffinity@plt>
test   %rax,%rax
je     1186 <set_cpu_affinity+0x46>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
lea    0xe7f(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"Unable to set affinity. %m\0A\00"
define void @set_cpu_affinity(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @CPU_ZERO(i32* %3)
%5 = load i32, i32* %2
%6 = call i32 @CPU_SET(i32 %5, i32* %3)
%7 = call i64 @sched_setaffinity(i32 0, i32 4, i32* %3)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"Unable to set affinity. %m\0A\00"
define void @set_cpu_affinity(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @CPU_ZERO(i32* %2)
%5 = call i32 @CPU_SET(i32 %0, i32* %2)
%6 = call i64 @sched_setaffinity(i32 0, i32 4, i32* %2)
%7 = icmp eq i64 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %8, %1
ret void
}
/* Variables and functions */
size_t parent(int node) { return (node - 1) / 2; }


x86 assembly (clang, -O0):
<parent>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<parent>:
mov    %edi,%eax
add    $0xffffffff,%eax
shr    $0x1f,%eax
add    %edi,%eax
add    $0xffffffff,%eax
sar    %eax
cltq
ret

LLVM IR (-O0):
define i64 @parent(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
%5 = sdiv i32 %4, 2
%6 = sext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @parent(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = sdiv i32 %2, 2
%4 = sext i32 %3 to i64
ret i64 %4
}
/* Variables and functions */
char *basename(char *);
int /*<<< orphan*/ mintaka_set_fullpath_filebase(char const *);
char *strdup(char const *);
void mintaka_set_filebase(const char *tracefile_filebase) {
  const char *nopath_filebase;
  char *copy = strdup(tracefile_filebase);
  nopath_filebase = basename(copy);
  mintaka_set_fullpath_filebase(nopath_filebase);
}


x86 assembly (clang, -O0):
<mintaka_set_filebase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <basename@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <mintaka_set_fullpath_filebase@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mintaka_set_filebase>:
push   %rax
call   1040 <strdup@plt>
mov    %rax,%rdi
call   1030 <basename@plt>
mov    %rax,%rdi
pop    %rax
jmp    1050 <mintaka_set_fullpath_filebase@plt>

LLVM IR (-O0):
define void @mintaka_set_filebase(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @strdup(i8* %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = call i8* @basename(i8* %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = call i32 @mintaka_set_fullpath_filebase(i8* %9)
ret void
}

LLVM IR (-O2):
define void @mintaka_set_filebase(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = tail call i8* @basename(i8* %2)
%4 = tail call i32 @mintaka_set_fullpath_filebase(i8* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int read_bit(int /*<<< orphan*/ *);
int read_bits(int, int /*<<< orphan*/ *);
int a7_read_mask_index(FILE *in, int cur_mask_id) {
  if (read_bit(in) == 1) {
    return read_bits(20, in);
  } else {
    return cur_mask_id + read_bits(3, in);
  }
}


x86 assembly (clang, -O0):
<a7_read_mask_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <read_bit@plt>
cmp    $0x1,%eax
jne    1157 <a7_read_mask_index+0x37>
mov    -0x10(%rbp),%rsi
mov    $0x14,%edi
call   1030 <read_bits@plt>
mov    %eax,-0x4(%rbp)
jmp    1175 <a7_read_mask_index+0x55>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x3,%edi
call   1030 <read_bits@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a7_read_mask_index>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <read_bit@plt>
cmp    $0x1,%eax
jne    1145 <a7_read_mask_index+0x25>
mov    $0x14,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <read_bits@plt>
mov    $0x3,%edi
mov    %rbx,%rsi
call   1030 <read_bits@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @a7_read_mask_index(i32* %0, i32 %1) {
%3 = tail call i32 @read_bit(i32* %0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @read_bits(i32 20, i32* %0)
br label %10
7: ; preds = %2
%8 = tail call i32 @read_bits(i32 3, i32* %0)
%9 = add nsw i32 %8, %1
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ %6, %5 ], [ %9, %7 ]
ret i32 %11
}
void INT_Excep_OST_OST(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_OST_OST() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(unsigned char const *, int, int,
                          int /*<<< orphan*/ *);
int write_png_magic(FILE *fp) {
  static const unsigned char png_magic[8] = {137, 80, 78, 71, 13, 10, 26, 10};
  fwrite(png_magic, 1, 8, fp);
}


x86 assembly (clang, -O0):
<write_png_magic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    0xed9(%rip),%rdi
mov    $0x1,%esi
mov    $0x8,%edx
call   1030 <fwrite@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_png_magic>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x1,%esi
mov    $0x8,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@write_png_magic.png_magic = internal constant [8 x i8] c"\89PNG\0D\0A\1A\0A"
define i32 @write_png_magic(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = call i32 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @write_png_magic.png_magic, i64 0, i64 0), i32 1, i32 8, i32* %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
@write_png_magic.png_magic = internal constant [8 x i8] c"\89PNG\0D\0A\1A\0A"
define i32 @write_png_magic(i32* nocapture %0) {
%2 = tail call i32 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @write_png_magic.png_magic, i64 0, i64 0), i32 1, i32 8, i32* %0)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void _test_soft_timer_set_counter(uint32_t counter_value) { return; }


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

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

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

LLVM IR (-O2):
define void @_test_soft_timer_set_counter(i32 %0) {
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISLNK(int /*<<< orphan*/);
scalar_t__ lstat(char *, struct stat *);
int is_link(char *file) {
  struct stat buf;
  if (lstat(file, &buf) == 0) {
    return S_ISLNK(buf.st_mode);
  }
}


x86 assembly (clang, -O0):
<is_link>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <lstat@plt>
cmp    $0x0,%rax
jne    114e <is_link+0x2e>
mov    -0x18(%rbp),%edi
call   1030 <S_ISLNK@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_link>:
push   %rax
mov    %rsp,%rsi
call   1040 <lstat@plt>
test   %rax,%rax
je     1130 <is_link+0x10>
pop    %rcx
ret
mov    (%rsp),%edi
pop    %rax
jmp    1030 <S_ISLNK@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @is_link(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @lstat(i8* %5, %struct.stat* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i32 @S_ISLNK(i32 %10)
store i32 %11, i32* %2
br label %12
12: ; preds = %8, %1
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_link(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @lstat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @S_ISLNK(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ undef, %1 ]
ret i32 %11
}
double sqdis(double ax, double ay, double bx, double by) {
  return (ax - bx) * (ax - bx) + (ay - by) * (ay - by);
}


x86 assembly (clang, -O0):
<sqdis>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
subsd  -0x18(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm3
subsd  -0x20(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqdis>:
subsd  %xmm2,%xmm0
subsd  %xmm3,%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @sqdis(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %7
%11 = fsub double %9, %10
%12 = load double, double* %5
%13 = load double, double* %7
%14 = fsub double %12, %13
%15 = load double, double* %6
%16 = load double, double* %8
%17 = fsub double %15, %16
%18 = load double, double* %6
%19 = load double, double* %8
%20 = fsub double %18, %19
%21 = fmul double %17, %20
%22 = call double @llvm.fmuladd.f64(double %11, double %14, double %21)
ret double %22
}

LLVM IR (-O2):
define double @sqdis(double %0, double %1, double %2, double %3) {
%5 = fsub double %0, %2
%6 = fsub double %1, %3
%7 = fmul double %6, %6
%8 = tail call double @llvm.fmuladd.f64(double %5, double %5, double %7)
ret double %8
}
unsigned int f(unsigned int a, unsigned int b, unsigned int c) {
  a += (b >> 16) * (c >> 16);
  if (!a)
    return 10;
  return a;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
mov    -0x10(%rbp),%ecx
shr    $0x10,%ecx
imul   %ecx,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1138 <f+0x38>
movl   $0xa,-0x4(%rbp)
jmp    113e <f+0x3e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
shr    $0x10,%esi
shr    $0x10,%edx
imul   %esi,%edx
add    %edi,%edx
mov    $0xa,%eax
cmovne %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2) {
%4 = lshr i32 %1, 16
%5 = lshr i32 %2, 16
%6 = mul nuw i32 %5, %4
%7 = add i32 %6, %0
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i32 10, i32 %7
ret i32 %9
}
struct ListNode *deleteNode(struct ListNode *list, int val) {}


x86 assembly (clang, -O0):
<deleteNode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ListNode = type opaque
define %struct.ListNode* @deleteNode(%struct.ListNode* %0, i32 %1) {
%3 = alloca %struct.ListNode*
%4 = alloca %struct.ListNode*
%5 = alloca i32
store %struct.ListNode* %0, %struct.ListNode** %4
store i32 %1, i32* %5
%6 = load %struct.ListNode*, %struct.ListNode** %3
ret %struct.ListNode* %6
}

LLVM IR (-O2):
%struct.ListNode = type opaque
define noalias %struct.ListNode* @deleteNode(%struct.ListNode* nocapture readnone %0, i32 %1) {
ret %struct.ListNode* undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ _DIAGASSERT(int /*<<< orphan*/);
int __sferror(int /*<<< orphan*/ *);
int ferror(FILE *fp) {
  int r;
  _DIAGASSERT(fp != NULL);
  ;
  r = __sferror(fp);
  ;
  return r;
}


x86 assembly (clang, -O0):
<ferror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <_DIAGASSERT@plt>
mov    -0x8(%rbp),%rdi
call   1040 <__sferror@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ferror>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <_DIAGASSERT@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <__sferror@plt>

LLVM IR (-O0):
define i32 @ferror(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
%7 = call i32 @_DIAGASSERT(i32 %6)
%8 = load i32*, i32** %2
%9 = call i32 @__sferror(i32* %8)
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @ferror(i32* %0) {
%2 = icmp ne i32* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @_DIAGASSERT(i32 %3)
%5 = tail call i32 @__sferror(i32* %0)
ret i32 %5
}
int foo(int x) { return x * 25; }


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

x86 assembly (clang, -O2):
<foo>:
lea    (%rdi,%rdi,4),%eax
lea    (%rax,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 25
ret i32 %4
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = mul nsw i32 %0, 25
ret i32 %2
}
int f(int x[5]) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @f(i32* nocapture readnone %0) {
ret i32 0
}
void f1(void) {
#pragma omp barrier
}


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

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

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

LLVM IR (-O2):
define void @f1() {
ret void
}
void test_ptr(int *p) { *p = 212121; }


x86 assembly (clang, -O0):
<test_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x33c99,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ptr>:
movl   $0x33c99,(%rdi)
ret

LLVM IR (-O0):
define void @test_ptr(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
store i32 212121, i32* %3
ret void
}

LLVM IR (-O2):
define void @test_ptr(i32* nocapture writeonly %0) {
store i32 212121, i32* %0
ret void
}
/* Type definitions */
struct shared_network {
  int dummy;
};
struct parse {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ parse_warn(struct parse *, char *);
int /*<<< orphan*/ skip_to_semi(struct parse *);
void parse_subnet6_declaration(struct parse *cfile,
                               struct shared_network *share) {
  parse_warn(cfile, "No DHCPv6 support.");
  skip_to_semi(cfile);
}


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

x86 assembly (clang, -O2):
<parse_subnet6_declaration>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1030 <parse_warn@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <skip_to_semi@plt>

LLVM IR (-O0):
%struct.parse = type { i32 }
%struct.shared_network = type { i32 }
@.str = [19 x i8] c"No DHCPv6 support.\00"
define void @parse_subnet6_declaration(%struct.parse* %0, %struct.shared_network* %1) {
%3 = alloca %struct.parse*
%4 = alloca %struct.shared_network*
store %struct.parse* %0, %struct.parse** %3
store %struct.shared_network* %1, %struct.shared_network** %4
%5 = load %struct.parse*, %struct.parse** %3
%6 = call i32 @parse_warn(%struct.parse* %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = load %struct.parse*, %struct.parse** %3
%8 = call i32 @skip_to_semi(%struct.parse* %7)
ret void
}

LLVM IR (-O2):
%struct.parse = type { i32 }
%struct.shared_network = type { i32 }
@.str = [19 x i8] c"No DHCPv6 support.\00"
define void @parse_subnet6_declaration(%struct.parse* %0, %struct.shared_network* nocapture readnone %1) {
%3 = tail call i32 @parse_warn(%struct.parse* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @skip_to_semi(%struct.parse* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
main() {
  char nome[8] = "Carlos";
  char outro[10] = "Antonio";
  printf("%s \n", nome);
  strcpy(nome, outro);
  printf("%s \n", nome);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x12(%rbp)
mov    0xecb(%rip),%ax
mov    %ax,-0xa(%rbp)
lea    -0x8(%rbp),%rsi
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
lea    -0x8(%rbp),%rdi
lea    -0x12(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x8(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movabs $0x736f6c726143,%rax
mov    %rax,0x10(%rsp)
movabs $0x6f696e6f746e41,%rax
mov    %rax,(%rsp)
movw   $0x0,0x8(%rsp)
lea    0xeb8(%rip),%r14
lea    0x10(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.nome = [8 x i8] c"Carlos\00\00"
@__const.main.outro = [10 x i8] c"Antonio\00\00\00"
@.str = [5 x i8] c"%s \0A\00"
define i32 @main() {
%1 = alloca [8 x i8]
%2 = alloca [10 x i8]
%3 = bitcast [8 x i8]* %1 to i8*
%4 = bitcast [10 x i8]* %2 to i8*
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%9 = call i32 @strcpy(i8* %7, i8* %8)
%10 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.outro = [10 x i8] c"Antonio\00\00\00"
@.str = [5 x i8] c"%s \0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca [10 x i8]
%3 = bitcast i64* %1 to i8*
store i64 126922397999427, i64* %1
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = call i32 @strcpy(i8* %3, i8* %4)
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Type definitions */
typedef int wchar_t;

/* Variables and functions */
scalar_t__ malloc(int const);
int /*<<< orphan*/ wmemcpy(int *, int const *, int const);
wchar_t *StringUtilities_copy_string_part(const wchar_t *string,
                                          const int length) {
  wchar_t *copy = (wchar_t *)malloc((length + 1) * sizeof(wchar_t));
  wmemcpy(copy, string, length);
  copy[length] = L'\0';
  return copy;
}


x86 assembly (clang, -O0):
<StringUtilities_copy_string_part>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <wmemcpy@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StringUtilities_copy_string_part>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x4(,%r15,4),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1030 <wmemcpy@plt>
movslq %r15d,%rax
movl   $0x0,(%rbx,%rax,4)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32* @StringUtilities_copy_string_part(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 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = mul i64 %8, 4
%10 = trunc i64 %9 to i32
%11 = call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %5
%13 = load i32*, i32** %5
%14 = load i32*, i32** %3
%15 = load i32, i32* %4
%16 = call i32 @wmemcpy(i32* %13, i32* %14, i32 %15)
%17 = load i32*, i32** %5
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
store i32 0, i32* %20
%21 = load i32*, i32** %5
ret i32* %21
}

LLVM IR (-O2):
define i32* @StringUtilities_copy_string_part(i32* %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = add i32 %3, 4
%5 = tail call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to i32*
%7 = tail call i32 @wmemcpy(i32* %6, i32* %0, i32 %1)
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 %8
store i32 0, i32* %9
ret i32* %6
}
int lchild(int i) { return 2 * i; }


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

x86 assembly (clang, -O2):
<lchild>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @lchild(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int core3_safe(char const *);
int U_EMRSETROP2_safe(const char *record) { return (core3_safe(record)); }


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

x86 assembly (clang, -O2):
<U_EMRSETROP2_safe>:
jmp    1030 <core3_safe@plt>

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

LLVM IR (-O2):
define i32 @U_EMRSETROP2_safe(i8* %0) {
%2 = tail call i32 @core3_safe(i8* %0)
ret i32 %2
}
double vareph(int ura) {
  const double uraval[] = {0.08, 0.11, 0.15, 0.21, 0.30, 0.43, 0.60, 0.85,
                           1.20, 1.70, 2.40, 3.40, 4.85, 6.85, 9.65, 9.65};
  if (ura < 0 || 15 < ura)
    ura = 15;
  return uraval[ura];
}


x86 assembly (clang, -O0):
<vareph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x90(%rbp),%rdi
lea    0xed4(%rip),%rsi
mov    $0x80,%edx
call   1030 <memcpy@plt>
cmpl   $0x0,-0x4(%rbp)
jl     114e <vareph+0x3e>
mov    $0xf,%eax
cmp    -0x4(%rbp),%eax
jge    1155 <vareph+0x45>
movl   $0xf,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movsd  -0x90(%rbp,%rax,8),%xmm0
ff ff
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vareph>:
cmp    $0xf,%edi
mov    $0xf,%eax
cmovb  %edi,%eax
lea    0xeee(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
ret

LLVM IR (-O0):
@__const.vareph.uraval = [16 x double] [double 8.000000e-02, double 1.100000e-01, double 1.500000e-01, double 2.100000e-01, double 3.000000e-01, double 4.300000e-01, double 6.000000e-01, double 8.500000e-01, double 1.200000e+00, double 1.700000e+00, double 2.400000e+00, double 3.400000e+00, double 4.850000e+00, double 6.850000e+00, double 9.650000e+00, double 9.650000e+00]
define double @vareph(i32 %0) {
%2 = alloca i32
%3 = alloca [16 x double]
store i32 %0, i32* %2
%4 = bitcast [16 x double]* %3 to i8*
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp slt i32 15, %8
br i1 %9, label %10, label %11
10: ; preds = %7, %1
store i32 15, i32* %2
br label %11
11: ; preds = %10, %7
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [16 x double], [16 x double]* %3, i64 0, i64 %13
%15 = load double, double* %14
ret double %15
}

LLVM IR (-O2):
@__const.vareph.uraval = [16 x double] [double 8.000000e-02, double 1.100000e-01, double 1.500000e-01, double 2.100000e-01, double 3.000000e-01, double 4.300000e-01, double 6.000000e-01, double 8.500000e-01, double 1.200000e+00, double 1.700000e+00, double 2.400000e+00, double 3.400000e+00, double 4.850000e+00, double 6.850000e+00, double 9.650000e+00, double 9.650000e+00]
define double @vareph(i32 %0) {
%2 = icmp ult i32 %0, 15
%3 = select i1 %2, i32 %0, i32 15
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds [16 x double], [16 x double]* @__const.vareph.uraval, i64 0, i64 %4
%6 = load double, double* %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ IIC_SCLHigh();
int /*<<< orphan*/ IIC_SCLLow();
int /*<<< orphan*/ IIC_SDAHigh();
int /*<<< orphan*/ IIC_SDALow();
int /*<<< orphan*/ IIC_Wait1uSec();
void IOIIC_Start(void) {
  IIC_SDAHigh();
  IIC_Wait1uSec();
  IIC_SCLHigh();
  IIC_Wait1uSec();
  IIC_SDALow();
  IIC_Wait1uSec();
  IIC_SCLLow();
  IIC_Wait1uSec();
}


x86 assembly (clang, -O0):
<IOIIC_Start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <IIC_SDAHigh@plt>
mov    $0x0,%al
call   1060 <IIC_Wait1uSec@plt>
mov    $0x0,%al
call   1050 <IIC_SCLHigh@plt>
mov    $0x0,%al
call   1060 <IIC_Wait1uSec@plt>
mov    $0x0,%al
call   1040 <IIC_SDALow@plt>
mov    $0x0,%al
call   1060 <IIC_Wait1uSec@plt>
mov    $0x0,%al
call   1030 <IIC_SCLLow@plt>
mov    $0x0,%al
call   1060 <IIC_Wait1uSec@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IOIIC_Start>:
push   %rax
xor    %eax,%eax
call   1070 <IIC_SDAHigh@plt>
xor    %eax,%eax
call   1060 <IIC_Wait1uSec@plt>
xor    %eax,%eax
call   1050 <IIC_SCLHigh@plt>
xor    %eax,%eax
call   1060 <IIC_Wait1uSec@plt>
xor    %eax,%eax
call   1040 <IIC_SDALow@plt>
xor    %eax,%eax
call   1060 <IIC_Wait1uSec@plt>
xor    %eax,%eax
call   1030 <IIC_SCLLow@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <IIC_Wait1uSec@plt>

LLVM IR (-O0):
define void @IOIIC_Start() {
%1 = call i32 (...) @IIC_SDAHigh()
%2 = call i32 (...) @IIC_Wait1uSec()
%3 = call i32 (...) @IIC_SCLHigh()
%4 = call i32 (...) @IIC_Wait1uSec()
%5 = call i32 (...) @IIC_SDALow()
%6 = call i32 (...) @IIC_Wait1uSec()
%7 = call i32 (...) @IIC_SCLLow()
%8 = call i32 (...) @IIC_Wait1uSec()
ret void
}

LLVM IR (-O2):
define void @IOIIC_Start() {
%1 = tail call i32 (...) @IIC_SDAHigh()
%2 = tail call i32 (...) @IIC_Wait1uSec()
%3 = tail call i32 (...) @IIC_SCLHigh()
%4 = tail call i32 (...) @IIC_Wait1uSec()
%5 = tail call i32 (...) @IIC_SDALow()
%6 = tail call i32 (...) @IIC_Wait1uSec()
%7 = tail call i32 (...) @IIC_SCLLow()
%8 = tail call i32 (...) @IIC_Wait1uSec()
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ S_IFCHR;
int32_t _fstat(int32_t fd, struct stat *st) {
  st->st_mode = S_IFCHR;
  return 0;
}


x86 assembly (clang, -O0):
<_fstat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ece(%rip),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fstat>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@S_IFCHR = global i32 0
define i32 @_fstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca %struct.stat*
store i32 %0, i32* %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i32, i32* @S_IFCHR
%6 = load %struct.stat*, %struct.stat** %4
%7 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
store i32 %5, i32* %7
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@S_IFCHR = global i32 0
define i32 @_fstat(i32 %0, %struct.stat* nocapture writeonly %1) {
%3 = load i32, i32* @S_IFCHR
%4 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
store i32 %3, i32* %4
ret i32 0
}
/* Variables and functions */
scalar_t__ compareSub(char *, char *, int);
char *compare_equalSub_notEq() {
  do {
    if (!(compareSub("Hello12345", "Hello23456", 6) != 0))
      return "Compare not equal sub strings";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<compare_equalSub_notEq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    0xee5(%rip),%rsi
mov    $0x6,%edx
call   1030 <compareSub@plt>
cmp    $0x0,%rax
jne    114a <compare_equalSub_notEq+0x3a>
lea    0xed5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1157 <compare_equalSub_notEq+0x47>
jmp    114f <compare_equalSub_notEq+0x3f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_equalSub_notEq>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xeec(%rip),%rsi
mov    $0x6,%edx
call   1030 <compareSub@plt>
xor    %ecx,%ecx
test   %rax,%rax
lea    0xee1(%rip),%rax
cmove  %rax,%rcx
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Hello12345\00"
@.str.1 = [11 x i8] c"Hello23456\00"
@.str.2 = [30 x i8] c"Compare not equal sub strings\00"
define i8* @compare_equalSub_notEq() {
%1 = alloca i8*
br label %2
2: ; preds = %0
%3 = call i64 @compareSub(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 6)
%4 = icmp ne i64 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %2
store i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8** %1
br label %8
6: ; preds = %2
br label %7
7: ; preds = %6
store i8* null, i8** %1
br label %8
8: ; preds = %7, %5
%9 = load i8*, i8** %1
ret i8* %9
}

LLVM IR (-O2):
@.str = [11 x i8] c"Hello12345\00"
@.str.1 = [11 x i8] c"Hello23456\00"
@.str.2 = [30 x i8] c"Compare not equal sub strings\00"
define i8* @compare_equalSub_notEq() {
%1 = tail call i64 @compareSub(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 6)
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* null
ret i8* %3
}
/* Variables and functions */
char *new_Token(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *copy_Token(char *s) {
  char *d = new_Token(strlen(s) + 1);
  strcpy(d, s);
  return d;
}


x86 assembly (clang, -O0):
<copy_Token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <new_Token@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_Token>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <new_Token@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @copy_Token(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @new_Token(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @copy_Token(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @new_Token(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
char *pm_allocrow(cols, size)
int cols;
int size;
{
  register char *itrow;
  itrow = (char *)malloc(cols * size);
  if (itrow == (char *)0)
    pm_error("out of memory allocating a row");
  return itrow;
}


x86 assembly (clang, -O0):
<pm_allocrow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
movslq %eax,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115a <pm_allocrow+0x3a>
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1040 <pm_error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm_allocrow>:
push   %rbx
imul   %esi,%edi
movslq %edi,%rdi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1142 <pm_allocrow+0x22>
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <pm_error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"out of memory allocating a row\00"
define i8* @pm_allocrow(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = mul nsw i32 %6, %7
%9 = sext i32 %8 to i64
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 (i8*, ...) bitcast (i32 (...)* @pm_error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@.str = [31 x i8] c"out of memory allocating a row\00"
define i8* @pm_allocrow(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 (i8*, ...) bitcast (i32 (...)* @pm_error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
ret i8* %5
}
int headers_is_error(int state) {
  switch (state) {
  case 0:
  case 5:
    return 0;
  default:
    return 1;
  }
}


x86 assembly (clang, -O0):
<headers_is_error>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     112b <headers_is_error+0x2b>
jmp    111a <headers_is_error+0x1a>
mov    -0xc(%rbp),%eax
sub    $0x5,%eax
jne    1137 <headers_is_error+0x37>
jmp    112b <headers_is_error+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    113e <headers_is_error+0x3e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<headers_is_error>:
test   %edi,%edi
setne  %al
cmp    $0x5,%edi
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @headers_is_error(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 0, label %5
i32 5, label %5
]
5: ; preds = %1, %1
store i32 0, i32* %2
br label %7
6: ; preds = %1
store i32 1, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @headers_is_error(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = icmp ne i32 %0, 5
%4 = and i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ *display;
};
typedef TYPE_1__ XAnyEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
void set_XAnyEvent_display(void *_p, void *_v) {
  ((XAnyEvent *)_p)->display = (Display *)_v;
}


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

x86 assembly (clang, -O2):
<set_XAnyEvent_display>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32* }
define void @set_XAnyEvent_display(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 = bitcast i8* %5 to i32*
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.TYPE_2__*
%9 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %8, i32 0, i32 0
store i32* %6, i32** %9
ret void
}

LLVM IR (-O2):
define void @set_XAnyEvent_display(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t shift_mix(uint64_t v) { return v ^ (v >> 47); }


x86 assembly (clang, -O0):
<shift_mix>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%edx
mov    $0x2f,%ecx
sar    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @shift_mix(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 47
%6 = xor i32 %3, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @shift_mix(i32 %0) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
void _print_ptr(void *d) { printf("%p", d); }


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

x86 assembly (clang, -O2):
<_print_ptr>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%p\00"
define void @_print_ptr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%p\00"
define void @_print_ptr(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(void *);
void fthread_exit_(void *status) { pthread_exit(status); }


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

x86 assembly (clang, -O2):
<fthread_exit_>:
jmp    1030 <pthread_exit@plt>

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

LLVM IR (-O2):
define void @fthread_exit_(i8* %0) {
%2 = tail call i32 @pthread_exit(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _c_setbyte(int);
void WAIT() {
  ;
  _c_setbyte(0x9b);
  ;
}


x86 assembly (clang, -O0):
<WAIT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9b,%edi
call   1030 <_c_setbyte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<WAIT>:
mov    $0x9b,%edi
jmp    1030 <_c_setbyte@plt>

LLVM IR (-O0):
define void @WAIT() {
%1 = call i32 @_c_setbyte(i32 155)
ret void
}

LLVM IR (-O2):
define void @WAIT() {
%1 = tail call i32 @_c_setbyte(i32 155)
ret void
}
/* Type definitions */
struct gsm_modul {
  int dummy;
};

/* Variables and functions */
int module_send_pin(struct gsm_modul *, char const *);
int gsm_send_pin(struct gsm_modul *gsm, const char *pin) {
  if (!gsm) {
    return -1;
  }
  return module_send_pin(gsm, pin);
}


x86 assembly (clang, -O0):
<gsm_send_pin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1137 <gsm_send_pin+0x27>
movl   $0xffffffff,-0x4(%rbp)
jmp    1147 <gsm_send_pin+0x37>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <module_send_pin@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsm_send_pin>:
test   %rdi,%rdi
je     111a <gsm_send_pin+0xa>
jmp    1030 <module_send_pin@plt>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
%struct.gsm_modul = type { i32 }
define i32 @gsm_send_pin(%struct.gsm_modul* %0, i8* %1) {
%3 = icmp eq %struct.gsm_modul* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @module_send_pin(%struct.gsm_modul* %0, i8* %1)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ -1, %2 ]
ret i32 %7
}
/* Type definitions */
struct sembuf {
  int sem_num;
  int sem_op;
  int /*<<< orphan*/ sem_flg;
};

/* Variables and functions */
int /*<<< orphan*/ SEM_UNDO;
int /*<<< orphan*/ semop(int const, struct sembuf *, int);
void __sema_unlock(const int semid, const int semnum) {
  struct sembuf op[1];
  op[0].sem_num = semnum;
  op[0].sem_op = 1;
  op[0].sem_flg = SEM_UNDO;
  semop(semid, op, 1);
}


x86 assembly (clang, -O0):
<__sema_unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0x1,-0x14(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sema_unlock>:
sub    $0x18,%rsp
mov    %esi,0x8(%rsp)
movl   $0x1,0xc(%rsp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x10(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i32, i32 }
@SEM_UNDO = global i32 0
define void @__sema_unlock(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [1 x %struct.sembuf]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = getelementptr inbounds [1 x %struct.sembuf], [1 x %struct.sembuf]* %5, i64 0, i64 0
%8 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %7, i32 0, i32 0
store i32 %6, i32* %8
%9 = getelementptr inbounds [1 x %struct.sembuf], [1 x %struct.sembuf]* %5, i64 0, i64 0
%10 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %9, i32 0, i32 1
store i32 1, i32* %10
%11 = load i32, i32* @SEM_UNDO
%12 = getelementptr inbounds [1 x %struct.sembuf], [1 x %struct.sembuf]* %5, i64 0, i64 0
%13 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %12, i32 0, i32 2
store i32 %11, i32* %13
%14 = load i32, i32* %3
%15 = getelementptr inbounds [1 x %struct.sembuf], [1 x %struct.sembuf]* %5, i64 0, i64 0
%16 = call i32 @semop(i32 %14, %struct.sembuf* %15, i32 1)
ret void
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i32, i32 }
@SEM_UNDO = global i32 0
define void @__sema_unlock(i32 %0, i32 %1) {
%3 = alloca [1 x %struct.sembuf]
%4 = bitcast [1 x %struct.sembuf]* %3 to i8*
%5 = getelementptr inbounds [1 x %struct.sembuf], [1 x %struct.sembuf]* %3, i64 0, i64 0
%6 = getelementptr inbounds [1 x %struct.sembuf], [1 x %struct.sembuf]* %3, i64 0, i64 0, i32 0
store i32 %1, i32* %6
%7 = getelementptr inbounds [1 x %struct.sembuf], [1 x %struct.sembuf]* %3, i64 0, i64 0, i32 1
store i32 1, i32* %7
%8 = load i32, i32* @SEM_UNDO
%9 = getelementptr inbounds [1 x %struct.sembuf], [1 x %struct.sembuf]* %3, i64 0, i64 0, i32 2
store i32 %8, i32* %9
%10 = call i32 @semop(i32 %0, %struct.sembuf* %5, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int dev_write(int i) {
  printf("%d", i);
  return 0;
}


x86 assembly (clang, -O0):
<dev_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @dev_write(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 0
}