xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, void *, double);
int /*<<< orphan*/ stdout;
void table_key_value_show(const void *key, void *value, void *arg) {
  { arg = arg; }
  fprintf(stdout, "\tkey-value=>{key=>%d,value=>{object=>0x%p,value=>%.3f}}\n",
          (int)key, value, *(double *)value);
}


x86 assembly (clang, -O0):
<table_key_value_show>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    %eax,%edx
mov    -0x10(%rbp),%rcx
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xeb2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<table_key_value_show>:
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
movsd  (%rsi),%xmm0
lea    0xed6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [57 x i8] c"\09key-value=>{key=>%d,value=>{object=>0x%p,value=>%.3f}}\0A\00"
define void @table_key_value_show(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** %6
store i8* %7, i8** %6
%8 = load i32, i32* @stdout
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i32
%11 = load i8*, i8** %5
%12 = load i8*, i8** %5
%13 = bitcast i8* %12 to double*
%14 = load double, double* %13
%15 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %11, double %14)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [57 x i8] c"\09key-value=>{key=>%d,value=>{object=>0x%p,value=>%.3f}}\0A\00"
define void @table_key_value_show(i8* %0, i8* %1, i8* nocapture readnone %2) {
%4 = load i32, i32* @stdout
%5 = ptrtoint i8* %0 to i64
%6 = trunc i64 %5 to i32
%7 = bitcast i8* %1 to double*
%8 = load double, double* %7
%9 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %1, double %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long);
void SignalHandler(int signum) {
  static unsigned long msec_cnt = 0;
  msec_cnt++;
  if (!(msec_cnt % 100)) {
    printf("SignalHandler:%lu sec\n", (msec_cnt / 100));
  }
  return;
}


x86 assembly (clang, -O0):
<SignalHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2f0e(%rip),%rax
add    $0x1,%rax
mov    %rax,0x2f03(%rip)
mov    0x2efc(%rip),%rax
mov    $0x64,%ecx
xor    %edx,%edx
div    %rcx
cmp    $0x0,%rdx
jne    1168 <SignalHandler+0x58>
mov    0x2ee1(%rip),%rax
mov    $0x64,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rsi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SignalHandler>:
mov    0x2f19(%rip),%rax
add    $0x1,%rax
mov    %rax,0x2f0e(%rip)
movabs $0x8f5c28f5c28f5c29,%rcx
28 5c 8f
imul   %rax,%rcx
shr    $0x2,%rax
movabs $0x28f5c28f5c28f5c3,%rdx
c2 f5 28
mul    %rdx
ror    $0x2,%rcx
movabs $0x28f5c28f5c28f5c,%rax
5c 8f 02
cmp    %rax,%rcx
jbe    1155 <SignalHandler+0x45>
ret
shr    $0x2,%rdx
lea    0xea0(%rip),%rdi
mov    %rdx,%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@SignalHandler.msec_cnt = internal global i64 0
@.str = [23 x i8] c"SignalHandler:%lu sec\0A\00"
define void @SignalHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i64, i64* @SignalHandler.msec_cnt
%4 = add i64 %3, 1
store i64 %4, i64* @SignalHandler.msec_cnt
%5 = load i64, i64* @SignalHandler.msec_cnt
%6 = urem i64 %5, 100
%7 = icmp ne i64 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i64, i64* @SignalHandler.msec_cnt
%10 = udiv i64 %9, 100
%11 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i64 %10)
br label %12
12: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@SignalHandler.msec_cnt = internal unnamed_addr global i64 0
@.str = [23 x i8] c"SignalHandler:%lu sec\0A\00"
define void @SignalHandler(i32 %0) {
%2 = load i64, i64* @SignalHandler.msec_cnt
%3 = add i64 %2, 1
store i64 %3, i64* @SignalHandler.msec_cnt
%4 = urem i64 %3, 100
%5 = udiv i64 %3, 100
%6 = icmp eq i64 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i64 %5)
br label %9
9: ; preds = %7, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int _pthread_get_state(int /*<<< orphan*/ *, int);
int pthread_attr_getscope(pthread_attr_t *a, int *flag) {
  *flag = _pthread_get_state(a, 0x10);
  return 0;
}


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

x86 assembly (clang, -O2):
<pthread_attr_getscope>:
push   %rbx
mov    %rsi,%rbx
mov    $0x10,%esi
call   1030 <_pthread_get_state@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @pthread_attr_getscope(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = call i32 @_pthread_get_state(i32* %5, i32 16)
%7 = load i32*, i32** %4
store i32 %6, i32* %7
ret i32 0
}

LLVM IR (-O2):
define i32 @pthread_attr_getscope(i32* %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @_pthread_get_state(i32* %0, i32 16)
store i32 %3, i32* %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ IO_output(int, int);
void IO_output_high(int pin) { IO_output(pin, 1); }


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

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

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

LLVM IR (-O2):
define void @IO_output_high(i32 %0) {
%2 = tail call i32 @IO_output(i32 %0, i32 1)
ret void
}
/* Variables and functions */
int system(char *);
int main() {
  int return_value;
  return_value = system("ls -l /");
  return return_value;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <system@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"ls -l /\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i32 %3, i32* %2
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
@.str = [8 x i8] c"ls -l /\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ uitoa(int, char *, int);
void itoa(int value, char *string, int radix) {
  if (value < 0 && radix == 10) {
    *string++ = '-';
    uitoa(-value, string, radix);
  } else {
    uitoa(value, string, radix);
  }
}


x86 assembly (clang, -O0):
<itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    115e <itoa+0x4e>
cmpl   $0xa,-0x14(%rbp)
jne    115e <itoa+0x4e>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x2d,(%rax)
xor    %edi,%edi
sub    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <uitoa@plt>
jmp    116d <itoa+0x5d>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <uitoa@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoa>:
test   %edi,%edi
jns    1127 <itoa+0x17>
cmp    $0xa,%edx
jne    1127 <itoa+0x17>
movb   $0x2d,(%rsi)
add    $0x1,%rsi
neg    %edi
mov    $0xa,%edx
jmp    1030 <uitoa@plt>

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

LLVM IR (-O2):
define void @itoa(i32 %0, i8* %1, i32 %2) {
%4 = icmp slt i32 %0, 0
%5 = icmp eq i32 %2, 10
%6 = and i1 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %1, i64 1
store i8 45, i8* %1
%9 = sub nsw i32 0, %0
%10 = tail call i32 @uitoa(i32 %9, i8* %8, i32 10)
br label %13
11: ; preds = %3
%12 = tail call i32 @uitoa(i32 %0, i8* %1, i32 %2)
br label %13
13: ; preds = %11, %7
ret void
}
int recon_get_card_detect1(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @recon_get_card_detect1() {
ret i32 0
}
/* Type definitions */
struct passwd {
  char *pw_name;
};

/* Variables and functions */
struct passwd *getpwnam(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  struct passwd *nobody = getpwnam("nobody");
  printf("(%s)\n", nobody->pw_name);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <getpwnam@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeba(%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
call   1040 <getpwnam@plt>
mov    (%rax),%rsi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.passwd = type { i8* }
@.str = [7 x i8] c"nobody\00"
@.str.1 = [6 x i8] c"(%s)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.passwd*
store i32 0, i32* %1
%3 = call %struct.passwd* @getpwnam(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store %struct.passwd* %3, %struct.passwd** %2
%4 = load %struct.passwd*, %struct.passwd** %2
%5 = getelementptr inbounds %struct.passwd, %struct.passwd* %4, i32 0, i32 0
%6 = load i8*, i8** %5
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
%struct.passwd = type { i8* }
@.str = [7 x i8] c"nobody\00"
@.str.1 = [6 x i8] c"(%s)\0A\00"
define i32 @main() {
%1 = tail call %struct.passwd* @getpwnam(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = getelementptr inbounds %struct.passwd, %struct.passwd* %1, i64 0, i32 0
%3 = load i8*, i8** %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AbsoluteIndirectLongSlow(int);
int /*<<< orphan*/ S9xSetPCBase(int /*<<< orphan*/);
void OpDCSlow(void) { S9xSetPCBase(AbsoluteIndirectLongSlow(5)); }


x86 assembly (clang, -O0):
<OpDCSlow>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <AbsoluteIndirectLongSlow@plt>
mov    %eax,%edi
call   1040 <S9xSetPCBase@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpDCSlow>:
push   %rax
mov    $0x5,%edi
call   1030 <AbsoluteIndirectLongSlow@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <S9xSetPCBase@plt>

LLVM IR (-O0):
define void @OpDCSlow() {
%1 = call i32 @AbsoluteIndirectLongSlow(i32 5)
%2 = call i32 @S9xSetPCBase(i32 %1)
ret void
}

LLVM IR (-O2):
define void @OpDCSlow() {
%1 = tail call i32 @AbsoluteIndirectLongSlow(i32 5)
%2 = tail call i32 @S9xSetPCBase(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
void test(int x, int y) {
  if (x == y)
    printf("OK %d\n", x);
  else
    printf("NG %d %d\n", x, y);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1140 <test+0x30>
mov    -0x4(%rbp),%esi
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1154 <test+0x44>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
mov    %esi,%edx
mov    %edi,%esi
cmp    %edx,%edi
jne    1126 <test+0x16>
lea    0xee1(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xeda(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"OK %d\0A\00"
@.str.1 = [10 x i8] c"NG %d %d\0A\00"
define void @test(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %8
6: ; preds = %2
%7 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 %1)
br label %8
8: ; preds = %6, %4
ret void
}
void setval_470(unsigned *p) { *p = 3347925091U; }


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

x86 assembly (clang, -O2):
<setval_470>:
movl   $0xc78d4863,(%rdi)
ret

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

LLVM IR (-O2):
define void @setval_470(i32* nocapture writeonly %0) {
store i32 -947042205, i32* %0
ret void
}
/* Variables and functions */
void ucharinit(unsigned char *in, size_t size, const unsigned char v) {
  unsigned char *pt = in, *fpt;
  fpt = in + size;
  while (pt < fpt)
    *pt++ = v;
}


x86 assembly (clang, -O0):
<ucharinit>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    114c <ucharinit+0x4c>
mov    -0x11(%rbp),%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
jmp    1125 <ucharinit+0x25>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ucharinit>:
test   %rsi,%rsi
jle    1139 <ucharinit+0x29>
push   %rax
mov    %rsi,%rax
add    %rdi,%rax
lea    0x1(%rdi),%rcx
cmp    %rcx,%rax
cmovbe %rcx,%rax
sub    %rdi,%rax
movzbl %dl,%esi
mov    %rax,%rdx
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @ucharinit(i8* writeonly %0, i64 %1, i8 zeroext %2) {
%4 = ptrtoint i8* %0 to i64
%5 = icmp sgt i64 %1, 0
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = add i64 %4, %1
%8 = add i64 %4, 1
%9 = call i64 @llvm.umax.i64(i64 %7, i64 %8)
%10 = sub i64 %9, %4
br label %11
11: ; preds = %6, %3
ret void
}
void dodo(c) int c;
{
  int ack;
  switch (c) {
  default:
    ack = 252;
  }
  respond(ack, c);
}


x86 assembly (clang, -O0):
<dodo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xfc,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    $0x0,%al
call   1030 <respond@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dodo>:
mov    %edi,%esi
mov    $0xfc,%edi
xor    %eax,%eax
jmp    1030 <respond@plt>

LLVM IR (-O0):
define void @dodo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %5 [
]
5: ; preds = %1
store i32 252, i32* %3
br label %6
6: ; preds = %5
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = call i32 (i32, i32, ...) bitcast (i32 (...)* @respond to i32 (i32, i32, ...)*)(i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
define void @dodo(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @respond to i32 (i32, i32, ...)*)(i32 252, i32 %0)
ret void
}
unsigned int ConvertGrayToBinary32(unsigned int num) {
  unsigned int numBits = 8 * sizeof(num);
  unsigned int shift;
  for (shift = 1; shift < numBits; shift = 2 * shift)
    num = num ^ (num >> shift);
  return num;
}


x86 assembly (clang, -O0):
<ConvertGrayToBinary32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x20,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    1141 <ConvertGrayToBinary32+0x41>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%edx
mov    -0xc(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <ConvertGrayToBinary32+0x15>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvertGrayToBinary32>:
mov    %edi,%eax
shr    %eax
xor    %edi,%eax
mov    %eax,%ecx
shr    $0x2,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
shr    $0x4,%eax
xor    %ecx,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
shr    $0x10,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ConvertGrayToBinary32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 32, i32* %3
store i32 1, i32* %4
br label %5
5: ; preds = %15, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = icmp ult i32 %6, %7
br i1 %8, label %9, label %18
9: ; preds = %5
%10 = load i32, i32* %2
%11 = load i32, i32* %2
%12 = load i32, i32* %4
%13 = lshr i32 %11, %12
%14 = xor i32 %10, %13
store i32 %14, i32* %2
br label %15
15: ; preds = %9
%16 = load i32, i32* %4
%17 = mul i32 2, %16
store i32 %17, i32* %4
br label %5
18: ; preds = %5
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @ConvertGrayToBinary32(i32 %0) {
%2 = lshr i32 %0, 1
%3 = xor i32 %2, %0
%4 = lshr i32 %3, 2
%5 = xor i32 %4, %3
%6 = lshr i32 %5, 4
%7 = xor i32 %6, %5
%8 = lshr i32 %7, 8
%9 = xor i32 %8, %7
%10 = lshr i32 %9, 16
%11 = xor i32 %10, %9
ret i32 %11
}
OP(fd, c2) { op_c2(); }


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

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

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @op_c2()
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_c2()
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ readl(void *);
uint32_t read_pxintc(unsigned port) {
  return readl((void *)0xb0010000 + (port * 0x100) + (0x18));
}


x86 assembly (clang, -O0):
<read_pxintc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,%eax
mov    $0xb0010000,%edi
add    %rax,%rdi
add    $0x18,%rdi
call   1030 <readl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_pxintc>:
shl    $0x8,%edi
mov    $0xb0010018,%eax
add    %rax,%rdi
jmp    1030 <readl@plt>

LLVM IR (-O0):
define i32 @read_pxintc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 256
%5 = zext i32 %4 to i64
%6 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %5
%7 = getelementptr i8, i8* %6, i64 24
%8 = call i32 @readl(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @read_pxintc(i32 %0) {
%2 = shl i32 %0, 8
%3 = zext i32 %2 to i64
%4 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %3
%5 = getelementptr i8, i8* %4, i64 24
%6 = tail call i32 @readl(i8* %5)
ret i32 %6
}
void no_cdx_stw(unsigned int *p, unsigned int x) { p[16] = x; }


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

x86 assembly (clang, -O2):
<no_cdx_stw>:
mov    %esi,0x40(%rdi)
ret

LLVM IR (-O0):
define void @no_cdx_stw(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 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 16
store i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @no_cdx_stw(i32* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 16
store i32 %1, i32* %3
ret void
}
void dummy_abort(void) {}


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

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

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

LLVM IR (-O2):
define void @dummy_abort() {
ret void
}
/* Variables and functions */
double __infer_nondet_double();
double log1p(double x) { return __infer_nondet_double(); }


x86 assembly (clang, -O0):
<log1p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_double@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @log1p(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double (...) @__infer_nondet_double()
ret double %3
}

LLVM IR (-O2):
define double @log1p(double %0) {
%2 = tail call double (...) @__infer_nondet_double()
ret double %2
}
unsigned int get32(const void *buf_, unsigned offset) {
  unsigned char *buf = (unsigned char *)buf_ + offset;
  return buf[0] | (buf[1] << 8) | (buf[1] << 16) | (buf[1] << 24);
}


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

x86 assembly (clang, -O2):
<get32>:
mov    %esi,%eax
movzbl (%rdi,%rax,1),%ecx
movzbl 0x1(%rdi,%rax,1),%eax
mov    %eax,%edx
shl    $0x8,%edx
or     %ecx,%edx
mov    %eax,%ecx
shl    $0x10,%ecx
or     %edx,%ecx
shl    $0x18,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @get32(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 = load i32, i32* %4
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = load i8*, i8** %5
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = or i32 %13, %18
%20 = load i8*, i8** %5
%21 = getelementptr inbounds i8, i8* %20, i64 1
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = shl i32 %23, 16
%25 = or i32 %19, %24
%26 = load i8*, i8** %5
%27 = getelementptr inbounds i8, i8* %26, i64 1
%28 = load i8, i8* %27
%29 = zext i8 %28 to i32
%30 = shl i32 %29, 24
%31 = or i32 %25, %30
ret i32 %31
}

LLVM IR (-O2):
define i32 @get32(i8* nocapture %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = getelementptr inbounds i8, i8* %4, i64 1
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = shl nuw nsw i32 %9, 8
%11 = or i32 %10, %6
%12 = shl nuw nsw i32 %9, 16
%13 = or i32 %11, %12
%14 = shl nuw i32 %9, 24
%15 = or i32 %13, %14
ret i32 %15
}
int compare(const void *a, const void *b) {
  const unsigned long long *x = a, *y = b;
  if (*x > *y) {
    return 1;
  } else {
    return (*x < *y) ? -1 : 0;
  }
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%rax
jbe    113c <compare+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    115a <compare+0x5a>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdx
mov    -0x28(%rbp),%rax
mov    (%rax),%rsi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovb  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
cmp    %rcx,%rax
sbb    %edx,%edx
cmp    %rcx,%rax
mov    $0x1,%eax
cmovbe %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = bitcast i8* %1 to i64*
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ugt i64 %5, %6
%8 = icmp ult i64 %5, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
void g_date_get_iso8601_week_of_year() {}


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

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

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

LLVM IR (-O2):
define void @g_date_get_iso8601_week_of_year() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lprintf(int, char *);
scalar_t__ tcsendbreak(int, int /*<<< orphan*/);
int tio_break(int fd) {
  lprintf(5, "sending system call break");
  if (tcsendbreak(fd, 0) < 0) {
    lprintf(1, "tcsendbreak() failed");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<tio_break>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x5,%edi
lea    0xec9(%rip),%rsi
call   1040 <lprintf@plt>
mov    -0x8(%rbp),%edi
xor    %esi,%esi
call   1030 <tcsendbreak@plt>
cmp    $0x0,%rax
jge    116d <tio_break+0x4d>
mov    $0x1,%edi
lea    0xebe(%rip),%rsi
call   1040 <lprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1174 <tio_break+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tio_break>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
lea    0xed4(%rip),%rsi
mov    $0x5,%edi
call   1040 <lprintf@plt>
xor    %ebx,%ebx
mov    %ebp,%edi
xor    %esi,%esi
call   1030 <tcsendbreak@plt>
test   %rax,%rax
jns    115c <tio_break+0x3c>
lea    0xecd(%rip),%rsi
mov    $0x1,%edi
call   1040 <lprintf@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"sending system call break\00"
@.str.1 = [21 x i8] c"tcsendbreak() failed\00"
define i32 @tio_break(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @lprintf(i32 5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %3
%6 = call i64 @tcsendbreak(i32 %5, i32 0)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @lprintf(i32 1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %8
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [26 x i8] c"sending system call break\00"
@.str.1 = [21 x i8] c"tcsendbreak() failed\00"
define i32 @tio_break(i32 %0) {
%2 = tail call i32 @lprintf(i32 5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = tail call i64 @tcsendbreak(i32 %0, i32 0)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @lprintf(i32 1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ -1, %5 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
char *timlib_now_date_time();
char *timlib_get_now_date_time(void) { return timlib_now_date_time(); }


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

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

LLVM IR (-O0):
define i8* @timlib_get_now_date_time() {
%1 = call i8* (...) @timlib_now_date_time()
ret i8* %1
}

LLVM IR (-O2):
define i8* @timlib_get_now_date_time() {
%1 = tail call i8* (...) @timlib_now_date_time()
ret i8* %1
}
/* Type definitions */
typedef scalar_t__ int_fast64_t;

/* Variables and functions */
bool SHAREMIND_SET_KEY_EQUALS_int_fast64_t(int_fast64_t const k1,
                                           int_fast64_t const k2) {
  return k1 == k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_SET_KEY_EQUALS_int_fast64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_SET_KEY_EQUALS_int_fast64_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_SET_KEY_EQUALS_int_fast64_t(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
%6 = load i64, i64* %4
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_SET_KEY_EQUALS_int_fast64_t(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
bool isRotation(char *s1, char *s2) {
  bool isSubstring(char *s1, char *s2);
  void appendString(char *s1, char *s2);
  appendString(s2, s2);
  return isSubstring(s2, s1);
}


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

x86 assembly (clang, -O2):
<isRotation>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <appendString@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <isSubstring@plt>

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

LLVM IR (-O2):
define i32 @isRotation(i8* %0, i8* %1) {
tail call void @appendString(i8* %1, i8* %1)
%3 = tail call i32 @isSubstring(i8* %1, i8* %0)
ret i32 %3
}
/* Type definitions */
typedef int socklen_t;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_ERROR;
scalar_t__ getsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *,
                      int *);
int getsockerror(int fd) {
  int error = 0;
  socklen_t len = sizeof(int);
  if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &len) != 0) {
    return -1;
  }
  return error;
}


x86 assembly (clang, -O0):
<getsockerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x4,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
mov    0x2e9c(%rip),%rax
mov    (%rax),%edx
lea    -0xc(%rbp),%rcx
lea    -0x10(%rbp),%r8
call   1030 <getsockopt@plt>
cmp    $0x0,%rax
je     1161 <getsockerror+0x51>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <getsockerror+0x57>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsockerror>:
push   %rax
movl   $0x0,(%rsp)
movl   $0x4,0x4(%rsp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    0x2ea8(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rcx
lea    0x4(%rsp),%r8
call   1030 <getsockopt@plt>
neg    %rax
sbb    %eax,%eax
or     (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_ERROR = global i32 0
define i32 @getsockerror(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
store i32 4, i32* %5
%6 = load i32, i32* %3
%7 = load i32, i32* @SOL_SOCKET
%8 = load i32, i32* @SO_ERROR
%9 = call i64 @getsockopt(i32 %6, i32 %7, i32 %8, i32* %4, i32* %5)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 -1, i32* %2
br label %14
12: ; preds = %1
%13 = load i32, i32* %4
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %11
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_ERROR = global i32 0
define i32 @getsockerror(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_ERROR
%8 = call i64 @getsockopt(i32 %0, i32 %6, i32 %7, i32* %2, i32* %3)
%9 = icmp eq i64 %8, 0
%10 = load i32, i32* %2
%11 = select i1 %9, i32 %10, i32 -1
ret i32 %11
}
int test_imm_4Auint8_reg(unsigned char val) {
  return ((val) & (0x4A << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_4Auint8_reg>:
test   $0x4a,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_4Auint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 74
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void *calloc(size_t, size_t);
void *xcalloc(size_t n, size_t sz) {
  void *p = calloc(n, sz);
  assert(p || !n);
  return p;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0x19(%rbp)
jne    115e <xcalloc+0x3e>
cmpq   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <calloc@plt>
mov    %rax,%r14
test   %rax,%rax
setne  %al
test   %rbx,%rbx
sete   %cl
or     %al,%cl
movzbl %cl,%edi
call   1040 <assert@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %15, label %11
11: ; preds = %2
%12 = load i64, i64* %3
%13 = icmp ne i64 %12, 0
%14 = xor i1 %13, true
br label %15
15: ; preds = %11, %2
%16 = phi i1 [ true, %2 ], [ %14, %11 ]
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp ne i8* %3, null
%5 = icmp eq i64 %0, 0
%6 = or i1 %5, %4
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
ret i8* %3
}
long long g5(long long j, unsigned int *b, long long i) { return j + b[i]; }


x86 assembly (clang, -O0):
<g5>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rdx
mov    (%rcx,%rdx,4),%ecx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g5>:
mov    (%rsi,%rdx,4),%eax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @g5(i64 %0, i32* %1, i64 %2) {
%4 = alloca i64
%5 = alloca i32*
%6 = alloca i64
store i64 %0, i64* %4
store i32* %1, i32** %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i32*, i32** %5
%9 = load i64, i64* %6
%10 = getelementptr inbounds i32, i32* %8, i64 %9
%11 = load i32, i32* %10
%12 = zext i32 %11 to i64
%13 = add nsw i64 %7, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @g5(i64 %0, i32* nocapture %1, i64 %2) {
%4 = getelementptr inbounds i32, i32* %1, i64 %2
%5 = load i32, i32* %4
%6 = zext i32 %5 to i64
%7 = add nsw i64 %6, %0
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit2(int);
double empty_return_double(double a) {
  if (a > 0.0) {
    return 1.0;
  } else {
    exit2(-1);
  }
}


x86 assembly (clang, -O0):
<empty_return_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1141 <empty_return_double+0x31>
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    114b <empty_return_double+0x3b>
mov    $0xffffffff,%edi
call   1030 <exit2@plt>
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<empty_return_double>:
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
ja     1125 <empty_return_double+0x15>
mov    $0xffffffff,%edi
call   1030 <exit2@plt>
movsd  0xed3(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @empty_return_double(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 1.000000e+00, double* %2
br label %9
7: ; preds = %1
%8 = call i32 @exit2(i32 -1)
br label %9
9: ; preds = %6, %7
%10 = load double, double* %2
ret double %10
}

LLVM IR (-O2):
define double @empty_return_double(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @exit2(i32 -1)
br label %5
5: ; preds = %1, %3
ret double 1.000000e+00
}
void outw(unsigned short v, unsigned short p) {
  asm volatile("outw %1,%0" ::"d"(p), "a"(v));
}


x86 assembly (clang, -O0):
<outw>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%dx
mov    -0x2(%rbp),%ax
out    %ax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outw>:
mov    %esi,%edx
mov    %edi,%eax
out    %ax,(%dx)
ret

LLVM IR (-O0):
define void @outw(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = load i16, i16* %3
ret void
}

LLVM IR (-O2):
define void @outw(i16 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outw $1,$0", "{dx},{ax},~{dirflag},~{fpsr},~{flags}"(i16 %1, i16 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ SmcConn;
typedef int /*<<< orphan*/ SmPointer;

/* Variables and functions */
void save_complete(SmcConn conn, SmPointer client_data) {}


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

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

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

LLVM IR (-O2):
define void @save_complete(i32 %0, i32 %1) {
ret void
}
double interval_to_bpm(double interval) {
  double samples_per_beat, beats_per_second;
  samples_per_beat = interval * 128;
  beats_per_second = (double)44100 / samples_per_beat;
  return beats_per_second * 60;
}


x86 assembly (clang, -O0):
<interval_to_bpm>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeff(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xee5(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xecb(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<interval_to_bpm>:
mulsd  0xef8(%rip),%xmm0
movsd  0xef8(%rip),%xmm1
divsd  %xmm0,%xmm1
mulsd  0xef4(%rip),%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @interval_to_bpm(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = fmul double %5, 1.280000e+02
store double %6, double* %3
%7 = load double, double* %3
%8 = fdiv double 4.410000e+04, %7
store double %8, double* %4
%9 = load double, double* %4
%10 = fmul double %9, 6.000000e+01
ret double %10
}

LLVM IR (-O2):
define double @interval_to_bpm(double %0) {
%2 = fmul double %0, 1.280000e+02
%3 = fdiv double 4.410000e+04, %2
%4 = fmul double %3, 6.000000e+01
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned int);
void msleep(unsigned int milliSecond_p) { usleep((milliSecond_p * 1000U)); }


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

x86 assembly (clang, -O2):
<msleep>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @msleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @msleep(i32 %0) {
%2 = mul i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ run_program(char *, int);
int main() {
  run_program("[disk]exec_child1", 10);
  run_program("[disk]exec_child2", 5);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"[disk]exec_child1\00"
@.str.1 = [18 x i8] c"[disk]exec_child2\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @run_program(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 10)
%3 = call i32 @run_program(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 5)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"[disk]exec_child1\00"
@.str.1 = [18 x i8] c"[disk]exec_child2\00"
define i32 @main() {
%1 = tail call i32 @run_program(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @run_program(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("in main!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [9 x i8] c"in main!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret i32 0
}