xunge/DecIR huggingface dataset:
/* Type definitions */
struct hash {
  int dummy;
};

/* Variables and functions */
void *lib_hash_get(struct hash *, void *, int /*<<< orphan*/ *);
void *lib_hash_lookup(struct hash *hash, void *data) {
  return lib_hash_get(hash, data, NULL);
}


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

x86 assembly (clang, -O2):
<lib_hash_lookup>:
xor    %edx,%edx
jmp    1030 <lib_hash_get@plt>

LLVM IR (-O0):
%struct.hash = type { i32 }
define i8* @lib_hash_lookup(%struct.hash* %0, i8* %1) {
%3 = alloca %struct.hash*
%4 = alloca i8*
store %struct.hash* %0, %struct.hash** %3
store i8* %1, i8** %4
%5 = load %struct.hash*, %struct.hash** %3
%6 = load i8*, i8** %4
%7 = call i8* @lib_hash_get(%struct.hash* %5, i8* %6, i32* null)
ret i8* %7
}

LLVM IR (-O2):
%struct.hash = type { i32 }
define i8* @lib_hash_lookup(%struct.hash* %0, i8* %1) {
%3 = tail call i8* @lib_hash_get(%struct.hash* %0, i8* %1, i32* null)
ret i8* %3
}
void swap(int values[], int i, int j) {
  int tmp = values[i];
  values[i] = values[j];
  values[j] = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
int is_vbus_present(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @is_vbus_present() {
ret i32 1
}
int test_imm_F0int8_reg(signed char val) {
  return ((val) & (-0xF0 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F0int8_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, -240
%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_F0int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -240
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("usage : ipconfig interface \n");
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [29 x i8] c"usage : ipconfig interface \0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [28 x i8] c"usage : ipconfig interface \00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ bsW(int, unsigned int);
void bsPutIntVS(int numBits, unsigned int c) { bsW(numBits, c); }


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

x86 assembly (clang, -O2):
<bsPutIntVS>:
jmp    1030 <bsW@plt>

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

LLVM IR (-O2):
define void @bsPutIntVS(i32 %0, i32 %1) {
%3 = tail call i32 @bsW(i32 %0, i32 %1)
ret void
}
void rop3_73_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  unsigned char stk4;
  stk4 = T & *D;
  stk3 = S | stk4;
  stk2 = *D ^ stk3;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_73_0_0>:
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
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
and    %ecx,%eax
mov    %al,-0xe(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xe(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_73_0_0>:
mov    (%rdi),%al
mov    %eax,%ecx
and    %dl,%cl
or     %sil,%cl
xor    %dl,%al
xor    %cl,%al
not    %al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_73_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %2
%6 = or i8 %5, %1
%7 = xor i8 %4, %2
%8 = xor i8 %7, %6
%9 = xor i8 %8, -1
store i8 %9, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LPUART1_transmit_char(char);
void _putchar(int c) { LPUART1_transmit_char((char)c); }


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

x86 assembly (clang, -O2):
<_putchar>:
movsbl %dil,%edi
jmp    1030 <LPUART1_transmit_char@plt>

LLVM IR (-O0):
define void @_putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = call i32 @LPUART1_transmit_char(i8 signext %4)
ret void
}

LLVM IR (-O2):
define void @_putchar(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = tail call i32 @LPUART1_transmit_char(i8 signext %2)
ret void
}
void SSMR3SkipToEndOfUnit(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3SkipToEndOfUnit() {
ret void
}
void strchdel(char *s, char c) {
  while (*s != '\0') {
    if (*s == c) {
      *s = ' ';
    }
    ++s;
  }
}


x86 assembly (clang, -O0):
<strchdel>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <strchdel+0x49>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1138 <strchdel+0x38>
mov    -0x8(%rbp),%rax
movb   $0x20,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110e <strchdel+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchdel>:
mov    (%rdi),%al
test   %al,%al
je     1126 <strchdel+0x26>
add    $0x1,%rdi
jmp    111b <strchdel+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     1126 <strchdel+0x26>
cmp    %sil,%al
jne    1110 <strchdel+0x10>
movb   $0x20,-0x1(%rdi)
jmp    1110 <strchdel+0x10>
ret

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

LLVM IR (-O2):
define void @strchdel(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = icmp eq i8 %6, %1
br i1 %8, label %9, label %10
9: ; preds = %5
store i8 32, i8* %7
br label %10
10: ; preds = %9, %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %10, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ *tmpfile();
void tmpfile_t() {
  FILE *fp;
  fp = tmpfile();
  printf("Temporary file created\n");
  fclose(fp);
}


x86 assembly (clang, -O0):
<tmpfile_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <tmpfile@plt>
mov    %rax,-0x8(%rbp)
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmpfile_t>:
push   %rbx
xor    %eax,%eax
call   1050 <tmpfile@plt>
mov    %rax,%rbx
lea    0xebe(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <fclose@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Temporary file created\0A\00"
define void @tmpfile_t() {
%1 = alloca i32*
%2 = call i32* (...) @tmpfile()
store i32* %2, i32** %1
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = load i32*, i32** %1
%5 = call i32 @fclose(i32* %4)
ret void
}

LLVM IR (-O2):
@str = [23 x i8] c"Temporary file created\00"
define void @tmpfile_t() {
%1 = tail call i32* (...) @tmpfile()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @fclose(i32* %1)
ret void
}
void yy_1_ValueSqChoice(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_1_ValueSqChoice(i8* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
struct termp {
  int dummy;
};

/* Variables and functions */
size_t term_len(struct termp const *, size_t);
size_t term_tbl_len(size_t sz, void *arg) {
  return (term_len((const struct termp *)arg, sz));
}


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

x86 assembly (clang, -O2):
<term_tbl_len>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <term_len@plt>

LLVM IR (-O0):
%struct.termp = type { i32 }
define i64 @term_tbl_len(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to %struct.termp*
%7 = load i64, i64* %3
%8 = call i64 @term_len(%struct.termp* %6, i64 %7)
ret i64 %8
}

LLVM IR (-O2):
%struct.termp = type { i32 }
define i64 @term_tbl_len(i64 %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.termp*
%4 = tail call i64 @term_len(%struct.termp* %3, i64 %0)
ret i64 %4
}
int set_opts_int(struct opts *opts, const char *name, int value) { return 0; }


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

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

LLVM IR (-O0):
%struct.opts = type opaque
define i32 @set_opts_int(%struct.opts* %0, i8* %1, i32 %2) {
%4 = alloca %struct.opts*
%5 = alloca i8*
%6 = alloca i32
store %struct.opts* %0, %struct.opts** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.opts = type opaque
define i32 @set_opts_int(%struct.opts* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(short *, short *, long);
void dup_svector(short *src, long nl, long nh, short *dst) {
  long len = nh - nl + 1;
  static long size = sizeof(short);
  memcpy(dst + nl, src + nl, len * size);
}


x86 assembly (clang, -O0):
<dup_svector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
sub    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rsi
mov    -0x28(%rbp),%rdx
imul   0x2ec6(%rip),%rdx
call   1030 <memcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dup_svector>:
sub    %rsi,%rdx
lea    (%rcx,%rsi,2),%rax
lea    (%rdi,%rsi,2),%rsi
add    %rdx,%rdx
add    $0x2,%rdx
mov    %rax,%rdi
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
@dup_svector.size = internal global i64 2
define void @dup_svector(i16* %0, i64 %1, i64 %2, i16* %3) {
%5 = alloca i16*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i16*
%9 = alloca i64
store i16* %0, i16** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i16* %3, i16** %8
%10 = load i64, i64* %7
%11 = load i64, i64* %6
%12 = sub nsw i64 %10, %11
%13 = add nsw i64 %12, 1
store i64 %13, i64* %9
%14 = load i16*, i16** %8
%15 = load i64, i64* %6
%16 = getelementptr inbounds i16, i16* %14, i64 %15
%17 = load i16*, i16** %5
%18 = load i64, i64* %6
%19 = getelementptr inbounds i16, i16* %17, i64 %18
%20 = load i64, i64* %9
%21 = load i64, i64* @dup_svector.size
%22 = mul nsw i64 %20, %21
%23 = call i32 @memcpy(i16* %16, i16* %19, i64 %22)
ret void
}

LLVM IR (-O2):
define void @dup_svector(i16* %0, i64 %1, i64 %2, i16* %3) {
%5 = sub nsw i64 %2, %1
%6 = getelementptr inbounds i16, i16* %3, i64 %1
%7 = getelementptr inbounds i16, i16* %0, i64 %1
%8 = shl i64 %5, 1
%9 = add i64 %8, 2
%10 = tail call i32 @memcpy(i16* %6, i16* %7, i64 %9)
ret void
}
int iTestStrZero(unsigned char *psStr, int iLen) {
  while (iLen-- > 0)
    if (*psStr++ != 0)
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<iTestStrZero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
jle    114b <iTestStrZero+0x4b>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movzbl (%rax),%eax
cmp    $0x0,%eax
je     1146 <iTestStrZero+0x46>
movl   $0x1,-0x4(%rbp)
jmp    1152 <iTestStrZero+0x52>
jmp    110b <iTestStrZero+0xb>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iTestStrZero>:
test   %esi,%esi
jle    1116 <iTestStrZero+0x16>
add    $0xffffffff,%esi
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
je     1100 <iTestStrZero>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @iTestStrZero(i8* nocapture %0, i32 %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %0, %2 ], [ %9, %7 ]
%5 = phi i32 [ %1, %2 ], [ %8, %7 ]
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %3
%8 = add nsw i32 %5, -1
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = load i8, i8* %4
%11 = icmp eq i8 %10, 0
br i1 %11, label %3, label %12
12: ; preds = %3, %7
%13 = phi i32 [ 1, %7 ], [ 0, %3 ]
ret i32 %13
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
bool DESIVSet(uint32_t ui32Base, uint32_t *pui32IVdata) {
  ;
  if (((*((volatile unsigned long *)(ui32Base + 0x00000020))) & 0x80000000) ==
      0) {
    return (0);
  }
  (*((volatile unsigned long *)(ui32Base + 0x00000018))) = pui32IVdata[0];
  (*((volatile unsigned long *)(ui32Base + 0x0000001C))) = pui32IVdata[1];
  return (1);
}


x86 assembly (clang, -O0):
<DESIVSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
movabs $0x80000000,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
jne    1137 <DESIVSet+0x37>
movl   $0x0,-0x4(%rbp)
jmp    115d <DESIVSet+0x5d>
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x18(%rax)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x1c(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DESIVSet>:
mov    0x20(%rdi),%rcx
and    $0x80000000,%ecx
xor    %eax,%eax
test   %rcx,%rcx
je     1125 <DESIVSet+0x25>
mov    (%rsi),%rax
mov    %rax,0x18(%rdi)
mov    0x8(%rsi),%rax
mov    %rax,0x1c(%rdi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @DESIVSet(i64 %0, i64* nocapture %1) {
%3 = add i64 %0, 32
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %5, 2147483648
%7 = icmp eq i64 %6, 0
br i1 %7, label %16, label %8
8: ; preds = %2
%9 = load i64, i64* %1
%10 = add i64 %0, 24
%11 = inttoptr i64 %10 to i64*
store volatile i64 %9, i64* %11
%12 = getelementptr inbounds i64, i64* %1, i64 1
%13 = load i64, i64* %12
%14 = add i64 %0, 28
%15 = inttoptr i64 %14 to i64*
store volatile i64 %13, i64* %15
br label %16
16: ; preds = %2, %8
%17 = phi i32 [ 1, %8 ], [ 0, %2 ]
ret i32 %17
}
int is_power_of_2(int n) { return !(n & (n - 1)); }


x86 assembly (clang, -O0):
<is_power_of_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_power_of_2>:
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_power_of_2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1
%6 = and i32 %3, %5
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @is_power_of_2(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
unsigned int __dos_assemble_4le(unsigned char const *);
unsigned int mbr_get_id(const unsigned char *mbr) {
  return __dos_assemble_4le(&mbr[440]);
}


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

x86 assembly (clang, -O2):
<mbr_get_id>:
add    $0x1b8,%rdi
jmp    1030 <__dos_assemble_4le@plt>

LLVM IR (-O0):
define i32 @mbr_get_id(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 440
%5 = call i32 @__dos_assemble_4le(i8* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @mbr_get_id(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 440
%3 = tail call i32 @__dos_assemble_4le(i8* %2)
ret i32 %3
}
/* Variables and functions */
int foo_Foo(int);
int bar_Bar(int foo) {
  int bar = foo_Foo(foo);
  return bar + 666;
}


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

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

LLVM IR (-O0):
define i32 @bar_Bar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @foo_Foo(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 666
ret i32 %7
}

LLVM IR (-O2):
define i32 @bar_Bar(i32 %0) {
%2 = tail call i32 @foo_Foo(i32 %0)
%3 = add nsw i32 %2, 666
ret i32 %3
}
int child4() {
  int a = 0;
  int ii;
  for (ii = 0; ii < 8; ++ii)
    a += ii;
  return a;
}


x86 assembly (clang, -O0):
<child4>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    1133 <child4+0x33>
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <child4+0x12>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @child4() {
ret i32 28
}
void xor (int x, int y, int z) {
  bfalgo("$[-]$[$-$-]$[$+$[-]]", z, x, y, x, y, z, y);
}


x86 assembly (clang, -O0):
<xor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%r8d
mov    -0x8(%rbp),%r9d
mov    -0xc(%rbp),%r10d
mov    -0x8(%rbp),%eax
lea    0xec0(%rip),%rdi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1030 <bfalgo@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xor>:
push   %rax
mov    %edx,%r10d
mov    %esi,%ecx
mov    %edi,%edx
lea    0xee1(%rip),%rdi
mov    %r10d,%esi
mov    %edx,%r8d
mov    %ecx,%r9d
xor    %eax,%eax
push   %rcx
push   %r10
call   1030 <bfalgo@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
@.str = [21 x i8] c"$[-]$[$-$-]$[$+$[-]]\00"
define void @xor(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = load i32, i32* %5
%14 = call i32 (i8*, i32, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @bfalgo to i32 (i8*, i32, i32, i32, i32, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9, i32 %10, i32 %11, i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"$[-]$[$-$-]$[$+$[-]]\00"
define void @xor(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (i8*, i32, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @bfalgo to i32 (i8*, i32, i32, i32, i32, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %0, i32 %1, i32 %0, i32 %1, i32 %2, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *PrintHello(void *threadid) {
  printf("\n%d: Hello World!\n", *((int *)threadid));
  free(threadid);
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<PrintHello>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintHello>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%esi
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %edi,%edi
pop    %rbx
jmp    1050 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"\0A%d: Hello World!\0A\00"
define i8* @PrintHello(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
%10 = call i32 @pthread_exit(i32* null)
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@.str = [19 x i8] c"\0A%d: Hello World!\0A\00"
define noalias i8* @PrintHello(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @free(i8* %0)
%6 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
void putstr(s) register char *s;
{
  while (*s != '\0')
    putchr(*s++);
}


x86 assembly (clang, -O0):
<putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114a <putstr+0x3a>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
mov    $0x0,%al
call   1030 <putchr@plt>
jmp    111c <putstr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchr to i32 (i32, ...)*)(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
_findbuf() { abort(); }


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

x86 assembly (clang, -O2):
<_findbuf>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @_findbuf() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @_findbuf() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ctsetbytes(scalar_t__);
char *get_message();
int /*<<< orphan*/ printf(char *, char const *);
scalar_t__ strlen(char const *);
void ctbenchprintsz(int n) {
  int i;
  const char *m = get_message();
  ctsetbytes(strlen(m) + 1);
  for (i = 0; i < n; i++) {
    printf("%s\n", m);
  }
}


x86 assembly (clang, -O0):
<ctbenchprintsz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <get_message@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1060 <ctsetbytes@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    119c <ctbenchprintsz+0x5c>
mov    -0x10(%rbp),%rsi
lea    0xe77(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1172 <ctbenchprintsz+0x32>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctbenchprintsz>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <get_message@plt>
mov    %rax,%r14
mov    %rax,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1060 <ctsetbytes@plt>
test   %ebx,%ebx
jle    1180 <ctbenchprintsz+0x40>
lea    0xe93(%rip),%r15
nopl   (%rax)
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <printf@plt>
add    $0xffffffff,%ebx
jne    1170 <ctbenchprintsz+0x30>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @ctbenchprintsz(i32 %0) {
%2 = tail call i8* (...) @get_message()
%3 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%4 = add nsw i64 %3, 1
%5 = tail call i32 @ctsetbytes(i64 %4)
%6 = icmp sgt i32 %0, 0
br i1 %6, label %7, label %12
7: ; preds = %1, %7
%8 = phi i32 [ %10, %7 ], [ 0, %1 ]
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%10 = add nuw nsw i32 %8, 1
%11 = icmp eq i32 %10, %0
br i1 %11, label %12, label %7
12: ; preds = %7, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ main();
int /*<<< orphan*/ syscall(int, int /*<<< orphan*/);
void __attribute__((noreturn)) _start() {
  syscall(1, main());
loop:
  goto loop;
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <main@plt>
mov    %eax,%esi
mov    $0x1,%edi
call   1030 <syscall@plt>
jmp    1137 <_start+0x17>

x86 assembly (clang, -O2):
<_start>:
push   %rax
xor    %eax,%eax
call   1040 <main@plt>
mov    $0x1,%edi
mov    %eax,%esi
call   1030 <syscall@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
jmp    1140 <_start+0x20>

LLVM IR (-O0):
define void @_start() {
%1 = call i32 (...) @main()
%2 = call i32 @syscall(i32 1, i32 %1)
br label %3
3: ; preds = %3, %0
br label %3
}

LLVM IR (-O2):
define void @_start() {
%1 = tail call i32 (...) @main()
%2 = tail call i32 @syscall(i32 1, i32 %1)
br label %3
3: ; preds = %3, %0
br label %3
}
/* Variables and functions */
scalar_t__ numeric(unsigned char const *, int const, int /*<<< orphan*/, int,
                   int, int *, int *, char *);
int n13(const unsigned char *data, const int data_len, int *p_err_no,
        int *p_err_posn, char err_msg[50]) {
  return data_len == 13 &&
         numeric(data, data_len, 0, 13, 13, p_err_no, p_err_posn, err_msg);
}


x86 assembly (clang, -O0):
<n13>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
cmpl   $0xd,-0xc(%rbp)
mov    %al,-0x29(%rbp)
jne    1170 <n13+0x60>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%r9
mov    -0x20(%rbp),%r10
mov    -0x28(%rbp),%rax
xor    %edx,%edx
mov    $0xd,%r8d
mov    %r8d,%ecx
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <numeric@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<n13>:
xor    %eax,%eax
cmp    $0xd,%esi
jne    114f <n13+0x3f>
push   %rax
mov    %r8,%r11
mov    %rcx,%r10
mov    %rdx,%r9
mov    $0xd,%esi
xor    %edx,%edx
mov    $0xd,%ecx
mov    $0xd,%r8d
push   %r11
push   %r10
call   1030 <numeric@plt>
add    $0x10,%rsp
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @n13(i8* %0, i32 %1, i32* %2, i32* %3, i8* %4) {
%6 = icmp eq i32 %1, 13
br i1 %6, label %7, label %11
7: ; preds = %5
%8 = tail call i64 @numeric(i8* %0, i32 13, i32 0, i32 13, i32 13, i32* %2, i32* %3, i8* %4)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %5
%12 = phi i32 [ 0, %5 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ _delayMicroseconds(int);
void delay(int i) {
  while (i) {
    _delayMicroseconds(1000);
    i--;
  }
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113d <delay+0x2d>
mov    $0x3e8,%edi
call   1030 <_delayMicroseconds@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    111b <delay+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
push   %rbx
test   %edi,%edi
je     112f <delay+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x3e8,%edi
call   1030 <_delayMicroseconds@plt>
add    $0xffffffff,%ebx
jne    1120 <delay+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @delay(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = tail call i32 @_delayMicroseconds(i32 1000)
%6 = add nsw i32 %4, -1
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ printBase62(unsigned long, int /*<<< orphan*/ *);
void printCompositeId(FILE *stream, unsigned long parentId,
                      unsigned long userId, unsigned long collectionId) {
  printBase62(parentId, stream);
  fputc('-', stream);
  printBase62(userId, stream);
  fputc('-', stream);
  printBase62(collectionId, stream);
}


x86 assembly (clang, -O0):
<printCompositeId>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <printBase62@plt>
mov    -0x8(%rbp),%rsi
mov    $0x2d,%edi
call   1030 <fputc@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <printBase62@plt>
mov    -0x8(%rbp),%rsi
mov    $0x2d,%edi
call   1030 <fputc@plt>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <printBase62@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printCompositeId>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rbx,%rsi
call   1040 <printBase62@plt>
mov    $0x2d,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <printBase62@plt>
mov    $0x2d,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <printBase62@plt>

LLVM IR (-O0):
define void @printCompositeId(i32* %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i32* %0, i32** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %6
%10 = load i32*, i32** %5
%11 = call i32 @printBase62(i64 %9, i32* %10)
%12 = load i32*, i32** %5
%13 = call i32 @fputc(i8 signext 45, i32* %12)
%14 = load i64, i64* %7
%15 = load i32*, i32** %5
%16 = call i32 @printBase62(i64 %14, i32* %15)
%17 = load i32*, i32** %5
%18 = call i32 @fputc(i8 signext 45, i32* %17)
%19 = load i64, i64* %8
%20 = load i32*, i32** %5
%21 = call i32 @printBase62(i64 %19, i32* %20)
ret void
}

LLVM IR (-O2):
define void @printCompositeId(i32* %0, i64 %1, i64 %2, i64 %3) {
%5 = tail call i32 @printBase62(i64 %1, i32* %0)
%6 = tail call i32 @fputc(i8 signext 45, i32* %0)
%7 = tail call i32 @printBase62(i64 %2, i32* %0)
%8 = tail call i32 @fputc(i8 signext 45, i32* %0)
%9 = tail call i32 @printBase62(i64 %3, i32* %0)
ret void
}
void foo_2_1_1_2_1_1_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_1_2_1_1_2_1_1() {
ret void
}
unsigned int usb_checkreceivestatus() {
  unsigned int i = 0;
  *(volatile unsigned int *)0xCC006814 = 0x000000D0;
  *(volatile unsigned int *)0xCC006824 = 0xD0000000;
  *(volatile unsigned int *)0xCC006820 = 0x19;
  while ((*(volatile unsigned int *)0xCC006820) & 1)
    ;
  i = *(volatile unsigned int *)0xCC006824;
  *(volatile unsigned int *)0xCC006814 = 0x0;
  if (i & 0x04000000) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<usb_checkreceivestatus>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
mov    $0xcc006814,%eax
movl   $0xd0,(%rax)
mov    $0xcc006824,%eax
movl   $0xd0000000,(%rax)
mov    $0xcc006820,%eax
movl   $0x19,(%rax)
mov    $0xcc006820,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1144 <usb_checkreceivestatus+0x44>
jmp    112c <usb_checkreceivestatus+0x2c>
mov    $0xcc006824,%eax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    $0xcc006814,%eax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%eax
and    $0x4000000,%eax
cmp    $0x0,%eax
je     1176 <usb_checkreceivestatus+0x76>
movl   $0x1,-0x4(%rbp)
jmp    117d <usb_checkreceivestatus+0x7d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_checkreceivestatus>:
mov    $0xcc006814,%ecx
movl   $0xd0,(%rcx)
movl   $0xd0000000,0x10(%rcx)
movl   $0x19,0xc(%rcx)
nopl   0x0(%rax)
mov    0xc(%rcx),%eax
test   $0x1,%al
jne    1120 <usb_checkreceivestatus+0x20>
mov    0x10(%rcx),%eax
movl   $0x0,(%rcx)
shr    $0x1a,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @usb_checkreceivestatus() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
store volatile i32 208, i32* inttoptr (i64 3422578708 to i32*)
store volatile i32 -805306368, i32* inttoptr (i64 3422578724 to i32*)
store volatile i32 25, i32* inttoptr (i64 3422578720 to i32*)
br label %3
3: ; preds = %7, %0
%4 = load volatile i32, i32* inttoptr (i64 3422578720 to i32*)
%5 = and i32 %4, 1
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load volatile i32, i32* inttoptr (i64 3422578724 to i32*)
store i32 %9, i32* %2
store volatile i32 0, i32* inttoptr (i64 3422578708 to i32*)
%10 = load i32, i32* %2
%11 = and i32 %10, 67108864
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %8
store i32 1, i32* %1
br label %15
14: ; preds = %8
store i32 0, i32* %1
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @usb_checkreceivestatus() {
store volatile i32 208, i32* inttoptr (i64 3422578708 to i32*)
store volatile i32 -805306368, i32* inttoptr (i64 3422578724 to i32*)
store volatile i32 25, i32* inttoptr (i64 3422578720 to i32*)
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 3422578720 to i32*)
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
%6 = load volatile i32, i32* inttoptr (i64 3422578724 to i32*)
store volatile i32 0, i32* inttoptr (i64 3422578708 to i32*)
%7 = lshr i32 %6, 26
%8 = and i32 %7, 1
ret i32 %8
}
long durationToInches(long duration) { return duration / 73.746 / 2; }


x86 assembly (clang, -O0):
<durationToInches>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  0xef2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xede(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<durationToInches>:
cvtsi2sd %rdi,%xmm0
divsd  0xef3(%rip),%xmm0
mulsd  0xef3(%rip),%xmm0
cvttsd2si %xmm0,%rax
ret

LLVM IR (-O0):
define i64 @durationToInches(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to double
%5 = fdiv double %4, 0x40526FBE76C8B439
%6 = fdiv double %5, 2.000000e+00
%7 = fptosi double %6 to i64
ret i64 %7
}

LLVM IR (-O2):
define i64 @durationToInches(i64 %0) {
%2 = sitofp i64 %0 to double
%3 = fdiv double %2, 0x40526FBE76C8B439
%4 = fmul double %3, 5.000000e-01
%5 = fptosi double %4 to i64
ret i64 %5
}
/* Type definitions */
union bpf_attr {
  int /*<<< orphan*/ prog_id;
};
typedef int /*<<< orphan*/ attr;
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
int /*<<< orphan*/ BPF_PROG_GET_FD_BY_ID;
int /*<<< orphan*/ memset(union bpf_attr *, int /*<<< orphan*/, int);
int sys_bpf(int /*<<< orphan*/, union bpf_attr *, int);
int bpf_prog_get_fd_by_id(__u32 id) {
  union bpf_attr attr;
  memset(&attr, 0, sizeof(attr));
  attr.prog_id = id;
  return sys_bpf(BPF_PROG_GET_FD_BY_ID, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_prog_get_fd_by_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <sys_bpf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_prog_get_fd_by_id>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    %ebx,(%rsp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <sys_bpf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%union.bpf_attr = type { i32 }
@BPF_PROG_GET_FD_BY_ID = global i32 0
define i32 @bpf_prog_get_fd_by_id(i32 %0) {
%2 = alloca i32
%3 = alloca %union.bpf_attr
store i32 %0, i32* %2
%4 = call i32 @memset(%union.bpf_attr* %3, i32 0, i32 4)
%5 = load i32, i32* %2
%6 = bitcast %union.bpf_attr* %3 to i32*
store i32 %5, i32* %6
%7 = load i32, i32* @BPF_PROG_GET_FD_BY_ID
%8 = call i32 @sys_bpf(i32 %7, %union.bpf_attr* %3, i32 4)
ret i32 %8
}

LLVM IR (-O2):
%union.bpf_attr = type { i32 }
@BPF_PROG_GET_FD_BY_ID = global i32 0
define i32 @bpf_prog_get_fd_by_id(i32 %0) {
%2 = alloca %union.bpf_attr
%3 = bitcast %union.bpf_attr* %2 to i8*
%4 = call i32 @memset(%union.bpf_attr* %2, i32 0, i32 4)
%5 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %2, i64 0, i32 0
store i32 %0, i32* %5
%6 = load i32, i32* @BPF_PROG_GET_FD_BY_ID
%7 = call i32 @sys_bpf(i32 %6, %union.bpf_attr* %2, i32 4)
ret i32 %7
}