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

/* Variables and functions */
int /*<<< orphan*/ _mm_set_epi32(int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/, int /*<<< orphan*/);
__m128i load_epi32(uint32_t x0, uint32_t x1, uint32_t x2, uint32_t x3) {
  return _mm_set_epi32(x0, x1, x2, x3);
}


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

x86 assembly (clang, -O2):
<load_epi32>:
jmp    1030 <_mm_set_epi32@plt>

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

LLVM IR (-O2):
define i32 @load_epi32(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @_mm_set_epi32(i32 %0, i32 %1, i32 %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void closeSocket(int sock) { close(sock); }


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

x86 assembly (clang, -O2):
<closeSocket>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @closeSocket(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xio_redraw_input_cursor(int);
void xio_inputize_cursor(void) { xio_redraw_input_cursor(1); }


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

x86 assembly (clang, -O2):
<xio_inputize_cursor>:
mov    $0x1,%edi
jmp    1030 <xio_redraw_input_cursor@plt>

LLVM IR (-O0):
define void @xio_inputize_cursor() {
%1 = call i32 @xio_redraw_input_cursor(i32 1)
ret void
}

LLVM IR (-O2):
define void @xio_inputize_cursor() {
%1 = tail call i32 @xio_redraw_input_cursor(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ vecNf_print_to_string(char *, int, float const *, int const);
void vecNf_print(const float v[], const int n) {
  char str[128];
  vecNf_print_to_string(str, 128, v, n);
  printf("%s\n", str);
}


x86 assembly (clang, -O0):
<vecNf_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    $0x80,%esi
call   1040 <vecNf_print_to_string@plt>
lea    -0x90(%rbp),%rsi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vecNf_print>:
push   %rbx
sub    $0x80,%rsp
mov    %esi,%ecx
mov    %rdi,%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x80,%esi
call   1040 <vecNf_print_to_string@plt>
lea    0xebc(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @vecNf_print(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
%5 = alloca [128 x i8]
store float* %0, float** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%7 = load float*, float** %3
%8 = load i32, i32* %4
%9 = call i32 @vecNf_print_to_string(i8* %6, i32 128, float* %7, i32 %8)
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @vecNf_print(float* %0, i32 %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 @vecNf_print_to_string(i8* %4, i32 128, float* %0, i32 %1)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_init(struct list_head *);
int /*<<< orphan*/ list_replace(struct list_head *, struct list_head *);
__attribute__((always_)) void list_replace_init(struct list_head *old,
                                                struct list_head *new) {
  list_replace(old, new);
  list_init(old);
}


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

x86 assembly (clang, -O2):
<list_replace_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <list_replace@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <list_init@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_replace_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = load %struct.list_head*, %struct.list_head** %4
%7 = call i32 @list_replace(%struct.list_head* %5, %struct.list_head* %6)
%8 = load %struct.list_head*, %struct.list_head** %3
%9 = call i32 @list_init(%struct.list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_replace_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @list_replace(%struct.list_head* %0, %struct.list_head* %1)
%4 = tail call i32 @list_init(%struct.list_head* %0)
ret void
}
int isHexSymbol(char ch) {
  return ('0' <= ch && ch <= '9') || ('a' <= ch && ch <= 'f') ||
         ('A' <= ch && ch <= 'F');
}


x86 assembly (clang, -O0):
<isHexSymbol>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x30,%eax
cmp    %ecx,%eax
jg     112d <isHexSymbol+0x2d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jle    1179 <isHexSymbol+0x79>
movsbl -0x1(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
jg     1150 <isHexSymbol+0x50>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x66,%ecx
mov    %al,-0x2(%rbp)
jle    1179 <isHexSymbol+0x79>
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x41,%ecx
cmp    %edx,%ecx
mov    %al,-0x3(%rbp)
jg     1173 <isHexSymbol+0x73>
movsbl -0x1(%rbp),%eax
cmp    $0x46,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isHexSymbol>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
and    $0xdf,%dil
add    $0xbf,%dil
cmp    $0x6,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isHexSymbol(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 48, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br i1 %9, label %28, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sle i32 97, %12
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 102
br i1 %17, label %28, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sle i32 65, %20
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 70
br label %26
26: ; preds = %22, %18
%27 = phi i1 [ false, %18 ], [ %25, %22 ]
br label %28
28: ; preds = %26, %14, %6
%29 = phi i1 [ true, %14 ], [ true, %6 ], [ %27, %26 ]
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @isHexSymbol(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ IniAf_lc898122();
int /*<<< orphan*/ IniClk_lc898122();
int /*<<< orphan*/ IniCmd_lc898122();
void IniSetAf_lc898122(void) {
  IniCmd_lc898122();
  IniClk_lc898122();
  IniAf_lc898122();
}


x86 assembly (clang, -O0):
<IniSetAf_lc898122>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <IniCmd_lc898122@plt>
mov    $0x0,%al
call   1050 <IniClk_lc898122@plt>
mov    $0x0,%al
call   1030 <IniAf_lc898122@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IniSetAf_lc898122>:
push   %rax
xor    %eax,%eax
call   1040 <IniCmd_lc898122@plt>
xor    %eax,%eax
call   1050 <IniClk_lc898122@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <IniAf_lc898122@plt>

LLVM IR (-O0):
define void @IniSetAf_lc898122() {
%1 = call i32 (...) @IniCmd_lc898122()
%2 = call i32 (...) @IniClk_lc898122()
%3 = call i32 (...) @IniAf_lc898122()
ret void
}

LLVM IR (-O2):
define void @IniSetAf_lc898122() {
%1 = tail call i32 (...) @IniCmd_lc898122()
%2 = tail call i32 (...) @IniClk_lc898122()
%3 = tail call i32 (...) @IniAf_lc898122()
ret void
}
/* Variables and functions */
int get_char_ran();
unsigned char get_ttl(void) {
  static unsigned char ttl[4] = {255, 128, 64, 32};
  static unsigned int i = 0;
  return (ttl[(i++) & 3] - (get_char_ran() & 0x0f));
}


x86 assembly (clang, -O0):
<get_ttl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2f12(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f07(%rip)
and    $0x3,%eax
mov    %eax,%eax
mov    %eax,%ecx
lea    0x2ef1(%rip),%rax
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <get_char_ran@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
and    $0xf,%ecx
sub    %ecx,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ttl>:
push   %rbx
mov    0x2f15(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f0c(%rip)
and    $0x3,%eax
lea    0xed6(%rip),%rcx
mov    (%rax,%rcx,1),%bl
xor    %eax,%eax
call   1030 <get_char_ran@plt>
and    $0xf,%al
sub    %al,%bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@get_ttl.ttl = internal global [4 x i8] c"\FF\80@ "
@get_ttl.i = internal global i32 0
define zeroext i8 @get_ttl() {
%1 = load i32, i32* @get_ttl.i
%2 = add i32 %1, 1
store i32 %2, i32* @get_ttl.i
%3 = and i32 %1, 3
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds [4 x i8], [4 x i8]* @get_ttl.ttl, i64 0, i64 %4
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = call i32 (...) @get_char_ran()
%9 = and i32 %8, 15
%10 = sub nsw i32 %7, %9
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
@get_ttl.ttl = internal unnamed_addr constant [4 x i8] c"\FF\80@ "
@get_ttl.i = internal unnamed_addr global i32 0
define zeroext i8 @get_ttl() {
%1 = load i32, i32* @get_ttl.i
%2 = add i32 %1, 1
store i32 %2, i32* @get_ttl.i
%3 = and i32 %1, 3
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds [4 x i8], [4 x i8]* @get_ttl.ttl, i64 0, i64 %4
%6 = load i8, i8* %5
%7 = tail call i32 (...) @get_char_ran()
%8 = trunc i32 %7 to i8
%9 = and i8 %8, 15
%10 = sub i8 %6, %9
ret i8 %10
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ system(char *);
void *scheduler4(void *variables4) {
  int vars;
  int *p_vars = (int *)variables4;
  vars = *p_vars;
  while (1) {
    system("netstat -anp | grep php | awk '{print $7}' | cut -d / -f1 | xargs "
           "kill");
    sleep(vars);
  }
}


x86 assembly (clang, -O0):
<scheduler4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
lea    0xebc(%rip),%rdi
call   1030 <system@plt>
mov    -0xc(%rbp),%edi
call   1040 <sleep@plt>
jmp    113d <scheduler4+0x1d>

x86 assembly (clang, -O2):
<scheduler4>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
call   1030 <system@plt>
mov    %ebx,%edi
call   1040 <sleep@plt>
jmp    1130 <scheduler4+0x10>

LLVM IR (-O0):
@.str = [71 x i8] c"netstat -anp | grep php | awk '{print $7}' | cut -d / -f1 | xargs kill\00"
define i8* @scheduler4(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
store i32 %8, i32* %3
br label %9
9: ; preds = %1, %9
%10 = call i32 @system(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %3
%12 = call i32 @sleep(i32 %11)
br label %9
}

LLVM IR (-O2):
@.str = [71 x i8] c"netstat -anp | grep php | awk '{print $7}' | cut -d / -f1 | xargs kill\00"
define noalias i8* @scheduler4(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
br label %4
4: ; preds = %4, %1
%5 = tail call i32 @system(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @sleep(i32 %3)
br label %4
}
long gcd(long a, long b) {
  if (b == 0 || a == b) {
    return a;
  }
  return gcd(b, a % b);
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1139 <gcd+0x29>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1146 <gcd+0x36>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1160 <gcd+0x50>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
mov    %rdx,%rsi
call   1030 <gcd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1145 <gcd+0x45>
mov    %rsi,%rdx
cmp    %rsi,%rax
jne    112d <gcd+0x2d>
ret
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cqto
idiv   %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1142 <gcd+0x42>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1120 <gcd+0x20>
xor    %edx,%edx
div    %ecx
jmp    1125 <gcd+0x25>
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
%4 = icmp eq i64 %0, %1
%5 = or i1 %3, %4
br i1 %5, label %11, label %6
6: ; preds = %2, %6
%7 = phi i64 [ %9, %6 ], [ %1, %2 ]
%8 = phi i64 [ %7, %6 ], [ %0, %2 ]
%9 = srem i64 %8, %7
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6, %2
%12 = phi i64 [ %0, %2 ], [ %7, %6 ]
ret i64 %12
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ supported_styles;
};
typedef TYPE_1__ XIMStyles;

/* Variables and functions */
void *get_XIMStyles_supported_styles(void *_p) {
  return (void *)((XIMStyles *)_p)->supported_styles;
}


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

x86 assembly (clang, -O2):
<get_XIMStyles_supported_styles>:
mov    (%rdi),%rax
ret

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

LLVM IR (-O2):
define i8* @get_XIMStyles_supported_styles(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn79() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn79");
  return result;
}


x86 assembly (clang, -O0):
<fn79>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn79>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fn79\00"
define i8* @fn79() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"fn79\00"
define i8* @fn79() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ leak0();
int /*<<< orphan*/ leak1();
int /*<<< orphan*/ leak2();
int /*<<< orphan*/ leak3();
int /*<<< orphan*/ should_be_ok();
int main() {
  should_be_ok();
  leak0();
  leak1();
  leak2();
  leak3();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <should_be_ok@plt>
mov    $0x0,%al
call   1040 <leak0@plt>
mov    $0x0,%al
call   1060 <leak1@plt>
mov    $0x0,%al
call   1030 <leak2@plt>
mov    $0x0,%al
call   1050 <leak3@plt>
mov    0x2e57(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <should_be_ok@plt>
xor    %eax,%eax
call   1040 <leak0@plt>
xor    %eax,%eax
call   1060 <leak1@plt>
xor    %eax,%eax
call   1030 <leak2@plt>
xor    %eax,%eax
call   1050 <leak3@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @should_be_ok()
%3 = call i32 (...) @leak0()
%4 = call i32 (...) @leak1()
%5 = call i32 (...) @leak2()
%6 = call i32 (...) @leak3()
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @should_be_ok()
%2 = tail call i32 (...) @leak0()
%3 = tail call i32 (...) @leak1()
%4 = tail call i32 (...) @leak2()
%5 = tail call i32 (...) @leak3()
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}
/* Variables and functions */
int japi_saveimage(int, char *, int);
int j_saveimage(int arg0, char *arg1, int arg2) {
  return (japi_saveimage(arg0, arg1, arg2));
}


x86 assembly (clang, -O0):
<j_saveimage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <japi_saveimage@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j_saveimage>:
jmp    1030 <japi_saveimage@plt>

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

LLVM IR (-O2):
define i32 @j_saveimage(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @japi_saveimage(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ output(char);
int main(void) {
  output('a');
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x61,%edi
call   1030 <output@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @output(i8 signext 97)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @output(i8 signext 97)
ret i32 0
}
void SIO1writeMode32(unsigned long val) {}


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

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

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

LLVM IR (-O2):
define void @SIO1writeMode32(i64 %0) {
ret void
}
__attribute__((always_)) int baz(int a, int b) { return a + b; }


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @baz(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
int __attribute__((no)) baz(long long int *x) { return *x; }


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

x86 assembly (clang, -O2):
<baz>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @baz(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
ret i32 %3
}
void dev_refresh() {}


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

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

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

LLVM IR (-O2):
define void @dev_refresh() {
ret void
}
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  unsigned int local1;
  {
    state[0UL] = (input[0UL] & 914778474UL) << 7U;
    local1 = 0UL;
    while (local1 < 1UL) {
      state[0UL] &= state[local1];
      local1++;
    }
    output[0UL] = state[0UL] & 690137161UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x3686696a,%rax
shl    $0x7,%rax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    $0x1,%rax
jae    114e <RandomFunc+0x4e>
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp,%rax,4),%eax
and    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1126 <RandomFunc+0x26>
mov    -0x14(%rbp),%eax
and    $0x2922a849,%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%eax
shl    $0x7,%eax
and    $0x120a000,%eax
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @RandomFunc(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = shl i32 %3, 7
%5 = and i32 %4, 18915328
store i32 %5, i32* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ b;
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, ...);
int main() {
  int a[10];
  int *b;
  printf("%d %d %d\n", sizeof(a), sizeof(*a), sizeof(a[0]));
  printf("%d %d\n", sizeof(b), sizeof(*b));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    0xee1(%rip),%rdi
mov    $0x28,%esi
mov    $0x4,%edx
mov    $0x4,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
mov    $0x8,%esi
mov    $0x4,%edx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x4,%ecx
mov    $0x28,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
mov    $0x8,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %d\0A\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 40, i32 4, i64 4)
%2 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 8, i32 4)
ret i32 0
}
void gtk_vruler_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_vruler_get_type() {
ret void
}
/* Variables and functions */
char *getenv(char const *);
char *secure_getenv(const char *name) { return getenv(name); }


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

x86 assembly (clang, -O2):
<secure_getenv>:
jmp    1030 <getenv@plt>

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

LLVM IR (-O2):
define i8* @secure_getenv(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
ret i8* %2
}
int isspace(int c) {
  switch (c) {
  case '\n':
  case '\r':
  case '\t':
  case ' ':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xfffffff7,%eax
sub    $0x2,%eax
jb     1140 <isspace+0x40>
jmp    111e <isspace+0x1e>
mov    -0xc(%rbp),%eax
sub    $0xd,%eax
je     1140 <isspace+0x40>
jmp    112f <isspace+0x2f>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
jne    114c <isspace+0x4c>
jmp    1140 <isspace+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1153 <isspace+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
cmp    $0x20,%edi
ja     111d <isspace+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100002600,%rdx
bt     %rcx,%rdx
jae    111d <isspace+0x1d>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
switch i32 %0, label %2 [
i32 10, label %3
i32 13, label %3
i32 9, label %3
i32 32, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xd8() {
  Assert_real((isodigit(216) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              1085, ("isodigit should be 0 for 0xd8"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0xd8>:
push   %rax
mov    $0xd8,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x43d,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xd8\00"
define void @t_isodigit_0xd8() {
%1 = tail call i64 @isodigit(i32 216)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1085, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int stress_mlock_region(const void *addr_start, const void *addr_end) {
  (void)addr_start;
  (void)addr_end;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @stress_mlock_region(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
ret i32 0
}

LLVM IR (-O2):
define i32 @stress_mlock_region(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
size_t max(size_t a, size_t b) {
  if (a > b)
    return a;
  else
    return b;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    1127 <max+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <max+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmova  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @max(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = icmp ugt i64 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i64, i64* %4
store i64 %10, i64* %3
br label %13
11: ; preds = %2
%12 = load i64, i64* %5
store i64 %12, i64* %3
br label %13
13: ; preds = %11, %9
%14 = load i64, i64* %3
ret i64 %14
}

LLVM IR (-O2):
define i64 @max(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
bool nrf53_errata_14(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_14() {
ret i32 0
}
/* Type definitions */
struct string {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ string_append(struct string *, struct string const *);
int /*<<< orphan*/ string_clear(struct string *);
void string_set(struct string *string, const struct string *other) {
  string_clear(string);
  string_append(string, other);
}


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

x86 assembly (clang, -O2):
<string_set>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <string_clear@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <string_append@plt>

LLVM IR (-O0):
%struct.string = type { i32 }
define void @string_set(%struct.string* %0, %struct.string* %1) {
%3 = alloca %struct.string*
%4 = alloca %struct.string*
store %struct.string* %0, %struct.string** %3
store %struct.string* %1, %struct.string** %4
%5 = load %struct.string*, %struct.string** %3
%6 = call i32 @string_clear(%struct.string* %5)
%7 = load %struct.string*, %struct.string** %3
%8 = load %struct.string*, %struct.string** %4
%9 = call i32 @string_append(%struct.string* %7, %struct.string* %8)
ret void
}

LLVM IR (-O2):
%struct.string = type { i32 }
define void @string_set(%struct.string* %0, %struct.string* %1) {
%3 = tail call i32 @string_clear(%struct.string* %0)
%4 = tail call i32 @string_append(%struct.string* %0, %struct.string* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WRITETEST(char *);
void SetDispBold() { WRITETEST("\033[1m"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[1m\00"
define void @SetDispBold() {
%1 = tail call i32 @WRITETEST(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *sr_malloc(size_t);
void *sr_mallocz(size_t size) {
  void *ptr = sr_malloc(size);
  memset(ptr, 0, size);
  return ptr;
}


x86 assembly (clang, -O0):
<sr_mallocz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sr_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sr_mallocz>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <sr_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1040 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @sr_mallocz(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @sr_malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i64, i64* %2
%8 = call i32 @memset(i8* %6, i32 0, i64 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @sr_mallocz(i64 %0) {
%2 = tail call i8* @sr_malloc(i64 %0)
%3 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ error(char *);
int fseek(int /*<<< orphan*/ *, long, int);
void Fseek(FILE *stream, long offset, int whence) {
  int r = fseek(stream, offset, whence);
  if (r)
    error("Can't seek a file\n");
}


x86 assembly (clang, -O0):
<Fseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <fseek@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     115c <Fseek+0x3c>
lea    0xea9(%rip),%rdi
call   1040 <error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fseek>:
push   %rax
call   1030 <fseek@plt>
test   %eax,%eax
je     1137 <Fseek+0x17>
lea    0xecf(%rip),%rdi
pop    %rax
jmp    1040 <error@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Can't seek a file\0A\00"
define void @Fseek(i32* %0, i64 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i64, i64* %5
%10 = load i32, i32* %6
%11 = call i32 @fseek(i32* %8, i64 %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = call i32 @error(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %3
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Can't seek a file\0A\00"
define void @Fseek(i32* nocapture %0, i64 %1, i32 %2) {
%4 = tail call i32 @fseek(i32* %0, i64 %1, i32 %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @error(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ dlock_unlock(int /*<<< orphan*/ *, int /*<<< orphan*/);
int o_pthread_mutex_unlock(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_self();
int pthread_mutex_unlock(pthread_mutex_t *mutex) {
  dlock_unlock(mutex, pthread_self());
  return o_pthread_mutex_unlock(mutex);
}


x86 assembly (clang, -O0):
<pthread_mutex_unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1050 <dlock_unlock@plt>
mov    -0x8(%rbp),%rdi
call   1030 <o_pthread_mutex_unlock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_mutex_unlock>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <pthread_self@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <dlock_unlock@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <o_pthread_mutex_unlock@plt>

LLVM IR (-O0):
define i32 @pthread_mutex_unlock(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 (...) @pthread_self()
%5 = call i32 @dlock_unlock(i32* %3, i32 %4)
%6 = load i32*, i32** %2
%7 = call i32 @o_pthread_mutex_unlock(i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @pthread_mutex_unlock(i32* %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @dlock_unlock(i32* %0, i32 %2)
%4 = tail call i32 @o_pthread_mutex_unlock(i32* %0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ lnp_hexdump(char *, unsigned char *, unsigned int);
void lnp_raw_hexdump_invalid(unsigned char *data, unsigned length,
                             int isvalid) {
  if (!isvalid)
    lnp_hexdump("[RAW ]", data, length);
}


x86 assembly (clang, -O0):
<lnp_raw_hexdump_invalid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    113f <lnp_raw_hexdump_invalid+0x2f>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xec6(%rip),%rdi
call   1030 <lnp_hexdump@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lnp_raw_hexdump_invalid>:
test   %edx,%edx
je     1115 <lnp_raw_hexdump_invalid+0x5>
ret
mov    %esi,%eax
mov    %rdi,%rsi
lea    0xedf(%rip),%rdi
mov    %eax,%edx
jmp    1030 <lnp_hexdump@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"[RAW ]\00"
define void @lnp_raw_hexdump_invalid(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
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = call i32 @lnp_hexdump(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11)
br label %13
13: ; preds = %9, %3
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"[RAW ]\00"
define void @lnp_raw_hexdump_invalid(i8* %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @lnp_hexdump(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
br label %7
7: ; preds = %5, %3
ret void
}
void setstate(i) char *i;
{}


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

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

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

LLVM IR (-O2):
define void @setstate(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ msg_out(int, char *, char *, int, char *);
void parse_err(int sev, int line, char *msg) {
  msg_out(sev, "%s: line %d: %s\n",
          "/usr/local/etc"
          "/zsrelay.conf",
          line, msg);
}


x86 assembly (clang, -O0):
<parse_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%r8
lea    0xecd(%rip),%rsi
lea    0xed7(%rip),%rdx
call   1030 <msg_out@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_err>:
mov    %rdx,%r8
mov    %esi,%ecx
lea    0xee4(%rip),%rsi
lea    0xeee(%rip),%rdx
jmp    1030 <msg_out@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"%s: line %d: %s\0A\00"
@.str.1 = [28 x i8] c"/usr/local/etc/zsrelay.conf\00"
define void @parse_err(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @msg_out(i32 %7, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"%s: line %d: %s\0A\00"
@.str.1 = [28 x i8] c"/usr/local/etc/zsrelay.conf\00"
define void @parse_err(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @msg_out(i32 %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %1, i8* %2)
ret void
}
void pnv_power9_force_smt4(void) {}


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

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

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

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