xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ test6();
int main(int argc, char **argv) {
  if (!test6())
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <test6@plt>
cmp    $0x0,%eax
jne    114d <main+0x2d>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test6@plt>
test   %eax,%eax
je     1130 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test6()
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret i32 0
}
void devpts_pty_kill(int line) {}


x86 assembly (clang, -O0):
<devpts_pty_kill>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @devpts_pty_kill(i32 %0) {
ret void
}
void foo3(void) {
  void *x = 0;
  void *y = &*x;
}


x86 assembly (clang, -O0):
<foo3>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo3() {
ret void
}
char *sep_get_type(struct separator *s) { return "Separator"; }


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

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

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

LLVM IR (-O2):
%struct.separator = type opaque
@.str = [10 x i8] c"Separator\00"
define i8* @sep_get_type(%struct.separator* nocapture readnone %0) {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  typedef enum weekday { sun, mon, tue, wed, thu, fri, sat } Weekday;
  Weekday a, b, c;
  a = sun;
  b = mon;
  c = tue;
  printf("中文：%d,%d,%d", a, b, c);
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"\E4\B8\AD\E6\96\87\EF\BC\9A%d,%d,%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 2, i32* %3
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"\E4\B8\AD\E6\96\87\EF\BC\9A%d,%d,%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 0, i32 1, i32 2)
ret i32 0
}
unsigned short GetBubbleMaxValue(unsigned short *src, unsigned char len) {
  while ((len > 1) && (src[len - 1] == 0))
    len--;
  return src[len - 1];
}


x86 assembly (clang, -O0):
<GetBubbleMaxValue>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
mov    %al,-0xa(%rbp)
jle    113b <GetBubbleMaxValue+0x3b>
mov    -0x8(%rbp),%rax
movzbl -0x9(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movzwl (%rax,%rcx,2),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
test   $0x1,%al
jne    114b <GetBubbleMaxValue+0x4b>
jmp    1158 <GetBubbleMaxValue+0x58>
mov    -0x9(%rbp),%al
add    $0xff,%al
mov    %al,-0x9(%rbp)
jmp    110e <GetBubbleMaxValue+0xe>
mov    -0x8(%rbp),%rax
movzbl -0x9(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movzwl (%rax,%rcx,2),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetBubbleMaxValue>:
cmp    $0x2,%sil
jb     1128 <GetBubbleMaxValue+0x28>
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%rsi),%eax
cmpw   $0x0,(%rdi,%rax,2)
jne    1128 <GetBubbleMaxValue+0x28>
add    $0xff,%sil
movzbl %sil,%esi
cmp    $0x2,%sil
jae    1110 <GetBubbleMaxValue+0x10>
movslq %esi,%rax
movzwl -0x2(%rdi,%rax,2),%eax
ret

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

LLVM IR (-O2):
define zeroext i16 @GetBubbleMaxValue(i16* nocapture %0, i8 zeroext %1) {
%3 = zext i8 %1 to i32
%4 = icmp ugt i8 %1, 1
br i1 %4, label %8, label %17
5: ; preds = %8
%6 = zext i8 %16 to i32
%7 = icmp ugt i8 %16, 1
br i1 %7, label %8, label %17
8: ; preds = %2, %5
%9 = phi i32 [ %6, %5 ], [ %3, %2 ]
%10 = trunc i32 %9 to i8
%11 = add nsw i32 %9, -1
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i16, i16* %0, i64 %12
%14 = load i16, i16* %13
%15 = icmp eq i16 %14, 0
%16 = add i8 %10, -1
br i1 %15, label %5, label %17
17: ; preds = %8, %5, %2
%18 = phi i32 [ %3, %2 ], [ %6, %5 ], [ %9, %8 ]
%19 = add nsw i32 %18, -1
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i16, i16* %0, i64 %20
%22 = load i16, i16* %21
ret i16 %22
}
int main(void) {
  register int x[10] = {};
  int a[10] = {};
  a[5];
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca [10 x i32]
store i32 0, i32* %1
%4 = bitcast [10 x i32]* %2 to i8*
%5 = bitcast [10 x i32]* %3 to i8*
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 5
%7 = load i32, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int test_imm_02int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x02 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_02int64_midword_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, 16
%6 = and i64 %5, 2
%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_02int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 131072
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int;
typedef int /*<<< orphan*/ SVCXPRT;

/* Variables and functions */
int /*<<< orphan*/ *makefd_xprt(int, int /*<<< orphan*/, int /*<<< orphan*/);
SVCXPRT *svcfd_create(int fd, u_int sendsize, u_int recvsize) {
  return (makefd_xprt(fd, sendsize, recvsize));
}


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

x86 assembly (clang, -O2):
<svcfd_create>:
jmp    1030 <makefd_xprt@plt>

LLVM IR (-O0):
define i32* @svcfd_create(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 = call i32* @makefd_xprt(i32 %7, i32 %8, i32 %9)
ret i32* %10
}

LLVM IR (-O2):
define i32* @svcfd_create(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32* @makefd_xprt(i32 %0, i32 %1, i32 %2)
ret i32* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
__attribute__((always_)) void bigint_grow_raw(const uint64_t *source0,
                                              unsigned int source_size,
                                              uint64_t *dest0,
                                              unsigned int dest_size) {
  unsigned int pad_size = (dest_size - source_size);
  memcpy(dest0, source0, sizeof(bigint_t(source_size)));
  memset((dest0 + source_size), 0, sizeof(bigint_t(pad_size)));
}


x86 assembly (clang, -O0):
<bigint_grow_raw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%eax
shl    $0x2,%rax
add    %rax,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bigint_grow_raw>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %rdi,%rsi
mov    %rdx,%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    %ebp,%eax
lea    (%rbx,%rax,4),%rdi
xor    %esi,%esi
mov    $0x4,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @bigint_grow_raw(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = tail call i32 @memcpy(i32* %2, i32* %0, i32 4)
%6 = zext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %2, i64 %6
%8 = tail call i32 @memset(i32* %7, i32 0, i32 4)
ret void
}
int dn_expand(unsigned char *msg, unsigned char *eomorig,
              unsigned char *comp_dn, char *exp_dn, int length) {
  return -1;
}


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

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

LLVM IR (-O0):
define i32 @dn_expand(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
ret i32 -1
}

LLVM IR (-O2):
define i32 @dn_expand(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i32 %4) {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int mkdir(const char *pathname, mode_t mode) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<mkdir>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebd(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkdir>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @mkdir(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @mkdir(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
void f(void) { __builtin_eh_return(0xdeadbeef, 0xc0dec0de); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rbp,%rcx
mov    $0xc0dec0de,%edi
mov    $0xdeadbef7,%esi
mov    %rdi,(%rcx,%rsi,1)
add    %rsi,%rcx
pop    %rbp
mov    %rcx,%rsp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc0dec0de,%esi
mov    $0xdeadbef7,%ecx
mov    %rsi,0x0(%rbp,%rcx,1)
add    %rbp,%rcx
pop    %rbp
mov    %rcx,%rsp
ret

LLVM IR (-O0):
define void @f() {
unreachable
}

LLVM IR (-O2):
define void @f() {
tail call void @llvm.eh.return.i64(i64 3735928559, i8* inttoptr (i64 3235823838 to i8*))
unreachable
}
unsigned int ReverseNumber(unsigned int num) {
  unsigned int rev_num = 0;
  while (num != 0) {
    rev_num = rev_num * 10 + num % 10;
    num /= 10;
  }
  return rev_num;
}


x86 assembly (clang, -O0):
<ReverseNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1147 <ReverseNumber+0x47>
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <ReverseNumber+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReverseNumber>:
xor    %eax,%eax
test   %edi,%edi
je     1131 <ReverseNumber+0x31>
mov    $0xcccccccd,%r8d
nopl   0x0(%rax)
lea    (%rax,%rax,4),%eax
mov    %edi,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edi,%ecx
sub    %esi,%ecx
lea    (%rcx,%rax,2),%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <ReverseNumber+0x10>
ret

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

LLVM IR (-O2):
define i32 @ReverseNumber(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = mul i32 %4, 10
%7 = urem i32 %5, 10
%8 = add i32 %6, %7
%9 = udiv i32 %5, 10
%10 = icmp ult i32 %5, 10
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %12
}
/* Type definitions */
typedef int uint_fast32_t;
typedef int uint8_t;

/* Variables and functions */
void _a32be(uint8_t *d, uint_fast32_t val) {
  d[0] = val >> 24;
  d[1] = val >> 16;
  d[2] = val >> 8;
  d[3] = val;
}


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

x86 assembly (clang, -O2):
<_a32be>:
mov    %esi,%eax
sar    $0x18,%eax
mov    %eax,(%rdi)
mov    %esi,%eax
sar    $0x10,%eax
mov    %eax,0x4(%rdi)
mov    %esi,%eax
sar    $0x8,%eax
mov    %eax,0x8(%rdi)
mov    %esi,0xc(%rdi)
ret

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

LLVM IR (-O2):
define void @_a32be(i32* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 24
store i32 %3, i32* %0
%4 = ashr i32 %1, 16
%5 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %4, i32* %5
%6 = ashr i32 %1, 8
%7 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %6, i32* %7
%8 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %1, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_pdispatch_register_reply() {
  printf("NOT IMPLEMENTED:"
         "pa_pdispatch_register_reply"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [44 x i8] c"NOT IMPLEMENTED:pa_pdispatch_register_reply\00"
define i32 @pa_pdispatch_register_reply() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void SysExcIntClear(unsigned long ulIntFlags) {
  (*((volatile unsigned long *)(0x400F900C))) = ulIntFlags;
}


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

x86 assembly (clang, -O2):
<SysExcIntClear>:
mov    %rdi,0x400f900c
40
ret

LLVM IR (-O0):
define void @SysExcIntClear(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store volatile i64 %3, i64* inttoptr (i64 1074761740 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysExcIntClear(i64 %0) {
store volatile i64 %0, i64* inttoptr (i64 1074761740 to i64*)
ret void
}
void INT_Excep_RSPI1_SPII1(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_RSPI1_SPII1() {
ret void
}
int my_function() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @my_function() {
ret i32 1
}
/* Type definitions */
struct passwd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ puts(char *);
struct passwd *getpwnam(const char *name) {
  (void)name;
  puts("getpwnam: not implemented");
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.passwd = type { i32 }
@.str = [26 x i8] c"getpwnam: not implemented\00"
define %struct.passwd* @getpwnam(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret %struct.passwd* null
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
@.str = [26 x i8] c"getpwnam: not implemented\00"
define noalias %struct.passwd* @getpwnam(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret %struct.passwd* null
}
/* Variables and functions */
int /*<<< orphan*/ ignored_isa_trait();
int /*<<< orphan*/ unknown_isa_trait();
int /*<<< orphan*/ unknown_isa_trait2();
void caller() {
  unknown_isa_trait();
  unknown_isa_trait2();
  ignored_isa_trait();
}


x86 assembly (clang, -O0):
<caller>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <unknown_isa_trait@plt>
mov    $0x0,%al
call   1040 <unknown_isa_trait2@plt>
mov    $0x0,%al
call   1030 <ignored_isa_trait@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<caller>:
push   %rax
xor    %eax,%eax
call   1050 <unknown_isa_trait@plt>
xor    %eax,%eax
call   1040 <unknown_isa_trait2@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ignored_isa_trait@plt>

LLVM IR (-O0):
define void @caller() {
%1 = call i32 (...) @unknown_isa_trait()
%2 = call i32 (...) @unknown_isa_trait2()
%3 = call i32 (...) @ignored_isa_trait()
ret void
}

LLVM IR (-O2):
define void @caller() {
%1 = tail call i32 (...) @unknown_isa_trait()
%2 = tail call i32 (...) @unknown_isa_trait2()
%3 = tail call i32 (...) @ignored_isa_trait()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void **);
void free_image(void **image) {
  free(*image);
  free(image);
}


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

x86 assembly (clang, -O2):
<free_image>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_image(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = bitcast i8* %4 to i8**
%6 = call i32 @free(i8** %5)
%7 = load i8**, i8*** %2
%8 = call i32 @free(i8** %7)
ret void
}

LLVM IR (-O2):
define void @free_image(i8** nocapture %0) {
%2 = bitcast i8** %0 to i8***
%3 = load i8**, i8*** %2
%4 = tail call i32 @free(i8** %3)
%5 = tail call i32 @free(i8** %0)
ret void
}
/* Variables and functions */
int add_match(char *);
int vle_compl_put_match(char match[]) { return add_match(match); }


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

x86 assembly (clang, -O2):
<vle_compl_put_match>:
jmp    1030 <add_match@plt>

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

LLVM IR (-O2):
define i32 @vle_compl_put_match(i8* %0) {
%2 = tail call i32 @add_match(i8* %0)
ret i32 %2
}
/* Variables and functions */
int __iscntrl_impl(int);
int iscntrl(int c) { return __iscntrl_impl(c); }


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

x86 assembly (clang, -O2):
<iscntrl>:
jmp    1030 <__iscntrl_impl@plt>

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

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
%2 = tail call i32 @__iscntrl_impl(i32 %0)
ret i32 %2
}
unsigned short __attribute__((regparm(2))) Def_READW(unsigned long adr) {
  return 0;
}


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

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

LLVM IR (-O0):
define zeroext i16 @Def_READW(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
ret i16 0
}

LLVM IR (-O2):
define zeroext i16 @Def_READW(i64 %0) {
ret i16 0
}
adrx0regx1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if ((((unsigned int *)10000000)[x0]) <= (p1[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrx0regx1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movslq -0x10(%rbp),%rcx
mov    $0x989680,%eax
mov    (%rax,%rcx,4),%eax
mov    -0x28(%rbp),%rcx
movslq -0x14(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
ja     1141 <adrx0regx1+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1148 <adrx0regx1+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0regx1>:
movslq %edx,%rax
mov    0x989680(,%rax,4),%edx
movslq %ecx,%rcx
xor    %eax,%eax
cmp    (%r9,%rcx,4),%edx
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @adrx0regx1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* inttoptr (i64 10000000 to i32*), i64 %7
%9 = load i32, i32* %8
%10 = sext i32 %3 to i64
%11 = getelementptr inbounds i32, i32* %5, i64 %10
%12 = load i32, i32* %11
%13 = icmp ule i32 %9, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(int argc, char *argv[]) {
  printf("Usage: %s [-r|-w|-d] <entry_name> [value]\n", argv[0]);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [43 x i8] c"Usage: %s [-r|-w|-d] <entry_name> [value]\0A\00"
define void @usage(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"Usage: %s [-r|-w|-d] <entry_name> [value]\0A\00"
define void @usage(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int printf(char *, ...);
int scanf(char *, char *);
int main() {
  int i, j, a, b, c, d;
  char str[50];
  i = printf("thisisc\n");
  printf("%d", i);
  j = scanf("%s", str);
  printf("%d", j);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x50(%rbp),%rsi
lea    0xeb7(%rip),%rdi
call   1040 <scanf@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecf(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"thisisc\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [50 x i8]
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i32 %8, i32* %1
%9 = load i32, i32* %1
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds [50 x i8], [50 x i8]* %7, i64 0, i64 0
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %11)
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"thisisc\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
int have_cpuid(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @have_cpuid() {
ret i32 1
}
void I2CSlaveAddressSet(unsigned long ulBase, unsigned char ucAddrNum,
                        unsigned char ucSlaveAddr) {
  ;
  ;
  ;
  switch (ucAddrNum) {
  case 0: {
    (*((volatile unsigned long *)(ulBase + 0x00000000))) = ucSlaveAddr;
    break;
  }
  case 1: {
    (*((volatile unsigned long *)(ulBase + 0x0000001C))) =
        0x00000080 | ucSlaveAddr;
    break;
  }
  }
}


x86 assembly (clang, -O0):
<I2CSlaveAddressSet>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     1138 <I2CSlaveAddressSet+0x38>
jmp    1127 <I2CSlaveAddressSet+0x27>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     114a <I2CSlaveAddressSet+0x4a>
jmp    115e <I2CSlaveAddressSet+0x5e>
movzbl -0xa(%rbp),%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    115e <I2CSlaveAddressSet+0x5e>
movzbl -0xa(%rbp),%eax
or     $0x80,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x1c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveAddressSet>:
test   %esi,%esi
je     1111 <I2CSlaveAddressSet+0x11>
cmp    $0x1,%sil
jne    1117 <I2CSlaveAddressSet+0x17>
or     $0x80,%dl
add    $0x1c,%rdi
movzbl %dl,%eax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @I2CSlaveAddressSet(i64 %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i64
%5 = alloca i8
%6 = alloca i8
store i64 %0, i64* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %5
%8 = zext i8 %7 to i32
switch i32 %8, label %23 [
i32 0, label %9
i32 1, label %15
]
9: ; preds = %3
%10 = load i8, i8* %6
%11 = zext i8 %10 to i64
%12 = load i64, i64* %4
%13 = add i64 %12, 0
%14 = inttoptr i64 %13 to i64*
store volatile i64 %11, i64* %14
br label %23
15: ; preds = %3
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = or i32 128, %17
%19 = sext i32 %18 to i64
%20 = load i64, i64* %4
%21 = add i64 %20, 28
%22 = inttoptr i64 %21 to i64*
store volatile i64 %19, i64* %22
br label %23
23: ; preds = %3, %15, %9
ret void
}

LLVM IR (-O2):
define void @I2CSlaveAddressSet(i64 %0, i8 zeroext %1, i8 zeroext %2) {
switch i8 %1, label %12 [
i8 0, label %7
i8 1, label %4
]
4: ; preds = %3
%5 = or i8 %2, -128
%6 = add i64 %0, 28
br label %7
7: ; preds = %3, %4
%8 = phi i64 [ %6, %4 ], [ %0, %3 ]
%9 = phi i8 [ %5, %4 ], [ %2, %3 ]
%10 = zext i8 %9 to i64
%11 = inttoptr i64 %8 to i64*
store volatile i64 %10, i64* %11
br label %12
12: ; preds = %7, %3
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, struct timeval *);
int tcp_wait_for_data(int fd, struct timeval *timeout) {
  fd_set set;
  FD_ZERO(&set);
  FD_SET(fd, &set);
  return select(fd + 1, &set, NULL, NULL, timeout);
}


x86 assembly (clang, -O0):
<tcp_wait_for_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <FD_ZERO@plt>
mov    -0x4(%rbp),%edi
lea    -0x14(%rbp),%rsi
call   1050 <FD_SET@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x10(%rbp),%r8
lea    -0x14(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1040 <select@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcp_wait_for_data>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %edi,%ebp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <FD_ZERO@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1050 <FD_SET@plt>
add    $0x1,%ebp
mov    %ebp,%edi
mov    %rbx,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %r14,%r8
call   1040 <select@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @tcp_wait_for_data(i32 %0, %struct.timeval* %1) {
%3 = alloca i32
%4 = alloca %struct.timeval*
%5 = alloca i32
store i32 %0, i32* %3
store %struct.timeval* %1, %struct.timeval** %4
%6 = call i32 @FD_ZERO(i32* %5)
%7 = load i32, i32* %3
%8 = call i32 @FD_SET(i32 %7, i32* %5)
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
%11 = load %struct.timeval*, %struct.timeval** %4
%12 = call i32 @select(i32 %10, i32* %5, i32* null, i32* null, %struct.timeval* %11)
ret i32 %12
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @tcp_wait_for_data(i32 %0, %struct.timeval* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @FD_ZERO(i32* %3)
%6 = call i32 @FD_SET(i32 %0, i32* %3)
%7 = add nsw i32 %0, 1
%8 = call i32 @select(i32 %7, i32* %3, i32* null, i32* null, %struct.timeval* %1)
ret i32 %8
}
/* Variables and functions */
size_t strlen(char *);
char tolower(char);
void normalize(char *str) {
  size_t len = strlen(str);
  for (size_t i = 0; i < len; i++) {
    str[i] = tolower(str[i]);
  }
}


x86 assembly (clang, -O0):
<normalize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    117e <normalize+0x5e>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1141 <normalize+0x21>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalize>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1030 <strlen@plt>
test   %rax,%rax
je     1157 <normalize+0x37>
mov    %rax,%r14
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1040 <tolower@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1140 <normalize+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @normalize(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
store i64 0, i64* %4
br label %7
7: ; preds = %20, %1
%8 = load i64, i64* %4
%9 = load i64, i64* %3
%10 = icmp ult i64 %8, %9
br i1 %10, label %11, label %23
11: ; preds = %7
%12 = load i8*, i8** %2
%13 = load i64, i64* %4
%14 = getelementptr inbounds i8, i8* %12, i64 %13
%15 = load i8, i8* %14
%16 = call signext i8 @tolower(i8 signext %15)
%17 = load i8*, i8** %2
%18 = load i64, i64* %4
%19 = getelementptr inbounds i8, i8* %17, i64 %18
store i8 %16, i8* %19
br label %20
20: ; preds = %11
%21 = load i64, i64* %4
%22 = add i64 %21, 1
store i64 %22, i64* %4
br label %7
23: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @normalize(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %1
ret void
5: ; preds = %1, %5
%6 = phi i64 [ %10, %5 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = tail call signext i8 @tolower(i8 signext %8)
store i8 %9, i8* %7
%10 = add nuw i64 %6, 1
%11 = icmp eq i64 %10, %2
br i1 %11, label %4, label %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void document_output_dynarch_hide_ul_contents(void) {
  printf("<!-- following there's an workaround to hide the UL contents while "
         "the page is loading ;-) -->\n"
         "<script type=\"text/javascript\">//<![CDATA[ "
         "\ndocument.writeln(\"<style type='text/css'>#menu { display: none; "
         "}</style>\");\n"
         "     //]]></script>\n");
}


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

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

LLVM IR (-O0):
@.str = [237 x i8] c"<!-- following there's an workaround to hide the UL contents while the page is loading ;-) -->\0A<script type=\22text/javascript\22>//<![CDATA[ \0Adocument.writeln(\22<style type='text/css'>#menu { display: none; }</style>\22);\0A //]]></script>\0A\00"
define void @document_output_dynarch_hide_ul_contents() {
%1 = call i32 @printf(i8* getelementptr inbounds ([237 x i8], [237 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [236 x i8] c"<!-- following there's an workaround to hide the UL contents while the page is loading ;-) -->\0A<script type=\22text/javascript\22>//<![CDATA[ \0Adocument.writeln(\22<style type='text/css'>#menu { display: none; }</style>\22);\0A //]]></script>\00"
define void @document_output_dynarch_hide_ul_contents() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([236 x i8], [236 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int eggDrop(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int eggs = 2, floors = 10;
  printf("The number of eggs: %d\n", eggs);
  printf("The number of floors: %d\n", floors);
  printf("Minimum number of trials:  %d ", eggDrop(eggs, floors));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <eggDrop@plt>
mov    %eax,%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
mov    $0x2,%edi
mov    $0xa,%esi
call   1040 <eggDrop@plt>
lea    0xed9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"The number of eggs: %d\0A\00"
@.str.1 = [26 x i8] c"The number of floors: %d\0A\00"
@.str.2 = [31 x i8] c"Minimum number of trials: %d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
store i32 10, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 @eggDrop(i32 %8, i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"The number of eggs: %d\0A\00"
@.str.1 = [26 x i8] c"The number of floors: %d\0A\00"
@.str.2 = [31 x i8] c"Minimum number of trials: %d \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 10)
%3 = tail call i32 @eggDrop(i32 2, i32 10)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int strcasecmp(char *, char *);
int scmp(const void *e, const void *t) {
  return strcasecmp(*(char **)e, *(char **)t);
}


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

x86 assembly (clang, -O2):
<scmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcasecmp@plt>

LLVM IR (-O0):
define i32 @scmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcasecmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @scmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcasecmp(i8* %4, i8* %6)
ret i32 %7
}
/* Variables and functions */
char const *strrchr(char *, char);
const char *get_ext(char *url) { return strrchr(url, '.'); }


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

x86 assembly (clang, -O2):
<get_ext>:
mov    $0x2e,%esi
jmp    1030 <strrchr@plt>

LLVM IR (-O0):
define i8* @get_ext(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @strrchr(i8* %3, i8 signext 46)
ret i8* %4
}

LLVM IR (-O2):
define i8* @get_ext(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_pdispatch_unregister_reply() {
  printf("NOT IMPLEMENTED:"
         "pa_pdispatch_unregister_reply"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [46 x i8] c"NOT IMPLEMENTED:pa_pdispatch_unregister_reply\00"
define i32 @pa_pdispatch_unregister_reply() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void testSwitchWithSizeofs() {
  switch (sizeof(char) == 1) { case sizeof(char):; }
}


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

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

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

LLVM IR (-O2):
define void @testSwitchWithSizeofs() {
ret void
}
/* Type definitions */
struct ddb_map_cursor {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct ddb_map_cursor *);
void ddb_map_cursor_free(struct ddb_map_cursor *c) { free(c); }


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

x86 assembly (clang, -O2):
<ddb_map_cursor_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.ddb_map_cursor = type { i32 }
define void @ddb_map_cursor_free(%struct.ddb_map_cursor* nocapture %0) {
%2 = tail call i32 @free(%struct.ddb_map_cursor* %0)
ret void
}