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

/* Variables and functions */
int /*<<< orphan*/ Warning(char *, char *);
char *addrbook_get_path(struct config *);
scalar_t__ file_exists(char *);
int /*<<< orphan*/ file_unlink(char *);
int /*<<< orphan*/ free(char *);
void addrbook_zap(struct config *config) {
  char *filename;
  filename = addrbook_get_path(config);
  if (file_exists(filename)) {
    Warning("ADDR:"
            " removing addrbook '%s'.\n",
            filename);
    file_unlink(filename);
  }
  free(filename);
}


x86 assembly (clang, -O0):
<addrbook_zap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <addrbook_get_path@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <file_exists@plt>
cmp    $0x0,%rax
je     1195 <addrbook_zap+0x45>
mov    -0x10(%rbp),%rsi
lea    0xe79(%rip),%rdi
call   1050 <Warning@plt>
mov    -0x10(%rbp),%rdi
call   1060 <file_unlink@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addrbook_zap>:
push   %rbx
call   1070 <addrbook_get_path@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <file_exists@plt>
test   %rax,%rax
je     117d <addrbook_zap+0x2d>
lea    0xe93(%rip),%rdi
mov    %rbx,%rsi
call   1050 <Warning@plt>
mov    %rbx,%rdi
call   1060 <file_unlink@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.config = type { i32 }
@.str = [31 x i8] c"ADDR: removing addrbook '%s'.\0A\00"
define void @addrbook_zap(%struct.config* %0) {
%2 = alloca %struct.config*
%3 = alloca i8*
store %struct.config* %0, %struct.config** %2
%4 = load %struct.config*, %struct.config** %2
%5 = call i8* @addrbook_get_path(%struct.config* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i64 @file_exists(i8* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i32 @Warning(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i8*, i8** %3
%13 = call i32 @file_unlink(i8* %12)
br label %14
14: ; preds = %9, %1
%15 = load i8*, i8** %3
%16 = call i32 @free(i8* %15)
ret void
}

LLVM IR (-O2):
%struct.config = type { i32 }
@.str = [31 x i8] c"ADDR: removing addrbook '%s'.\0A\00"
define void @addrbook_zap(%struct.config* %0) {
%2 = tail call i8* @addrbook_get_path(%struct.config* %0)
%3 = tail call i64 @file_exists(i8* %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call i32 @Warning(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %2)
%7 = tail call i32 @file_unlink(i8* %2)
br label %8
8: ; preds = %5, %1
%9 = tail call i32 @free(i8* %2)
ret void
}
void I2STxDisable(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000C00))) &= ~0x00000001;
}


x86 assembly (clang, -O0):
<I2STxDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc00(%rax),%rcx
and    $0xfffffffffffffffe,%rcx
mov    %rcx,0xc00(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2STxDisable>:
andq   $0xfffffffffffffffe,0xc00(%rdi)
fe
ret

LLVM IR (-O0):
define void @I2STxDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 3072
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -2
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @I2STxDisable(i64 %0) {
%2 = add i64 %0, 3072
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, -2
store volatile i64 %5, i64* %3
ret void
}
void length(num) int num;
{ print("You made %d moves.\n", num); }


x86 assembly (clang, -O0):
<length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<length>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
xor    %eax,%eax
jmp    1030 <print@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"You made %d moves.\0A\00"
define void @length(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @print to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"You made %d moves.\0A\00"
define void @length(i32 %0) {
%2 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @print to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void unw_is_signal_frame() {}


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

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

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

LLVM IR (-O2):
define void @unw_is_signal_frame() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  char b[10];
  (void)strcpy(b, "1");
  (void)strcat(b, argv[1]);
  (void)printf("%s\n", b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1a(%rbp),%rdi
lea    0xeaf(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x1a(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1050 <strcat@plt>
lea    -0x1a(%rbp),%rsi
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
lea    0xebf(%rip),%rsi
lea    0xe(%rsp),%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    0x8(%rbx),%rsi
mov    %r14,%rdi
call   1050 <strcat@plt>
lea    0xea1(%rip),%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"1\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = call i32 @strcat(i8* %4, i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *);
void enomem(void) { errx(1, "no memory"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"no memory\00"
define void @enomem() {
%1 = call i32 @errx(i32 1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"no memory\00"
define void @enomem() {
%1 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ task_assert_flag(int, int);
void task_assert_root(int id) { task_assert_flag(id, (1 << 6)); }


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

x86 assembly (clang, -O2):
<task_assert_root>:
mov    $0x40,%esi
jmp    1030 <task_assert_flag@plt>

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

LLVM IR (-O2):
define void @task_assert_root(i32 %0) {
%2 = tail call i32 @task_assert_flag(i32 %0, i32 64)
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t vlan_tci2prio(uint16_t tci) { return (tci & 0xe000) >> 13; }


x86 assembly (clang, -O0):
<vlan_tci2prio>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xe000,%eax
sar    $0xd,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vlan_tci2prio>:
mov    %edi,%eax
shr    $0xd,%eax
and    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @vlan_tci2prio(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 57344
%5 = ashr i32 %4, 13
ret i32 %5
}

LLVM IR (-O2):
define i32 @vlan_tci2prio(i32 %0) {
%2 = lshr i32 %0, 13
%3 = and i32 %2, 7
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XQueryBestCursor() {
  printf("XQueryBestCursor called\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [24 x i8] c"XQueryBestCursor called\00"
define i32 @XQueryBestCursor() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void *_sys_memcpy(void *dest, const void *src, int n) {
  asm volatile("pushf		\n"
               "cld		\n"
               "rep		\n"
               "movsb		\n"
               "popf		\n"
               :
               : "c"((unsigned int)n), "S"(src), "D"(dest));
  return dest;
}


x86 assembly (clang, -O0):
<_sys_memcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdi
pushf
cld
rep movsb %ds:(%rsi),%es:(%rdi)
popf
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sys_memcpy>:
mov    %edx,%ecx
pushf
cld
rep movsb %ds:(%rsi),%es:(%rdi)
popf
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @_sys_memcpy(i8* returned %0, i8* %1, i32 %2) {
tail call void asm sideeffect "pushf\09\09\0Acld\09\09\0Arep\09\09\0Amovsb\09\09\0Apopf\09\09\0A", "{cx},{si},{di},~{dirflag},~{fpsr},~{flags}"(i32 %2, i8* %1, i8* %0)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
void delays(unsigned int s) {
  while (s--) {
    delay(1000);
  }
}


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

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

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

LLVM IR (-O2):
define void @delays(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add i32 %4, -1
%6 = tail call i32 @delay(i32 1000)
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
int rand();
float obter_numero_uniforme() {
  int max_mix = rand() % 100;
  int i;
  for (i = 0; i < max_mix; i++)
    rand();
  return (float)rand() / (float)RAND_MAX;
}


x86 assembly (clang, -O0):
<obter_numero_uniforme>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1152 <obter_numero_uniforme+0x42>
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1131 <obter_numero_uniforme+0x21>
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2ss %eax,%xmm0
mov    0x2e84(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<obter_numero_uniforme>:
push   %rbx
xor    %eax,%eax
call   1030 <rand@plt>
movslq %eax,%rbx
imul   $0x51eb851f,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%ebx
test   %ebx,%ebx
jle    114c <obter_numero_uniforme+0x3c>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
add    $0xffffffff,%ebx
jne    1140 <obter_numero_uniforme+0x30>
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2ss %eax,%xmm0
mov    0x2e8a(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define float @obter_numero_uniforme() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @rand()
%4 = srem i32 %3, 100
store i32 %4, i32* %1
store i32 0, i32* %2
br label %5
5: ; preds = %11, %0
%6 = load i32, i32* %2
%7 = load i32, i32* %1
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %14
9: ; preds = %5
%10 = call i32 (...) @rand()
br label %11
11: ; preds = %9
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %5
14: ; preds = %5
%15 = call i32 (...) @rand()
%16 = sitofp i32 %15 to float
%17 = load i64, i64* @RAND_MAX
%18 = sitofp i64 %17 to float
%19 = fdiv float %16, %18
ret float %19
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define float @obter_numero_uniforme() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 100
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %0, %4
%5 = phi i32 [ %7, %4 ], [ 0, %0 ]
%6 = tail call i32 (...) @rand()
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %2
br i1 %8, label %9, label %4
9: ; preds = %4, %0
%10 = tail call i32 (...) @rand()
%11 = sitofp i32 %10 to float
%12 = load i64, i64* @RAND_MAX
%13 = sitofp i64 %12 to float
%14 = fdiv float %11, %13
ret float %14
}
unsigned long long
unsignedlonglong_ignoring_unsignedlongint(unsigned long long x,
                                          unsigned long int y) {
  return x;
}


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

x86 assembly (clang, -O2):
<unsignedlonglong_ignoring_unsignedlongint>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @unsignedlonglong_ignoring_unsignedlongint(i64 returned %0, i64 %1) {
ret i64 %0
}
void d999(char *p, int v) {
  int ht = (v * 205) >> 11, h = (ht * 205) >> 11;
  *(short *)p = (short)(h + ((ht - 10 * h) << 8) + 0x3030),
          p[2] = v - 10 * ht + 48;
}


x86 assembly (clang, -O0):
<d999>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
imul   $0xcd,-0xc(%rbp),%eax
sar    $0xb,%eax
mov    %eax,-0x10(%rbp)
imul   $0xcd,-0x10(%rbp),%eax
sar    $0xb,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%ecx
imul   $0xa,-0x14(%rbp),%edx
sub    %edx,%ecx
shl    $0x8,%ecx
add    %ecx,%eax
add    $0x3030,%eax
mov    %ax,%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
mov    -0xc(%rbp),%eax
imul   $0xa,-0x10(%rbp),%ecx
sub    %ecx,%eax
add    $0x30,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<d999>:
imul   $0xcd,%esi,%ecx
sar    $0xb,%ecx
imul   $0xcd,%ecx,%r8d
sar    $0xb,%r8d
lea    (%r8,%r8,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%eax
sub    %edx,%eax
shl    $0x8,%eax
add    %r8d,%eax
add    $0x3030,%eax
mov    %ax,(%rdi)
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%eax
sub    %eax,%esi
add    $0x30,%sil
mov    %sil,0x2(%rdi)
ret

LLVM IR (-O0):
define void @d999(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 205
%9 = ashr i32 %8, 11
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = mul nsw i32 %10, 205
%12 = ashr i32 %11, 11
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = mul nsw i32 10, %15
%17 = sub nsw i32 %14, %16
%18 = shl i32 %17, 8
%19 = add nsw i32 %13, %18
%20 = add nsw i32 %19, 12336
%21 = trunc i32 %20 to i16
%22 = load i8*, i8** %3
%23 = bitcast i8* %22 to i16*
store i16 %21, i16* %23
%24 = load i32, i32* %4
%25 = load i32, i32* %5
%26 = mul nsw i32 10, %25
%27 = sub nsw i32 %24, %26
%28 = add nsw i32 %27, 48
%29 = trunc i32 %28 to i8
%30 = load i8*, i8** %3
%31 = getelementptr inbounds i8, i8* %30, i64 2
store i8 %29, i8* %31
ret void
}

LLVM IR (-O2):
define void @d999(i8* nocapture writeonly %0, i32 %1) {
%3 = mul nsw i32 %1, 205
%4 = ashr i32 %3, 11
%5 = mul nsw i32 %4, 205
%6 = ashr i32 %5, 11
%7 = mul nsw i32 %6, -10
%8 = add nsw i32 %7, %4
%9 = shl nsw i32 %8, 8
%10 = add nsw i32 %9, %6
%11 = trunc i32 %10 to i16
%12 = add i16 %11, 12336
%13 = bitcast i8* %0 to i16*
store i16 %12, i16* %13
%14 = mul nsw i32 %4, -10
%15 = add i32 %14, %1
%16 = trunc i32 %15 to i8
%17 = add i8 %16, 48
%18 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %17, i8* %18
ret void
}
int snd_info_register(struct snd_info_entry *entry) { return 0; }


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

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

LLVM IR (-O0):
%struct.snd_info_entry = type opaque
define i32 @snd_info_register(%struct.snd_info_entry* %0) {
%2 = alloca %struct.snd_info_entry*
store %struct.snd_info_entry* %0, %struct.snd_info_entry** %2
ret i32 0
}

LLVM IR (-O2):
%struct.snd_info_entry = type opaque
define i32 @snd_info_register(%struct.snd_info_entry* nocapture readnone %0) {
ret i32 0
}
void __arch_adjust_zones(int node, unsigned long *zone_size,
                         unsigned long *zhole_size) {
  if (node != 0)
    return;
  zone_size[2] = zone_size[0];
  zone_size[0] = 0;
  zhole_size[2] = zhole_size[0];
  zhole_size[0] = 0;
}


x86 assembly (clang, -O0):
<__arch_adjust_zones>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     111e <__arch_adjust_zones+0x1e>
jmp    1152 <__arch_adjust_zones+0x52>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__arch_adjust_zones>:
test   %edi,%edi
je     1105 <__arch_adjust_zones+0x5>
ret
mov    (%rsi),%rax
mov    %rax,0x10(%rsi)
movq   $0x0,(%rsi)
mov    (%rdx),%rax
mov    %rax,0x10(%rdx)
movq   $0x0,(%rdx)
ret

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

LLVM IR (-O2):
define void @__arch_adjust_zones(i32 %0, i64* nocapture %1, i64* nocapture %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %5, label %10
5: ; preds = %3
%6 = load i64, i64* %1
%7 = getelementptr inbounds i64, i64* %1, i64 2
store i64 %6, i64* %7
store i64 0, i64* %1
%8 = load i64, i64* %2
%9 = getelementptr inbounds i64, i64* %2, i64 2
store i64 %8, i64* %9
store i64 0, i64* %2
br label %10
10: ; preds = %3, %5
ret void
}
int unpacki32(unsigned char *buf) {
  return (buf[0] << 24) + (buf[1] << 16) + (buf[2] << 8) + buf[3];
}


x86 assembly (clang, -O0):
<unpacki32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
add    %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @unpacki32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(
      stderr,
      "Usage: ping6 [-LUdfnqrvVaAD] [-c count] [-i interval] [-w deadline]\n"
      "             [-p pattern] [-s packetsize] [-t ttl] [-I interface]\n"
      "             [-M pmtudisc-hint] [-S sndbuf] [-F flowlabel] [-Q tclass]\n"
      "             [[-N nodeinfo-option] ...]\n"
      "             [hop1 ...] destination\n");
  exit(2);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [282 x i8] c"Usage: ping6 [-LUdfnqrvVaAD] [-c count] [-i interval] [-w deadline]\0A [-p pattern] [-s packetsize] [-t ttl] [-I interface]\0A [-M pmtudisc-hint] [-S sndbuf] [-F flowlabel] [-Q tclass]\0A [[-N nodeinfo-option] ...]\0A [hop1 ...] destination\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([282 x i8], [282 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [282 x i8] c"Usage: ping6 [-LUdfnqrvVaAD] [-c count] [-i interval] [-w deadline]\0A [-p pattern] [-s packetsize] [-t ttl] [-I interface]\0A [-M pmtudisc-hint] [-S sndbuf] [-F flowlabel] [-Q tclass]\0A [[-N nodeinfo-option] ...]\0A [hop1 ...] destination\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([282 x i8], [282 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
void *__attribute__((stdcall)) GetCurrentProcess() { return (void *)-1; }


x86 assembly (clang, -O0):
<GetCurrentProcess>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetCurrentProcess>:
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i8* @GetCurrentProcess() {
ret i8* inttoptr (i64 -1 to i8*)
}

LLVM IR (-O2):
define i8* @GetCurrentProcess() {
ret i8* inttoptr (i64 -1 to i8*)
}
void INT_Excep_RSPI0_SPTI0(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_RSPI0_SPTI0() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLfloat;

/* Variables and functions */
int /*<<< orphan*/ glMultMatrixf(int /*<<< orphan*/ *);
void MultMatrixf(GLfloat v[16]) { glMultMatrixf(v); }


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

x86 assembly (clang, -O2):
<MultMatrixf>:
jmp    1030 <glMultMatrixf@plt>

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

LLVM IR (-O2):
define void @MultMatrixf(i32* %0) {
%2 = tail call i32 @glMultMatrixf(i32* %0)
ret void
}
int call_back_3(void *target, void *routine_ptr, void *eiffel_string) {
  return (((int (*)(void *, void *))routine_ptr)(target, eiffel_string));
}


x86 assembly (clang, -O0):
<call_back_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_back_3>:
mov    %rsi,%rax
mov    %rdx,%rsi
jmp    *%rax

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

LLVM IR (-O2):
define i32 @call_back_3(i8* %0, i8* nocapture %1, i8* %2) {
%4 = bitcast i8* %1 to i32 (i8*, i8*)*
%5 = tail call i32 %4(i8* %0, i8* %2)
ret i32 %5
}
void tr_context_dummy_func(void) {}


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

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

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

LLVM IR (-O2):
define void @tr_context_dummy_func() {
ret void
}
/* Variables and functions */
int anetTcpGenericConnect(char *, char *, int, int);
int kr_net_tcp_nonblock_connect(char *err, char *addr, int port) {
  return anetTcpGenericConnect(err, addr, port, 1);
}


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

x86 assembly (clang, -O2):
<kr_net_tcp_nonblock_connect>:
mov    $0x1,%ecx
jmp    1030 <anetTcpGenericConnect@plt>

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

LLVM IR (-O2):
define i32 @kr_net_tcp_nonblock_connect(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @anetTcpGenericConnect(i8* %0, i8* %1, i32 %2, i32 1)
ret i32 %4
}
int mIsBrazilState(int ccode) { return (ccode >= 315 && ccode <= 341); }


x86 assembly (clang, -O0):
<mIsBrazilState>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x13b,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <mIsBrazilState+0x26>
cmpl   $0x155,-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):
<mIsBrazilState>:
add    $0xfffffec5,%edi
xor    %eax,%eax
cmp    $0x1b,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @mIsBrazilState(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 315
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 341
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 @mIsBrazilState(i32 %0) {
%2 = add i32 %0, -315
%3 = icmp ult i32 %2, 27
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
unsigned short get_checksum(char *, int, int /*<<< orphan*/);
unsigned short get_checksum_mem(char *buff, int bytes) {
  return get_checksum(buff, bytes, 0);
}


x86 assembly (clang, -O0):
<get_checksum_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1030 <get_checksum@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @get_checksum_mem(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call zeroext i16 @get_checksum(i8* %5, i32 %6, i32 0)
ret i16 %7
}

LLVM IR (-O2):
define zeroext i16 @get_checksum_mem(i8* %0, i32 %1) {
%3 = tail call zeroext i16 @get_checksum(i8* %0, i32 %1, i32 0)
ret i16 %3
}
/* Variables and functions */
size_t mmdb_strnlen(const char *s, size_t maxlen) {
  size_t len;
  for (len = 0; len < maxlen; len++, s++) {
    if (!*s)
      break;
  }
  return (len);
}


x86 assembly (clang, -O0):
<mmdb_strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1156 <mmdb_strnlen+0x56>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1134 <mmdb_strnlen+0x34>
jmp    1156 <mmdb_strnlen+0x56>
jmp    1139 <mmdb_strnlen+0x39>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <mmdb_strnlen+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmdb_strnlen>:
xor    %eax,%eax
test   %rsi,%rsi
je     1122 <mmdb_strnlen+0x22>
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
je     1122 <mmdb_strnlen+0x22>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <mmdb_strnlen+0x10>
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @mmdb_strnlen(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %9
%5 = phi i64 [ %10, %9 ], [ 0, %2 ]
%6 = phi i8* [ %11, %9 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = add nuw i64 %5, 1
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = icmp eq i64 %10, %1
br i1 %12, label %13, label %4
13: ; preds = %9, %4, %2
%14 = phi i64 [ 0, %2 ], [ %5, %4 ], [ %1, %9 ]
ret i64 %14
}
int sys$synch(unsigned int efn, struct _iosb *iosb) {
  return ({
    unsigned long resultvar;
    register long int _a2 asm("rsi") = (long)(iosb);
    register long int _a1 asm("rdi") = (long)(efn);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x81\n\t"
                 : "=a"(resultvar)
                 : "i"(27), "r"(_a1), "r"(_a2)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$synch>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0x1b,%rax
int    $0x81
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$synch>:
mov    %edi,%edi
mov    $0x1b,%rax
int    $0x81
ret

LLVM IR (-O0):
%struct._iosb = type opaque
define i32 @"sys$synch"(i32 %0, %struct._iosb* %1) {
%3 = alloca i32
%4 = alloca %struct._iosb*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i32 %0, i32* %3
store %struct._iosb* %1, %struct._iosb** %4
%9 = load %struct._iosb*, %struct._iosb** %4
%10 = ptrtoint %struct._iosb* %9 to i64
store i64 %10, i64* %6
%11 = load i32, i32* %3
%12 = zext i32 %11 to i64
store i64 %12, i64* %7
%13 = load i64, i64* %7
%14 = load i64, i64* %6
%15 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 27, i64 %13, i64 %14)
store i64 %15, i64* %5
%16 = load i64, i64* %5
store i64 %16, i64* %8
%17 = load i64, i64* %8
%18 = trunc i64 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
%struct._iosb = type opaque
define i32 @"sys$synch"(i32 %0, %struct._iosb* %1) {
%3 = ptrtoint %struct._iosb* %1 to i64
%4 = zext i32 %0 to i64
%5 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 27, i64 %4, i64 %3)
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ uart_write_byte(char);
void uart_write_char(char c) {
  if (c == '\n')
    uart_write_byte('\r');
  uart_write_byte(c);
}


x86 assembly (clang, -O0):
<uart_write_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    1135 <uart_write_char+0x25>
mov    $0xd,%edi
call   1030 <uart_write_byte@plt>
movsbl -0x1(%rbp),%edi
call   1030 <uart_write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_write_char>:
push   %rbx
mov    %edi,%ebx
cmp    $0xa,%bl
jne    1122 <uart_write_char+0x12>
mov    $0xd,%edi
call   1030 <uart_write_byte@plt>
movsbl %bl,%edi
pop    %rbx
jmp    1030 <uart_write_byte@plt>

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

LLVM IR (-O2):
define void @uart_write_char(i8 signext %0) {
%2 = icmp eq i8 %0, 10
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @uart_write_byte(i8 signext 13)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @uart_write_byte(i8 signext %0)
ret void
}
void break_one() {}


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

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

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

LLVM IR (-O2):
define void @break_one() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clrtoeol();
int /*<<< orphan*/ move(int, int /*<<< orphan*/);
void clr_line(int line) {
  move(line, 0);
  clrtoeol();
}


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

x86 assembly (clang, -O2):
<clr_line>:
push   %rax
xor    %esi,%esi
call   1040 <move@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <clrtoeol@plt>

LLVM IR (-O0):
define void @clr_line(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @move(i32 %3, i32 0)
%5 = call i32 (...) @clrtoeol()
ret void
}

LLVM IR (-O2):
define void @clr_line(i32 %0) {
%2 = tail call i32 @move(i32 %0, i32 0)
%3 = tail call i32 (...) @clrtoeol()
ret void
}
int main(void) { (void)(int)5; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct ibuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ibuf_add(struct ibuf *, int /*<<< orphan*/);
int /*<<< orphan*/ ibuf_get(struct ibuf *);
struct ibuf *ibuf_init();
struct ibuf *ibuf_dup(struct ibuf *s) {
  struct ibuf *ns = ibuf_init();
  ibuf_add(ns, ibuf_get(s));
  return ns;
}


x86 assembly (clang, -O0):
<ibuf_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <ibuf_init@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ibuf_get@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <ibuf_add@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ibuf_dup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1050 <ibuf_init@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <ibuf_get@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <ibuf_add@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.ibuf = type { i32 }
define %struct.ibuf* @ibuf_dup(%struct.ibuf* %0) {
%2 = alloca %struct.ibuf*
%3 = alloca %struct.ibuf*
store %struct.ibuf* %0, %struct.ibuf** %2
%4 = call %struct.ibuf* (...) @ibuf_init()
store %struct.ibuf* %4, %struct.ibuf** %3
%5 = load %struct.ibuf*, %struct.ibuf** %3
%6 = load %struct.ibuf*, %struct.ibuf** %2
%7 = call i32 @ibuf_get(%struct.ibuf* %6)
%8 = call i32 @ibuf_add(%struct.ibuf* %5, i32 %7)
%9 = load %struct.ibuf*, %struct.ibuf** %3
ret %struct.ibuf* %9
}

LLVM IR (-O2):
%struct.ibuf = type { i32 }
define %struct.ibuf* @ibuf_dup(%struct.ibuf* %0) {
%2 = tail call %struct.ibuf* (...) @ibuf_init()
%3 = tail call i32 @ibuf_get(%struct.ibuf* %0)
%4 = tail call i32 @ibuf_add(%struct.ibuf* %2, i32 %3)
ret %struct.ibuf* %2
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void strcpy_Good() {
  char src[5] = "test";
  char dst[10];
  strcpy(dst, src);
}


x86 assembly (clang, -O0):
<strcpy_Good>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xedd(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0xf(%rbp),%rdi
lea    -0x5(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy_Good>:
sub    $0x18,%rsp
movb   $0x0,0xc(%rsp)
movl   $0x74736574,0x8(%rsp)
74
lea    0xe(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <strcpy@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.strcpy_Good.src = [5 x i8] c"test\00"
define void @strcpy_Good() {
%1 = alloca [5 x i8]
%2 = alloca [10 x i8]
%3 = bitcast [5 x i8]* %1 to i8*
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%6 = call i32 @strcpy(i8* %4, i8* %5)
ret void
}

LLVM IR (-O2):
@__const.strcpy_Good.src = [5 x i8] c"test\00"
define void @strcpy_Good() {
%1 = alloca [5 x i8]
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* %3)
ret void
}
/* Variables and functions */
int printf(char *, char const *, int, char);
int foo(register char const *str, register int i) {
  char c = str[0];
  return printf("%s, %d, %c\n", str, i, c);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xeca(%rip),%rdi
movsbl -0xd(%rbp),%ecx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %esi,%edx
mov    %rdi,%rsi
movsbl (%rdi),%ecx
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"%s, %d, %c\0A\00"
define i32 @foo(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8 signext %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ creature_encounter();
unsigned int d(int);
int /*<<< orphan*/ printf(char *);
void random_encounter(void) {
  unsigned d20;
  d20 = d(20);
  if (d20 < 16) {
    printf("No encounter\n");
    return;
  }
  creature_encounter();
}


x86 assembly (clang, -O0):
<random_encounter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x14,%edi
call   1030 <d@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jae    1160 <random_encounter+0x30>
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
jmp    1167 <random_encounter+0x37>
mov    $0x0,%al
call   1050 <creature_encounter@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_encounter>:
push   %rax
mov    $0x14,%edi
call   1040 <d@plt>
cmp    $0xf,%eax
ja     114d <random_encounter+0x1d>
lea    0xeb9(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <creature_encounter@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"No encounter\0A\00"
define void @random_encounter() {
%1 = alloca i32
%2 = call i32 @d(i32 20)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp ult i32 %3, 16
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %0
%8 = call i32 (...) @creature_encounter()
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"No encounter\00"
define void @random_encounter() {
%1 = tail call i32 @d(i32 20)
%2 = icmp ult i32 %1, 16
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %7
5: ; preds = %0
%6 = tail call i32 (...) @creature_encounter()
br label %7
7: ; preds = %5, %3
ret void
}
void BIO_dump_indent_fp(void) {}


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

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

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

LLVM IR (-O2):
define void @BIO_dump_indent_fp() {
ret void
}
void bar(void *(*service)(int, int)) {
  int i;
  for (i = 0; i < 100000; i++)
    ;
  service(1, 'h');
  service(1, 'e');
  service(1, 'l');
  service(1, 'l');
  service(1, 'o');
  service(1, '\n');
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x186a0,-0xc(%rbp)
jge    1133 <bar+0x33>
jmp    1125 <bar+0x25>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1113 <bar+0x13>
mov    $0x1,%edi
mov    $0x68,%esi
call   *-0x8(%rbp)
mov    $0x1,%edi
mov    $0x65,%esi
call   *-0x8(%rbp)
mov    $0x1,%edi
mov    $0x6c,%esi
call   *-0x8(%rbp)
mov    $0x1,%edi
mov    $0x6c,%esi
call   *-0x8(%rbp)
mov    $0x1,%edi
mov    $0x6f,%esi
call   *-0x8(%rbp)
mov    $0x1,%edi
mov    $0xa,%esi
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%edi
mov    $0x68,%esi
call   *%rbx
mov    $0x1,%edi
mov    $0x65,%esi
call   *%rbx
mov    $0x1,%edi
mov    $0x6c,%esi
call   *%rbx
mov    $0x1,%edi
mov    $0x6c,%esi
call   *%rbx
mov    $0x1,%edi
mov    $0x6f,%esi
call   *%rbx
mov    $0x1,%edi
mov    $0xa,%esi
mov    %rbx,%rax
pop    %rbx
jmp    *%rax

LLVM IR (-O0):
define void @bar(i8* (i32, i32)* %0) {
%2 = alloca i8* (i32, i32)*
%3 = alloca i32
store i8* (i32, i32)* %0, i8* (i32, i32)** %2
store i32 0, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 100000
br i1 %6, label %7, label %11
7: ; preds = %4
br label %8
8: ; preds = %7
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
br label %4
11: ; preds = %4
%12 = load i8* (i32, i32)*, i8* (i32, i32)** %2
%13 = call i8* %12(i32 1, i32 104)
%14 = load i8* (i32, i32)*, i8* (i32, i32)** %2
%15 = call i8* %14(i32 1, i32 101)
%16 = load i8* (i32, i32)*, i8* (i32, i32)** %2
%17 = call i8* %16(i32 1, i32 108)
%18 = load i8* (i32, i32)*, i8* (i32, i32)** %2
%19 = call i8* %18(i32 1, i32 108)
%20 = load i8* (i32, i32)*, i8* (i32, i32)** %2
%21 = call i8* %20(i32 1, i32 111)
%22 = load i8* (i32, i32)*, i8* (i32, i32)** %2
%23 = call i8* %22(i32 1, i32 10)
ret void
}

LLVM IR (-O2):
define void @bar(i8* (i32, i32)* nocapture %0) {
%2 = tail call i8* %0(i32 1, i32 104)
%3 = tail call i8* %0(i32 1, i32 101)
%4 = tail call i8* %0(i32 1, i32 108)
%5 = tail call i8* %0(i32 1, i32 108)
%6 = tail call i8* %0(i32 1, i32 111)
%7 = tail call i8* %0(i32 1, i32 10)
ret void
}