xunge/DecIR huggingface dataset:
/* Variables and functions */
char uriHexToLetterExA(unsigned int, int);
char uriHexToLetterA(unsigned int value) { return uriHexToLetterExA(value, 1); }


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

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

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

LLVM IR (-O2):
define signext i8 @uriHexToLetterA(i32 %0) {
%2 = tail call signext i8 @uriHexToLetterExA(i32 %0, i32 1)
ret i8 %2
}
/* Type definitions */
struct RNAplex_args_info {
  int dummy;
};

/* Variables and functions */
int RNAplex_cmdline_parser2(int, char **, struct RNAplex_args_info *,
                            int /*<<< orphan*/, int, int);
int RNAplex_cmdline_parser(int argc, char **argv,
                           struct RNAplex_args_info *args_info) {
  return RNAplex_cmdline_parser2(argc, argv, args_info, 0, 1, 1);
}


x86 assembly (clang, -O0):
<RNAplex_cmdline_parser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
mov    $0x1,%r9d
mov    %r9d,%r8d
call   1030 <RNAplex_cmdline_parser2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RNAplex_cmdline_parser>:
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
jmp    1030 <RNAplex_cmdline_parser2@plt>

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

LLVM IR (-O2):
%struct.RNAplex_args_info = type { i32 }
define i32 @RNAplex_cmdline_parser(i32 %0, i8** %1, %struct.RNAplex_args_info* %2) {
%4 = tail call i32 @RNAplex_cmdline_parser2(i32 %0, i8** %1, %struct.RNAplex_args_info* %2, i32 0, i32 1, i32 1)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ readidew(int);
uint16_t ide_read_ter_w(uint16_t addr, void *priv) { return readidew(2); }


x86 assembly (clang, -O0):
<ide_read_ter_w>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x2,%edi
call   1030 <readidew@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ide_read_ter_w>:
mov    $0x2,%edi
jmp    1030 <readidew@plt>

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

LLVM IR (-O2):
define i32 @ide_read_ter_w(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @readidew(i32 2)
ret i32 %3
}
char *strcpy(char *dest, const char *source) {
  int i = 0;
  while ((dest[i] = source[i]) != '\0') {
    i++;
  }
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rdx
mov    %al,(%rcx,%rdx,1)
movsbl %al,%eax
cmp    $0x0,%eax
je     1143 <strcpy+0x43>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <strcpy+0x13>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %9, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %6, i8* %7
%8 = icmp eq i8 %6, 0
%9 = add nuw i64 %4, 1
br i1 %8, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int call_me(int x) {
  if (x == 1) {
    return x;
  } else {
    printf("%d\n", x);
    return call_me(x - 1);
  }
}


x86 assembly (clang, -O0):
<call_me>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1140 <call_me+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <call_me+0x3d>
mov    -0x8(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1040 <call_me@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_me>:
push   %r14
push   %rbx
push   %rax
cmp    $0x1,%edi
je     1142 <call_me+0x32>
mov    %edi,%ebx
lea    0xede(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
jne    1130 <call_me+0x20>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @call_me(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = add nsw i32 %4, -1
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret i32 1
}
void g_node_child_position() {}


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

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

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

LLVM IR (-O2):
define void @g_node_child_position() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sci_send(int);
int kputc(int c) {
  if (c == '\n') {
    sci_send('\r');
  }
  sci_send(c);
  return 1;
}


x86 assembly (clang, -O0):
<kputc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jne    112f <kputc+0x1f>
mov    $0xd,%edi
call   1030 <sci_send@plt>
mov    -0x4(%rbp),%edi
call   1030 <sci_send@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kputc>:
push   %rbx
mov    %edi,%ebx
cmp    $0xa,%edi
jne    1122 <kputc+0x12>
mov    $0xd,%edi
call   1030 <sci_send@plt>
mov    %ebx,%edi
call   1030 <sci_send@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @kputc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 10
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @sci_send(i32 13)
br label %7
7: ; preds = %5, %1
%8 = load i32, i32* %2
%9 = call i32 @sci_send(i32 %8)
ret i32 1
}

LLVM IR (-O2):
define i32 @kputc(i32 %0) {
%2 = icmp eq i32 %0, 10
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @sci_send(i32 13)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @sci_send(i32 %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ assert_fail(char const *, int, char *, int);
void assert_false_(const char *file, int line, int cond) {
  if (cond) {
    assert_fail(file, line, "Expected <false> but was <%d>", cond);
  }
}


x86 assembly (clang, -O0):
<assert_false_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1142 <assert_false_+0x32>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%ecx
lea    0xec3(%rip),%rdx
call   1030 <assert_fail@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_false_>:
test   %edx,%edx
je     1122 <assert_false_+0x12>
mov    %edx,%ecx
lea    0xee3(%rip),%rdx
jmp    1030 <assert_fail@plt>
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Expected <false> but was <%d>\00"
define void @assert_false_(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = call i32 @assert_fail(i8* %10, i32 %11, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %9, %3
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Expected <false> but was <%d>\00"
define void @assert_false_(i8* %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @assert_fail(i8* %0, i32 %1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %7
7: ; preds = %5, %3
ret void
}
/* Type definitions */
struct hmap_node {
  int dummy;
};
struct hmap {
  int dummy;
};

/* Variables and functions */
struct hmap_node *hmap_next__(struct hmap const *, int /*<<< orphan*/);
struct hmap_node *hmap_first(const struct hmap *hmap) {
  return hmap_next__(hmap, 0);
}


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

x86 assembly (clang, -O2):
<hmap_first>:
xor    %esi,%esi
jmp    1030 <hmap_next__@plt>

LLVM IR (-O0):
%struct.hmap_node = type { i32 }
%struct.hmap = type { i32 }
define %struct.hmap_node* @hmap_first(%struct.hmap* %0) {
%2 = alloca %struct.hmap*
store %struct.hmap* %0, %struct.hmap** %2
%3 = load %struct.hmap*, %struct.hmap** %2
%4 = call %struct.hmap_node* @hmap_next__(%struct.hmap* %3, i32 0)
ret %struct.hmap_node* %4
}

LLVM IR (-O2):
%struct.hmap_node = type { i32 }
%struct.hmap = type { i32 }
define %struct.hmap_node* @hmap_first(%struct.hmap* %0) {
%2 = tail call %struct.hmap_node* @hmap_next__(%struct.hmap* %0, i32 0)
ret %struct.hmap_node* %2
}
unsigned int CrcGetDigest(unsigned int *crc) { return *crc ^ 0xFFFFFFFF; }


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

x86 assembly (clang, -O2):
<CrcGetDigest>:
mov    (%rdi),%eax
not    %eax
ret

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

LLVM IR (-O2):
define i32 @CrcGetDigest(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = xor i32 %2, -1
ret i32 %3
}
int test_imm_EEint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xEE << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_EEint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0xee,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_EEint64_highword_mem>:
testb  $0xee,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_EEint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 238
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_EEint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1022202216448
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int isdigit(int ch) { return (ch >= '0') && (ch <= '9'); }


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isdigit+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ LedsP__Leds__led2On();
void BlinkNoTimerTaskC__Leds__led2On(void) { LedsP__Leds__led2On(); }


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

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

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

LLVM IR (-O2):
define void @BlinkNoTimerTaskC__Leds__led2On() {
%1 = tail call i32 (...) @LedsP__Leds__led2On()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ who_am_i();
int main(void) {
  printf("%lu is who i am.\n", who_am_i());
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <who_am_i@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <who_am_i@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"%lu is who i am.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @who_am_i()
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [18 x i8] c"%lu is who i am.\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @who_am_i()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  char *a;
  int *b;
  printf("%ld %ld\n", sizeof(*a), sizeof(*b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%ld %ld\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
page4() {
  printf("\"That is classified information, Troubleshooter, thank you for your "
         "inquiry.\n");
  printf(" Please report to an Internal Security self incrimination station as "
         "soon as\n");
  printf(" possible.\"\n");
  return 9;
}


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

x86 assembly (clang, -O2):
<page4>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf29(%rip),%rdi
call   1030 <puts@plt>
lea    0xf6a(%rip),%rdi
call   1030 <puts@plt>
mov    $0x9,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [78 x i8] c"\22That is classified information, Troubleshooter, thank you for your inquiry.\0A\00"
@.str.1 = [78 x i8] c" Please report to an Internal Security self incrimination station as soon as\0A\00"
@.str.2 = [13 x i8] c" possible.\22\0A\00"
define i32 @page4() {
%1 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
ret i32 9
}

LLVM IR (-O2):
@str = [77 x i8] c"\22That is classified information, Troubleshooter, thank you for your inquiry.\00"
@str.3 = [77 x i8] c" Please report to an Internal Security self incrimination station as soon as\00"
@str.4 = [12 x i8] c" possible.\22\00"
define i32 @page4() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.4, i64 0, i64 0))
ret i32 9
}
void tap2audio_file_pause(void *priv) {}


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

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

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

LLVM IR (-O2):
define void @tap2audio_file_pause(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ showText(char *);
void showSquare(void) { showText("&sup2;"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"&sup2;\00"
define void @showSquare() {
%1 = call i32 @showText(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"&sup2;\00"
define void @showSquare() {
%1 = tail call i32 @showText(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long event;
};
typedef TYPE_1__ XMapEvent;

/* Variables and functions */
void set_XMapEvent_event(void *_p, unsigned long _v) {
  ((XMapEvent *)_p)->event = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XMapEvent_event>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XMapEvent_event(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
scalar_t__ is_little_endian();
int /*<<< orphan*/ swap32(int /*<<< orphan*/);
uint32_t pgp_hton32(uint32_t in) {
  return (is_little_endian()) ? swap32(in) : in;
}


x86 assembly (clang, -O0):
<pgp_hton32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <is_little_endian@plt>
cmp    $0x0,%rax
je     114c <pgp_hton32+0x2c>
mov    -0x4(%rbp),%edi
call   1030 <swap32@plt>
mov    %eax,-0x8(%rbp)
jmp    1152 <pgp_hton32+0x32>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pgp_hton32>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <is_little_endian@plt>
test   %rax,%rax
je     1137 <pgp_hton32+0x17>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <swap32@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @pgp_hton32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 (...) @is_little_endian()
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @swap32(i32 %6)
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @pgp_hton32(i32 %0) {
%2 = tail call i64 (...) @is_little_endian()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @swap32(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ bsort(int *, int);
void sort(int a[], int len) {
  if (len > 1)
    bsort(a, len);
}


x86 assembly (clang, -O0):
<sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    1135 <sort+0x25>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <bsort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort>:
cmp    $0x2,%esi
jl     111a <sort+0xa>
jmp    1030 <bsort@plt>
ret

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

LLVM IR (-O2):
define void @sort(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @bsort(i32* %0, i32 %1)
br label %6
6: ; preds = %4, %2
ret void
}
unsigned long
str$replace_not(struct dsc$descriptor_s *destinstaion_string,
                const struct dsc$descriptor_s *source_string,
                const long *start_position, const long *end_position,
                const struct dsc$descriptor_s *replacement_string) {
  assert(0);
  return 2392148;
}


x86 assembly (clang, -O0):
<str$replace_not>:
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    %r8,-0x28(%rbp)
xor    %edi,%edi
mov    $0x0,%al
call   1030 <assert@plt>
mov    $0x248054,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str$replace_not>:
push   %rax
xor    %edi,%edi
xor    %eax,%eax
call   1030 <assert@plt>
mov    $0x248054,%eax
pop    %rcx
ret

LLVM IR (-O0):
%"struct.dsc$descriptor_s" = type opaque
define i64 @"str$replace_not"(%"struct.dsc$descriptor_s"* %0, %"struct.dsc$descriptor_s"* %1, i64* %2, i64* %3, %"struct.dsc$descriptor_s"* %4) {
%6 = alloca %"struct.dsc$descriptor_s"*
%7 = alloca %"struct.dsc$descriptor_s"*
%8 = alloca i64*
%9 = alloca i64*
%10 = alloca %"struct.dsc$descriptor_s"*
store %"struct.dsc$descriptor_s"* %0, %"struct.dsc$descriptor_s"** %6
store %"struct.dsc$descriptor_s"* %1, %"struct.dsc$descriptor_s"** %7
store i64* %2, i64** %8
store i64* %3, i64** %9
store %"struct.dsc$descriptor_s"* %4, %"struct.dsc$descriptor_s"** %10
%11 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 0)
ret i64 2392148
}

LLVM IR (-O2):
%"struct.dsc$descriptor_s" = type opaque
define i64 @"str$replace_not"(%"struct.dsc$descriptor_s"* nocapture readnone %0, %"struct.dsc$descriptor_s"* nocapture readnone %1, i64* nocapture readnone %2, i64* nocapture readnone %3, %"struct.dsc$descriptor_s"* nocapture readnone %4) {
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 0)
ret i64 2392148
}
__attribute__((always_)) int devtmpfs_mount(const char *mountpoint) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @devtmpfs_mount(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LD_A_R();
int /*<<< orphan*/ T_WAIT_UNTIL(int);
void op_ED_0x5f(void) {
  LD_A_R();
  T_WAIT_UNTIL(5);
  return;
}


x86 assembly (clang, -O0):
<op_ED_0x5f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <LD_A_R@plt>
mov    $0x5,%edi
call   1040 <T_WAIT_UNTIL@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_ED_0x5f>:
push   %rax
xor    %eax,%eax
call   1030 <LD_A_R@plt>
mov    $0x5,%edi
pop    %rax
jmp    1040 <T_WAIT_UNTIL@plt>

LLVM IR (-O0):
define void @op_ED_0x5f() {
%1 = call i32 (...) @LD_A_R()
%2 = call i32 @T_WAIT_UNTIL(i32 5)
ret void
}

LLVM IR (-O2):
define void @op_ED_0x5f() {
%1 = tail call i32 (...) @LD_A_R()
%2 = tail call i32 @T_WAIT_UNTIL(i32 5)
ret void
}
int loadprogram() { return 0; }


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

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

LLVM IR (-O0):
define i32 @loadprogram() {
ret i32 0
}

LLVM IR (-O2):
define i32 @loadprogram() {
ret i32 0
}
/* Variables and functions */
scalar_t__ toupper(char);
char *strupr(char *str) {
  char *ptr;
  ptr = str;
  while (*ptr) {
    *ptr = (char)toupper(*ptr);
    ptr++;
  }
  return str;
}


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

x86 assembly (clang, -O2):
<strupr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <strupr+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strupr+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strupr(i8* returned %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* [ %9, %4 ], [ %0, %1 ]
%7 = tail call i64 @toupper(i8 signext %5)
%8 = trunc i64 %7 to i8
store i8 %8, i8* %6
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret i8* %0
}
void foo790() {}


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

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

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

LLVM IR (-O2):
define void @foo790() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MiniUart_SendChar(char);
void MiniUart_SendString(char *s) {
  while (*s != '\0') {
    MiniUart_SendChar(*s);
    s++;
  }
}


x86 assembly (clang, -O0):
<MiniUart_SendString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <MiniUart_SendString+0x39>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <MiniUart_SendChar@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <MiniUart_SendString+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @MiniUart_SendString(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 = load i8, i8* %9
%11 = call i32 @MiniUart_SendChar(i8 signext %10)
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %2
br label %3
14: ; preds = %3
ret void
}

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

/* Variables and functions */
scalar_t__ EOF;
scalar_t__ fscanf(int /*<<< orphan*/ *, char *, int *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int getAmount(FILE *fp) {
  FILE *input = fp;
  int val;
  int count = 0;
  rewind(input);
  while (fscanf(input, "%d", &val) != EOF) {
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<getAmount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0x10(%rbp),%rdi
lea    0xeb1(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <fscanf@plt>
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%rax
je     1176 <getAmount+0x56>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1144 <getAmount+0x24>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getAmount>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1030 <rewind@plt>
mov    $0xffffffff,%ebp
lea    0xec0(%rip),%r14
lea    0xc(%rsp),%r15
mov    0x2e9c(%rip),%r12
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <fscanf@plt>
add    $0x1,%ebp
cmp    (%r12),%rax
jne    1150 <getAmount+0x30>
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
define i32 @getAmount(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @rewind(i32* %0)
br label %5
5: ; preds = %5, %1
%6 = phi i32 [ 0, %1 ], [ %10, %5 ]
%7 = call i64 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%8 = load i64, i64* @EOF
%9 = icmp eq i64 %7, %8
%10 = add nuw nsw i32 %6, 1
br i1 %9, label %11, label %5
11: ; preds = %5
ret i32 %6
}
int xfer_upgrade_read_cb(void *data, struct t_upgrade_file *upgrade_file,
                         int object_id, struct t_infolist *infolist) {
  (void)data;
  (void)upgrade_file;
  (void)object_id;
  (void)infolist;
  return 0;
}


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

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

LLVM IR (-O0):
%struct.t_upgrade_file = type opaque
%struct.t_infolist = type opaque
define i32 @xfer_upgrade_read_cb(i8* %0, %struct.t_upgrade_file* %1, i32 %2, %struct.t_infolist* %3) {
%5 = alloca i8*
%6 = alloca %struct.t_upgrade_file*
%7 = alloca i32
%8 = alloca %struct.t_infolist*
store i8* %0, i8** %5
store %struct.t_upgrade_file* %1, %struct.t_upgrade_file** %6
store i32 %2, i32* %7
store %struct.t_infolist* %3, %struct.t_infolist** %8
%9 = load i8*, i8** %5
%10 = load %struct.t_upgrade_file*, %struct.t_upgrade_file** %6
%11 = load i32, i32* %7
%12 = load %struct.t_infolist*, %struct.t_infolist** %8
ret i32 0
}

LLVM IR (-O2):
%struct.t_upgrade_file = type opaque
%struct.t_infolist = type opaque
define i32 @xfer_upgrade_read_cb(i8* nocapture readnone %0, %struct.t_upgrade_file* nocapture readnone %1, i32 %2, %struct.t_infolist* nocapture readnone %3) {
ret i32 0
}
__typeof__(sscanf(1, "")) test_sscanf_225(void) { return sscanf(1, ""); }


x86 assembly (clang, -O0):
<test_sscanf_225>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
mov    $0x0,%al
call   1030 <sscanf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sscanf_225>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <sscanf@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @test_sscanf_225() {
%1 = call i32 (i8*, i8*, ...) @sscanf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @test_sscanf_225() {
%1 = tail call i32 (i8*, i8*, ...) @sscanf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
void dump_stack(int p) {
  unsigned int *i, j;
  for (i = ((unsigned int *)&p) - 1, j = 0; j < 32; i++, j++) {
    printf("0x%X: 0x%X\n", i, *i);
    if (*i == 0xC0DEBABE || *i == 0xC0DEDAC0)
      break;
  }
}


x86 assembly (clang, -O0):
<dump_stack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x20,-0x14(%rbp)
jae    1194 <dump_stack+0x84>
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
cmpl   $0xc0debabe,(%rax)
je     1170 <dump_stack+0x60>
mov    -0x10(%rbp),%rax
cmpl   $0xc0dedac0,(%rax)
jne    1175 <dump_stack+0x65>
jmp    1194 <dump_stack+0x84>
jmp    117a <dump_stack+0x6a>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112e <dump_stack+0x1e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
@.str = [12 x i8] c"0x%X: 0x%X\0A\00"
define void @dump_stack(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32 %0, i32* %2
%5 = getelementptr inbounds i32, i32* %2, i64 -1
store i32* %5, i32** %3
store i32 0, i32* %4
br label %6
6: ; preds = %23, %1
%7 = load i32, i32* %4
%8 = icmp ult i32 %7, 32
br i1 %8, label %9, label %28
9: ; preds = %6
%10 = load i32*, i32** %3
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %10, i32 %12)
%14 = load i32*, i32** %3
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, -1059145026
br i1 %16, label %21, label %17
17: ; preds = %9
%18 = load i32*, i32** %3
%19 = load i32, i32* %18
%20 = icmp eq i32 %19, -1059136832
br i1 %20, label %21, label %22
21: ; preds = %17, %9
br label %28
22: ; preds = %17
br label %23
23: ; preds = %22
%24 = load i32*, i32** %3
%25 = getelementptr inbounds i32, i32* %24, i32 1
store i32* %25, i32** %3
%26 = load i32, i32* %4
%27 = add i32 %26, 1
store i32 %27, i32* %4
br label %6
28: ; preds = %21, %6
ret void
}

LLVM IR (-O2):
const char *deviceServoGetName(void) { return "servo"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"servo\00"
define i8* @deviceServoGetName() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
__attribute__((always_)) void invlpg(void *addr) {
  asm volatile("invlpg (%0)" ::"r"(addr) : "memory");
}


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

x86 assembly (clang, -O2):
<invlpg>:
invlpg (%rdi)
ret

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

LLVM IR (-O2):
define void @invlpg(i8* %0) {
tail call void asm sideeffect "invlpg ($0)", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
void foo377() {}


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

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

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

LLVM IR (-O2):
define void @foo377() {
ret void
}
int cmp(const int *key, const int *val) { return *key - *val; }


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @cmp(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = sub nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @cmp(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = sub nsw i32 %3, %4
ret i32 %5
}
/* Variables and functions */
scalar_t__ malloc(int);
void test() {
  void *leak __attribute__((unused));
  int i;
  for (i = 0; i < 1000; i++)
    leak = (void *)malloc(1);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0xc(%rbp)
cmpl   $0x3e8,-0xc(%rbp)
jge    1148 <test+0x38>
mov    $0x1,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <test+0xf>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test() {
%1 = alloca i8*
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 1000
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = call i64 @malloc(i32 1)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %1
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
ret void
}

LLVM IR (-O2):
define void @test() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i64 @malloc(i32 1)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 1000
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
/* Type definitions */
struct conn {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ asc_complete_nread(struct conn *);
void core_complete_nread(struct conn *c) { asc_complete_nread(c); }


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

x86 assembly (clang, -O2):
<core_complete_nread>:
jmp    1030 <asc_complete_nread@plt>

LLVM IR (-O0):
%struct.conn = type { i32 }
define void @core_complete_nread(%struct.conn* %0) {
%2 = alloca %struct.conn*
store %struct.conn* %0, %struct.conn** %2
%3 = load %struct.conn*, %struct.conn** %2
%4 = call i32 @asc_complete_nread(%struct.conn* %3)
ret void
}

LLVM IR (-O2):
%struct.conn = type { i32 }
define void @core_complete_nread(%struct.conn* %0) {
%2 = tail call i32 @asc_complete_nread(%struct.conn* %0)
ret void
}
void CFGMR3QueryU32(void) {}


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

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

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

LLVM IR (-O2):
define void @CFGMR3QueryU32() {
ret void
}
void s3c_wdt_setname(char *name) {}


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

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

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

LLVM IR (-O2):
define void @s3c_wdt_setname(i8* nocapture %0) {
ret void
}
void wpas_dbus_signal_blob_removed(struct wpa_supplicant *wpa_s,
                                   const char *name) {}


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

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

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

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
define void @wpas_dbus_signal_blob_removed(%struct.wpa_supplicant* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int wt_marked(uint32_t v, uint32_t h, uint32_t bit) {
  return v & (1 << (h - bit - 1));
}


x86 assembly (clang, -O0):
<wt_marked>:
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
sub    -0xc(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wt_marked>:
not    %edx
lea    (%rdx,%rsi,1),%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @wt_marked(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 = sub nsw i32 %8, %9
%11 = sub nsw i32 %10, 1
%12 = shl i32 1, %11
%13 = and i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @wt_marked(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %2, -1
%5 = add i32 %4, %1
%6 = shl nuw i32 1, %5
%7 = and i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ init_subsystems();
void kernel(void) { init_subsystems(); }


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

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

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

LLVM IR (-O2):
define void @kernel() {
%1 = tail call i32 (...) @init_subsystems()
ret void
}
float sqrt3(const float x) {
  union {
    int i;
    float x;
  } u;
  u.x = x;
  u.i = (1 << 29) + (u.i >> 1) - (1 << 22);
  return u.x;
}


x86 assembly (clang, -O0):
<sqrt3>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
add    $0x20000000,%eax
sub    $0x400000,%eax
mov    %eax,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrt3>:
movd   %xmm0,%eax
sar    %eax
add    $0x1fc00000,%eax
movd   %eax,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { i32 }
define float @sqrt3(float %0) {
%2 = alloca float
%3 = alloca %union.anon
store float %0, float* %2
%4 = load float, float* %2
%5 = bitcast %union.anon* %3 to float*
store float %4, float* %5
%6 = bitcast %union.anon* %3 to i32*
%7 = load i32, i32* %6
%8 = ashr i32 %7, 1
%9 = add nsw i32 536870912, %8
%10 = sub nsw i32 %9, 4194304
%11 = bitcast %union.anon* %3 to i32*
store i32 %10, i32* %11
%12 = bitcast %union.anon* %3 to float*
%13 = load float, float* %12
ret float %13
}

LLVM IR (-O2):
define float @sqrt3(float %0) {
%2 = bitcast float %0 to i32
%3 = ashr i32 %2, 1
%4 = add nsw i32 %3, 532676608
%5 = bitcast i32 %4 to float
ret float %5
}