xunge/DecIR huggingface dataset:
unsigned int f(unsigned int b, unsigned int c) {
  unsigned int a = (unsigned short)b * (unsigned short)c;
  return a;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
movzwl %ax,%eax
mov    -0x8(%rbp),%ecx
movzwl %cx,%ecx
imul   %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movzwl %di,%ecx
movzwl %si,%eax
imul   %ecx,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = trunc i32 %6 to i16
%8 = zext i16 %7 to i32
%9 = load i32, i32* %4
%10 = trunc i32 %9 to i16
%11 = zext i16 %10 to i32
%12 = mul nsw i32 %8, %11
store i32 %12, i32* %5
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = and i32 %0, 65535
%4 = and i32 %1, 65535
%5 = mul nuw nsw i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int close(int);
int SocketClose(int sockfd) { return close(sockfd); }


x86 assembly (clang, -O0):
<SocketClose>:
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):
<SocketClose>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @SocketClose(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
int foo23() { return 23; }


x86 assembly (clang, -O0):
<foo23>:
push   %rbp
mov    %rsp,%rbp
mov    $0x17,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo23() {
ret i32 23
}

LLVM IR (-O2):
define i32 @foo23() {
ret i32 23
}
void yy_1_ValueDqChoice(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_1_ValueDqChoice(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_combinations_aux(char const *, size_t,
                                          int /*<<< orphan*/, char *,
                                          int /*<<< orphan*/);
size_t strlen(char const *);
void print_combinations(const char *str) {
  size_t str_sz = strlen(str);
  char buff[str_sz + 1];
  print_combinations_aux(str, str_sz, 0, buff, 0);
}


x86 assembly (clang, -O0):
<print_combinations>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    %rdx,%rax
add    $0x1,%rax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
add    $0x10,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %r8d,%r8d
mov    %r8d,%edx
call   1040 <print_combinations_aux@plt>
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_combinations>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rsp,%rcx
lea    0x10(%rax),%rdx
and    $0xfffffffffffffff0,%rdx
sub    %rdx,%rcx
mov    %rcx,%rsp
mov    %rbx,%rdi
mov    %rax,%rsi
xor    %edx,%edx
xor    %r8d,%r8d
call   1040 <print_combinations_aux@plt>
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @print_combinations(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i64 @strlen(i8* %6)
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = add i64 %8, 1
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %4
%11 = alloca i8, i64 %9
store i64 %9, i64* %5
%12 = load i8*, i8** %2
%13 = load i64, i64* %3
%14 = call i32 @print_combinations_aux(i8* %12, i64 %13, i32 0, i8* %11, i32 0)
%15 = load i8*, i8** %4
ret void
}

LLVM IR (-O2):
define void @print_combinations(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = alloca i8, i64 %3
%5 = call i32 @print_combinations_aux(i8* %0, i64 %2, i32 0, i8* %4, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_version() {
  printf("qethqoat: Tool to query the OSA address table version %s\n",
         "S390_TOOLS_RELEASE");
  printf("Copyright IBM Corp. 2012, 2017\n");
}


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xf18(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf1d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_version>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xf0b(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf10(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [58 x i8] c"qethqoat: Tool to query the OSA address table version %s\0A\00"
@.str.1 = [19 x i8] c"S390_TOOLS_RELEASE\00"
@.str.2 = [32 x i8] c"Copyright IBM Corp. 2012, 2017\0A\00"
define void @print_version() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [58 x i8] c"qethqoat: Tool to query the OSA address table version %s\0A\00"
@.str.1 = [19 x i8] c"S390_TOOLS_RELEASE\00"
@str = [31 x i8] c"Copyright IBM Corp. 2012, 2017\00"
define void @print_version() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
int _get_file_size(const char *filename) {
  struct stat sb;
  if (stat(filename, &sb) == 0)
    return sb.st_size;
  else
    return -1;
}


x86 assembly (clang, -O0):
<_get_file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jne    113e <_get_file_size+0x2e>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1145 <_get_file_size+0x35>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_file_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
neg    %rax
sbb    %eax,%eax
or     (%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @_get_file_size(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 %7, i32 -1
ret i32 %8
}
/* Variables and functions */
char *concat(char *, char *);
char *getTabs(int indent) {
  char *tabs = "";
  char *tab = "\t";
  int i;
  for (i = 0; i < indent; i++) {
    tabs = concat(tabs, tab);
  }
  return tabs;
}


x86 assembly (clang, -O0):
<getTabs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    0xedf(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xed3(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1163 <getTabs+0x53>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <concat@plt>
mov    %rax,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1138 <getTabs+0x28>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTabs>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    1142 <getTabs+0x32>
mov    %edi,%ebx
lea    0xee0(%rip),%rax
lea    0xed8(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <concat@plt>
add    $0xffffffff,%ebx
jne    1130 <getTabs+0x20>
jmp    1149 <getTabs+0x39>
lea    0xeb8(%rip),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"\09\00"
define i8* @getTabs(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %2
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %3
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %4
store i32 0, i32* %5
br label %6
6: ; preds = %14, %1
%7 = load i32, i32* %5
%8 = load i32, i32* %2
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i8*, i8** %4
%13 = call i8* @concat(i8* %11, i8* %12)
store i8* %13, i8** %3
br label %14
14: ; preds = %10
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 1
store i32 %16, i32* %5
br label %6
17: ; preds = %6
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"\09\00"
define i8* @getTabs(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i8* [ %6, %3 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %1 ]
%6 = tail call i8* @concat(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %1 ], [ %6, %3 ]
ret i8* %10
}
int get_max(int left, int right) { return ((left > right) ? left : right); }


x86 assembly (clang, -O0):
<get_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <get_max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <get_max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @get_max(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @get_max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int gets(char *buf) {
  fgets(buf, 512, stdin);
  return 1;
}


x86 assembly (clang, -O0):
<gets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%edx
mov    $0x200,%esi
call   1030 <fgets@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gets>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edx
mov    $0x200,%esi
call   1030 <fgets@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @gets(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 512, i32 %4)
ret i32 1
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @gets(i8* %0) {
%2 = load i32, i32* @stdin
%3 = tail call i32 @fgets(i8* %0, i32 512, i32 %2)
ret i32 1
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
char *prepare_cmd(const char *cmd) {
  char *buff;
  int len;
  len = strlen(cmd) + 1 + 1;
  buff = malloc(len);
  memcpy(buff, cmd, strlen(cmd));
  buff[len - 1] = '&';
  buff[len] = '\0';
  return buff;
}


x86 assembly (clang, -O0):
<prepare_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x26,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prepare_cmd>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
movslq %eax,%r15
lea    0x2(%r15),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <memcpy@plt>
movw   $0x26,0x1(%r15,%rbx,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @prepare_cmd(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = call i8* @malloc(i32 %9)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = load i8*, i8** %2
%14 = call i32 @strlen(i8* %13)
%15 = call i32 @memcpy(i8* %11, i8* %12, i32 %14)
%16 = load i8*, i8** %3
%17 = load i32, i32* %4
%18 = sub nsw i32 %17, 1
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %16, i64 %19
store i8 38, i8* %20
%21 = load i8*, i8** %3
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
store i8 0, i8* %24
%25 = load i8*, i8** %3
ret i8* %25
}

LLVM IR (-O2):
define i8* @prepare_cmd(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = add nsw i32 %2, 2
%5 = tail call i8* @malloc(i32 %4)
%6 = tail call i32 @strlen(i8* %0)
%7 = tail call i32 @memcpy(i8* %5, i8* %0, i32 %6)
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
store i8 38, i8* %9
%10 = sext i32 %4 to i64
%11 = getelementptr inbounds i8, i8* %5, i64 %10
store i8 0, i8* %11
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *diminuto_pin_setup(int, int /*<<< orphan*/);
FILE *diminuto_pin_input(int pin) { return diminuto_pin_setup(pin, 0); }


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

x86 assembly (clang, -O2):
<diminuto_pin_input>:
xor    %esi,%esi
jmp    1030 <diminuto_pin_setup@plt>

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

LLVM IR (-O2):
define i32* @diminuto_pin_input(i32 %0) {
%2 = tail call i32* @diminuto_pin_setup(i32 %0, i32 0)
ret i32* %2
}
void board_timer(int x) {
  int timer = 50000 * x;
  volatile int *timer_low = (int *)0xFF202000 + 0x8;
  volatile int *timer_high = (int *)0xFF202000 + 0xc;
  volatile int *timer_ctrl = (int *)0xFF202000 + 0x4;
  volatile int *timer_status = (int *)0xFF202000;
  *(timer_low) = timer;
  *(timer_high) = timer >> 16;
  *(timer_ctrl) = 0x4;
  while (*(timer_status) != 0x1)
    ;
  *(timer_status) = 0;
}


x86 assembly (clang, -O0):
<board_timer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0xc350,-0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0xff202000,%eax
add    $0x20,%rax
mov    %rax,-0x10(%rbp)
mov    $0xff202000,%eax
add    $0x30,%rax
mov    %rax,-0x18(%rbp)
mov    $0xff202000,%eax
add    $0x10,%rax
mov    %rax,-0x20(%rbp)
mov    $0xff202000,%eax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%ecx
sar    $0x10,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x4,(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
cmp    $0x1,%eax
je     1174 <board_timer+0x74>
jmp    1160 <board_timer+0x60>
mov    -0x28(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<board_timer>:
mov    $0xff202000,%eax
imul   $0xc350,%edi,%ecx
mov    %ecx,0x20(%rax)
sar    $0x10,%ecx
mov    %ecx,0x30(%rax)
movl   $0x4,0x10(%rax)
nopl   0x0(%rax,%rax,1)
mov    (%rax),%ecx
cmp    $0x1,%ecx
jne    1120 <board_timer+0x20>
movl   $0x0,(%rax)
ret

LLVM IR (-O0):
define void @board_timer(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
store i32 %0, i32* %2
%8 = load i32, i32* %2
%9 = mul nsw i32 50000, %8
store i32 %9, i32* %3
store i32* getelementptr inbounds (i32, i32* inttoptr (i64 4280295424 to i32*), i64 8), i32** %4
store i32* getelementptr inbounds (i32, i32* inttoptr (i64 4280295424 to i32*), i64 12), i32** %5
store i32* getelementptr inbounds (i32, i32* inttoptr (i64 4280295424 to i32*), i64 4), i32** %6
store i32* inttoptr (i64 4280295424 to i32*), i32** %7
%10 = load i32, i32* %3
%11 = load i32*, i32** %4
store volatile i32 %10, i32* %11
%12 = load i32, i32* %3
%13 = ashr i32 %12, 16
%14 = load i32*, i32** %5
store volatile i32 %13, i32* %14
%15 = load i32*, i32** %6
store volatile i32 4, i32* %15
br label %16
16: ; preds = %20, %1
%17 = load i32*, i32** %7
%18 = load volatile i32, i32* %17
%19 = icmp ne i32 %18, 1
br i1 %19, label %20, label %21
20: ; preds = %16
br label %16
21: ; preds = %16
%22 = load i32*, i32** %7
store volatile i32 0, i32* %22
ret void
}

LLVM IR (-O2):
define void @board_timer(i32 %0) {
%2 = mul nsw i32 %0, 50000
store volatile i32 %2, i32* inttoptr (i64 4280295456 to i32*)
%3 = ashr i32 %2, 16
store volatile i32 %3, i32* inttoptr (i64 4280295472 to i32*)
store volatile i32 4, i32* inttoptr (i64 4280295440 to i32*)
br label %4
4: ; preds = %4, %1
%5 = load volatile i32, i32* inttoptr (i64 4280295424 to i32*)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %4
7: ; preds = %4
store volatile i32 0, i32* inttoptr (i64 4280295424 to i32*)
ret void
}
/* Variables and functions */
int ssl2_num_ciphers();
int ssl3_num_ciphers();
int ssl23_num_ciphers(void) {
  return (ssl3_num_ciphers() + ssl2_num_ciphers());
}


x86 assembly (clang, -O0):
<ssl23_num_ciphers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <ssl3_num_ciphers@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <ssl2_num_ciphers@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssl23_num_ciphers>:
push   %rbx
xor    %eax,%eax
call   1030 <ssl3_num_ciphers@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <ssl2_num_ciphers@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ssl23_num_ciphers() {
%1 = call i32 (...) @ssl3_num_ciphers()
%2 = call i32 (...) @ssl2_num_ciphers()
%3 = add nsw i32 %1, %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @ssl23_num_ciphers() {
%1 = tail call i32 (...) @ssl3_num_ciphers()
%2 = tail call i32 (...) @ssl2_num_ciphers()
%3 = add nsw i32 %2, %1
ret i32 %3
}
/* Variables and functions */
bool close_blank_input_file(void) { return (1); }


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

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

LLVM IR (-O0):
define i32 @close_blank_input_file() {
ret i32 1
}

LLVM IR (-O2):
define i32 @close_blank_input_file() {
ret i32 1
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void ts_init(uint8_t *p_ts) {
  p_ts[0] = 0x47;
  p_ts[1] = 0x0;
  p_ts[2] = 0x0;
  p_ts[3] = 0x0;
}


x86 assembly (clang, -O0):
<ts_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x47,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,0x8(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_init>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @ts_init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
store i32 71, i32* %4
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 0, i32* %6
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 2
store i32 0, i32* %8
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 3
store i32 0, i32* %10
ret void
}

LLVM IR (-O2):
define void @ts_init(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 71, i32 0, i32 0, i32 0>, <4 x i32>* %2
ret void
}
int test_imm_1Bint8_reg(signed char val) {
  return ((val) & (0x1B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Bint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x1b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_1Bint8_reg(i8 signext %0) {
%2 = and i8 %0, 27
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
int SIGN_EXTEND_L_W(int reg) {
  if (reg & 8)
    addbyte(0x41);
  addbyte(0x0f);
  addbyte(0xbf);
  addbyte(0xc0 | (reg & 7));
  return 0;
}


x86 assembly (clang, -O0):
<SIGN_EXTEND_L_W>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1134 <SIGN_EXTEND_L_W+0x24>
mov    $0x41,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0xbf,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
and    $0x7,%edi
or     $0xc0,%edi
call   1030 <addbyte@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIGN_EXTEND_L_W>:
push   %rbx
mov    %edi,%ebx
test   $0x8,%bl
je     1122 <SIGN_EXTEND_L_W+0x12>
mov    $0x41,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0xbf,%edi
call   1030 <addbyte@plt>
and    $0x7,%ebx
or     $0xc0,%ebx
mov    %ebx,%edi
call   1030 <addbyte@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @SIGN_EXTEND_L_W(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 8
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @addbyte(i32 65)
br label %8
8: ; preds = %6, %1
%9 = call i32 @addbyte(i32 15)
%10 = call i32 @addbyte(i32 191)
%11 = load i32, i32* %2
%12 = and i32 %11, 7
%13 = or i32 192, %12
%14 = call i32 @addbyte(i32 %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @SIGN_EXTEND_L_W(i32 %0) {
%2 = and i32 %0, 8
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @addbyte(i32 65)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @addbyte(i32 15)
%8 = tail call i32 @addbyte(i32 191)
%9 = and i32 %0, 7
%10 = or i32 %9, 192
%11 = tail call i32 @addbyte(i32 %10)
ret i32 0
}
int dict_uint_cmp(const void *k1, const void *k2) {
  const unsigned int a = *(const unsigned int *)k1;
  const unsigned int b = *(const unsigned int *)k2;
  return (a > b) - (a < b);
}


x86 assembly (clang, -O0):
<dict_uint_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x14(%rbp),%ecx
cmp    -0x18(%rbp),%ecx
setb   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dict_uint_cmp>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
seta   %al
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @dict_uint_cmp(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*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = icmp ugt i32 %13, %14
%16 = zext i1 %15 to i32
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = icmp ult i32 %17, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @dict_uint_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp ugt i32 %4, %6
%8 = zext i1 %7 to i32
%9 = icmp ult i32 %4, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void usage(int bad_digit) {
  printf("hex2dec: Illegal digit %c: use A-F, a-f and 0-9 with 		"
         "leading 'Ox'.\n",
         bad_digit);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [70 x i8] c"hex2dec: Illegal digit %c: use A-F, a-f and 0-9 with \09\09leading 'Ox'.\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [70 x i8] c"hex2dec: Illegal digit %c: use A-F, a-f and 0-9 with \09\09leading 'Ox'.\0A\00"
define void @usage(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0xa9() {
  Assert_real((isspace(169) == 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_isspace.c",
              850, ("isspace should be 0 for 0xa9"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0xa9>:
push   %rax
mov    $0xa9,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x352,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xa9\00"
define void @t_isspace_0xa9() {
%1 = call i64 @isspace(i32 169)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 850, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xa9\00"
define void @t_isspace_0xa9() {
%1 = tail call i64 @isspace(i32 169)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 850, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int is_leap(int year) {
  if (((year % 4) == 0) && (((year % 100) != 0) || ((year % 400) == 0))) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_leap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <is_leap+0x4f>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1143 <is_leap+0x43>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <is_leap+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <is_leap+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leap>:
test   $0x3,%dil
jne    1143 <is_leap+0x43>
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
ror    $0x2,%ecx
mov    $0x1,%eax
cmp    $0x28f5c28,%ecx
ja     1145 <is_leap+0x45>
movslq %edi,%rcx
imul   $0x51eb851f,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x27,%rcx
add    %edx,%ecx
imul   $0x190,%ecx,%ecx
sub    %ecx,%edi
je     1145 <is_leap+0x45>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_leap(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp ne i32 %5, 0
%7 = srem i32 %0, 400
%8 = icmp eq i32 %7, 0
%9 = or i1 %6, %8
br i1 %9, label %11, label %10
10: ; preds = %4, %1
br label %11
11: ; preds = %4, %10
%12 = phi i32 [ 0, %10 ], [ 1, %4 ]
ret i32 %12
}
int(safe_mod_func_int32_t_s_s)(int si1, int si2) {
  return ((si2 == 0) || ((si1 == (-2147483647 - 1)) && (si2 == (-1))))
             ? ((si1))
             : (si1 % si2);
}


x86 assembly (clang, -O0):
<safe_mod_func_int32_t_s_s>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112b <safe_mod_func_int32_t_s_s+0x2b>
cmpl   $0x80000000,-0x4(%rbp)
jne    1136 <safe_mod_func_int32_t_s_s+0x36>
cmpl   $0xffffffff,-0x8(%rbp)
jne    1136 <safe_mod_func_int32_t_s_s+0x36>
mov    -0x4(%rbp),%edx
mov    %edx,-0xc(%rbp)
jmp    1140 <safe_mod_func_int32_t_s_s+0x40>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_mod_func_int32_t_s_s>:
test   %esi,%esi
je     1117 <safe_mod_func_int32_t_s_s+0x17>
cmp    $0x80000000,%edi
jne    111a <safe_mod_func_int32_t_s_s+0x1a>
mov    $0x80000000,%eax
cmp    $0xffffffff,%esi
jne    111a <safe_mod_func_int32_t_s_s+0x1a>
ret
mov    %edi,%eax
ret
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @safe_mod_func_int32_t_s_s(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = icmp eq i32 %0, -2147483648
%6 = icmp eq i32 %1, -1
%7 = and i1 %5, %6
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = srem i32 %0, %1
br label %10
10: ; preds = %2, %4, %8
%11 = phi i32 [ %9, %8 ], [ -2147483648, %4 ], [ %0, %2 ]
ret i32 %11
}
void clearBRKflag(char flags[]) { flags[8 - 5] = '0'; }


x86 assembly (clang, -O0):
<clearBRKflag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x30,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearBRKflag>:
movb   $0x30,0x3(%rdi)
ret

LLVM IR (-O0):
define void @clearBRKflag(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 3
store i8 48, i8* %4
ret void
}

LLVM IR (-O2):
define void @clearBRKflag(i8* nocapture writeonly %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
store i8 48, i8* %2
ret void
}
int _start() {
  main();
  asm("movl $1,%%eax\n"
      "xorl %%ebx,%%ebx\n"
      "int $0x80"
      :);
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <main@plt>
mov    $0x1,%eax
xor    %ebx,%ebx
int    $0x80
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_start>:
push   %rax
xor    %eax,%eax
call   1030 <main@plt>
mov    $0x1,%eax
xor    %ebx,%ebx
int    $0x80
pop    %rcx
ret

LLVM IR (-O0):
define i32 @_start() {
%1 = alloca i32
%2 = call i32 (...) @main()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @_start() {
%1 = tail call i32 (...) @main()
tail call void asm sideeffect "movl $$1,%eax\0Axorl %ebx,%ebx\0Aint $$0x80", "~{dirflag},~{fpsr},~{flags}"()
ret i32 undef
}
/* Variables and functions */
int shim_enosys(int /*<<< orphan*/, int, unsigned int, unsigned int);
int shim_fsmount(int fd, unsigned int flags, unsigned int ms_flags) {
  return shim_enosys(0, fd, flags, ms_flags);
}


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

x86 assembly (clang, -O2):
<shim_fsmount>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

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

LLVM IR (-O2):
define i32 @shim_fsmount(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @shim_enosys(i32 0, i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
double exp(int /*<<< orphan*/);
int /*<<< orphan*/ random_exponential();
double random_pareto(void) { return exp(random_exponential()); }


x86 assembly (clang, -O0):
<random_pareto>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <random_exponential@plt>
mov    %eax,%edi
call   1040 <exp@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_pareto>:
push   %rax
xor    %eax,%eax
call   1030 <random_exponential@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <exp@plt>

LLVM IR (-O0):
define double @random_pareto() {
%1 = call i32 (...) @random_exponential()
%2 = call double @exp(i32 %1)
ret double %2
}

LLVM IR (-O2):
define double @random_pareto() {
%1 = tail call i32 (...) @random_exponential()
%2 = tail call double @exp(i32 %1)
ret double %2
}
/* Variables and functions */
int cos(float);
int sin(float);
void convert(float angle, float delta, int bin, int *x, int *y) {
  float r_angle = angle * (3.14159265 / 180);
  *x = bin * cos(r_angle);
  *y = bin * sin(r_angle);
}


x86 assembly (clang, -O0):
<convert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb2(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
movss  -0x24(%rbp),%xmm0
call   1040 <cos@plt>
mov    -0x2c(%rbp),%ecx
imul   %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
mov    %eax,-0x28(%rbp)
movss  -0x24(%rbp),%xmm0
call   1030 <sin@plt>
mov    -0x28(%rbp),%ecx
imul   %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
cvtss2sd %xmm0,%xmm0
mulsd  0xec4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
call   1040 <cos@plt>
imul   %ebp,%eax
mov    %eax,(%rbx)
movss  0xc(%rsp),%xmm0
call   1030 <sin@plt>
imul   %ebp,%eax
mov    %eax,(%r14)
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @convert(float %0, float %1, i32 %2, i32* %3, i32* %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca float
store float %0, float* %6
store float %1, float* %7
store i32 %2, i32* %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%12 = load float, float* %6
%13 = fpext float %12 to double
%14 = fmul double %13, 0x3F91DF46A1FAE712
%15 = fptrunc double %14 to float
store float %15, float* %11
%16 = load i32, i32* %8
%17 = load float, float* %11
%18 = call i32 @cos(float %17)
%19 = mul nsw i32 %16, %18
%20 = load i32*, i32** %9
store i32 %19, i32* %20
%21 = load i32, i32* %8
%22 = load float, float* %11
%23 = call i32 @sin(float %22)
%24 = mul nsw i32 %21, %23
%25 = load i32*, i32** %10
store i32 %24, i32* %25
ret void
}

LLVM IR (-O2):
define void @convert(float %0, float %1, i32 %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4) {
%6 = fpext float %0 to double
%7 = fmul double %6, 0x3F91DF46A1FAE712
%8 = fptrunc double %7 to float
%9 = tail call i32 @cos(float %8)
%10 = mul nsw i32 %9, %2
store i32 %10, i32* %3
%11 = tail call i32 @sin(float %8)
%12 = mul nsw i32 %11, %2
store i32 %12, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mat3d_from_mat4d(double *, double const *);
int /*<<< orphan*/ quatd_from_mat3d(double *, double *);
void quatd_from_mat4d(double quat[4], const double matrix[16]) {
  double tmpMat[9];
  mat3d_from_mat4d(tmpMat, matrix);
  quatd_from_mat3d(quat, tmpMat);
}


x86 assembly (clang, -O0):
<quatd_from_mat4d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <mat3d_from_mat4d@plt>
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1030 <quatd_from_mat3d@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quatd_from_mat4d>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <mat3d_from_mat4d@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <quatd_from_mat3d@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @quatd_from_mat4d(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca [9 x double]
store double* %0, double** %3
store double* %1, double** %4
%6 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 0
%7 = load double*, double** %4
%8 = call i32 @mat3d_from_mat4d(double* %6, double* %7)
%9 = load double*, double** %3
%10 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 0
%11 = call i32 @quatd_from_mat3d(double* %9, double* %10)
ret void
}

LLVM IR (-O2):
define void @quatd_from_mat4d(double* %0, double* %1) {
%3 = alloca [9 x double]
%4 = bitcast [9 x double]* %3 to i8*
%5 = getelementptr inbounds [9 x double], [9 x double]* %3, i64 0, i64 0
%6 = call i32 @mat3d_from_mat4d(double* %5, double* %1)
%7 = call i32 @quatd_from_mat3d(double* %0, double* %5)
ret void
}
/* Variables and functions */
scalar_t__ memcmp(char const *, char const *, size_t);
size_t strlen(char const *);
int starts_with(const char *pre, const char *str) {
  size_t lenpre = strlen(pre);
  size_t lenstr = strlen(str);
  return lenstr < lenpre ? 0 : memcmp(pre, str, lenpre) == 0;
}


x86 assembly (clang, -O0):
<starts_with>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1162 <starts_with+0x42>
xor    %eax,%eax
mov    %eax,-0x24(%rbp)
jmp    1182 <starts_with+0x62>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<starts_with>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rbx,%rcx
jb     115e <starts_with+0x3e>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @starts_with(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = icmp ult i64 %4, %3
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i64 @memcmp(i8* %0, i8* %1, i64 %3)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ 0, %2 ]
ret i32 %11
}
void ZeroArray1(float *a, int len) {
  int i = 0;
  while (i < len) {
    a[i] = 0.0;
    i += 1;
  }
}


x86 assembly (clang, -O0):
<ZeroArray1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113c <ZeroArray1+0x3c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <ZeroArray1+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZeroArray1>:
test   %esi,%esi
jle    1126 <ZeroArray1+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @ZeroArray1(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
%5 = alloca i32
store float* %0, float** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %10, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load float*, float** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds float, float* %11, i64 %13
store float 0.000000e+00, float* %14
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 1
store i32 %16, i32* %5
br label %6
17: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @ZeroArray1(float* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast float* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void command() { printf("this is command\n"); }


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

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

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

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

/* Variables and functions */
void h265hvcc_set_profile_idc(uint8_t *p, uint8_t val) {
  p[1] &= ~0x1f;
  p[1] |= val & 0x1f;
}


x86 assembly (clang, -O0):
<h265hvcc_set_profile_idc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
and    $0xffffffe0,%ecx
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
and    $0x1f,%ecx
mov    -0x8(%rbp),%rax
or     0x4(%rax),%ecx
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<h265hvcc_set_profile_idc>:
mov    0x4(%rdi),%eax
and    $0xffffffe0,%eax
and    $0x1f,%esi
or     %eax,%esi
mov    %esi,0x4(%rdi)
ret

LLVM IR (-O0):
define void @h265hvcc_set_profile_idc(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 = getelementptr inbounds i32, i32* %5, i64 1
%7 = load i32, i32* %6
%8 = and i32 %7, -32
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = and i32 %9, 31
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32, i32* %12
%14 = or i32 %13, %10
store i32 %14, i32* %12
ret void
}

LLVM IR (-O2):
define void @h265hvcc_set_profile_idc(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = and i32 %4, -32
%6 = and i32 %1, 31
%7 = or i32 %5, %6
store i32 %7, i32* %3
ret void
}