xunge/DecIR huggingface dataset:
/* Variables and functions */
char *basename(char *);
int /*<<< orphan*/ printf(char *, ...);
void _usage(char *arg) {
  char *command = basename(arg);
  printf("Usage: %s [-f FILE]\n\n", command);
  printf("  -f, --file=FILE output file name [DEFAULT:stdout]\n");
}


x86 assembly (clang, -O0):
<_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <basename@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_usage>:
push   %rax
call   1050 <basename@plt>
lea    0xec3(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec8(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Usage: %s [-f FILE]\0A\0A\00"
@.str.1 = [53 x i8] c" -f, --file=FILE output file name [DEFAULT:stdout]\0A\00"
define void @_usage(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @basename(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Usage: %s [-f FILE]\0A\0A\00"
@str = [52 x i8] c" -f, --file=FILE output file name [DEFAULT:stdout]\00"
define void @_usage(i8* %0) {
%2 = tail call i8* @basename(i8* %0)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_AAuint16_reg(unsigned short val) {
  return ((val) & (-0xAA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_AAuint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff56,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_AAuint16_reg>:
test   $0xff56,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_AAuint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -170
%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_AAuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -170
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ stat(char const *, struct stat *);
int pl_file_exists(const char *file) {
  struct stat st;
  if (!stat(file, &st))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<pl_file_exists>:
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,%eax
jne    113e <pl_file_exists+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1145 <pl_file_exists+0x35>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pl_file_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @pl_file_exists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
int compter_uns(int x) {
  int res;
  res = 0;
  while (x != 0) {
    res = (res + (x % 2)) % 2;
    x = x / 2;
  }
  return res;
}


x86 assembly (clang, -O0):
<compter_uns>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114c <compter_uns+0x4c>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <compter_uns+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compter_uns>:
test   %edi,%edi
je     113b <compter_uns+0x3b>
xor    %edx,%edx
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
shr    $0x1f,%ecx
add    %edi,%ecx
mov    %ecx,%esi
and    $0xfffffffe,%esi
mov    %edi,%eax
sub    %esi,%eax
add    %edx,%eax
mov    %eax,%edx
shr    $0x1f,%edx
add    %eax,%edx
and    $0xfffffffe,%edx
sub    %edx,%eax
sar    %ecx
add    $0x1,%edi
mov    %eax,%edx
cmp    $0x2,%edi
mov    %ecx,%edi
ja     1110 <compter_uns+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @compter_uns(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = srem i32 %5, 2
%7 = add nsw i32 %4, %6
%8 = srem i32 %7, 2
%9 = sdiv i32 %5, 2
%10 = add i32 %5, 1
%11 = icmp ult i32 %10, 3
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ enumerate();
int main() { enumerate(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <enumerate@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <enumerate@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @enumerate()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @enumerate()
ret i32 0
}
void init_net(void) {}


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

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

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

LLVM IR (-O2):
define void @init_net() {
ret void
}
/* Variables and functions */
int getword(char *, int);
int /*<<< orphan*/ printf(char *, char *);
void main() {
  int l = 1000;
  char *w[l];
  int i = getword(*w, l);
  printf("%s", w[i]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x3e8,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
lea    0xf(,%rcx,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,-0x28(%rbp)
mov    %rax,%rsp
mov    %rcx,-0x18(%rbp)
mov    (%rax),%rdi
mov    -0x4(%rbp),%esi
call   1040 <getword@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,-0x1c(%rbp)
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3e8,%esi
call   1040 <getword@plt>
lea    0xece(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i32
store i32 1000, i32* %1
%5 = load i32, i32* %1
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %2
%8 = alloca i8*, i64 %6
store i64 %6, i64* %3
%9 = load i8*, i8** %8
%10 = load i32, i32* %1
%11 = call i32 @getword(i8* %9, i32 %10)
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8*, i8** %8, i64 %13
%15 = load i8*, i8** %14
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @main() {
%1 = tail call i32 @getword(i8* undef, i32 1000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bzero(void *, unsigned long);
int /*<<< orphan*/ free(void *);
unsigned long ht_remove(void *, char *);
int /*<<< orphan*/ initialize();
void mhandle_free(void *ptr, char *at) {
  unsigned long size;
  if (!ptr)
    return;
  initialize();
  ptr -= 2;
  size = ht_remove(ptr, at);
  bzero(ptr, size + (2 * 2));
  free(ptr);
}


x86 assembly (clang, -O0):
<mhandle_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1160 <mhandle_free+0x20>
jmp    119e <mhandle_free+0x5e>
mov    $0x0,%al
call   1050 <initialize@plt>
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffffe,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <ht_remove@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x4,%rsi
call   1060 <bzero@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mhandle_free>:
test   %rdi,%rdi
je     1180 <mhandle_free+0x40>
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <initialize@plt>
add    $0xfffffffffffffffe,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <ht_remove@plt>
lea    0x4(%rax),%rsi
mov    %rbx,%rdi
call   1060 <bzero@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @mhandle_free(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = tail call i32 (...) @initialize()
%6 = getelementptr i8, i8* %0, i64 -2
%7 = tail call i64 @ht_remove(i8* %6, i8* %1)
%8 = add i64 %7, 4
%9 = tail call i32 @bzero(i8* %6, i64 %8)
%10 = tail call i32 @free(i8* %6)
br label %11
11: ; preds = %2, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RegReadA_LC898122AF(int, unsigned char *);
unsigned char TriSts(void) {
  unsigned char UcRsltSts = 0;
  unsigned char UcVal;
  RegReadA_LC898122AF(0x0129, &UcVal);
  if (UcVal & 0x03) {
    RegReadA_LC898122AF(0x01F4, &UcVal);
    UcRsltSts = UcVal & 0x11;
    UcRsltSts |= 0x80;
  }
  return UcRsltSts;
}


x86 assembly (clang, -O0):
<TriSts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
mov    $0x129,%edi
lea    -0x2(%rbp),%rsi
call   1030 <RegReadA_LC898122AF@plt>
movzbl -0x2(%rbp),%eax
and    $0x3,%eax
cmp    $0x0,%eax
je     115e <TriSts+0x4e>
mov    $0x1f4,%edi
lea    -0x2(%rbp),%rsi
call   1030 <RegReadA_LC898122AF@plt>
movzbl -0x2(%rbp),%eax
and    $0x11,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
or     $0x80,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TriSts>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x129,%edi
call   1030 <RegReadA_LC898122AF@plt>
testb  $0x3,0x7(%rsp)
je     1140 <TriSts+0x30>
lea    0x7(%rsp),%rsi
mov    $0x1f4,%edi
call   1030 <RegReadA_LC898122AF@plt>
mov    0x7(%rsp),%al
and    $0x11,%al
or     $0x80,%al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @TriSts() {
%1 = alloca i8
%2 = alloca i8
store i8 0, i8* %1
%3 = call i32 @RegReadA_LC898122AF(i32 297, i8* %2)
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = and i32 %5, 3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %18
8: ; preds = %0
%9 = call i32 @RegReadA_LC898122AF(i32 500, i8* %2)
%10 = load i8, i8* %2
%11 = zext i8 %10 to i32
%12 = and i32 %11, 17
%13 = trunc i32 %12 to i8
store i8 %13, i8* %1
%14 = load i8, i8* %1
%15 = zext i8 %14 to i32
%16 = or i32 %15, 128
%17 = trunc i32 %16 to i8
store i8 %17, i8* %1
br label %18
18: ; preds = %8, %0
%19 = load i8, i8* %1
ret i8 %19
}

LLVM IR (-O2):
define zeroext i8 @TriSts() {
%1 = alloca i8
%2 = call i32 @RegReadA_LC898122AF(i32 297, i8* %1)
%3 = load i8, i8* %1
%4 = and i8 %3, 3
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %0
%7 = call i32 @RegReadA_LC898122AF(i32 500, i8* %1)
%8 = load i8, i8* %1
%9 = and i8 %8, 17
%10 = or i8 %9, -128
br label %11
11: ; preds = %6, %0
%12 = phi i8 [ %10, %6 ], [ 0, %0 ]
ret i8 %12
}
long RoundUpToEven(long value) { return value + (value % 2); }


x86 assembly (clang, -O0):
<RoundUpToEven>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    -0x10(%rbp),%rax
add    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RoundUpToEven>:
mov    %rdi,%rcx
shr    $0x3f,%rcx
add    %rdi,%rcx
and    $0xfffffffffffffffe,%rcx
mov    %rdi,%rax
sub    %rcx,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @RoundUpToEven(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = srem i64 %4, 2
%6 = add nsw i64 %3, %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @RoundUpToEven(i64 %0) {
%2 = srem i64 %0, 2
%3 = add nsw i64 %2, %0
ret i64 %3
}
void intToByte(int i, unsigned char *bytes, int size) {
  bytes[0] = (unsigned char)(0xff & i);
  bytes[1] = (unsigned char)((0xff00 & i) >> 8);
  bytes[2] = (unsigned char)((0xff0000 & i) >> 16);
  bytes[3] = (unsigned char)((0xff000000 & i) >> 24);
  return;
}


x86 assembly (clang, -O0):
<intToByte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x4(%rbp),%eax
and    $0xff0000,%eax
sar    $0x10,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x4(%rbp),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<intToByte>:
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @intToByte(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = and i32 255, %7
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i32, i32* %4
%13 = and i32 65280, %12
%14 = ashr i32 %13, 8
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8 %15, i8* %17
%18 = load i32, i32* %4
%19 = and i32 16711680, %18
%20 = ashr i32 %19, 16
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %5
%23 = getelementptr inbounds i8, i8* %22, i64 2
store i8 %21, i8* %23
%24 = load i32, i32* %4
%25 = and i32 -16777216, %24
%26 = lshr i32 %25, 24
%27 = trunc i32 %26 to i8
%28 = load i8*, i8** %5
%29 = getelementptr inbounds i8, i8* %28, i64 3
store i8 %27, i8* %29
ret void
}

LLVM IR (-O2):
define void @intToByte(i32 %0, i8* nocapture writeonly %1, i32 %2) {
%4 = trunc i32 %0 to i8
store i8 %4, i8* %1
%5 = lshr i32 %0, 8
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %6, i8* %7
%8 = lshr i32 %0, 16
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %9, i8* %10
%11 = lshr i32 %0, 24
%12 = trunc i32 %11 to i8
%13 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %12, i8* %13
ret void
}
void rop3_252_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = T | S;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


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

x86 assembly (clang, -O2):
<rop3_252_0_1>:
mov    %esi,%eax
not    %al
and    %dl,%al
and    (%rdi),%al
or     %sil,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_252_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, -1
%5 = and i8 %4, %2
%6 = load i8, i8* %0
%7 = and i8 %5, %6
%8 = or i8 %7, %1
store i8 %8, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nullpo_info_core(char const *, int, char const *,
                                    int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int nullpo_chk(const char *file, int line, const char *func,
               const void *target) {
  if (target != NULL)
    return 0;
  nullpo_info_core(file, line, func, NULL, NULL);
  return 1;
}


x86 assembly (clang, -O0):
<nullpo_chk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     113e <nullpo_chk+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    115d <nullpo_chk+0x4d>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rcx
call   1030 <nullpo_info_core@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nullpo_chk>:
xor    %eax,%eax
test   %rcx,%rcx
je     1118 <nullpo_chk+0x8>
ret
push   %rax
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <nullpo_info_core@plt>
mov    $0x1,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @nullpo_chk(i8* %0, i32 %1, i8* %2, i8* readnone %3) {
%5 = icmp eq i8* %3, null
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @nullpo_info_core(i8* %0, i32 %1, i8* %2, i32* null, i32* null)
br label %8
8: ; preds = %4, %6
%9 = phi i32 [ 1, %6 ], [ 0, %4 ]
ret i32 %9
}
void av_i2int() {}


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

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

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

LLVM IR (-O2):
define void @av_i2int() {
ret void
}
/* Variables and functions */
unsigned int MMINL(unsigned int);
void ert_read(unsigned int reg, unsigned int *data) {
  *data = MMINL(reg);
  ;
}


x86 assembly (clang, -O0):
<ert_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <MMINL@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ert_read>:
push   %rbx
mov    %rsi,%rbx
call   1030 <MMINL@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @ert_read(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 = call i32 @MMINL(i32 %5)
%7 = load i32*, i32** %4
store i32 %6, i32* %7
ret void
}

LLVM IR (-O2):
define void @ert_read(i32 %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @MMINL(i32 %0)
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clearLEDBuffer();
void clear(void) { clearLEDBuffer(); }


x86 assembly (clang, -O0):
<clear>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clearLEDBuffer@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @clear() {
%1 = call i32 (...) @clearLEDBuffer()
ret void
}

LLVM IR (-O2):
define void @clear() {
%1 = tail call i32 (...) @clearLEDBuffer()
ret void
}
/* Variables and functions */
int ext2_block_to_sector_count(int);
int ext2_block_to_lba(int block_num) {
  return 2048 + ext2_block_to_sector_count(block_num);
}


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

x86 assembly (clang, -O2):
<ext2_block_to_lba>:
push   %rax
call   1030 <ext2_block_to_sector_count@plt>
add    $0x800,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ext2_block_to_lba(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ext2_block_to_sector_count(i32 %3)
%5 = add nsw i32 2048, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @ext2_block_to_lba(i32 %0) {
%2 = tail call i32 @ext2_block_to_sector_count(i32 %0)
%3 = add nsw i32 %2, 2048
ret i32 %3
}
/* Variables and functions */
scalar_t__ strlen(char *);
int string_num_bytes(char *s) {
  int string_num_chars = (int)strlen(s);
  return string_num_chars + 1;
}


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

x86 assembly (clang, -O2):
<string_num_bytes>:
push   %rax
call   1030 <strlen@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @string_num_bytes(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = trunc i64 %5 to i32
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @string_num_bytes(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
%4 = add nsw i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int pow(double, int);
int sqrt(int);
double areaTriangle(double length) { return (sqrt(3) / 4) * pow(length, 2); }


x86 assembly (clang, -O0):
<areaTriangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x3,%edi
call   1040 <sqrt@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<areaTriangle>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    $0x3,%edi
call   1040 <sqrt@plt>
lea    0x3(%rax),%ebx
test   %eax,%eax
cmovns %eax,%ebx
sar    $0x2,%ebx
movsd  0x8(%rsp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
imul   %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @areaTriangle(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @sqrt(i32 3)
%4 = sdiv i32 %3, 4
%5 = load double, double* %2
%6 = call i32 @pow(double %5, i32 2)
%7 = mul nsw i32 %4, %6
%8 = sitofp i32 %7 to double
ret double %8
}

LLVM IR (-O2):
define double @areaTriangle(double %0) {
%2 = tail call i32 @sqrt(i32 3)
%3 = sdiv i32 %2, 4
%4 = tail call i32 @pow(double %0, i32 2)
%5 = mul nsw i32 %3, %4
%6 = sitofp i32 %5 to double
ret double %6
}
x(const char *s) {
  char a[1];
  const char *ss = s;
  a[*s++] |= 1;
  return (int)ss + 1 == (int)s;
}


x86 assembly (clang, -O0):
<x>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbq (%rax),%rax
movsbl -0x9(%rbp,%rax,1),%ecx
or     $0x1,%ecx
mov    %cl,-0x9(%rbp,%rax,1)
mov    -0x18(%rbp),%rax
add    $0x1,%eax
mov    -0x8(%rbp),%rcx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @x(i8* %0) {
%2 = alloca i8*
%3 = alloca [1 x i8]
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %4
%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 i64
%10 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = or i32 %12, 1
%14 = trunc i32 %13 to i8
store i8 %14, i8* %10
%15 = load i8*, i8** %4
%16 = ptrtoint i8* %15 to i32
%17 = add nsw i32 %16, 1
%18 = load i8*, i8** %2
%19 = ptrtoint i8* %18 to i32
%20 = icmp eq i32 %17, %19
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @x(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = add nsw i32 %4, 1
%6 = ptrtoint i8* %2 to i64
%7 = trunc i64 %6 to i32
%8 = icmp eq i32 %5, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ translate_seconds(int, int *, int *, int *);
int main(void) {
  int totalSeconds = 3600, hours, minutes, seconds;
  translate_seconds(totalSeconds, &hours, &minutes, &seconds);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xe10,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
call   1030 <translate_seconds@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
mov    $0xe10,%edi
call   1030 <translate_seconds@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @translate_seconds(i32 3600, i32* %1, i32* %2, i32* %3)
ret i32 0
}
float *mat2_assign_mat4(float *result, float *m) {
  result[0] = m[0];
  result[1] = m[1];
  result[2] = m[4];
  result[3] = m[5];
  return result;
}


x86 assembly (clang, -O0):
<mat2_assign_mat4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movss  0x14(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat2_assign_mat4>:
mov    %rdi,%rax
movss  (%rsi),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x10(%rsi),%xmm0
movss  %xmm0,0x8(%rdi)
movss  0x14(%rsi),%xmm0
movss  %xmm0,0xc(%rdi)
ret

LLVM IR (-O0):
define float* @mat2_assign_mat4(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 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %3
%9 = getelementptr inbounds float, float* %8, i64 0
store float %7, float* %9
%10 = load float*, float** %4
%11 = getelementptr inbounds float, float* %10, i64 1
%12 = load float, float* %11
%13 = load float*, float** %3
%14 = getelementptr inbounds float, float* %13, i64 1
store float %12, float* %14
%15 = load float*, float** %4
%16 = getelementptr inbounds float, float* %15, i64 4
%17 = load float, float* %16
%18 = load float*, float** %3
%19 = getelementptr inbounds float, float* %18, i64 2
store float %17, float* %19
%20 = load float*, float** %4
%21 = getelementptr inbounds float, float* %20, i64 5
%22 = load float, float* %21
%23 = load float*, float** %3
%24 = getelementptr inbounds float, float* %23, i64 3
store float %22, float* %24
%25 = load float*, float** %3
ret float* %25
}

LLVM IR (-O2):
define float* @mat2_assign_mat4(float* returned writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
store float %3, float* %0
%4 = getelementptr inbounds float, float* %1, i64 1
%5 = load float, float* %4
%6 = getelementptr inbounds float, float* %0, i64 1
store float %5, float* %6
%7 = getelementptr inbounds float, float* %1, i64 4
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %0, i64 2
store float %8, float* %9
%10 = getelementptr inbounds float, float* %1, i64 5
%11 = load float, float* %10
%12 = getelementptr inbounds float, float* %0, i64 3
store float %11, float* %12
ret float* %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void Sys_exit() { exit(0); }


x86 assembly (clang, -O0):
<Sys_exit>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<Sys_exit>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @Sys_exit() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @Sys_exit() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
const char *snd_vol(void) { return ""; }


x86 assembly (clang, -O0):
<snd_vol>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<snd_vol>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @snd_vol() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @snd_vol() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
void __attribute__((always_)) eINT(void) { asm volatile("sti"); }


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

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

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

LLVM IR (-O2):
define void @eINT() {
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
scalar_t__ ascii_numeric_cmp(char const *, char const *);
int num_eq(const char *pat, const char *text) {
  return (ascii_numeric_cmp(text, pat) == 0);
}


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

x86 assembly (clang, -O2):
<num_eq>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <ascii_numeric_cmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @num_eq(i8* %0, i8* %1) {
%3 = tail call i64 @ascii_numeric_cmp(i8* %1, i8* %0)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ execv(char *, int /*<<< orphan*/);
scalar_t__ fork();
int main(int argc, const char *argv[]) {
  for (int i = 0; i < 20; i++) {
    if (fork()) {
      execv("./PATHTOavionExecutable", 0);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x14,-0x14(%rbp)
jge    1179 <main+0x59>
mov    $0x0,%al
call   1040 <fork@plt>
cmp    $0x0,%rax
je     1166 <main+0x46>
lea    0xea1(%rip),%rdi
xor    %esi,%esi
call   1030 <execv@plt>
jmp    116b <main+0x4b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x14,%ebp
lea    0xed1(%rip),%rbx
jmp    1145 <main+0x25>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0xffffffff,%ebp
je     115d <main+0x3d>
xor    %eax,%eax
call   1040 <fork@plt>
test   %rax,%rax
je     1140 <main+0x20>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <execv@plt>
jmp    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [24 x i8] c"./PATHTOavionExecutable\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %4
3: ; preds = %10
ret i32 0
4: ; preds = %2, %10
%5 = phi i32 [ 0, %2 ], [ %11, %10 ]
%6 = tail call i64 (...) @fork()
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = tail call i32 @execv(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 0)
br label %10
10: ; preds = %4, %8
%11 = add nuw nsw i32 %5, 1
%12 = icmp eq i32 %11, 20
br i1 %12, label %3, label %4
}
/* Variables and functions */
int write(int, char *, int);
int print_char(char c) { return (write(1, &c, 1)); }


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

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

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

LLVM IR (-O2):
define i32 @print_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
ret i32 %3
}
/* Variables and functions */
int close(int);
int i2cdev_close(int fd) { return close(fd); }


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

LLVM IR (-O0):
define i32 @i2cdev_close(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 @i2cdev_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int g(int);
main() { return g(7); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x7,%edi
jmp    1030 <g@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @g(i32 7)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __my_little_hc128_random();
uint32_t hc128random(void) { return __my_little_hc128_random(); }


x86 assembly (clang, -O0):
<hc128random>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <__my_little_hc128_random@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @hc128random() {
%1 = call i32 (...) @__my_little_hc128_random()
ret i32 %1
}

LLVM IR (-O2):
define i32 @hc128random() {
%1 = tail call i32 (...) @__my_little_hc128_random()
ret i32 %1
}
const char *z_zlibVersion() { return "1.2.4"; }


x86 assembly (clang, -O0):
<z_zlibVersion>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<z_zlibVersion>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"1.2.4\00"
define i8* @z_zlibVersion() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"1.2.4\00"
define i8* @z_zlibVersion() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
double dblMod(double a, double b) { return ((long)a) % ((long)b); }


x86 assembly (clang, -O0):
<dblMod>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
cvttsd2si -0x8(%rbp),%rax
cvttsd2si -0x10(%rbp),%rcx
cqto
idiv   %rcx
cvtsi2sd %rdx,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dblMod>:
cvttsd2si %xmm0,%rax
cvttsd2si %xmm1,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1124 <dblMod+0x24>
cqto
idiv   %rcx
xorps  %xmm0,%xmm0
cvtsi2sd %rdx,%xmm0
ret
xor    %edx,%edx
div    %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %rdx,%xmm0
ret

LLVM IR (-O0):
define double @dblMod(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fptosi double %5 to i64
%7 = load double, double* %4
%8 = fptosi double %7 to i64
%9 = srem i64 %6, %8
%10 = sitofp i64 %9 to double
ret double %10
}

LLVM IR (-O2):
define double @dblMod(double %0, double %1) {
%3 = fptosi double %0 to i64
%4 = fptosi double %1 to i64
%5 = srem i64 %3, %4
%6 = sitofp i64 %5 to double
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int, double);
void sprintf_exponential(int d, double x) {
  char buf[64];
  snprintf(buf, 64, "%*e", d, x);
}


x86 assembly (clang, -O0):
<sprintf_exponential>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x4(%rbp),%ecx
movsd  -0x10(%rbp),%xmm0
mov    $0x40,%esi
lea    0xec8(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprintf_exponential>:
sub    $0x48,%rsp
mov    %edi,%ecx
lea    0xee3(%rip),%rdx
mov    %rsp,%rdi
mov    $0x40,%esi
call   1030 <snprintf@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%*e\00"
define void @sprintf_exponential(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca [64 x i8]
store i32 %0, i32* %3
store double %1, double* %4
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = load double, double* %4
%9 = call i32 @snprintf(i8* %6, i32 64, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7, double %8)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%*e\00"
define void @sprintf_exponential(i32 %0, double %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 64, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0, double %1)
ret void
}
void _cgo_allocate(void *a, int c) {}


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

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

LLVM IR (-O0):
define void @_cgo_allocate(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 @_cgo_allocate(i8* nocapture %0, i32 %1) {
ret void
}
void gdk_rgb_set_min_colors() {}


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

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

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

LLVM IR (-O2):
define void @gdk_rgb_set_min_colors() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test();
void pointer() { test(); }


x86 assembly (clang, -O0):
<pointer>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <test@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @pointer() {
%1 = call i32 (...) @test()
ret void
}

LLVM IR (-O2):
define void @pointer() {
%1 = tail call i32 (...) @test()
ret void
}
void l2_symbolic_no_overrun_Good(int n) {
  int a[n];
  if (n > 0) {
    a[n - 1] = 0;
  }
}


x86 assembly (clang, -O0):
<l2_symbolic_no_overrun_Good>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1150 <l2_symbolic_no_overrun_Good+0x50>
mov    -0x20(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @l2_symbolic_no_overrun_Good(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i32, i64 %6
store i64 %6, i64* %4
%9 = load i32, i32* %2
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %1
%12 = load i32, i32* %2
%13 = sub nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %8, i64 %14
store i32 0, i32* %15
br label %16
16: ; preds = %11, %1
%17 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
define void @l2_symbolic_no_overrun_Good(i32 %0) {
ret void
}
/* Variables and functions */
char tolower(char);
void toLower(char *s) {
  char *p = s;
  while (*p) {
    *p = tolower(*p);
    p++;
  }
}


x86 assembly (clang, -O0):
<toLower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <toLower+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <toLower+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toLower>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <toLower+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <toLower+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @toLower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putstr(char *);
void printError(void) { putstr("Unknown error!\r\n"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Unknown error!\0D\0A\00"
define void @printError() {
%1 = call i32 @putstr(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Unknown error!\0D\0A\00"
define void @printError() {
%1 = tail call i32 @putstr(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int puts(const char *s) {
  printf("%s", s);
  return 1;
}


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

x86 assembly (clang, -O2):
<puts>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @puts(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 1
}