xunge/DecIR huggingface dataset:
int main(void) {
  int a = 20, b = 42;
  if (a > b) {
    return a;
  } else {
    return b;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
movl   $0x2a,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1130 <main+0x30>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <main+0x36>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 20, i32* %2
store i32 42, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = icmp sgt i32 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = load i32, i32* %2
store i32 %8, i32* %1
br label %11
9: ; preds = %0
%10 = load i32, i32* %3
store i32 %10, i32* %1
br label %11
11: ; preds = %9, %7
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @main() {
ret i32 42
}
int rho_ruby_is_double(unsigned long val) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @rho_ruby_is_double(i64 %0) {
ret i32 0
}
/* Variables and functions */
unsigned long long ULLONG_MAX;
unsigned long long pow(int, int);
unsigned long long int quotient(unsigned long long int a,
                                unsigned long long int b) {
  if (b == 0) {
    if (4 == 64) {
      return ULLONG_MAX;
    } else {
      return (pow(2, 4) - 1);
    }
  } else {
    return a / b;
  }
}


x86 assembly (clang, -O0):
<quotient>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1147 <quotient+0x37>
mov    $0x2,%edi
mov    $0x4,%esi
call   1030 <pow@plt>
sub    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1157 <quotient+0x47>
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quotient>:
test   %rsi,%rsi
je     112a <quotient+0x1a>
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     1143 <quotient+0x33>
mov    %rdi,%rax
xor    %edx,%edx
div    %rsi
ret
push   %rax
mov    $0x2,%edi
mov    $0x4,%esi
call   1030 <pow@plt>
add    $0xffffffffffffffff,%rax
add    $0x8,%rsp
ret
mov    %edi,%eax
xor    %edx,%edx
div    %esi
ret

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

LLVM IR (-O2):
@ULLONG_MAX = global i64 0
define i64 @quotient(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i64 @pow(i32 2, i32 4)
%6 = add i64 %5, -1
br label %9
7: ; preds = %2
%8 = udiv i64 %0, %1
br label %9
9: ; preds = %7, %4
%10 = phi i64 [ %6, %4 ], [ %8, %7 ]
ret i64 %10
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
pid_t getpid(void) { return 42; }


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

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

LLVM IR (-O0):
define i32 @getpid() {
ret i32 42
}

LLVM IR (-O2):
define i32 @getpid() {
ret i32 42
}
/* Type definitions */
struct rtattr {
  int dummy;
};

/* Variables and functions */
int parse_rtattr_flags(struct rtattr **, int, struct rtattr *, int,
                       int /*<<< orphan*/);
int parse_rtattr(struct rtattr *tb[], int max, struct rtattr *rta, int len) {
  return parse_rtattr_flags(tb, max, rta, len, 0);
}


x86 assembly (clang, -O0):
<parse_rtattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
xor    %r8d,%r8d
call   1030 <parse_rtattr_flags@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_rtattr>:
xor    %r8d,%r8d
jmp    1030 <parse_rtattr_flags@plt>

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

LLVM IR (-O2):
%struct.rtattr = type { i32 }
define i32 @parse_rtattr(%struct.rtattr** %0, i32 %1, %struct.rtattr* %2, i32 %3) {
%5 = tail call i32 @parse_rtattr_flags(%struct.rtattr** %0, i32 %1, %struct.rtattr* %2, i32 %3, i32 0)
ret i32 %5
}
int test_imm_F8int8_reg(signed char val) {
  return ((val) & (0xF8 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_F8int8_reg>:
cmp    $0x8,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F8int8_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, 248
%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_F8int8_reg(i8 signext %0) {
%2 = icmp ult i8 %0, 8
%3 = select i1 %2, i32 -40, i32 -20
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ pcibios_write_config_word(int /*<<< orphan*/, scalar_t__,
                                             int, int);
void set_rps(void) {
  pcibios_write_config_word(0, ((0x00 << 3) + 0), 0x74, 0x5555);
}


x86 assembly (clang, -O0):
<set_rps>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x74,%edx
mov    $0x5555,%ecx
call   1030 <pcibios_write_config_word@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_rps>:
xor    %edi,%edi
xor    %esi,%esi
mov    $0x74,%edx
mov    $0x5555,%ecx
jmp    1030 <pcibios_write_config_word@plt>

LLVM IR (-O0):
define void @set_rps() {
%1 = call i32 @pcibios_write_config_word(i32 0, i64 0, i32 116, i32 21845)
ret void
}

LLVM IR (-O2):
define void @set_rps() {
%1 = tail call i32 @pcibios_write_config_word(i32 0, i64 0, i32 116, i32 21845)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ perror(char *);
FILE *e_open_op_file(char *fname) {
  FILE *fp;
  fp = fopen(fname, "w");
  if (fp == NULL) {
    perror("File open failed\n");
    exit(1);
  }
  return fp;
}


x86 assembly (clang, -O0):
<e_open_op_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1171 <e_open_op_file+0x41>
lea    0xea0(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_open_op_file>:
push   %rax
lea    0xec8(%rip),%rsi
call   1030 <fopen@plt>
test   %rax,%rax
je     1144 <e_open_op_file+0x14>
pop    %rcx
ret
lea    0xeb7(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
@.str.1 = [18 x i8] c"File open failed\0A\00"
define i32* @e_open_op_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
%12 = load i32*, i32** %3
ret i32* %12
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
@.str.1 = [18 x i8] c"File open failed\0A\00"
define noalias i32* @e_open_op_file(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello World!\n");
  printf("Thank you:\n");
  printf("\tNumber 33\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xed5(%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>
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
@.str.1 = [12 x i8] c"Thank you:\0A\00"
@.str.2 = [12 x i8] c"\09Number 33\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
@str.3 = [11 x i8] c"Thank you:\00"
@str.4 = [11 x i8] c"\09Number 33\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.3, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
unsigned int str_hash(const char *s) {
  unsigned int hash = 0;
  int c;
  while ((c = *s++)) {
    hash = ((hash << 5) + hash) ^ c;
  }
  return (hash);
}


x86 assembly (clang, -O0):
<str_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     1141 <str_hash+0x41>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <str_hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <str_hash+0x28>
add    $0x1,%rdi
xor    %edx,%edx
mov    %edx,%eax
xchg   %ax,%ax
movsbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
xor    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1110 <str_hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @str_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = mul i32 %7, 33
%11 = xor i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
void UserBackgroundProcessingCalloutf(void) {}


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

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

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

LLVM IR (-O2):
define void @UserBackgroundProcessingCalloutf() {
ret void
}
/* Variables and functions */
char *strncpy(char *dst, const char *src, size_t n) {
  char *d = dst;
  while (n-- > 0 && (*d++ = *src++))
    ;
  return dst;
}


x86 assembly (clang, -O0):
<strncpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
mov    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x21(%rbp)
jbe    1164 <strncpy+0x64>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x20(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1174 <strncpy+0x74>
jmp    1179 <strncpy+0x79>
jmp    1118 <strncpy+0x18>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %rcx,%rdx
je     1126 <strncpy+0x26>
movzbl (%rsi,%rcx,1),%edi
mov    %dil,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dil,%dil
jne    1110 <strncpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strncpy(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
br label %4
4: ; preds = %9, %3
%5 = phi i8* [ %1, %3 ], [ %11, %9 ]
%6 = phi i64 [ %2, %3 ], [ %10, %9 ]
%7 = phi i8* [ %0, %3 ], [ %13, %9 ]
%8 = icmp eq i64 %6, 0
br i1 %8, label %15, label %9
9: ; preds = %4
%10 = add i64 %6, -1
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = load i8, i8* %5
%13 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %12, i8* %7
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %9
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("git world!");
  printf("hello world!");
  printf("test git");
  printf("git tag -a v1.1");
  printf("git tag -a v1.2");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
lea    0xed4(%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 <printf@plt>
lea    0xee7(%rip),%rdi
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"git world!\00"
@.str.1 = [13 x i8] c"hello world!\00"
@.str.2 = [9 x i8] c"test git\00"
@.str.3 = [16 x i8] c"git tag -a v1.1\00"
@.str.4 = [16 x i8] c"git tag -a v1.2\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"git world!\00"
@.str.1 = [13 x i8] c"hello world!\00"
@.str.2 = [9 x i8] c"test git\00"
@.str.3 = [16 x i8] c"git tag -a v1.1\00"
@.str.4 = [16 x i8] c"git tag -a v1.2\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int write(int, char *, int);
int cput(int fd, char c) { return write(fd, &c, 1); }


x86 assembly (clang, -O0):
<cput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cput>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cput(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i32, i32* %3
%6 = call i32 @write(i32 %5, i8* %4, i32 1)
ret i32 %6
}

LLVM IR (-O2):
define i32 @cput(i32 %0, i8 signext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @write(i32 %0, i8* %3, i32 1)
ret i32 %4
}
/* Variables and functions */
int strcmp(void const *, void const *);
int scmp(const void *p, const void *q) { return (strcmp(p, q)); }


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

x86 assembly (clang, -O2):
<scmp>:
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @scmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @strcmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @scmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
void TimerTick() {}


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

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

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

LLVM IR (-O2):
define void @TimerTick() {
ret void
}
/* Type definitions */
struct PdSocketEvent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct PdSocketEvent *);
void free_(struct PdSocketEvent *ev) {
  if (NULL != ev) {
    free(ev);
  }
}


x86 assembly (clang, -O0):
<free_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     1131 <free_+0x21>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_>:
test   %rdi,%rdi
je     111a <free_+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.PdSocketEvent = type { i32 }
define void @free_(%struct.PdSocketEvent* %0) {
%2 = alloca %struct.PdSocketEvent*
store %struct.PdSocketEvent* %0, %struct.PdSocketEvent** %2
%3 = load %struct.PdSocketEvent*, %struct.PdSocketEvent** %2
%4 = icmp ne %struct.PdSocketEvent* null, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.PdSocketEvent*, %struct.PdSocketEvent** %2
%7 = call i32 @free(%struct.PdSocketEvent* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.PdSocketEvent = type { i32 }
define void @free_(%struct.PdSocketEvent* %0) {
%2 = icmp eq %struct.PdSocketEvent* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.PdSocketEvent* %0)
br label %5
5: ; preds = %3, %1
ret void
}
unsigned long SysCtlFlashSizeGet(void) {
  return ((*((volatile unsigned long *)(0x400FB900))) & 0x00000007);
}


x86 assembly (clang, -O0):
<SysCtlFlashSizeGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fb900,%eax
mov    (%rax),%rax
and    $0x7,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlFlashSizeGet>:
mov    0x400fb900,%rax
40
and    $0x7,%eax
ret

LLVM IR (-O0):
define i64 @SysCtlFlashSizeGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074772224 to i64*)
%2 = and i64 %1, 7
ret i64 %2
}

LLVM IR (-O2):
define i64 @SysCtlFlashSizeGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074772224 to i64*)
%2 = and i64 %1, 7
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x62() {
  Assert_real((isgraph(98)),
              "/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_isgraph.c",
              495, ("isgraph should be 1 for b"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x62>:
push   %rbp
mov    %rsp,%rbp
mov    $0x62,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1ef,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x62>:
push   %rax
mov    $0x62,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x1ef,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for b\00"
define void @t_isgraph_0x62() {
%1 = call i32 @isgraph(i32 98)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 495, i8* getelementptr inbounds ([26 x i8], [26 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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for b\00"
define void @t_isgraph_0x62() {
%1 = tail call i32 @isgraph(i32 98)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 495, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct wl_surface {
  int dummy;
};
struct wl_subsurface {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_marshal(struct wl_proxy *, int,
                                    struct wl_surface *);
void wl_subsurface_place_above(struct wl_subsurface *wl_subsurface,
                               struct wl_surface *sibling) {
  wl_proxy_marshal((struct wl_proxy *)wl_subsurface, 2, sibling);
}


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

x86 assembly (clang, -O2):
<wl_subsurface_place_above>:
mov    %rsi,%rdx
mov    $0x2,%esi
jmp    1030 <wl_proxy_marshal@plt>

LLVM IR (-O0):
%struct.wl_subsurface = type { i32 }
%struct.wl_surface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_subsurface_place_above(%struct.wl_subsurface* %0, %struct.wl_surface* %1) {
%3 = alloca %struct.wl_subsurface*
%4 = alloca %struct.wl_surface*
store %struct.wl_subsurface* %0, %struct.wl_subsurface** %3
store %struct.wl_surface* %1, %struct.wl_surface** %4
%5 = load %struct.wl_subsurface*, %struct.wl_subsurface** %3
%6 = bitcast %struct.wl_subsurface* %5 to %struct.wl_proxy*
%7 = load %struct.wl_surface*, %struct.wl_surface** %4
%8 = call i32 @wl_proxy_marshal(%struct.wl_proxy* %6, i32 2, %struct.wl_surface* %7)
ret void
}

LLVM IR (-O2):
%struct.wl_subsurface = type { i32 }
%struct.wl_surface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_subsurface_place_above(%struct.wl_subsurface* %0, %struct.wl_surface* %1) {
%3 = bitcast %struct.wl_subsurface* %0 to %struct.wl_proxy*
%4 = tail call i32 @wl_proxy_marshal(%struct.wl_proxy* %3, i32 2, %struct.wl_surface* %1)
ret void
}
void clrtask(unsigned int *set, int task) { *set &= ~(1 << task); }


x86 assembly (clang, -O0):
<clrtask>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
xor    $0xffffffff,%ecx
mov    -0x8(%rbp),%rax
and    (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clrtask>:
mov    %esi,%ecx
mov    $0xfffffffe,%eax
rol    %cl,%eax
and    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @clrtask(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 = shl i32 1, %5
%7 = xor i32 %6, -1
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = and i32 %9, %7
store i32 %10, i32* %8
ret void
}

LLVM IR (-O2):
define void @clrtask(i32* nocapture %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, -1
%5 = load i32, i32* %0
%6 = and i32 %5, %4
store i32 %6, i32* %0
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int override_redirect;
};
struct TYPE_4__ {
  TYPE_1__ xreparent;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xreparent_override_redirect(void *_p, int _v) {
  ((XEvent *)_p)->xreparent.override_redirect = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xreparent_override_redirect>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xreparent_override_redirect(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xreparent_override_redirect(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void cmd_nick(char *prefix, char **params, int n_params) {}


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

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

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

LLVM IR (-O2):
define void @cmd_nick(i8* nocapture %0, i8** nocapture %1, i32 %2) {
ret void
}
float invert(float color, float factor) {
  return factor * (1.0f - color) + (1.0f - factor) * color;
}


x86 assembly (clang, -O0):
<invert>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xee5(%rip),%xmm2
subss  -0x4(%rbp),%xmm2
movss  0xed8(%rip),%xmm1
subss  -0x8(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<invert>:
movss  0xef8(%rip),%xmm2
movaps %xmm2,%xmm3
subss  %xmm0,%xmm3
subss  %xmm1,%xmm2
mulss  %xmm2,%xmm0
mulss  %xmm1,%xmm3
addss  %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @invert(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load float, float* %3
%7 = fsub float 1.000000e+00, %6
%8 = load float, float* %4
%9 = fsub float 1.000000e+00, %8
%10 = load float, float* %3
%11 = fmul float %9, %10
%12 = call float @llvm.fmuladd.f32(float %5, float %7, float %11)
ret float %12
}

LLVM IR (-O2):
define float @invert(float %0, float %1) {
%3 = fsub float 1.000000e+00, %0
%4 = fsub float 1.000000e+00, %1
%5 = fmul float %4, %0
%6 = tail call float @llvm.fmuladd.f32(float %1, float %3, float %5)
ret float %6
}
int NextPrime(int N) {
  int i;
  if (N % 2 == 0)
    N++;
  for (;; N += 2) {
    for (i = 3; i * i <= N; i += 2)
      if (N % i == 0)
        goto ContOuter;
    return N;
  ContOuter:;
  }
}


x86 assembly (clang, -O0):
<NextPrime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1124 <NextPrime+0x24>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1129 <NextPrime+0x29>
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1168 <NextPrime+0x68>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    1155 <NextPrime+0x55>
jmp    116d <NextPrime+0x6d>
jmp    115a <NextPrime+0x5a>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1130 <NextPrime+0x30>
mov    -0x4(%rbp),%eax
pop    %rbp
ret
jmp    1172 <NextPrime+0x72>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    1129 <NextPrime+0x29>

x86 assembly (clang, -O2):
<NextPrime>:
mov    %edi,%ecx
not    %ecx
and    $0x1,%ecx
add    %edi,%ecx
cmp    $0x9,%ecx
jge    1111 <NextPrime+0x11>
mov    %ecx,%eax
ret
mov    $0x3,%esi
cs nopw 0x0(%rax,%rax,1)
mov    %ecx,%eax
cltd
idiv   %esi
add    $0x2,%esi
test   %edx,%edx
je     1137 <NextPrime+0x37>
mov    %esi,%eax
imul   %esi,%eax
cmp    %ecx,%eax
jle    1120 <NextPrime+0x20>
jmp    110e <NextPrime+0xe>
add    $0x2,%ecx
mov    $0x3,%esi
jmp    1120 <NextPrime+0x20>

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

LLVM IR (-O2):
define i32 @NextPrime(i32 %0) {
%2 = and i32 %0, 1
%3 = xor i32 %2, 1
%4 = add nsw i32 %3, %0
%5 = icmp slt i32 %4, 9
br i1 %5, label %16, label %6
6: ; preds = %1, %18
%7 = phi i32 [ %19, %18 ], [ %4, %1 ]
br label %11
8: ; preds = %11
%9 = mul nsw i32 %15, %15
%10 = icmp sgt i32 %9, %7
br i1 %10, label %16, label %11
11: ; preds = %6, %8
%12 = phi i32 [ 3, %6 ], [ %15, %8 ]
%13 = srem i32 %7, %12
%14 = icmp eq i32 %13, 0
%15 = add nuw nsw i32 %12, 2
br i1 %14, label %18, label %8
16: ; preds = %8, %1
%17 = phi i32 [ %4, %1 ], [ %7, %8 ]
ret i32 %17
18: ; preds = %11
%19 = add nsw i32 %7, 2
br label %6
}
void XkbGetControls() {}


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

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

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

LLVM IR (-O2):
define void @XkbGetControls() {
ret void
}
int dummy_1(int a, int b, int c) { return a + b + c; }


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

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

LLVM IR (-O0):
define i32 @dummy_1(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 = add nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @dummy_1(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = add nsw i32 %4, %2
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
scalar_t__ fork();
int /*<<< orphan*/ workHard(int, int);
pid_t startWorker(void) {
  pid_t pid = fork();
  if (pid == 0) {
    while (1) {
      workHard(50, 800);
    }
  }
  return pid;
}


x86 assembly (clang, -O0):
<startWorker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <fork@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1157 <startWorker+0x37>
jmp    1143 <startWorker+0x23>
mov    $0x32,%edi
mov    $0x320,%esi
call   1030 <workHard@plt>
jmp    1143 <startWorker+0x23>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startWorker>:
push   %rax
xor    %eax,%eax
call   1040 <fork@plt>
test   %rax,%rax
je     1130 <startWorker+0x10>
pop    %rcx
ret
nop
mov    $0x32,%edi
mov    $0x320,%esi
call   1030 <workHard@plt>
jmp    1130 <startWorker+0x10>

LLVM IR (-O0):
define i64 @startWorker() {
%1 = alloca i64
%2 = call i64 (...) @fork()
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
br label %6
6: ; preds = %5, %6
%7 = call i32 @workHard(i32 50, i32 800)
br label %6
8: ; preds = %0
%9 = load i64, i64* %1
ret i64 %9
}

LLVM IR (-O2):
define i64 @startWorker() {
%1 = tail call i64 (...) @fork()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0, %3
%4 = tail call i32 @workHard(i32 50, i32 800)
br label %3
5: ; preds = %0
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int func_count();
int func_inputs_max();
size_t index_in_cell(size_t i) {
  const size_t items_in_cell = func_inputs_max() + (func_count() > 1 ? 1 : 0);
  assert(items_in_cell > 0);
  return i % items_in_cell;
}


x86 assembly (clang, -O0):
<index_in_cell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <func_inputs_max@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <func_count@plt>
mov    %eax,%esi
mov    -0x14(%rbp),%eax
xor    %ecx,%ecx
mov    $0x1,%edx
cmp    $0x1,%esi
cmovg  %edx,%ecx
add    %ecx,%eax
cltq
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rdx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<index_in_cell>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1050 <func_inputs_max@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <func_count@plt>
xor    %ebx,%ebx
cmp    $0x2,%eax
setge  %bl
add    %ebp,%ebx
movslq %ebx,%rbp
xor    %edi,%edi
test   %ebp,%ebp
setne  %dil
call   1040 <assert@plt>
mov    %r14,%rax
or     %rbp,%rax
shr    $0x20,%rax
je     117a <index_in_cell+0x4a>
mov    %r14,%rax
xor    %edx,%edx
div    %rbp
mov    %rdx,%rax
jmp    1183 <index_in_cell+0x53>
mov    %r14d,%eax
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i64 @index_in_cell(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = call i32 (...) @func_inputs_max()
%5 = call i32 (...) @func_count()
%6 = icmp sgt i32 %5, 1
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 1, i32 0
%9 = add nsw i32 %4, %8
%10 = sext i32 %9 to i64
store i64 %10, i64* %3
%11 = load i64, i64* %3
%12 = icmp ugt i64 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i64, i64* %2
%16 = load i64, i64* %3
%17 = urem i64 %15, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @index_in_cell(i64 %0) {
%2 = tail call i32 (...) @func_inputs_max()
%3 = tail call i32 (...) @func_count()
%4 = icmp sgt i32 %3, 1
%5 = zext i1 %4 to i32
%6 = add nsw i32 %2, %5
%7 = sext i32 %6 to i64
%8 = icmp ne i32 %6, 0
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = urem i64 %0, %7
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ foo2(short *);
void tr4(short array[], int n) {
  int x;
  if (n > 0)
    for (x = 0; x < n; x++)
      foo2(&array[x]);
}


x86 assembly (clang, -O0):
<tr4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1163 <tr4+0x53>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <tr4+0x4e>
mov    -0x8(%rbp),%rdi
movslq -0x10(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rdi
call   1030 <foo2@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1130 <tr4+0x20>
jmp    1163 <tr4+0x53>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tr4>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1132 <tr4+0x22>
mov    %rdi,%rbx
mov    %esi,%r14d
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <foo2@plt>
add    $0x2,%rbx
add    $0xffffffffffffffff,%r14
jne    1120 <tr4+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @tr4(i16* %0, i32 %1) {
%3 = alloca i16*
%4 = alloca i32
%5 = alloca i32
store i16* %0, i16** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %23
8: ; preds = %2
store i32 0, i32* %5
br label %9
9: ; preds = %19, %8
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %22
13: ; preds = %9
%14 = load i16*, i16** %3
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i16, i16* %14, i64 %16
%18 = call i32 @foo2(i16* %17)
br label %19
19: ; preds = %13
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %9
22: ; preds = %9
br label %23
23: ; preds = %22, %2
ret void
}

LLVM IR (-O2):
define void @tr4(i16* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i16, i16* %0, i64 %7
%9 = tail call i32 @foo2(i16* %8)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_magic_databases();
int /*<<< orphan*/ precalc_king_moves();
int /*<<< orphan*/ precalc_knight_moves();
int /*<<< orphan*/ precalc_pawn_moves();
void bb_init(void) {
  init_magic_databases();
  precalc_pawn_moves();
  precalc_king_moves();
  precalc_knight_moves();
}


x86 assembly (clang, -O0):
<bb_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <init_magic_databases@plt>
mov    $0x0,%al
call   1030 <precalc_pawn_moves@plt>
mov    $0x0,%al
call   1060 <precalc_king_moves@plt>
mov    $0x0,%al
call   1040 <precalc_knight_moves@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bb_init>:
push   %rax
xor    %eax,%eax
call   1050 <init_magic_databases@plt>
xor    %eax,%eax
call   1030 <precalc_pawn_moves@plt>
xor    %eax,%eax
call   1060 <precalc_king_moves@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <precalc_knight_moves@plt>

LLVM IR (-O0):
define void @bb_init() {
%1 = call i32 (...) @init_magic_databases()
%2 = call i32 (...) @precalc_pawn_moves()
%3 = call i32 (...) @precalc_king_moves()
%4 = call i32 (...) @precalc_knight_moves()
ret void
}

LLVM IR (-O2):
define void @bb_init() {
%1 = tail call i32 (...) @init_magic_databases()
%2 = tail call i32 (...) @precalc_pawn_moves()
%3 = tail call i32 (...) @precalc_king_moves()
%4 = tail call i32 (...) @precalc_knight_moves()
ret void
}
int intComp(const int a1, const int a2) { return a1 - a2; }


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

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

LLVM IR (-O0):
define i32 @intComp(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 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @intComp(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
void stoptimer(int timernum) {}


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

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

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

LLVM IR (-O2):
define void @stoptimer(i32 %0) {
ret void
}
void __attribute__((weak)) dma1_stream7_isr() { debug_handler(__FUNCTION__); }


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

x86 assembly (clang, -O2):
<dma1_stream7_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.dma1_stream7_isr = [17 x i8] c"dma1_stream7_isr\00"
define weak void @dma1_stream7_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__FUNCTION__.dma1_stream7_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.dma1_stream7_isr = [17 x i8] c"dma1_stream7_isr\00"
define weak void @dma1_stream7_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__FUNCTION__.dma1_stream7_isr, i64 0, i64 0))
ret void
}
/* Variables and functions */
int any_decrqss(char const *, char *);
int rpt_DECSZS(const char *the_title) { return any_decrqss(the_title, ",{"); }


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

x86 assembly (clang, -O2):
<rpt_DECSZS>:
lea    0xee9(%rip),%rsi
jmp    1030 <any_decrqss@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c",{\00"
define i32 @rpt_DECSZS(i8* %0) {
%2 = tail call i32 @any_decrqss(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
char *strdup(char *);
char *__str_copy__(char *v) {
  if (!v)
    return 0;
  return strdup(v);
}


x86 assembly (clang, -O0):
<__str_copy__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <__str_copy__+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1141 <__str_copy__+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__str_copy__>:
test   %rdi,%rdi
je     111a <__str_copy__+0xa>
jmp    1030 <strdup@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i8* @__str_copy__(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @strdup(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
int execve(char *name, char **argv, char **env) { return 0; }


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

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

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

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