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

/* Variables and functions */
int /*<<< orphan*/ little_endian_read_16(int /*<<< orphan*/ const *, int);
uint16_t sdp_event_query_attribute_value_get_record_id(const uint8_t *event) {
  return little_endian_read_16(event, 2);
}


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

x86 assembly (clang, -O2):
<sdp_event_query_attribute_value_get_record_id>:
mov    $0x2,%esi
jmp    1030 <little_endian_read_16@plt>

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

LLVM IR (-O2):
define i32 @sdp_event_query_attribute_value_get_record_id(i32* %0) {
%2 = tail call i32 @little_endian_read_16(i32* %0, i32 2)
ret i32 %2
}
void clear_covers(int nrow, int ncol, int *rowCover, int *colCover) {
  for (int r = 0; r < nrow; r++)
    rowCover[r] = 0;
  for (int c = 0; c < ncol; c++)
    colCover[c] = 0;
}


x86 assembly (clang, -O0):
<clear_covers>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1142 <clear_covers+0x42>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1119 <clear_covers+0x19>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1172 <clear_covers+0x72>
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1149 <clear_covers+0x49>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_covers>:
push   %rbp
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %esi,%ebp
test   %edi,%edi
jle    112f <clear_covers+0x1f>
mov    %edi,%eax
shl    $0x2,%rax
mov    %rdx,%rdi
xor    %esi,%esi
mov    %rax,%rdx
call   1030 <memset@plt>
test   %ebp,%ebp
jle    1143 <clear_covers+0x33>
mov    %ebp,%edx
shl    $0x2,%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @clear_covers(i32 %0, i32 %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = bitcast i32* %3 to i8*
%6 = icmp sgt i32 %0, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = bitcast i32* %2 to i8*
%9 = zext i32 %0 to i64
%10 = shl nuw nsw i64 %9, 2
br label %11
11: ; preds = %7, %4
%12 = icmp sgt i32 %1, 0
br i1 %12, label %13, label %16
13: ; preds = %11
%14 = zext i32 %1 to i64
%15 = shl nuw nsw i64 %14, 2
br label %16
16: ; preds = %13, %11
ret void
}
/* Type definitions */
typedef char uint8_t;
typedef size_t int32_t;

/* Variables and functions */
bool ParseString(const char *str, int32_t length, const uint8_t *data,
                 int32_t *parsed) {
  *parsed = (str[length] == '\0') ? length : 0;
  return str[length - 1] == data[length - 1];
}


x86 assembly (clang, -O0):
<ParseString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1136 <ParseString+0x36>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1141 <ParseString+0x41>
xor    %eax,%eax
mov    %rax,-0x28(%rbp)
jmp    1141 <ParseString+0x41>
mov    -0x28(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rdx
sub    $0x1,%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ParseString>:
xor    %eax,%eax
cmpb   $0x0,(%rdi,%rsi,1)
cmove  %rsi,%rax
mov    %rax,(%rcx)
mov    -0x1(%rdi,%rsi,1),%cl
xor    %eax,%eax
cmp    -0x1(%rdx,%rsi,1),%cl
sete   %al
ret

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

LLVM IR (-O2):
define i32 @ParseString(i8* nocapture %0, i64 %1, i8* nocapture %2, i64* nocapture writeonly %3) {
%5 = getelementptr inbounds i8, i8* %0, i64 %1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = select i1 %7, i64 %1, i64 0
store i64 %8, i64* %3
%9 = add i64 %1, -1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = getelementptr inbounds i8, i8* %2, i64 %9
%13 = load i8, i8* %12
%14 = icmp eq i8 %11, %13
%15 = zext i1 %14 to i32
ret i32 %15
}
void asus_bat_set_phone_bat(struct asus_bat_phone_bat_struct *pbs) {}


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

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

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

LLVM IR (-O2):
%struct.asus_bat_phone_bat_struct = type opaque
define void @asus_bat_set_phone_bat(%struct.asus_bat_phone_bat_struct* nocapture %0) {
ret void
}
/* Variables and functions */
double M_PI;
double sin(double);
double MAP_ITERATIVE(double x_n, int iteration) {
  return (sin((0.7 * M_PI) / x_n));
}


x86 assembly (clang, -O0):
<MAP_ITERATIVE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  0xed8(%rip),%xmm0
mov    0x2eb9(%rip),%rax
mulsd  (%rax),%xmm0
divsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAP_ITERATIVE>:
mov    0x2ed1(%rip),%rax
movsd  (%rax),%xmm1
mulsd  0xedd(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
jmp    1030 <sin@plt>

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @MAP_ITERATIVE(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load double, double* @M_PI
%6 = fmul double 0x3FE6666666666666, %5
%7 = load double, double* %3
%8 = fdiv double %6, %7
%9 = call double @sin(double %8)
ret double %9
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @MAP_ITERATIVE(double %0, i32 %1) {
%3 = load double, double* @M_PI
%4 = fmul double %3, 0x3FE6666666666666
%5 = fdiv double %4, %0
%6 = tail call double @sin(double %5)
ret double %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ gen_lohi_caps(int /*<<< orphan*/ *, int);
void gen_bound(FILE *outfile, char *regname, int dim, int lohi) {
  fprintf(outfile, "_SPS_REG_FLUFF_");
  gen_lohi_caps(outfile, lohi);
  fprintf(outfile, "(%s, %d)", regname, dim);
}


x86 assembly (clang, -O0):
<gen_bound>:
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
lea    0xebf(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1030 <gen_lohi_caps@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xeaa(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_bound>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edx,%r14d
mov    %rsi,%r15
mov    %rdi,%rbp
lea    0xeb7(%rip),%rdi
mov    $0xf,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
call   1050 <fwrite@plt>
mov    %rbp,%rdi
mov    %ebx,%esi
call   1030 <gen_lohi_caps@plt>
lea    0xea4(%rip),%rsi
mov    %rbp,%rdi
mov    %r15,%rdx
mov    %r14d,%ecx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"_SPS_REG_FLUFF_\00"
@.str.1 = [9 x i8] c"(%s, %d)\00"
define void @gen_bound(i32* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%11 = load i32*, i32** %5
%12 = load i32, i32* %8
%13 = call i32 @gen_lohi_caps(i32* %11, i32 %12)
%14 = load i32*, i32** %5
%15 = load i8*, i8** %6
%16 = load i32, i32* %7
%17 = call i32 (i32*, i8*, ...) @fprintf(i32* %14, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %15, i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"_SPS_REG_FLUFF_\00"
@.str.1 = [9 x i8] c"(%s, %d)\00"
define void @gen_bound(i32* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 15, i64 1, i32* %0)
%6 = tail call i32 @gen_lohi_caps(i32* %0, i32 %3)
%7 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ baz(int *);
void bar(void) {
  int i;
#pragma omp parallel
  {
#pragma omp for
    for (i = 0; i < 100; i++)
      baz(&i);
  }
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1140 <bar+0x30>
lea    -0x4(%rbp),%rdi
call   1030 <baz@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <bar+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <baz@plt>
mov    0xc(%rsp),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0xc(%rsp)
cmp    $0x63,%eax
jl     1130 <bar+0x20>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @bar() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = call i32 @baz(i32* %1)
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 1
store i32 %6, i32* %1
%7 = icmp slt i32 %5, 99
br i1 %7, label %3, label %8
8: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, size_t);
void *realloc(void *, size_t);
void *xrealloc(void *p, size_t len) {
  void *new = realloc(p, len);
  if (!new)
    die("realloc() failed (len=%zd)\n", len);
  return new;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115c <xrealloc+0x3c>
mov    -0x10(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1040 <die@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <xrealloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1040 <die@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [28 x i8] c"realloc() failed (len=%zd)\0A\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = load i64, i64* %4
%13 = call i32 @die(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %12)
br label %14
14: ; preds = %11, %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@.str = [28 x i8] c"realloc() failed (len=%zd)\0A\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @die(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %1)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
void *malloc(int const);
int /*<<< orphan*/ memset(void *, char, int const);
void eatmemory() {
  const int bytes = 1024 * 1024;
  void *p = malloc(bytes);
  memset(p, '\0', bytes);
}


x86 assembly (clang, -O0):
<eatmemory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x100000,-0x4(%rbp)
mov    $0x100000,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x100000,%edx
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eatmemory>:
push   %rax
mov    $0x100000,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x100000,%edx
pop    %rax
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @eatmemory() {
%1 = alloca i32
%2 = alloca i8*
store i32 1048576, i32* %1
%3 = call i8* @malloc(i32 1048576)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memset(i8* %4, i8 signext 0, i32 1048576)
ret void
}

LLVM IR (-O2):
define void @eatmemory() {
%1 = tail call dereferenceable_or_null(1048576) i8* @malloc(i32 1048576)
%2 = tail call i32 @memset(i8* %1, i8 signext 0, i32 1048576)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __assert_func(char *, int, char *, char *);
void force_error() { __assert_func("testcase.h", 38, "Init", "forced"); }


x86 assembly (clang, -O0):
<force_error>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x26,%esi
lea    0xee4(%rip),%rdx
lea    0xee2(%rip),%rcx
call   1030 <__assert_func@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<force_error>:
lea    0xee9(%rip),%rdi
lea    0xeed(%rip),%rdx
lea    0xeeb(%rip),%rcx
mov    $0x26,%esi
jmp    1030 <__assert_func@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"testcase.h\00"
@.str.1 = [5 x i8] c"Init\00"
@.str.2 = [7 x i8] c"forced\00"
define void @force_error() {
%1 = call i32 @__assert_func(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 38, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"testcase.h\00"
@.str.1 = [5 x i8] c"Init\00"
@.str.2 = [7 x i8] c"forced\00"
define void @force_error() {
%1 = tail call i32 @__assert_func(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 38, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
scalar_t__ strncmp(char const *, char const *, int /*<<< orphan*/);
bool oscap_str_startswith(const char *str, const char *prefix) {
  return strncmp(str, prefix, strlen(prefix)) == 0;
}


x86 assembly (clang, -O0):
<oscap_str_startswith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oscap_str_startswith>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @oscap_str_startswith(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @strncmp(i8* %5, i8* %6, i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @oscap_str_startswith(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
char toupper(char);
void chrUcase(char *string) {
  char *pw;
  if (!string)
    return;
  pw = string - 1;
  while (*(++pw)) {
    *pw = toupper(*pw);
  }
}


x86 assembly (clang, -O0):
<chrUcase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <chrUcase+0x1c>
jmp    116a <chrUcase+0x5a>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,0x1(%rax)
je     116a <chrUcase+0x5a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
jmp    1138 <chrUcase+0x28>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chrUcase>:
push   %rbx
test   %rdi,%rdi
je     1146 <chrUcase+0x36>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1146 <chrUcase+0x36>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <chrUcase+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @chrUcase(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %11, %6 ], [ %4, %3 ]
%8 = phi i8* [ %10, %6 ], [ %0, %3 ]
%9 = tail call signext i8 @toupper(i8 signext %7)
store i8 %9, i8* %8
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EX_OSERR;
int /*<<< orphan*/ pfpanic(char *, unsigned short, unsigned short, char const *,
                           char const *, int, int, int /*<<< orphan*/);
void __pfpanic_mutex_destroy(unsigned short _syslog, unsigned short _verbose,
                             const char *_function_name, const char *_file_name,
                             int _line_number, int _errno) {
  pfpanic("Unable to destroy mutex", _syslog, _verbose, _function_name,
          _file_name, _line_number, _errno, EX_OSERR);
}


x86 assembly (clang, -O0):
<__pfpanic_mutex_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %si,%ax
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x2(%rbp),%si
mov    -0x4(%rbp),%dx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
mov    -0x20(%rbp),%r10d
mov    0x2e8b(%rip),%rax
mov    (%rax),%eax
lea    0xea2(%rip),%rdi
movzwl %si,%esi
movzwl %dx,%edx
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <pfpanic@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__pfpanic_mutex_destroy>:
push   %rax
mov    %r9d,%r10d
mov    %r8d,%r9d
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
mov    0x2eb8(%rip),%rdi
mov    (%rdi),%eax
lea    0xecf(%rip),%rdi
push   %rax
push   %r10
call   1030 <pfpanic@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Unable to destroy mutex\00"
@EX_OSERR = global i32 0
define void @__pfpanic_mutex_destroy(i16 zeroext %0, i16 zeroext %1, i8* %2, i8* %3, i32 %4, i32 %5) {
%7 = alloca i16
%8 = alloca i16
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
store i16 %0, i16* %7
store i16 %1, i16* %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i16, i16* %7
%14 = load i16, i16* %8
%15 = load i8*, i8** %9
%16 = load i8*, i8** %10
%17 = load i32, i32* %11
%18 = load i32, i32* %12
%19 = load i32, i32* @EX_OSERR
%20 = call i32 @pfpanic(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i16 zeroext %13, i16 zeroext %14, i8* %15, i8* %16, i32 %17, i32 %18, i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Unable to destroy mutex\00"
@EX_OSERR = global i32 0
define void @__pfpanic_mutex_destroy(i16 zeroext %0, i16 zeroext %1, i8* %2, i8* %3, i32 %4, i32 %5) {
%7 = load i32, i32* @EX_OSERR
%8 = tail call i32 @pfpanic(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i16 zeroext %0, i16 zeroext %1, i8* %2, i8* %3, i32 %4, i32 %5, i32 %7)
ret void
}
long long f(long long x) { return x / 10000000000LL; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movabs $0x2540be400,%rcx
cqto
idiv   %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %rdi,%rax
movabs $0x36f9bfb3af7b757,%rcx
9b 6f 03
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x1b,%rdx
add    %rdx,%rax
ret

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

LLVM IR (-O2):
define i64 @f(i64 %0) {
%2 = sdiv i64 %0, 10000000000
ret i64 %2
}
unsigned xrop3_76_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D & T;
  stk2 = ~stk2;
  stk1 = S & stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_76_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xrop3_76_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %6
%28 = load i32, i32* %9
%29 = and i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = load i32, i32* %7
%35 = xor i32 %34, -1
%36 = and i32 %33, %35
%37 = load i32, i32* %5
%38 = load i32, i32* %6
%39 = and i32 %37, %38
%40 = or i32 %36, %39
%41 = load i32, i32* %5
%42 = load i32, i32* %7
%43 = and i32 %41, %42
%44 = or i32 %40, %43
ret i32 %44
}

LLVM IR (-O2):
define i32 @xrop3_76_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = or i8 %1, %0
%4 = zext i8 %3 to i32
ret i32 %4
}
void VIDDummyVdp1LocalCoordinate(void) {}


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

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

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

LLVM IR (-O2):
define void @VIDDummyVdp1LocalCoordinate() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ juman_log_err(char *);
scalar_t__ my_alloc(int);
int strlen(char *);
unsigned char *_set_buffer(char *str) {
  static unsigned char *buf;
  if ((buf = (unsigned char *)my_alloc((strlen(str) + 1) * 4)) == NULL) {
    juman_log_err("Can't malloc buffer\n");
    exit(2);
  }
  return buf;
}


x86 assembly (clang, -O0):
<_set_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%edi
add    $0x1,%edi
shl    $0x2,%edi
call   1040 <my_alloc@plt>
mov    %rax,0x2edf(%rip)
cmp    $0x0,%rax
jne    1189 <_set_buffer+0x49>
lea    0xe86(%rip),%rdi
call   1030 <juman_log_err@plt>
mov    $0x2,%edi
call   1060 <exit@plt>
mov    0x2eb8(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_set_buffer>:
push   %rax
call   1050 <strlen@plt>
lea    0x4(,%rax,4),%edi
call   1040 <my_alloc@plt>
mov    %rax,0x2eef(%rip)
test   %rax,%rax
je     1160 <_set_buffer+0x20>
pop    %rcx
ret
lea    0xe99(%rip),%rdi
call   1030 <juman_log_err@plt>
mov    $0x2,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@_set_buffer.buf = internal global i8* null
@.str = [21 x i8] c"Can't malloc buffer\0A\00"
define i8* @_set_buffer(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strlen(i8* %3)
%5 = add nsw i32 %4, 1
%6 = mul nsw i32 %5, 4
%7 = call i64 @my_alloc(i32 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** @_set_buffer.buf
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = call i32 @juman_log_err(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 2)
unreachable
13: ; preds = %1
%14 = load i8*, i8** @_set_buffer.buf
ret i8* %14
}

LLVM IR (-O2):
@_set_buffer.buf = internal unnamed_addr global i8* null
@.str = [21 x i8] c"Can't malloc buffer\0A\00"
define i8* @_set_buffer(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = shl i32 %2, 2
%4 = add i32 %3, 4
%5 = tail call i64 @my_alloc(i32 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** @_set_buffer.buf
%7 = icmp eq i64 %5, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = tail call i32 @juman_log_err(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 2)
unreachable
11: ; preds = %1
ret i8* %6
}
void init_dummy() {}


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

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

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

LLVM IR (-O2):
define void @init_dummy() {
ret void
}
/* Variables and functions */
float __infer_nondet_float();
float log2f(float x) { return __infer_nondet_float(); }


x86 assembly (clang, -O0):
<log2f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_float@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define float @log2f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call float (...) @__infer_nondet_float()
ret float %3
}

LLVM IR (-O2):
define float @log2f(float %0) {
%2 = tail call float (...) @__infer_nondet_float()
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello C!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"Hello C!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [9 x i8] c"Hello C!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ target;

/* Variables and functions */
scalar_t__ memcmp(int *, int *, int);
int yatzy_hand_score_straight2(int dice[], int count[]) {
  int target[] = {0, 1, 1, 1, 1, 1};
  if (memcmp(count, target, sizeof(target)) == 0) {
    return 20;
  }
  return 0;
}


x86 assembly (clang, -O0):
<yatzy_hand_score_straight2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    0xed9(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed6(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x18,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
jne    1169 <yatzy_hand_score_straight2+0x59>
movl   $0x14,-0x4(%rbp)
jmp    1170 <yatzy_hand_score_straight2+0x60>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yatzy_hand_score_straight2>:
sub    $0x18,%rsp
mov    %rsi,%rdi
mov    0xef2(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xed6(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x18,%edx
call   1030 <memcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
mov    $0x14,%eax
cmovne %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.yatzy_hand_score_straight2.target = [6 x i32] [i32 0, i32 1, i32 1, i32 1, i32 1, i32 1]
define i32 @yatzy_hand_score_straight2(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca [6 x i32]
store i32* %0, i32** %4
store i32* %1, i32** %5
%7 = bitcast [6 x i32]* %6 to i8*
%8 = load i32*, i32** %5
%9 = getelementptr inbounds [6 x i32], [6 x i32]* %6, i64 0, i64 0
%10 = call i64 @memcmp(i32* %8, i32* %9, i32 24)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 20, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@__const.yatzy_hand_score_straight2.target = [6 x i32] [i32 0, i32 1, i32 1, i32 1, i32 1, i32 1]
define i32 @yatzy_hand_score_straight2(i32* nocapture readnone %0, i32* %1) {
%3 = alloca [6 x i32]
%4 = bitcast [6 x i32]* %3 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%6 = call i64 @memcmp(i32* %1, i32* %5, i32 24)
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i32 20, i32 0
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ gpio_value(char *, char *);
int gpio_pulse(char *gp) {
  gpio_value(gp, "1");
  gpio_value(gp, "0");
  return 0;
}


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

x86 assembly (clang, -O2):
<gpio_pulse>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <gpio_value@plt>
lea    0xedb(%rip),%rsi
mov    %rbx,%rdi
call   1030 <gpio_value@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"1\00"
@.str.1 = [2 x i8] c"0\00"
define i32 @gpio_pulse(i8* %0) {
%2 = tail call i32 @gpio_value(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @gpio_value(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int foo(int i, int b, int result) {
  int mask;
  if (b)
    mask = -1;
  else
    mask = 0;
  result = i + 1;
  result = result & mask;
  return result;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1123 <foo+0x23>
movl   $0xffffffff,-0x10(%rbp)
jmp    112a <foo+0x2a>
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    0x1(%rdi),%eax
test   %esi,%esi
cmove  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
%5 = add nsw i32 %0, 1
%6 = select i1 %4, i32 0, i32 %5
ret i32 %6
}
int h(long long c) {
  long long d = c >> 32;
  return d >> 2;
}


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x20,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sar    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
mov    %rdi,%rax
sar    $0x22,%rax
ret

LLVM IR (-O0):
define i32 @h(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = ashr i64 %4, 32
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = ashr i64 %6, 2
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @h(i64 %0) {
%2 = ashr i64 %0, 34
%3 = trunc i64 %2 to i32
ret i32 %3
}
int vbr_getintra_2pass1(void *state) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @vbr_getintra_2pass1(i8* nocapture readnone %0) {
ret i32 -1
}
float f1(float x) { return (x > 0.f ? 1.f : -1.f); }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm1
movss  0xeea(%rip),%xmm3
movss  0xee6(%rip),%xmm2
xorps  %xmm0,%xmm0
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm1
andps  %xmm3,%xmm1
andnps %xmm2,%xmm0
orps   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
seta   %al
lea    0xeee(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
ret

LLVM IR (-O0):
define float @f1(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp ogt float %3, 0.000000e+00
%5 = zext i1 %4 to i64
%6 = select i1 %4, float 1.000000e+00, float -1.000000e+00
ret float %6
}

LLVM IR (-O2):
define float @f1(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
%3 = select i1 %2, float 1.000000e+00, float -1.000000e+00
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
char *cuserid(char *s) {
  __set_errno(ENOSYS);
  return NULL;
}


x86 assembly (clang, -O0):
<cuserid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cuserid>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i8* @cuserid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @ENOSYS
%4 = call i32 @__set_errno(i32 %3)
ret i8* null
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define noalias i8* @cuserid(i8* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret i8* null
}
void *YM2151Init(int index, int clock, int rate) {
  char *chip;
  printf("debug[%s]: \n", __func__);
  YM2151ResetChip(chip);
}


x86 assembly (clang, -O0):
<YM2151Init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    0xec8(%rip),%rdi
lea    0xece(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1040 <YM2151ResetChip@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<YM2151Init>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xede(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <YM2151ResetChip@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"debug[%s]: \0A\00"
@__func__.YM2151Init = [11 x i8] c"YM2151Init\00"
define i8* @YM2151Init(i32 %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.YM2151Init, i64 0, i64 0))
%10 = load i8*, i8** %8
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @YM2151ResetChip to i32 (i8*, ...)*)(i8* %10)
%12 = load i8*, i8** %4
ret i8* %12
}

LLVM IR (-O2):
@.str = [13 x i8] c"debug[%s]: \0A\00"
@__func__.YM2151Init = [11 x i8] c"YM2151Init\00"
define i8* @YM2151Init(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.YM2151Init, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @YM2151ResetChip to i32 (i8*, ...)*)(i8* undef)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ printinvertedtriangle(char *, int);
int /*<<< orphan*/ printtriangle(char *, int);
void printdiamond(char *ch, int height) {
  printtriangle(ch, height);
  printinvertedtriangle(ch, height);
}


x86 assembly (clang, -O0):
<printdiamond>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <printtriangle@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <printinvertedtriangle@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @printdiamond(i8* %0, i32 %1) {
%3 = tail call i32 @printtriangle(i8* %0, i32 %1)
%4 = tail call i32 @printinvertedtriangle(i8* %0, i32 %1)
ret void
}
long _syscall4(long cnum, long a1, long a2, long a3, long a4) {
  register long ret __asm__("rax");
  register long r0 __asm__("rax") = cnum;
  register long r1 __asm__("rdi") = a1;
  register long r2 __asm__("rsi") = a2;
  register long r3 __asm__("rdx") = a3;
  register long r4 __asm__("r10") = a4;
  __asm__ __volatile__("syscall"
                       : "=r"(ret)
                       : "r"(r0), "r"(r1), "r"(r2), "r"(r3), "r"(r4)
                       : "rcx", "r11", "memory");
  return ret;
}


x86 assembly (clang, -O0):
<_syscall4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x38(%rbp),%rax
mov    -0x40(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x50(%rbp),%rdx
mov    -0x58(%rbp),%r10
syscall
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_syscall4>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r8,%r10
syscall
ret

LLVM IR (-O0):
define i64 @_syscall4(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
store i64 %0, i64* %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%17 = load i64, i64* %6
store i64 %17, i64* %12
%18 = load i64, i64* %7
store i64 %18, i64* %13
%19 = load i64, i64* %8
store i64 %19, i64* %14
%20 = load i64, i64* %9
store i64 %20, i64* %15
%21 = load i64, i64* %10
store i64 %21, i64* %16
%22 = load i64, i64* %12
%23 = load i64, i64* %13
%24 = load i64, i64* %14
%25 = load i64, i64* %15
%26 = load i64, i64* %16
%27 = call i64 asm sideeffect "syscall", "={rax},{rax},{rdi},{rsi},{rdx},{r10},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %22, i64 %23, i64 %24, i64 %25, i64 %26)
store i64 %27, i64* %11
%28 = load i64, i64* %11
ret i64 %28
}

LLVM IR (-O2):
define i64 @_syscall4(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = tail call i64 asm sideeffect "syscall", "={rax},{rax},{rdi},{rsi},{rdx},{r10},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4)
ret i64 %6
}
void rop3_0_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = 0;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


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

x86 assembly (clang, -O2):
<rop3_0_0_1>:
not    %sil
and    %dl,%sil
and    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_0_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, -1
%5 = and i8 %4, %2
%6 = load i8, i8* %0
%7 = and i8 %5, %6
store i8 %7, i8* %0
ret void
}
int region_desrtroy() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @region_desrtroy() {
ret i32 0
}
void writeFile(char *filename, int *nums, int len) {}


x86 assembly (clang, -O0):
<writeFile>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @writeFile(i8* nocapture %0, i32* nocapture %1, i32 %2) {
ret void
}