xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ usleep(int);
void *steppers_thread(__attribute__((__unused__)) void *buf) {
  printf("Main steppers' thread\n");
  while (1)
    usleep(1000);
}


x86 assembly (clang, -O0):
<steppers_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3e8,%edi
call   1040 <usleep@plt>
jmp    1138 <steppers_thread+0x18>

x86 assembly (clang, -O2):
<steppers_thread>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
nopl   (%rax)
mov    $0x3e8,%edi
call   1040 <usleep@plt>
jmp    1130 <steppers_thread+0x10>

LLVM IR (-O0):
@.str = [23 x i8] c"Main steppers' thread\0A\00"
define i8* @steppers_thread(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %1, %4
%5 = call i32 @usleep(i32 1000)
br label %4
}

LLVM IR (-O2):
@str = [22 x i8] c"Main steppers' thread\00"
define noalias i8* @steppers_thread(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
br label %3
3: ; preds = %1, %3
%4 = tail call i32 @usleep(i32 1000)
br label %3
}
unsigned short toshort(char *data) {
  return (unsigned char)*data | ((unsigned char)*(data + 1) << 8);
}


x86 assembly (clang, -O0):
<toshort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toshort>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define zeroext i16 @toshort(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = shl i32 %9, 8
%11 = or i32 %5, %10
%12 = trunc i32 %11 to i16
ret i16 %12
}

LLVM IR (-O2):
define zeroext i16 @toshort(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i16
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i16
%7 = shl nuw i16 %6, 8
%8 = or i16 %7, %3
ret i16 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ atomic_postadd_uint16_t(int /*<<< orphan*/ *, int);
uint16_t atomic_postinc_uint16_t(uint16_t *var) {
  return atomic_postadd_uint16_t(var, 1);
}


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

x86 assembly (clang, -O2):
<atomic_postinc_uint16_t>:
mov    $0x1,%esi
jmp    1030 <atomic_postadd_uint16_t@plt>

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

LLVM IR (-O2):
define i32 @atomic_postinc_uint16_t(i32* %0) {
%2 = tail call i32 @atomic_postadd_uint16_t(i32* %0, i32 1)
ret i32 %2
}
int pict2png_header(void *ctx, int version, const struct unrez_rect *frame) {
  (void)ctx;
  (void)version;
  (void)frame;
  return 0;
}


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

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

LLVM IR (-O0):
%struct.unrez_rect = type opaque
define i32 @pict2png_header(i8* %0, i32 %1, %struct.unrez_rect* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca %struct.unrez_rect*
store i8* %0, i8** %4
store i32 %1, i32* %5
store %struct.unrez_rect* %2, %struct.unrez_rect** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load %struct.unrez_rect*, %struct.unrez_rect** %6
ret i32 0
}

LLVM IR (-O2):
%struct.unrez_rect = type opaque
define i32 @pict2png_header(i8* nocapture readnone %0, i32 %1, %struct.unrez_rect* nocapture readnone %2) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, unsigned char,
                         int /*<<< orphan*/);
int /*<<< orphan*/ fwrite(unsigned char const *, int, int,
                          int /*<<< orphan*/ *);
void write8(FILE *f, unsigned char offset, const unsigned char value) {
  fseek(f, offset, SEEK_SET);
  unsigned char c = 0;
  fwrite(&value, sizeof(unsigned char), 1, f);
}


x86 assembly (clang, -O0):
<write8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
mov    0x2e9b(%rip),%rcx
mov    (%rcx),%edx
movzbl %al,%esi
call   1030 <fseek@plt>
movb   $0x0,-0xb(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xa(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1040 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write8>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
movsbl %bpl,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define void @write8(i32* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i32*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i32* %0, i32** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = load i32*, i32** %4
%9 = load i8, i8* %5
%10 = load i32, i32* @SEEK_SET
%11 = call i32 @fseek(i32* %8, i8 zeroext %9, i32 %10)
store i8 0, i8* %7
%12 = load i32*, i32** %4
%13 = call i32 @fwrite(i8* %6, i32 1, i32 1, i32* %12)
ret void
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define void @write8(i32* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i32, i32* @SEEK_SET
%5 = tail call i32 @fseek(i32* %0, i8 zeroext %1, i32 %4)
%6 = sext i8 %2 to i32
%7 = tail call i32 @fputc(i32 %6, i32* %0)
ret void
}
/* Type definitions */
struct Block {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
void InitBlocks(char *str_out, const struct Block *block) {
  for (size_t i = 0; i < 15; i += 5) {
    memcpy(str_out, (char *)block, 5);
    str_out += i;
  }
}


x86 assembly (clang, -O0):
<InitBlocks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0xf,-0x18(%rbp)
jae    1162 <InitBlocks+0x52>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x5,%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
add    $0x5,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <InitBlocks+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitBlocks>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x5,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x5,%edx
call   1030 <memcpy@plt>
add    $0x5,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x5,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
%struct.Block = type { i32 }
define void @InitBlocks(i8* %0, %struct.Block* %1) {
%3 = alloca i8*
%4 = alloca %struct.Block*
%5 = alloca i64
store i8* %0, i8** %3
store %struct.Block* %1, %struct.Block** %4
store i64 0, i64* %5
br label %6
6: ; preds = %17, %2
%7 = load i64, i64* %5
%8 = icmp ult i64 %7, 15
br i1 %8, label %9, label %20
9: ; preds = %6
%10 = load i8*, i8** %3
%11 = load %struct.Block*, %struct.Block** %4
%12 = bitcast %struct.Block* %11 to i8*
%13 = call i32 @memcpy(i8* %10, i8* %12, i32 5)
%14 = load i64, i64* %5
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 %14
store i8* %16, i8** %3
br label %17
17: ; preds = %9
%18 = load i64, i64* %5
%19 = add i64 %18, 5
store i64 %19, i64* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
%struct.Block = type { i32 }
define void @InitBlocks(i8* %0, %struct.Block* %1) {
%3 = bitcast %struct.Block* %1 to i8*
%4 = tail call i32 @memcpy(i8* %0, i8* %3, i32 5)
%5 = tail call i32 @memcpy(i8* %0, i8* %3, i32 5)
%6 = getelementptr inbounds i8, i8* %0, i64 5
%7 = tail call i32 @memcpy(i8* %6, i8* %3, i32 5)
ret void
}
void ath11k_debugfs_htt_ext_stats_handler(struct ath11k_base *ab,
                                          struct sk_buff *skb) {}


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

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

LLVM IR (-O0):
%struct.ath11k_base = type opaque
%struct.sk_buff = type opaque
define void @ath11k_debugfs_htt_ext_stats_handler(%struct.ath11k_base* %0, %struct.sk_buff* %1) {
%3 = alloca %struct.ath11k_base*
%4 = alloca %struct.sk_buff*
store %struct.ath11k_base* %0, %struct.ath11k_base** %3
store %struct.sk_buff* %1, %struct.sk_buff** %4
ret void
}

LLVM IR (-O2):
%struct.ath11k_base = type opaque
%struct.sk_buff = type opaque
define void @ath11k_debugfs_htt_ext_stats_handler(%struct.ath11k_base* nocapture %0, %struct.sk_buff* nocapture %1) {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void compat_be16enc(void *pp, uint16_t x) {
  uint8_t *p = (uint8_t *)pp;
  p[1] = x & 0xff;
  p[0] = (x >> 8) & 0xff;
}


x86 assembly (clang, -O0):
<compat_be16enc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<compat_be16enc>:
mov    %esi,%eax
movzbl %al,%ecx
mov    %ecx,0x4(%rdi)
movzbl %ah,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @compat_be16enc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32, i32* %4
%9 = and i32 %8, 255
%10 = load i32*, i32** %5
%11 = getelementptr inbounds i32, i32* %10, i64 1
store i32 %9, i32* %11
%12 = load i32, i32* %4
%13 = ashr i32 %12, 8
%14 = and i32 %13, 255
%15 = load i32*, i32** %5
%16 = getelementptr inbounds i32, i32* %15, i64 0
store i32 %14, i32* %16
ret void
}

LLVM IR (-O2):
define void @compat_be16enc(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = and i32 %1, 255
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = bitcast i8* %5 to i32*
store i32 %4, i32* %6
%7 = lshr i32 %1, 8
%8 = and i32 %7, 255
store i32 %8, i32* %3
ret void
}
/* Variables and functions */
scalar_t__ isalpha(char);
scalar_t__ toupper(char);
int hashFunc(char a) {
  if (isalpha(a)) {
    return ((int)toupper(a) - 65) % 45;
  } else if (a == '\n') {
    return a;
  } else {
    return 26;
  }
}


x86 assembly (clang, -O0):
<hashFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1040 <isalpha@plt>
cmp    $0x0,%rax
je     115d <hashFunc+0x3d>
movsbl -0x5(%rbp),%edi
call   1030 <toupper@plt>
sub    $0x41,%eax
mov    $0x2d,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
jmp    117d <hashFunc+0x5d>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
jne    1176 <hashFunc+0x56>
movsbl -0x5(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117d <hashFunc+0x5d>
movl   $0x1a,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashFunc>:
push   %rbx
mov    %edi,%ebx
call   1040 <isalpha@plt>
test   %rax,%rax
je     1161 <hashFunc+0x41>
movsbl %bl,%edi
call   1030 <toupper@plt>
mov    %rax,%rcx
add    $0xffffffbf,%eax
cltq
imul   $0xffffffffb60b60b7,%rax,%rdx
shr    $0x20,%rdx
add    %edx,%ecx
add    $0xffffffbf,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x5,%ecx
add    %edx,%ecx
lea    (%rcx,%rcx,8),%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
pop    %rbx
ret
xor    %eax,%eax
cmp    $0xa,%bl
setne  %al
shl    $0x4,%eax
or     $0xa,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @hashFunc(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @isalpha(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i8, i8* %3
%9 = call i64 @toupper(i8 signext %8)
%10 = trunc i64 %9 to i32
%11 = sub nsw i32 %10, 65
%12 = srem i32 %11, 45
store i32 %12, i32* %2
br label %21
13: ; preds = %1
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 10
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
store i32 %19, i32* %2
br label %21
20: ; preds = %13
store i32 26, i32* %2
br label %21
21: ; preds = %20, %17, %7
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @hashFunc(i8 signext %0) {
%2 = tail call i64 @isalpha(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i64 @toupper(i8 signext %0)
%6 = trunc i64 %5 to i32
%7 = add nsw i32 %6, -65
%8 = srem i32 %7, 45
br label %12
9: ; preds = %1
%10 = icmp eq i8 %0, 10
%11 = select i1 %10, i32 10, i32 26
br label %12
12: ; preds = %9, %4
%13 = phi i32 [ %8, %4 ], [ %11, %9 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pain() {
  printf("Hello world\n");
  return (0);
}


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Hello world\00"
define i32 @pain() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int test_unsignedlong() {
  int i;
  unsigned long reds[2] = {4096, 4096};
#pragma acc parallel loop
  for (i = 0; i < 4096; i++) {
#pragma acc atomic
    reds[0]--;
#pragma acc atomic
    --reds[1];
  }
  for (i = 0; i < 2; i++) {
    if (reds[i] != 0) {
      return i + 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<test_unsignedlong>:
push   %rbp
mov    %rsp,%rbp
mov    0xef5(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xef2(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1000,-0x8(%rbp)
jge    1154 <test_unsignedlong+0x54>
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1121 <test_unsignedlong+0x21>
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1196 <test_unsignedlong+0x96>
movslq -0x8(%rbp),%rax
cmpq   $0x0,-0x20(%rbp,%rax,8)
je     1183 <test_unsignedlong+0x83>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    119d <test_unsignedlong+0x9d>
jmp    1188 <test_unsignedlong+0x88>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115b <test_unsignedlong+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.test_unsignedlong.reds = [2 x i64] [i64 4096, i64 4096]
define i32 @test_unsignedlong() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [2 x i64]
%4 = bitcast [2 x i64]* %3 to i8*
store i32 0, i32* %2
br label %5
5: ; preds = %15, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 4096
br i1 %7, label %8, label %18
8: ; preds = %5
%9 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0, i64 0
%10 = load i64, i64* %9
%11 = add i64 %10, -1
store i64 %11, i64* %9
%12 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0, i64 1
%13 = load i64, i64* %12
%14 = add i64 %13, -1
store i64 %14, i64* %12
br label %15
15: ; preds = %8
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %5
18: ; preds = %5
store i32 0, i32* %2
br label %19
19: ; preds = %32, %18
%20 = load i32, i32* %2
%21 = icmp slt i32 %20, 2
br i1 %21, label %22, label %35
22: ; preds = %19
%23 = load i32, i32* %2
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0, i64 %24
%26 = load i64, i64* %25
%27 = icmp ne i64 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %22
%29 = load i32, i32* %2
%30 = add nsw i32 %29, 1
store i32 %30, i32* %1
br label %36
31: ; preds = %22
br label %32
32: ; preds = %31
%33 = load i32, i32* %2
%34 = add nsw i32 %33, 1
store i32 %34, i32* %2
br label %19
35: ; preds = %19
store i32 0, i32* %1
br label %36
36: ; preds = %35, %28
%37 = load i32, i32* %1
ret i32 %37
}

LLVM IR (-O2):
define i32 @test_unsignedlong() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strlen(char *);
int main(int argc, char *argv[]) {
  char s[] = {'c', 'a', 't'};
  printf("%d\n", strlen(s));
  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)
mov    0xec3(%rip),%ax
mov    %ax,-0x13(%rbp)
mov    0xebb(%rip),%al
mov    %al,-0x11(%rbp)
lea    -0x13(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x74,0x6(%rsp)
movw   $0x6163,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <strlen@plt>
lea    0xec5(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.s = [3 x i8] c"cat"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [3 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [3 x i8]* %6 to i8*
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 0
%9 = call i32 @strlen(i8* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [3 x i8] c"cat"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [3 x i8]
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
void set_fips_error(void) { return; }


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

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

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

LLVM IR (-O2):
define void @set_fips_error() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf(
      "\nUsage: sdei [-v <n>] | [--skip <n>] | [--run <r>]\n"
      "Options:\n"
      "-v      Verbosity of the Prints\n"
      "        5 shows all prints, 1 shows Errors, 6 for Linux kernel printks\n"
      "--skip  Test(s) to be skipped\n"
      "--run   Test(s) to be run\n"
      "        Refer to section 4 of SDEI_ACS_User_Guide\n"
      "        To skip a module, use Model_ID as mentioned in user guide\n"
      "        To skip a particular test within a module, use the exact "
      "testcase number\n");
}


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

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

LLVM IR (-O0):
@.str = [417 x i8] c"\0AUsage: sdei [-v <n>] | [--skip <n>] | [--run <r>]\0AOptions:\0A-v Verbosity of the Prints\0A 5 shows all prints, 1 shows Errors, 6 for Linux kernel printks\0A--skip Test(s) to be skipped\0A--run Test(s) to be run\0A Refer to section 4 of SDEI_ACS_User_Guide\0A To skip a module, use Model_ID as mentioned in user guide\0A To skip a particular test within a module, use the exact testcase number\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([417 x i8], [417 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [416 x i8] c"\0AUsage: sdei [-v <n>] | [--skip <n>] | [--run <r>]\0AOptions:\0A-v Verbosity of the Prints\0A 5 shows all prints, 1 shows Errors, 6 for Linux kernel printks\0A--skip Test(s) to be skipped\0A--run Test(s) to be run\0A Refer to section 4 of SDEI_ACS_User_Guide\0A To skip a module, use Model_ID as mentioned in user guide\0A To skip a particular test within a module, use the exact testcase number\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([416 x i8], [416 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct imv_window {
  int dummy;
};

/* Variables and functions */
void imv_window_set_fullscreen(struct imv_window *window, bool fullscreen) {
  (void)window;
  (void)fullscreen;
}


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

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

LLVM IR (-O0):
%struct.imv_window = type { i32 }
define void @imv_window_set_fullscreen(%struct.imv_window* %0, i32 %1) {
%3 = alloca %struct.imv_window*
%4 = alloca i32
store %struct.imv_window* %0, %struct.imv_window** %3
store i32 %1, i32* %4
%5 = load %struct.imv_window*, %struct.imv_window** %3
%6 = load i32, i32* %4
ret void
}

LLVM IR (-O2):
%struct.imv_window = type { i32 }
define void @imv_window_set_fullscreen(%struct.imv_window* nocapture %0, i32 %1) {
ret void
}
void RTSemEventSignal(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemEventSignal() {
ret void
}
int isblank(int ch) { return ch == ' ' || ch == '\t'; }


x86 assembly (clang, -O0):
<isblank>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <isblank+0x20>
cmpl   $0x9,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isblank>:
cmp    $0x20,%edi
sete   %al
cmp    $0x9,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isblank(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 9
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isblank(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = icmp eq i32 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void gtk_window_get_size() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_get_size() {
ret void
}
int bitAndwith(int sourceWord, int destinationWord) {
  return sourceWord & destinationWord;
}


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

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

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

LLVM IR (-O2):
define i32 @bitAndwith(i32 %0, i32 %1) {
%3 = and i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int /*<<< orphan*/ foo(int, int);
int main(void) {
  int s = __VERIFIER_nondet_int();
  int t = __VERIFIER_nondet_int();
  foo(s, t);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <foo@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 @foo(i32 %1, i32 %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ mbstate_t;

/* Variables and functions */
size_t __infer_nondet_int();
size_t mbrlen(const char *s, size_t n, mbstate_t *ps) {
  return __infer_nondet_int();
}


x86 assembly (clang, -O0):
<mbrlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @mbrlen(i8* %0, i64 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32* %2, i32** %6
%7 = call i64 (...) @__infer_nondet_int()
ret i64 %7
}

LLVM IR (-O2):
define i64 @mbrlen(i8* nocapture readnone %0, i64 %1, i32* nocapture readnone %2) {
%4 = tail call i64 (...) @__infer_nondet_int()
ret i64 %4
}
int test5() {
  int x, y, z, a, b, c;
  x = 1;
  y = 2;
  z = 3;
  a = 4;
  b = 5;
  c = 6;
  if (x < 10) {
    if (y < 10) {
      if (z < 10) {
        x = 4;
      } else {
        x = 5;
      }
      a = 10;
    } else {
      x = 6;
    }
    b = 10;
  } else {
    x = 7;
  }
  c = 11;
  return 0;
}


x86 assembly (clang, -O0):
<test5>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x4,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
movl   $0x6,-0x18(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    117e <test5+0x7e>
cmpl   $0xa,-0x8(%rbp)
jge    116b <test5+0x6b>
cmpl   $0xa,-0xc(%rbp)
jge    1158 <test5+0x58>
movl   $0x4,-0x4(%rbp)
jmp    115f <test5+0x5f>
movl   $0x5,-0x4(%rbp)
movl   $0xa,-0x10(%rbp)
jmp    1172 <test5+0x72>
movl   $0x6,-0x4(%rbp)
movl   $0xa,-0x14(%rbp)
jmp    1185 <test5+0x85>
movl   $0x7,-0x4(%rbp)
movl   $0xb,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test5() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_Orthographic_init(void) {
  _hmt_register_covercase("HMM_Orthographic", "1");
}


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

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

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

LLVM IR (-O2):
@.str = [17 x i8] c"HMM_Orthographic\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_Orthographic_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_EEint8_reg(signed char val) {
  return ((val) & (-0xEE << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_EEint8_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, -238
%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_EEint8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -238
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
__attribute__((always_)) void raid_sse_end(void) {
  asm volatile("sfence" : : : "memory");
  asm volatile("" : : : "%xmm0", "%xmm1", "%xmm2", "%xmm3");
  asm volatile("" : : : "%xmm4", "%xmm5", "%xmm6", "%xmm7");
  asm volatile("" : : : "%xmm8", "%xmm9", "%xmm10", "%xmm11");
  asm volatile("" : : : "%xmm12", "%xmm13", "%xmm14", "%xmm15");
}


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

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

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

LLVM IR (-O2):
define void @raid_sse_end() {
tail call void asm sideeffect "sfence", "~{memory},~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "", "~{xmm0},~{xmm1},~{xmm2},~{xmm3},~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "", "~{xmm4},~{xmm5},~{xmm6},~{xmm7},~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "", "~{xmm8},~{xmm9},~{xmm10},~{xmm11},~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "", "~{xmm12},~{xmm13},~{xmm14},~{xmm15},~{dirflag},~{fpsr},~{flags}"()
ret void
}
unsigned bit_div3(unsigned num) {
  unsigned x, y;
  x = (num >> 2) + (num >> 4);
  x += x >> 4;
  x += x >> 8;
  x += x >> 16;
  y = num - ((x << 2) - x);
  return x + ((((y + 1) << 2) + (y + 1)) >> 4);
}


x86 assembly (clang, -O0):
<bit_div3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
mov    -0x4(%rbp),%ecx
shr    $0x4,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x4,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x8,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x10,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x2,%ecx
sub    -0x8(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
shl    $0x2,%ecx
mov    -0xc(%rbp),%edx
add    $0x1,%edx
add    %edx,%ecx
shr    $0x4,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_div3>:
mov    %edi,%eax
shr    $0x2,%eax
mov    %edi,%ecx
shr    $0x4,%ecx
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x4,%eax
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x10,%edx
add    %ecx,%edx
lea    (%rdx,%rdx,2),%eax
sub    %eax,%edi
lea    (%rdi,%rdi,4),%eax
add    $0x5,%eax
shr    $0x4,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @bit_div3(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = lshr i32 %5, 2
%7 = load i32, i32* %2
%8 = lshr i32 %7, 4
%9 = add i32 %6, %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = lshr i32 %10, 4
%12 = load i32, i32* %3
%13 = add i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = lshr i32 %14, 8
%16 = load i32, i32* %3
%17 = add i32 %16, %15
store i32 %17, i32* %3
%18 = load i32, i32* %3
%19 = lshr i32 %18, 16
%20 = load i32, i32* %3
%21 = add i32 %20, %19
store i32 %21, i32* %3
%22 = load i32, i32* %2
%23 = load i32, i32* %3
%24 = shl i32 %23, 2
%25 = load i32, i32* %3
%26 = sub i32 %24, %25
%27 = sub i32 %22, %26
store i32 %27, i32* %4
%28 = load i32, i32* %3
%29 = load i32, i32* %4
%30 = add i32 %29, 1
%31 = shl i32 %30, 2
%32 = load i32, i32* %4
%33 = add i32 %32, 1
%34 = add i32 %31, %33
%35 = lshr i32 %34, 4
%36 = add i32 %28, %35
ret i32 %36
}

LLVM IR (-O2):
define i32 @bit_div3(i32 %0) {
%2 = lshr i32 %0, 2
%3 = lshr i32 %0, 4
%4 = add nuw nsw i32 %2, %3
%5 = lshr i32 %4, 4
%6 = add nuw nsw i32 %5, %4
%7 = lshr i32 %6, 8
%8 = add nuw nsw i32 %7, %6
%9 = lshr i32 %8, 16
%10 = add nuw nsw i32 %9, %8
%11 = mul i32 %10, -3
%12 = add i32 %11, %0
%13 = mul i32 %12, 5
%14 = add i32 %13, 5
%15 = lshr i32 %14, 4
%16 = add nuw nsw i32 %15, %10
ret i32 %16
}
/* Variables and functions */
float pow(float, int);
float quintic_in(float step, float max_steps, float max_val) {
  float ratio = step / max_steps;
  return max_val * pow(ratio, 5);
}


x86 assembly (clang, -O0):
<quintic_in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
mov    $0x5,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
mulss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quintic_in>:
push   %rax
movss  %xmm2,0x4(%rsp)
divss  %xmm1,%xmm0
mov    $0x5,%edi
call   1030 <pow@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @quintic_in(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %4
%9 = load float, float* %5
%10 = fdiv float %8, %9
store float %10, float* %7
%11 = load float, float* %6
%12 = load float, float* %7
%13 = call float @pow(float %12, i32 5)
%14 = fmul float %11, %13
ret float %14
}

LLVM IR (-O2):
define float @quintic_in(float %0, float %1, float %2) {
%4 = fdiv float %0, %1
%5 = tail call float @pow(float %4, i32 5)
%6 = fmul float %5, %2
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  int a, b;
  b = -8;
  if ((a = b))
    puts("Value assigned");
  else
    puts("Value is zero");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xfffffff8,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1146 <main+0x36>
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
jmp    1152 <main+0x42>
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"Value assigned\00"
@.str.1 = [14 x i8] c"Value is zero\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 -8, i32* %3
%4 = load i32, i32* %3
store i32 %4, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %0
%9 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Value assigned\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void *winapi_get_proc(void *, char *);
void *__attribute__((stdcall)) GetProcAddress(void *module, char *proc) {
  return winapi_get_proc(module, proc);
}


x86 assembly (clang, -O0):
<GetProcAddress>:
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 <winapi_get_proc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetProcAddress>:
jmp    1030 <winapi_get_proc@plt>

LLVM IR (-O0):
define i8* @GetProcAddress(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 i8* @winapi_get_proc(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @GetProcAddress(i8* %0, i8* %1) {
%3 = tail call i8* @winapi_get_proc(i8* %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ explicit_bzero(void *, size_t);
int /*<<< orphan*/ free(void *);
void freezero(void *ptr, size_t sz) {
  if (ptr == NULL)
    return;
  explicit_bzero(ptr, sz);
  free(ptr);
}


x86 assembly (clang, -O0):
<freezero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1140 <freezero+0x20>
jmp    1156 <freezero+0x36>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <explicit_bzero@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freezero>:
test   %rdi,%rdi
je     1137 <freezero+0x17>
push   %rbx
mov    %rdi,%rbx
call   1040 <explicit_bzero@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @freezero(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %2
br label %14
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = load i64, i64* %4
%11 = call i32 @explicit_bzero(i8* %9, i64 %10)
%12 = load i8*, i8** %3
%13 = call i32 @free(i8* %12)
br label %14
14: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
define void @freezero(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @explicit_bzero(i8* %0, i64 %1)
%6 = tail call i32 @free(i8* %0)
br label %7
7: ; preds = %2, %4
ret void
}
void spend_CPU_time() {
  int i;
  for (i = 0; i < (0x7fffffff); i++) {
  }
}


x86 assembly (clang, -O0):
<spend_CPU_time>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x7fffffff,-0x4(%rbp)
jge    112b <spend_CPU_time+0x2b>
jmp    111d <spend_CPU_time+0x1d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <spend_CPU_time+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @spend_CPU_time() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 2147483647
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @spend_CPU_time() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void show_help(char *prog) {
  printf("Usage: %s \n"
         "[-d <device>] (default - %s)\n"
         "[-h]\n"
         "\n"
         "Mandatory: root privilege\n",
         prog, "lo");
}


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

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

LLVM IR (-O0):
@.str = [73 x i8] c"Usage: %s \0A[-d <device>] (default - %s)\0A[-h]\0A\0AMandatory: root privilege\0A\00"
@.str.1 = [3 x i8] c"lo\00"
define void @show_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [73 x i8] c"Usage: %s \0A[-d <device>] (default - %s)\0A[-h]\0A\0AMandatory: root privilege\0A\00"
@.str.1 = [3 x i8] c"lo\00"
define void @show_help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char *my_memset(char *str, const int beg, const int end) {
  int i;
  i = beg;
  while (i < end)
    str[i++] = '\0';
  return (str);
}


x86 assembly (clang, -O0):
<my_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    113b <my_memset+0x3b>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1114 <my_memset+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_memset>:
push   %rbx
mov    %rdi,%rbx
cmp    %edx,%esi
jge    1132 <my_memset+0x22>
mov    %esi,%eax
movslq %esi,%rdi
add    %rbx,%rdi
not    %eax
add    %edx,%eax
add    $0x1,%rax
xor    %esi,%esi
mov    %rax,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @my_memset(i8* returned writeonly %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %12
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = getelementptr i8, i8* %0, i64 %6
%8 = xor i32 %1, -1
%9 = add i32 %8, %2
%10 = zext i32 %9 to i64
%11 = add nuw nsw i64 %10, 1
br label %12
12: ; preds = %5, %3
ret i8* %0
}
void tlib_on_interrupt_complete(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @delayacct_blkio_end() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char const *);
void isns_remove_pidfile(const char *filename) { unlink(filename); }


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

x86 assembly (clang, -O2):
<isns_remove_pidfile>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define void @isns_remove_pidfile(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret void
}
double OP_And(double op1, double op2) { return op1 && op2; }


x86 assembly (clang, -O0):
<OP_And>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x11(%rbp)
jne    1130 <OP_And+0x30>
jp     1130 <OP_And+0x30>
jmp    1147 <OP_And+0x47>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP_And>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
setp   %al
setne  %cl
or     %al,%cl
ucomisd %xmm2,%xmm1
setp   %al
setne  %dl
or     %al,%dl
and    %cl,%dl
movzbl %dl,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
ret

LLVM IR (-O0):
define double @OP_And(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 = fcmp une double %5, 0.000000e+00
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load double, double* %4
%9 = fcmp une double %8, 0.000000e+00
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = sitofp i32 %12 to double
ret double %13
}

LLVM IR (-O2):
define double @OP_And(double %0, double %1) {
%3 = fcmp une double %0, 0.000000e+00
%4 = fcmp une double %1, 0.000000e+00
%5 = and i1 %3, %4
%6 = uitofp i1 %5 to double
ret double %6
}