xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, size_t);
int readdata(char *packet, char **src, char *dst, size_t len) {
  memcpy(dst, *src, len);
  (*src) += len;
  return len;
}


x86 assembly (clang, -O0):
<readdata>:
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    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
add    (%rax),%rcx
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readdata>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %rdx,%rdi
mov    %rsi,%r14
mov    (%rsi),%rsi
mov    %rcx,%rdx
call   1030 <memcpy@plt>
add    %rbx,(%r14)
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @readdata(i8* %0, i8** %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i8** %1, i8*** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %7
%10 = load i8**, i8*** %6
%11 = load i8*, i8** %10
%12 = load i64, i64* %8
%13 = call i32 @memcpy(i8* %9, i8* %11, i64 %12)
%14 = load i64, i64* %8
%15 = load i8**, i8*** %6
%16 = load i8*, i8** %15
%17 = getelementptr inbounds i8, i8* %16, i64 %14
store i8* %17, i8** %15
%18 = load i64, i64* %8
%19 = trunc i64 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @readdata(i8* nocapture readnone %0, i8** nocapture %1, i8* %2, i64 %3) {
%5 = load i8*, i8** %1
%6 = tail call i32 @memcpy(i8* %2, i8* %5, i64 %3)
%7 = load i8*, i8** %1
%8 = getelementptr inbounds i8, i8* %7, i64 %3
store i8* %8, i8** %1
%9 = trunc i64 %3 to i32
ret i32 %9
}
const char *skip_whitespace(const char *text) {
  while ((*text == ' ' || *text == '\t' || *text == '\r' || *text == '\n') ||
         *text == 0) {
    text++;
  }
  return text;
}


x86 assembly (clang, -O0):
<skip_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     116c <skip_whitespace+0x6c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x9(%rbp)
je     116c <skip_whitespace+0x6c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x9(%rbp)
je     116c <skip_whitespace+0x6c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x9(%rbp)
je     116c <skip_whitespace+0x6c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    117c <skip_whitespace+0x7c>
jmp    118d <skip_whitespace+0x8d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip_whitespace+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_whitespace>:
mov    %rdi,%rax
movabs $0x100002601,%rcx
nopl   (%rax)
movzbl (%rax),%edx
cmp    $0x20,%rdx
ja     1125 <skip_whitespace+0x25>
bt     %rdx,%rcx
jae    1125 <skip_whitespace+0x25>
add    $0x1,%rax
jmp    1110 <skip_whitespace+0x10>
ret

LLVM IR (-O0):
define i8* @skip_whitespace(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %30, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 32
br i1 %7, label %28, label %8
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 9
br i1 %12, label %28, label %13
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 13
br i1 %17, label %28, label %18
18: ; preds = %13
%19 = load i8*, i8** %2
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 10
br i1 %22, label %28, label %23
23: ; preds = %18
%24 = load i8*, i8** %2
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 0
br label %28
28: ; preds = %23, %18, %13, %8, %3
%29 = phi i1 [ true, %18 ], [ true, %13 ], [ true, %8 ], [ true, %3 ], [ %27, %23 ]
br i1 %29, label %30, label %33
30: ; preds = %28
%31 = load i8*, i8** %2
%32 = getelementptr inbounds i8, i8* %31, i32 1
store i8* %32, i8** %2
br label %3
33: ; preds = %28
%34 = load i8*, i8** %2
ret i8* %34
}

LLVM IR (-O2):
define i8* @skip_whitespace(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 32, label %5
i8 9, label %5
i8 13, label %5
i8 10, label %5
i8 0, label %5
]
5: ; preds = %2, %2, %2, %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int open(char const *, int /*<<< orphan*/);
int ptys_open(const char *pts_name) { return open(pts_name, O_RDWR); }


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

x86 assembly (clang, -O2):
<ptys_open>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_RDWR = global i32 0
define i32 @ptys_open(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @O_RDWR
%5 = call i32 @open(i8* %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@O_RDWR = global i32 0
define i32 @ptys_open(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = tail call i32 @open(i8* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int isdigit(int);
bool valid_numeral_first_char(char ch) { return isdigit((int)ch); }


x86 assembly (clang, -O0):
<valid_numeral_first_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isdigit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_numeral_first_char>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @valid_numeral_first_char(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
%4 = icmp ult i32 %3, 10
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *);
int /*<<< orphan*/ output_byte(int);
void emit_fchs(void) {
  assem_debug("fchs");
  output_byte(0xd9);
  output_byte(0xe0);
}


x86 assembly (clang, -O0):
<emit_fchs>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0xd9,%edi
call   1040 <output_byte@plt>
mov    $0xe0,%edi
call   1040 <output_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fchs>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0xd9,%edi
call   1040 <output_byte@plt>
mov    $0xe0,%edi
pop    %rax
jmp    1040 <output_byte@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"fchs\00"
define void @emit_fchs() {
%1 = call i32 @assem_debug(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @output_byte(i32 217)
%3 = call i32 @output_byte(i32 224)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"fchs\00"
define void @emit_fchs() {
%1 = tail call i32 @assem_debug(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @output_byte(i32 217)
%3 = tail call i32 @output_byte(i32 224)
ret void
}
const char *adv_choice_get_use(const struct adv_choice *choice) {
  return "(unknown)";
}


x86 assembly (clang, -O0):
<adv_choice_get_use>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.adv_choice = type opaque
@.str = [10 x i8] c"(unknown)\00"
define i8* @adv_choice_get_use(%struct.adv_choice* %0) {
%2 = alloca %struct.adv_choice*
store %struct.adv_choice* %0, %struct.adv_choice** %2
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.adv_choice = type opaque
@.str = [10 x i8] c"(unknown)\00"
define i8* @adv_choice_get_use(%struct.adv_choice* nocapture readnone %0) {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
int test_imm_BDuint16_reg(unsigned short val) {
  return ((val) & (-0xBD << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_BDuint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -189
%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_BDuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -189
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int pre_ign(struct termp *p, struct mtermp *mt, const struct man_node *n,
            const struct man_meta *m) {
  return (0);
}


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

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

LLVM IR (-O0):
%struct.termp = type opaque
%struct.mtermp = type opaque
%struct.man_node = type opaque
%struct.man_meta = type opaque
define i32 @pre_ign(%struct.termp* %0, %struct.mtermp* %1, %struct.man_node* %2, %struct.man_meta* %3) {
%5 = alloca %struct.termp*
%6 = alloca %struct.mtermp*
%7 = alloca %struct.man_node*
%8 = alloca %struct.man_meta*
store %struct.termp* %0, %struct.termp** %5
store %struct.mtermp* %1, %struct.mtermp** %6
store %struct.man_node* %2, %struct.man_node** %7
store %struct.man_meta* %3, %struct.man_meta** %8
ret i32 0
}

LLVM IR (-O2):
%struct.termp = type opaque
%struct.mtermp = type opaque
%struct.man_node = type opaque
%struct.man_meta = type opaque
define i32 @pre_ign(%struct.termp* nocapture readnone %0, %struct.mtermp* nocapture readnone %1, %struct.man_node* nocapture readnone %2, %struct.man_meta* nocapture readnone %3) {
ret i32 0
}
/* Variables and functions */
unsigned int sum(unsigned int *, int);
unsigned int example_sums(void) {
  unsigned int nums[10] = {0, 1, 2, 3, 4, 6, 7, 8, 9};
  return sum(nums, 10) + sum(nums + 2, 6);
}


x86 assembly (clang, -O0):
<example_sums>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x28,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1040 <sum@plt>
mov    %eax,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
add    $0x8,%rdi
mov    $0x6,%esi
call   1040 <sum@plt>
mov    %eax,%ecx
mov    -0x34(%rbp),%eax
add    %ecx,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<example_sums>:
push   %rbx
sub    $0x30,%rsp
mov    0xf04(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xee8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecc(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1030 <sum@plt>
mov    %eax,%ebx
lea    0x8(%rsp),%rdi
mov    $0x6,%esi
call   1030 <sum@plt>
add    %ebx,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.example_sums.nums = [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 6, i32 7, i32 8, i32 9, i32 0]
define i32 @example_sums() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @sum(i32* %3, i32 10)
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds i32, i32* %5, i64 2
%7 = call i32 @sum(i32* %6, i32 6)
%8 = add i32 %4, %7
ret i32 %8
}

LLVM IR (-O2):
@__const.example_sums.nums = [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 6, i32 7, i32 8, i32 9, i32 0]
define i32 @example_sums() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @sum(i32* %3, i32 10)
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
%6 = call i32 @sum(i32* %5, i32 6)
%7 = add i32 %6, %4
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ func1();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = 3;
  printf("[in main] i = %d\n", i);
  func1();
  printf("[back in main] i = %d\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <func1@plt>
mov    -0x8(%rbp),%esi
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x3,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <func1@plt>
lea    0xed2(%rip),%rdi
mov    $0x3,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"[in main] i = %d\0A\00"
@.str.1 = [23 x i8] c"[back in main] i = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (...) @func1()
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"[in main] i = %d\0A\00"
@.str.1 = [23 x i8] c"[back in main] i = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 3)
%2 = tail call i32 (...) @func1()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char fgetc(int /*<<< orphan*/ *);
void eraseSpaces(FILE *pFile, char *c) {
  do {
    *c = fgetc(pFile);
  } while ((*c == ' ') || (*c == '\n'));
}


x86 assembly (clang, -O0):
<eraseSpaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x11(%rbp)
je     1156 <eraseSpaces+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1120 <eraseSpaces+0x10>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eraseSpaces>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <fgetc@plt>
mov    %al,(%r14)
cmp    $0xa,%al
je     1120 <eraseSpaces+0x10>
cmp    $0x20,%al
je     1120 <eraseSpaces+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @eraseSpaces(i32* nocapture %0, i8* nocapture writeonly %1) {
br label %3
3: ; preds = %5, %2
%4 = tail call signext i8 @fgetc(i32* %0)
store i8 %4, i8* %1
switch i8 %4, label %6 [
i8 32, label %5
i8 10, label %5
]
5: ; preds = %3, %3
br label %3
6: ; preds = %3
ret void
}
/* Type definitions */
struct flashrom_flashctx {
  int dummy;
};

/* Variables and functions */
int spi_disable_blockprotect_generic(struct flashrom_flashctx *, int, int,
                                     int /*<<< orphan*/, int);
int spi_disable_blockprotect_n25q(struct flashrom_flashctx *flash) {
  return spi_disable_blockprotect_generic(flash, 0x5C, 1 << 7, 0, 0xFF);
}


x86 assembly (clang, -O0):
<spi_disable_blockprotect_n25q>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x5c,%esi
mov    $0x80,%edx
xor    %ecx,%ecx
mov    $0xff,%r8d
call   1030 <spi_disable_blockprotect_generic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_disable_blockprotect_n25q>:
mov    $0x5c,%esi
mov    $0x80,%edx
xor    %ecx,%ecx
mov    $0xff,%r8d
jmp    1030 <spi_disable_blockprotect_generic@plt>

LLVM IR (-O0):
%struct.flashrom_flashctx = type { i32 }
define i32 @spi_disable_blockprotect_n25q(%struct.flashrom_flashctx* %0) {
%2 = alloca %struct.flashrom_flashctx*
store %struct.flashrom_flashctx* %0, %struct.flashrom_flashctx** %2
%3 = load %struct.flashrom_flashctx*, %struct.flashrom_flashctx** %2
%4 = call i32 @spi_disable_blockprotect_generic(%struct.flashrom_flashctx* %3, i32 92, i32 128, i32 0, i32 255)
ret i32 %4
}

LLVM IR (-O2):
%struct.flashrom_flashctx = type { i32 }
define i32 @spi_disable_blockprotect_n25q(%struct.flashrom_flashctx* %0) {
%2 = tail call i32 @spi_disable_blockprotect_generic(%struct.flashrom_flashctx* %0, i32 92, i32 128, i32 0, i32 255)
ret i32 %2
}
/* Type definitions */
struct passwd {
  int dummy;
};
typedef enum nss_status { ____Placeholder_nss_status } nss_status;

/* Variables and functions */
int internal_getpwent_r(struct passwd *, char *, size_t, int *);
int /*<<< orphan*/ sss_nss_lock();
int /*<<< orphan*/ sss_nss_unlock();
enum nss_status _nss_sss_getpwent_r(struct passwd *result, char *buffer,
                                    size_t buflen, int *errnop) {
  enum nss_status nret;
  sss_nss_lock();
  nret = internal_getpwent_r(result, buffer, buflen, errnop);
  sss_nss_unlock();
  return nret;
}


x86 assembly (clang, -O0):
<_nss_sss_getpwent_r>:
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    $0x0,%al
call   1030 <sss_nss_lock@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1040 <internal_getpwent_r@plt>
mov    %eax,-0x24(%rbp)
mov    $0x0,%al
call   1050 <sss_nss_unlock@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nss_sss_getpwent_r>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <sss_nss_lock@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1040 <internal_getpwent_r@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <sss_nss_unlock@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.passwd = type { i32 }
define i32 @_nss_sss_getpwent_r(%struct.passwd* %0, i8* %1, i64 %2, i32* %3) {
%5 = alloca %struct.passwd*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32*
%9 = alloca i32
store %struct.passwd* %0, %struct.passwd** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%10 = call i32 (...) @sss_nss_lock()
%11 = load %struct.passwd*, %struct.passwd** %5
%12 = load i8*, i8** %6
%13 = load i64, i64* %7
%14 = load i32*, i32** %8
%15 = call i32 @internal_getpwent_r(%struct.passwd* %11, i8* %12, i64 %13, i32* %14)
store i32 %15, i32* %9
%16 = call i32 (...) @sss_nss_unlock()
%17 = load i32, i32* %9
ret i32 %17
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
define i32 @_nss_sss_getpwent_r(%struct.passwd* %0, i8* %1, i64 %2, i32* %3) {
%5 = tail call i32 (...) @sss_nss_lock()
%6 = tail call i32 @internal_getpwent_r(%struct.passwd* %0, i8* %1, i64 %2, i32* %3)
%7 = tail call i32 (...) @sss_nss_unlock()
ret i32 %6
}
void globl(name) char *name;
{
  outop0str("GLOBL\t");
  outnccname(name);
}


x86 assembly (clang, -O0):
<globl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1040 <outop0str@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <outnccname@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<globl>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <outop0str@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <outnccname@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"GLOBL\09\00"
define void @globl(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @outop0str to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @outnccname to i32 (i8*, ...)*)(i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"GLOBL\09\00"
define void @globl(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outop0str to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outnccname to i32 (i8*, ...)*)(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func_1();
void func_0(void) {
  int var_0 = 0;
  func_1();
}


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

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

LLVM IR (-O0):
define void @func_0() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @func_1()
ret void
}

LLVM IR (-O2):
define void @func_0() {
%1 = tail call i32 (...) @func_1()
ret void
}
/* Type definitions */
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long long mstime(void) {
  struct timeval tv;
  long long mst;
  gettimeofday(&tv, NULL);
  mst = ((long)tv.tv_sec) * 1000;
  mst += tv.tv_usec / 1000;
  return mst;
}


x86 assembly (clang, -O0):
<mstime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
cltq
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mstime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,0x10(%rsp),%rcx
movslq 0x8(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @mstime() {
%1 = alloca %struct.timeval
%2 = alloca i64
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000
store i64 %6, i64* %2
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = sext i32 %9 to i64
%11 = load i64, i64* %2
%12 = add nsw i64 %11, %10
store i64 %12, i64* %2
%13 = load i64, i64* %2
ret i64 %13
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @mstime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = sext i32 %9 to i64
%11 = add nsw i64 %6, %10
ret i64 %11
}
/* Type definitions */
typedef int wint_t;

/* Variables and functions */
int __iswspace_ascii(wint_t c) {
  return (unsigned int)(c - 9) < 5u || c == ' ';
}


x86 assembly (clang, -O0):
<__iswspace_ascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
sub    $0x9,%ecx
mov    $0x1,%al
cmp    $0x5,%ecx
mov    %al,-0x5(%rbp)
jb     1125 <__iswspace_ascii+0x25>
cmpl   $0x20,-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):
<__iswspace_ascii>:
lea    -0x9(%rdi),%eax
cmp    $0x5,%eax
setb   %al
cmp    $0x20,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @__iswspace_ascii(i32 %0) {
%2 = add nsw i32 %0, -9
%3 = icmp ult i32 %2, 5
%4 = icmp eq i32 %0, 32
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fibonacci();
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main() {
  for (int i = 0; i < 50; i++) {
    printf("%lli\n", fibonacci());
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x32,-0x8(%rbp)
jge    1163 <main+0x43>
mov    $0x0,%al
call   1040 <fibonacci@plt>
mov    %eax,%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x32,%ebp
lea    0xed1(%rip),%rbx
nop
xor    %eax,%eax
call   1040 <fibonacci@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%lli\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 50
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = call i32 (...) @fibonacci()
%8 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [6 x i8] c"%lli\0A\00"
define i32 @main() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %6, %2 ]
%4 = tail call i32 (...) @fibonacci()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = add nuw nsw i32 %3, 1
%7 = icmp eq i32 %6, 50
br i1 %7, label %1, label %2
}
/* Variables and functions */
int /*<<< orphan*/ esc(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void tek_linestyle(int style) {
  char temp[10];
  sprintf(temp, "%c", 0x60 + style);
  esc(temp);
}


x86 assembly (clang, -O0):
<tek_linestyle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0xe(%rbp),%rdi
mov    -0x4(%rbp),%edx
add    $0x60,%edx
lea    0xec4(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0xe(%rbp),%rdi
call   1030 <esc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tek_linestyle>:
sub    $0x18,%rsp
add    $0x60,%dil
mov    %dil,0xe(%rsp)
movb   $0x0,0xf(%rsp)
lea    0xe(%rsp),%rdi
call   1030 <esc@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @tek_linestyle(i32 %0) {
%2 = alloca i32
%3 = alloca [10 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = add nsw i32 96, %5
%7 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%9 = call i32 @esc(i8* %8)
ret void
}

LLVM IR (-O2):
define void @tek_linestyle(i32 %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = trunc i32 %0 to i8
%5 = add i8 %4, 96
store i8 %5, i8* %3
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 1
store i8 0, i8* %6
%7 = call i32 @esc(i8* %3)
ret void
}
void swr_inject_silence() {}


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

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

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

LLVM IR (-O2):
define void @swr_inject_silence() {
ret void
}
/* Variables and functions */
unsigned int vcmpges4(unsigned int, unsigned int);
unsigned int vsub4(unsigned int, unsigned int);
unsigned int vabsdiffs4(unsigned int a, unsigned int b) {
  unsigned int r, s;
  s = vcmpges4(a, b);
  r = a ^ b;
  s = (r & s) ^ b;
  r = s ^ r;
  r = vsub4(s, r);
  return r;
}


x86 assembly (clang, -O0):
<vabsdiffs4>:
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   1040 <vcmpges4@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    -0x10(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <vsub4@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vabsdiffs4>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <vcmpges4@plt>
mov    %ebx,%esi
xor    %ebp,%esi
and    %eax,%esi
xor    %esi,%ebx
xor    %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <vsub4@plt>

LLVM IR (-O0):
define i32 @vabsdiffs4(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @vcmpges4(i32 %7, i32 %8)
store i32 %9, i32* %6
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = xor i32 %10, %11
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = and i32 %13, %14
%16 = load i32, i32* %4
%17 = xor i32 %15, %16
store i32 %17, i32* %6
%18 = load i32, i32* %6
%19 = load i32, i32* %5
%20 = xor i32 %18, %19
store i32 %20, i32* %5
%21 = load i32, i32* %6
%22 = load i32, i32* %5
%23 = call i32 @vsub4(i32 %21, i32 %22)
store i32 %23, i32* %5
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
define i32 @vabsdiffs4(i32 %0, i32 %1) {
%3 = tail call i32 @vcmpges4(i32 %0, i32 %1)
%4 = xor i32 %1, %0
%5 = and i32 %3, %4
%6 = xor i32 %5, %1
%7 = xor i32 %5, %0
%8 = tail call i32 @vsub4(i32 %6, i32 %7)
ret i32 %8
}
extern void android_memory_barrier(void) {
  __asm__ __volatile__("mfence" : : : "memory");
}


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

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

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

LLVM IR (-O2):
define void @android_memory_barrier() {
tail call void asm sideeffect "mfence", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int swap_symbols_for_dobldobl_witness_set(int nvr, int dim) {
  int fail;
  double *c;
  fail = _ada_use_c2phc4c(817, &nvr, &dim, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<swap_symbols_for_dobldobl_witness_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x18(%rbp),%rcx
mov    $0x331,%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_symbols_for_dobldobl_witness_set>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    $0x331,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @swap_symbols_for_dobldobl_witness_set(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load double*, double** %6
%8 = call i32 @_ada_use_c2phc4c(i32 817, i32* %3, i32* %4, double* %7, i32 0)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @swap_symbols_for_dobldobl_witness_set(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @_ada_use_c2phc4c(i32 817, i32* %3, i32* %4, double* undef, i32 0)
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;
typedef int c;

/* Variables and functions */
bool u_char_isvalid(uint32_t c) {
  return ((c) < 0x110000 && (((c)&0xffffff800) != 0xd800) &&
          ((c) < 0xfdd0 || (c) > 0xfdef) && ((c)&0xfffe) != 0xfffe);
}


x86 assembly (clang, -O0):
<u_char_isvalid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x110000,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jge    116e <u_char_isvalid+0x6e>
movslq -0x4(%rbp),%rcx
movabs $0xffffff800,%rax
and    %rax,%rcx
xor    %eax,%eax
cmp    $0xd800,%rcx
mov    %al,-0x5(%rbp)
je     116e <u_char_isvalid+0x6e>
cmpl   $0xfdd0,-0x4(%rbp)
jl     115b <u_char_isvalid+0x5b>
xor    %eax,%eax
cmpl   $0xfdef,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    116e <u_char_isvalid+0x6e>
mov    -0x4(%rbp),%eax
and    $0xfffe,%eax
cmp    $0xfffe,%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_char_isvalid>:
xor    %eax,%eax
cmp    $0x10ffff,%edi
jg     113b <u_char_isvalid+0x3b>
lea    -0xfdf0(%rdi),%ecx
cmp    $0xffffffdf,%ecx
ja     113b <u_char_isvalid+0x3b>
movslq %edi,%rcx
movabs $0xffffff800,%rdx
and    %rcx,%rdx
cmp    $0xd800,%rdx
je     113b <u_char_isvalid+0x3b>
not    %edi
xor    %eax,%eax
test   $0xfffe,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @u_char_isvalid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 1114112
br i1 %4, label %5, label %20
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = and i64 %7, 68719474688
%9 = icmp ne i64 %8, 55296
br i1 %9, label %10, label %20
10: ; preds = %5
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 64976
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = load i32, i32* %2
%15 = icmp sgt i32 %14, 65007
br i1 %15, label %16, label %20
16: ; preds = %13, %10
%17 = load i32, i32* %2
%18 = and i32 %17, 65534
%19 = icmp ne i32 %18, 65534
br label %20
20: ; preds = %16, %13, %5, %1
%21 = phi i1 [ false, %13 ], [ false, %5 ], [ false, %1 ], [ %19, %16 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @u_char_isvalid(i32 %0) {
%2 = icmp slt i32 %0, 1114112
br i1 %2, label %3, label %14
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = and i64 %4, 68719474688
%6 = icmp ne i64 %5, 55296
%7 = add i32 %0, -65008
%8 = icmp ult i32 %7, -32
%9 = and i1 %8, %6
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = and i32 %0, 65534
%12 = icmp ne i32 %11, 65534
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %10, %3, %1
%15 = phi i32 [ 0, %3 ], [ 0, %1 ], [ %13, %10 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ foo(short, char);
int main() {
  short a;
  char i, j;
  i = 10;
  j = 20;
  a = (i * j) * 2;
  foo(a, i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0xa,-0x3(%rbp)
movb   $0x14,-0x4(%rbp)
movsbl -0x3(%rbp),%eax
movsbl -0x4(%rbp),%ecx
imul   %ecx,%eax
shl    $0x1,%eax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
movswl %ax,%edi
movsbl -0x3(%rbp),%esi
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x190,%edi
mov    $0xa,%esi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i16
%2 = alloca i8
%3 = alloca i8
store i8 10, i8* %2
store i8 20, i8* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = mul nsw i32 %5, %7
%9 = mul nsw i32 %8, 2
%10 = trunc i32 %9 to i16
store i16 %10, i16* %1
%11 = load i16, i16* %1
%12 = load i8, i8* %2
%13 = call i32 @foo(i16 signext %11, i8 signext %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i16 signext 400, i8 signext 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void TS_Xinv(void) {
  fputs("Invalid dynamic array argument\n", stderr);
  abort();
}


x86 assembly (clang, -O0):
<TS_Xinv>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1040 <fputs@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<TS_Xinv>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <fputs@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Invalid dynamic array argument\0A\00"
@stderr = global i32 0
define void @TS_Xinv() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [32 x i8] c"Invalid dynamic array argument\0A\00"
@stderr = global i32 0
define void @TS_Xinv() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
struct test_entry {
  int dummy;
};
struct atom {
  int dummy;
};

/* Variables and functions */
int parse_expr_argX(struct test_entry *, struct atom *, int);
int parse_expr_arg1(struct test_entry *test, struct atom *atom) {
  return parse_expr_argX(test, atom, 1);
}


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

x86 assembly (clang, -O2):
<parse_expr_arg1>:
mov    $0x1,%edx
jmp    1030 <parse_expr_argX@plt>

LLVM IR (-O0):
%struct.test_entry = type { i32 }
%struct.atom = type { i32 }
define i32 @parse_expr_arg1(%struct.test_entry* %0, %struct.atom* %1) {
%3 = alloca %struct.test_entry*
%4 = alloca %struct.atom*
store %struct.test_entry* %0, %struct.test_entry** %3
store %struct.atom* %1, %struct.atom** %4
%5 = load %struct.test_entry*, %struct.test_entry** %3
%6 = load %struct.atom*, %struct.atom** %4
%7 = call i32 @parse_expr_argX(%struct.test_entry* %5, %struct.atom* %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
%struct.test_entry = type { i32 }
%struct.atom = type { i32 }
define i32 @parse_expr_arg1(%struct.test_entry* %0, %struct.atom* %1) {
%3 = tail call i32 @parse_expr_argX(%struct.test_entry* %0, %struct.atom* %1, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ f(int *);
main() {
  int a[3];
  f(a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xc(%rbp),%rdi
call   1030 <f@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xc(%rsp),%rdi
call   1030 <f@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [3 x i32]
%2 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%3 = call i32 @f(i32* %2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = call i32 @f(i32* %3)
ret i32 0
}
int linear_index(int r, int c, int rows) { return r + c * rows; }


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

x86 assembly (clang, -O2):
<linear_index>:
imul   %edx,%esi
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @linear_index(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = mul nsw i32 %8, %9
%11 = add nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @linear_index(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %1
%5 = add nsw i32 %4, %0
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t _fwrite(void const *, size_t, int /*<<< orphan*/ *);
size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *f) {
  return _fwrite(ptr, size * nmemb, f) / size;
}


x86 assembly (clang, -O0):
<fwrite>:
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    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
imul   -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <_fwrite@plt>
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fwrite>:
push   %rbx
mov    %rsi,%rbx
imul   %rsi,%rdx
mov    %rdx,%rsi
mov    %rcx,%rdx
call   1030 <_fwrite@plt>
mov    %rax,%rcx
or     %rbx,%rcx
shr    $0x20,%rcx
je     1136 <fwrite+0x26>
xor    %edx,%edx
div    %rbx
pop    %rbx
ret
xor    %edx,%edx
div    %ebx
pop    %rbx
ret

LLVM IR (-O0):
define i64 @fwrite(i8* %0, i64 %1, i64 %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = mul i64 %10, %11
%13 = load i32*, i32** %8
%14 = call i64 @_fwrite(i8* %9, i64 %12, i32* %13)
%15 = load i64, i64* %6
%16 = udiv i64 %14, %15
ret i64 %16
}

LLVM IR (-O2):
define i64 @fwrite(i8* %0, i64 %1, i64 %2, i32* %3) {
%5 = mul i64 %2, %1
%6 = tail call i64 @_fwrite(i8* %0, i64 %5, i32* %3)
%7 = udiv i64 %6, %1
ret i64 %7
}
int same(char *haystack, char *needle) {
  if (*needle == '\0')
    return 1;
  if (*haystack == '\0')
    return -1;
  if (*needle == *haystack)
    return same(haystack + 1, needle + 1);
  return 0;
}


x86 assembly (clang, -O0):
<same>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113c <same+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1192 <same+0x82>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1158 <same+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    1192 <same+0x82>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    118b <same+0x7b>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    -0x18(%rbp),%rsi
add    $0x1,%rsi
call   1030 <same@plt>
mov    %eax,-0x4(%rbp)
jmp    1192 <same+0x82>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<same>:
mov    (%rsi),%r8b
mov    $0x1,%eax
test   %r8b,%r8b
je     112c <same+0x2c>
xor    %edx,%edx
nop
movzbl (%rdi,%rdx,1),%ecx
test   %cl,%cl
je     112d <same+0x2d>
cmp    %cl,%r8b
jne    1133 <same+0x33>
movzbl 0x1(%rsi,%rdx,1),%r8d
add    $0x1,%rdx
test   %r8b,%r8b
jne    1110 <same+0x10>
ret
mov    $0xffffffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @same(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %2, %13
%6 = phi i8 [ %16, %13 ], [ %3, %2 ]
%7 = phi i8* [ %15, %13 ], [ %1, %2 ]
%8 = phi i8* [ %14, %13 ], [ %0, %2 ]
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %18, label %11
11: ; preds = %5
%12 = icmp eq i8 %6, %9
br i1 %12, label %13, label %18
13: ; preds = %11
%14 = getelementptr inbounds i8, i8* %8, i64 1
%15 = getelementptr inbounds i8, i8* %7, i64 1
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %5
18: ; preds = %13, %5, %11, %2
%19 = phi i32 [ 1, %2 ], [ 0, %11 ], [ -1, %5 ], [ 1, %13 ]
ret i32 %19
}
void main(void) {
  static struct coord {
    int x;
    int y;
  } coord = {1, 2};
  static struct coord coord2 = {3, 4};
  coord.x = 10;
  coord2.y = 20;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0xa,0x2f12(%rip)
movl   $0x14,0x2f14(%rip)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.coord = type { i32, i32 }
@main.coord = internal global %struct.coord { i32 1, i32 2 }
@main.coord2 = internal global %struct.coord { i32 3, i32 4 }
define void @main() {
store i32 10, i32* getelementptr inbounds (%struct.coord, %struct.coord* @main.coord, i32 0, i32 0)
store i32 20, i32* getelementptr inbounds (%struct.coord, %struct.coord* @main.coord2, i32 0, i32 1)
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, char *);
void bufoverflow() {
  char buf[10];
  gets(buf);
  buf[9] = '\0';
  printf("%s\n", buf);
  return;
}


x86 assembly (clang, -O0):
<bufoverflow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xa(%rbp),%rdi
call   1040 <gets@plt>
movb   $0x0,-0x1(%rbp)
lea    -0xa(%rbp),%rsi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bufoverflow>:
push   %rbx
sub    $0x10,%rsp
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
movb   $0x0,0xf(%rsp)
lea    0xec2(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @bufoverflow() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 9
store i8 0, i8* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}