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

/* Variables and functions */
int /*<<< orphan*/ __set_file_attribute(int /*<<< orphan*/ *);
int /*<<< orphan*/ *malloc(int);
FILE *fopen(const char *filename, const char *mode) {
  FILE *ret;
  ret = malloc(sizeof(FILE));
  if (ret)
    __set_file_attribute(ret);
  return ret;
}


x86 assembly (clang, -O0):
<fopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1152 <fopen+0x32>
mov    -0x18(%rbp),%rdi
call   1040 <__set_file_attribute@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fopen>:
push   %rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113b <fopen+0x1b>
mov    %rbx,%rdi
call   1040 <__set_file_attribute@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32* @fopen(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32* @malloc(i32 4)
%4 = icmp eq i32* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @__set_file_attribute(i32* %3)
br label %7
7: ; preds = %5, %2
ret i32* %3
}
/* Type definitions */
struct Hero {
  int dummy;
};
struct Ability {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Hero_AddBuff(struct Hero *, int /*<<< orphan*/);
int /*<<< orphan*/ ZhuiYingShiBuff_Get(int);
void ChangPingJun_WuMing_add_buff_to_attacker(struct Ability *self,
                                              struct Hero *attacker,
                                              struct Hero *target) {
  Hero_AddBuff(attacker, ZhuiYingShiBuff_Get(20));
}


x86 assembly (clang, -O0):
<ChangPingJun_WuMing_add_buff_to_attacker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x14,%edi
call   1040 <ZhuiYingShiBuff_Get@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1030 <Hero_AddBuff@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ChangPingJun_WuMing_add_buff_to_attacker>:
push   %rbx
mov    %rsi,%rbx
mov    $0x14,%edi
call   1040 <ZhuiYingShiBuff_Get@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <Hero_AddBuff@plt>

LLVM IR (-O0):
%struct.Ability = type { i32 }
%struct.Hero = type { i32 }
define void @ChangPingJun_WuMing_add_buff_to_attacker(%struct.Ability* %0, %struct.Hero* %1, %struct.Hero* %2) {
%4 = alloca %struct.Ability*
%5 = alloca %struct.Hero*
%6 = alloca %struct.Hero*
store %struct.Ability* %0, %struct.Ability** %4
store %struct.Hero* %1, %struct.Hero** %5
store %struct.Hero* %2, %struct.Hero** %6
%7 = load %struct.Hero*, %struct.Hero** %5
%8 = call i32 @ZhuiYingShiBuff_Get(i32 20)
%9 = call i32 @Hero_AddBuff(%struct.Hero* %7, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.Ability = type { i32 }
%struct.Hero = type { i32 }
define void @ChangPingJun_WuMing_add_buff_to_attacker(%struct.Ability* nocapture readnone %0, %struct.Hero* %1, %struct.Hero* nocapture readnone %2) {
%4 = tail call i32 @ZhuiYingShiBuff_Get(i32 20)
%5 = tail call i32 @Hero_AddBuff(%struct.Hero* %1, i32 %4)
ret void
}
/* Variables and functions */
int _str_split(char *, char const *, char ***, int);
extern int str_split(char *s, const char *delims, char *out[], int max) {
  return _str_split(s, delims, &out, max);
}


x86 assembly (clang, -O0):
<str_split>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%ecx
lea    -0x18(%rbp),%rdx
call   1030 <_str_split@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_split>:
push   %rax
mov    %rdx,(%rsp)
mov    %rsp,%rdx
call   1030 <_str_split@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @str_split(i8* %0, i8* %1, i8** %2, i32 %3) {
%5 = alloca i8**
store i8** %2, i8*** %5
%6 = call i32 @_str_split(i8* %0, i8* %1, i8*** %5, i32 %3)
ret i32 %6
}
void h_template_function_name1() {}


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

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

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

LLVM IR (-O2):
define void @h_template_function_name1() {
ret void
}
/* Type definitions */
struct timeval {
  unsigned int tv_sec;
  unsigned int tv_usec;
};
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
scalar_t__ select(int /*<<< orphan*/, int /*<<< orphan*/ *,
                  int /*<<< orphan*/ *, int /*<<< orphan*/ *, struct timeval *);
int u_sleep(unsigned int sec, unsigned int usec) {
  struct timeval t;
  t.tv_sec = sec;
  t.tv_usec = usec;
  if (select(0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &t) < 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<u_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x18(%rbp),%r8
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1030 <select@plt>
cmp    $0x0,%rax
jge    1155 <u_sleep+0x45>
movl   $0xffffffff,-0x4(%rbp)
jmp    115c <u_sleep+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_sleep>:
push   %rax
mov    %edi,(%rsp)
mov    %esi,0x4(%rsp)
mov    %rsp,%r8
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <select@plt>
sar    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @u_sleep(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.timeval
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
store i32 %7, i32* %8
%9 = load i32, i32* %5
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
store i32 %9, i32* %10
%11 = call i64 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %6)
%12 = icmp slt i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %15
14: ; preds = %2
store i32 0, i32* %3
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @u_sleep(i32 %0, i32 %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
store i32 %0, i32* %5
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 1
store i32 %1, i32* %6
%7 = call i64 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %3)
%8 = ashr i64 %7, 63
%9 = trunc i64 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ semPautounlock(int, int);
void newDbFileLock(void) {
  semPautounlock(8620, 20);
  ;
}


x86 assembly (clang, -O0):
<newDbFileLock>:
push   %rbp
mov    %rsp,%rbp
mov    $0x21ac,%edi
mov    $0x14,%esi
call   1030 <semPautounlock@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<newDbFileLock>:
mov    $0x21ac,%edi
mov    $0x14,%esi
jmp    1030 <semPautounlock@plt>

LLVM IR (-O0):
define void @newDbFileLock() {
%1 = call i32 @semPautounlock(i32 8620, i32 20)
ret void
}

LLVM IR (-O2):
define void @newDbFileLock() {
%1 = tail call i32 @semPautounlock(i32 8620, i32 20)
ret void
}
int contains(char ch, char arr[], int size) {
  int i = 0;
  for (i = 0; i < size; i++) {
    if (ch == arr[i])
      return i;
  }
  return -1;
}


x86 assembly (clang, -O0):
<contains>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1161 <contains+0x61>
movsbl -0x5(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    114e <contains+0x4e>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1168 <contains+0x68>
jmp    1153 <contains+0x53>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111f <contains+0x1f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<contains>:
mov    $0xffffffff,%eax
test   %edx,%edx
jle    111f <contains+0x1f>
mov    %edx,%edx
xor    %ecx,%ecx
nopl   (%rax)
cmp    %dil,(%rsi,%rcx,1)
je     1120 <contains+0x20>
add    $0x1,%rcx
cmp    %rcx,%rdx
jne    1110 <contains+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @contains(i8 signext %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i8, i8* %1, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, %0
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus and "
         "Neptune!\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 = [73 x i8] c"Hello Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus and Neptune!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [72 x i8] c"Hello Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus and Neptune!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @str, i64 0, i64 0))
ret i32 0
}
short int _ts_ljump(unsigned char *ptr) {
  short int i = 0;
  unsigned char j = 0xc0;
  j ^= ptr[0];
  ((unsigned char *)&i)[0] = j;
  ((unsigned char *)&i)[1] = ptr[1];
  return i;
}


x86 assembly (clang, -O0):
<_ts_ljump>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movw   $0x0,-0xa(%rbp)
movb   $0xc0,-0xb(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
movzbl -0xb(%rbp),%eax
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x9(%rbp)
movswl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ts_ljump>:
movzbl (%rdi),%ecx
xor    $0xc0,%ecx
movzbl 0x1(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define signext i16 @_ts_ljump(i8* %0) {
%2 = alloca i8*
%3 = alloca i16
%4 = alloca i8
store i8* %0, i8** %2
store i16 0, i16* %3
store i8 -64, i8* %4
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = load i8, i8* %4
%10 = zext i8 %9 to i32
%11 = xor i32 %10, %8
%12 = trunc i32 %11 to i8
store i8 %12, i8* %4
%13 = load i8, i8* %4
%14 = bitcast i16* %3 to i8*
%15 = getelementptr inbounds i8, i8* %14, i64 0
store i8 %13, i8* %15
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = load i8, i8* %17
%19 = bitcast i16* %3 to i8*
%20 = getelementptr inbounds i8, i8* %19, i64 1
store i8 %18, i8* %20
%21 = load i16, i16* %3
ret i16 %21
}

LLVM IR (-O2):
define signext i16 @_ts_ljump(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = xor i8 %2, -64
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i16
%7 = shl nuw i16 %6, 8
%8 = zext i8 %3 to i16
%9 = or i16 %7, %8
ret i16 %9
}
int vsnprintf_put_in_string(char *string, unsigned int sz, char c, int pos) {
  if (pos >= sz)
    return 0;
  else
    string[pos] = c;
  return 1;
}


x86 assembly (clang, -O0):
<vsnprintf_put_in_string>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %al,-0x15(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jb     112b <vsnprintf_put_in_string+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    1140 <vsnprintf_put_in_string+0x40>
mov    -0x15(%rbp),%dl
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsnprintf_put_in_string>:
xor    %eax,%eax
cmp    %esi,%ecx
jae    1111 <vsnprintf_put_in_string+0x11>
movslq %ecx,%rax
mov    %dl,(%rdi,%rax,1)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @vsnprintf_put_in_string(i8* nocapture writeonly %0, i32 %1, i8 signext %2, i32 %3) {
%5 = icmp ult i32 %3, %1
br i1 %5, label %6, label %9
6: ; preds = %4
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %2, i8* %8
br label %9
9: ; preds = %4, %6
%10 = phi i32 [ 1, %6 ], [ 0, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("succeeded\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"succeeded\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [10 x i8] c"succeeded\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef char int16_t;

/* Variables and functions */
int16_t lower(int16_t character) {
  return (character >= 'A' && character <= 'Z') ? character + 'a' - 'A'
                                                : character;
}


x86 assembly (clang, -O0):
<lower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1136 <lower+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     1136 <lower+0x36>
movsbl -0x1(%rbp),%eax
add    $0x61,%eax
sub    $0x41,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <lower+0x3d>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @lower(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = add nsw i32 %12, 97
%14 = sub nsw i32 %13, 65
br label %18
15: ; preds = %6, %1
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
br label %18
18: ; preds = %15, %10
%19 = phi i32 [ %14, %10 ], [ %17, %15 ]
%20 = trunc i32 %19 to i8
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @lower(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, 32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void un(void) { printf("un\n"); }


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

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

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

LLVM IR (-O2):
@str = [3 x i8] c"un\00"
define void @un() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}
int compare_ints_max(const void *a, const void *b) {
  const int *da = (const int *)a;
  const int *db = (const int *)b;
  return (*da < *db) - (*da > *db);
}


x86 assembly (clang, -O0):
<compare_ints_max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%ecx
mov    -0x20(%rbp),%rdx
cmp    (%rdx),%ecx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_ints_max>:
mov    (%rdi),%ecx
xor    %eax,%eax
xor    %edx,%edx
cmp    (%rsi),%ecx
setl   %al
setg   %dl
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @compare_ints_max(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = icmp slt i32 %12, %14
%16 = zext i1 %15 to i32
%17 = load i32*, i32** %5
%18 = load i32, i32* %17
%19 = load i32*, i32** %6
%20 = load i32, i32* %19
%21 = icmp sgt i32 %18, %20
%22 = zext i1 %21 to i32
%23 = sub nsw i32 %16, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @compare_ints_max(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp slt i32 %5, %6
%8 = zext i1 %7 to i32
%9 = icmp sgt i32 %5, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_Perspective_init(void) {
  _hmt_register_covercase("HMM_Perspective", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_Perspective_init>:
lea    0xee9(%rip),%rdi
lea    0xef2(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

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

LLVM IR (-O2):
@.str = [16 x i8] c"HMM_Perspective\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_Perspective_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("hello world"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void gtk_tree_model_filter_get_model() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_model_filter_get_model() {
ret void
}
int msm_ipc_router_security_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @msm_ipc_router_security_init() {
ret i32 0
}
int test(int a) { return a + 1; }


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

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

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

LLVM IR (-O2):
define i32 @test(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
int conditie(int k) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @conditie(i32 %0) {
ret i32 0
}
void X509_REQ_free(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_REQ_free() {
ret void
}
char *strchrnul(const char *s, int c_in) {
  char c = c_in;
  while (*s && (*s != c))
    s++;
  return (char *)s;
}


x86 assembly (clang, -O0):
<strchrnul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xe(%rbp)
je     1139 <strchrnul+0x39>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0xd(%rbp),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0xe(%rbp)
mov    -0xe(%rbp),%al
test   $0x1,%al
jne    1149 <strchrnul+0x49>
jmp    115a <strchrnul+0x5a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1111 <strchrnul+0x11>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchrnul>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <strchrnul+0x23>
movsbl %sil,%edx
nopl   (%rax)
movsbl %cl,%ecx
cmp    %ecx,%edx
je     1123 <strchrnul+0x23>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchrnul+0x10>
ret

LLVM IR (-O0):
define i8* @strchrnul(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = trunc i32 %6 to i8
store i8 %7, i8* %5
br label %8
8: ; preds = %22, %2
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %20
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = load i8, i8* %5
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %16, %18
br label %20
20: ; preds = %13, %8
%21 = phi i1 [ false, %8 ], [ %19, %13 ]
br i1 %21, label %22, label %25
22: ; preds = %20
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %3
br label %8
25: ; preds = %20
%26 = load i8*, i8** %3
ret i8* %26
}

LLVM IR (-O2):
define i8* @strchrnul(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2
%6 = shl i32 %1, 24
%7 = ashr exact i32 %6, 24
br label %8
8: ; preds = %5, %13
%9 = phi i8 [ %3, %5 ], [ %15, %13 ]
%10 = phi i8* [ %0, %5 ], [ %14, %13 ]
%11 = sext i8 %9 to i32
%12 = icmp eq i32 %7, %11
br i1 %12, label %17, label %13
13: ; preds = %8
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %8
17: ; preds = %8, %13, %2
%18 = phi i8* [ %0, %2 ], [ %14, %13 ], [ %10, %8 ]
ret i8* %18
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr,
                "usage: locate.code common_bigrams < list > squozen_list\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [57 x i8] c"usage: locate.code common_bigrams < list > squozen_list\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [57 x i8] c"usage: locate.code common_bigrams < list > squozen_list\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
unsigned int _read_sched_status(unsigned int id) {
  unsigned int cmd = ((0x12000000) | (((0x0) & 0x00000003) << 16) |
                      (((id)&0x000000FF) << 8) | (((0x60) & 0x000000FF) << 0));
  return (*(volatile unsigned int *)(cmd));
}


x86 assembly (clang, -O0):
<_read_sched_status>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
or     $0x12000000,%eax
or     $0x60,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_read_sched_status>:
shl    $0x8,%edi
movzwl %di,%eax
mov    0x12000060(%rax),%eax
ret

LLVM IR (-O0):
define i32 @_read_sched_status(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 255
%6 = shl i32 %5, 8
%7 = or i32 301989888, %6
%8 = or i32 %7, 96
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = zext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load volatile i32, i32* %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @_read_sched_status(i32 %0) {
%2 = shl i32 %0, 8
%3 = and i32 %2, 65280
%4 = or i32 %3, 301989984
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
ret i32 %7
}
int MDC(int N, int D) {
  if (D == 0)
    return N;
  else
    return MDC(D, N % D);
}


x86 assembly (clang, -O0):
<MDC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <MDC+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <MDC+0x37>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <MDC@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MDC>:
mov    %edi,%eax
test   %esi,%esi
je     111d <MDC+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <MDC+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @MDC(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fclose(int /*<<< orphan*/ *);
int closeFile(long desc) {
  FILE *fd = (FILE *)desc;
  return fclose(fd);
}


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

x86 assembly (clang, -O2):
<closeFile>:
jmp    1030 <fclose@plt>

LLVM IR (-O0):
define i32 @closeFile(i64 %0) {
%2 = alloca i64
%3 = alloca i32*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @fclose(i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @closeFile(i64 %0) {
%2 = inttoptr i64 %0 to i32*
%3 = tail call i32 @fclose(i32* %2)
ret i32 %3
}
int codegen_timing_686_jump_cycles() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @codegen_timing_686_jump_cycles() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void out(char *s) { printf("%s\n", s); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @out(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
unsigned short *_runestrchr(const unsigned short *s, unsigned short c) {
  register unsigned short tmp;
  do {
    tmp = *s++;
    if (tmp == c)
      return (unsigned short *)(s - 1);
  } while (tmp != 0);
  return 0;
}


x86 assembly (clang, -O0):
<_runestrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x2,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%ax
mov    %ax,-0x14(%rbp)
movzwl -0x14(%rbp),%eax
movzwl -0x12(%rbp),%ecx
cmp    %ecx,%eax
jne    1146 <_runestrchr+0x46>
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffffe,%rax
mov    %rax,-0x8(%rbp)
jmp    1160 <_runestrchr+0x60>
jmp    114b <_runestrchr+0x4b>
movzwl -0x14(%rbp),%eax
cmp    $0x0,%eax
jne    110f <_runestrchr+0xf>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_runestrchr>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzwl (%rax),%ecx
cmp    %si,%cx
je     1123 <_runestrchr+0x23>
add    $0x2,%rax
test   %cx,%cx
jne    1110 <_runestrchr+0x10>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i16* @_runestrchr(i16* %0, i16 zeroext %1) {
%3 = alloca i16*
%4 = alloca i16*
%5 = alloca i16
%6 = alloca i16
store i16* %0, i16** %4
store i16 %1, i16* %5
br label %7
7: ; preds = %20, %2
%8 = load i16*, i16** %4
%9 = getelementptr inbounds i16, i16* %8, i32 1
store i16* %9, i16** %4
%10 = load i16, i16* %8
store i16 %10, i16* %6
%11 = load i16, i16* %6
%12 = zext i16 %11 to i32
%13 = load i16, i16* %5
%14 = zext i16 %13 to i32
%15 = icmp eq i32 %12, %14
br i1 %15, label %16, label %19
16: ; preds = %7
%17 = load i16*, i16** %4
%18 = getelementptr inbounds i16, i16* %17, i64 -1
store i16* %18, i16** %3
br label %25
19: ; preds = %7
br label %20
20: ; preds = %19
%21 = load i16, i16* %6
%22 = zext i16 %21 to i32
%23 = icmp ne i32 %22, 0
br i1 %23, label %7, label %24
24: ; preds = %20
store i16* null, i16** %3
br label %25
25: ; preds = %24, %16
%26 = load i16*, i16** %3
ret i16* %26
}

LLVM IR (-O2):
define i16* @_runestrchr(i16* %0, i16 zeroext %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i16* [ %0, %2 ], [ %8, %7 ]
%5 = load i16, i16* %4
%6 = icmp eq i16 %5, %1
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = getelementptr inbounds i16, i16* %4, i64 1
%9 = icmp eq i16 %5, 0
br i1 %9, label %10, label %3
10: ; preds = %7, %3
%11 = phi i16* [ %4, %3 ], [ null, %7 ]
ret i16* %11
}
/* Variables and functions */
int exact_square(int);
int /*<<< orphan*/ printf(char *, ...);
int scanf(char *, int *);
int main() {
  int number, check;
  printf("Enter a integer number:");
  check = scanf("%d", &number);
  printf("%d\n", exact_square(number));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <exact_square@plt>
mov    %eax,%esi
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <exact_square@plt>
lea    0xebb(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [24 x i8] c"Enter a integer number:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @exact_square(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
char *copystring(const char *s) {
  int len;
  char *b;
  len = strlen(s) + 1;
  b = malloc(len);
  memcpy(b, s, len);
  return b;
}


x86 assembly (clang, -O0):
<copystring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copystring>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
lea    0x1(%rax),%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @copystring(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i8* @malloc(i32 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load i8*, i8** %2
%12 = load i32, i32* %3
%13 = call i32 @memcpy(i8* %10, i8* %11, i32 %12)
%14 = load i8*, i8** %4
ret i8* %14
}

LLVM IR (-O2):
define i8* @copystring(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %3)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int open(char const *, int, int /*<<< orphan*/);
int r_open3(const char *path, int oflag, mode_t mode) {
  int retval;
  while (retval = open(path, oflag, mode), retval == -1 && errno == EINTR)
    ;
  return retval;
}


x86 assembly (clang, -O0):
<r_open3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <open@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
cmpl   $0xffffffff,-0x14(%rbp)
mov    %al,-0x15(%rbp)
jne    115d <r_open3+0x4d>
mov    0x2e96(%rip),%rax
mov    (%rax),%rax
mov    0x2e84(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    116d <r_open3+0x5d>
jmp    1172 <r_open3+0x62>
jmp    1122 <r_open3+0x12>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_open3>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb9(%rip),%r15
mov    0x2eaa(%rip),%r12
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <open@plt>
cmp    $0xffffffff,%eax
jne    114b <r_open3+0x3b>
mov    (%r12),%rcx
cmp    %rcx,(%r15)
je     1130 <r_open3+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i32 @r_open3(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
br label %8
8: ; preds = %21, %3
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 @open(i8* %9, i32 %10, i32 %11)
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %19
15: ; preds = %8
%16 = load i64, i64* @errno
%17 = load i64, i64* @EINTR
%18 = icmp eq i64 %16, %17
br label %19
19: ; preds = %15, %8
%20 = phi i1 [ false, %8 ], [ %18, %15 ]
br i1 %20, label %21, label %22
21: ; preds = %19
br label %8
22: ; preds = %19
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @r_open3(i8* nocapture %0, i32 %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i32 @open(i8* %0, i32 %1, i32 %2)
%6 = icmp eq i32 %5, -1
%7 = load i64, i64* @errno
%8 = load i64, i64* @EINTR
%9 = icmp eq i64 %7, %8
%10 = select i1 %6, i1 %9, i1 false
br i1 %10, label %4, label %11
11: ; preds = %4
ret i32 %5
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t __local_bswap16(uint16_t x) {
  return ((x << 8) & 0xff00) | ((x >> 8) & 0x00ff);
}


x86 assembly (clang, -O0):
<__local_bswap16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
and    $0xff00,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__local_bswap16>:
rol    $0x8,%di
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @__local_bswap16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = and i32 %4, 65280
%6 = load i32, i32* %2
%7 = ashr i32 %6, 8
%8 = and i32 %7, 255
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @__local_bswap16(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
double nmea_meters2dop(double meters) { return (meters / (5)); }


x86 assembly (clang, -O0):
<nmea_meters2dop>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<nmea_meters2dop>:
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @nmea_meters2dop(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 5.000000e+00
ret double %4
}

LLVM IR (-O2):
define double @nmea_meters2dop(double %0) {
%2 = fdiv double %0, 5.000000e+00
ret double %2
}
/* Type definitions */
struct genlist {
  int dummy;
};
struct fc_sockaddr_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_destroy(struct genlist *);
void fc_sockaddr_list_destroy(struct fc_sockaddr_list *tthis) {
  genlist_destroy((struct genlist *)tthis);
}


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

x86 assembly (clang, -O2):
<fc_sockaddr_list_destroy>:
jmp    1030 <genlist_destroy@plt>

LLVM IR (-O0):
%struct.fc_sockaddr_list = type { i32 }
%struct.genlist = type { i32 }
define void @fc_sockaddr_list_destroy(%struct.fc_sockaddr_list* %0) {
%2 = alloca %struct.fc_sockaddr_list*
store %struct.fc_sockaddr_list* %0, %struct.fc_sockaddr_list** %2
%3 = load %struct.fc_sockaddr_list*, %struct.fc_sockaddr_list** %2
%4 = bitcast %struct.fc_sockaddr_list* %3 to %struct.genlist*
%5 = call i32 @genlist_destroy(%struct.genlist* %4)
ret void
}

LLVM IR (-O2):
%struct.fc_sockaddr_list = type { i32 }
%struct.genlist = type { i32 }
define void @fc_sockaddr_list_destroy(%struct.fc_sockaddr_list* %0) {
%2 = bitcast %struct.fc_sockaddr_list* %0 to %struct.genlist*
%3 = tail call i32 @genlist_destroy(%struct.genlist* %2)
ret void
}
/* Variables and functions */
int bswap_16(unsigned int);
unsigned int bswap_32(unsigned int x) {
  return (bswap_16(x & 0xffff) << 16) | (bswap_16(x >> 16));
}


x86 assembly (clang, -O0):
<bswap_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xffff,%edi
call   1030 <bswap_16@plt>
shl    $0x10,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
shr    $0x10,%edi
call   1030 <bswap_16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bswap_32>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
movzwl %bx,%edi
call   1030 <bswap_16@plt>
mov    %eax,%ebp
shl    $0x10,%ebp
shr    $0x10,%ebx
mov    %ebx,%edi
call   1030 <bswap_16@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @bswap_32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65535
%5 = call i32 @bswap_16(i32 %4)
%6 = shl i32 %5, 16
%7 = load i32, i32* %2
%8 = lshr i32 %7, 16
%9 = call i32 @bswap_16(i32 %8)
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @bswap_32(i32 %0) {
%2 = and i32 %0, 65535
%3 = tail call i32 @bswap_16(i32 %2)
%4 = shl i32 %3, 16
%5 = lshr i32 %0, 16
%6 = tail call i32 @bswap_16(i32 %5)
%7 = or i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
f(int n) {
  short(*p)[n] = 0;
  assert(p == 0);
  assert((int)(p + 1) == 3 * sizeof(short));
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
shl    $0x0,%rcx
shl    $0x1,%rcx
add    %rcx,%rax
cltq
cmp    $0x6,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
call   1030 <assert@plt>
and    $0x7fffffff,%ebx
xor    %edi,%edi
cmp    $0x3,%ebx
sete   %dil
pop    %rbx
jmp    1030 <assert@plt>

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i16*
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = zext i32 %5 to i64
store i16* null, i16** %4
%7 = load i16*, i16** %4
%8 = icmp eq i16* %7, null
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i16*, i16** %4
%12 = mul nsw i64 1, %6
%13 = getelementptr inbounds i16, i16* %11, i64 %12
%14 = ptrtoint i16* %13 to i32
%15 = sext i32 %14 to i64
%16 = icmp eq i64 %15, 6
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = tail call i32 @assert(i32 1)
%3 = and i32 %0, 2147483647
%4 = icmp eq i32 %3, 3
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
ret i32 undef
}