xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("\"Hello, \t world\" \n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
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 = [19 x i8] c"\22Hello, \09 world\22 \0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [18 x i8] c"\22Hello, \09 world\22 \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int strlen(char s[]) {
  int i;
  i = 0;
  while (s[i] != '\0')
    ++i;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <strlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
void *realloc(void *, int);
int /*<<< orphan*/ zfatal(char *, int);
void *zmalloc_realloc(const void *ptr, int len) {
  void *r;
  if (len < 0) {
    len = 0;
  }
  if ((r = realloc((void *)ptr, len)) == 0) {
    zfatal("FATAL zrealloc: insufficient memory for %d bytes: %m", len);
  }
  return r;
}


x86 assembly (clang, -O0):
<zmalloc_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1140 <zmalloc_realloc+0x20>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1169 <zmalloc_realloc+0x49>
mov    -0xc(%rbp),%esi
lea    0xe9c(%rip),%rdi
call   1030 <zfatal@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zmalloc_realloc>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
test   %esi,%esi
cmovns %esi,%ebx
mov    %ebx,%esi
call   1040 <realloc@plt>
mov    %rax,%r14
test   %rax,%rax
jne    1148 <zmalloc_realloc+0x28>
lea    0xebf(%rip),%rdi
mov    %ebx,%esi
call   1030 <zfatal@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [53 x i8] c"FATAL zrealloc: insufficient memory for %d bytes: %m\00"
define i8* @zmalloc_realloc(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 i32, i32* %4
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %4
br label %9
9: ; preds = %8, %2
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = call i8* @realloc(i8* %10, i32 %11)
store i8* %12, i8** %5
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %17
14: ; preds = %9
%15 = load i32, i32* %4
%16 = call i32 @zfatal(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %14, %9
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
@.str = [53 x i8] c"FATAL zrealloc: insufficient memory for %d bytes: %m\00"
define i8* @zmalloc_realloc(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
%4 = select i1 %3, i32 %1, i32 0
%5 = tail call i8* @realloc(i8* %0, i32 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @zfatal(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %9
9: ; preds = %7, %2
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ ferror(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  const char *tag = (argc > 1 ? argv[1] : "xxx");
  fflush(stdout);
  if (ferror(stdout))
    exit(1);
  exit(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)
cmpl   $0x1,-0x8(%rbp)
jle    1161 <main+0x31>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    1171 <main+0x41>
lea    0xe98(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    1171 <main+0x41>
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e52(%rip),%rax
mov    (%rax),%edi
call   1030 <ferror@plt>
cmp    $0x0,%rax
je     11a9 <main+0x79>
mov    $0x1,%edi
call   1050 <exit@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ea8(%rip),%rbx
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    (%rbx),%edi
call   1030 <ferror@plt>
test   %rax,%rax
jne    1152 <main+0x22>
xor    %edi,%edi
call   1050 <exit@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"xxx\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
br label %14
13: ; preds = %2
br label %14
14: ; preds = %13, %9
%15 = phi i8* [ %12, %9 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %13 ]
store i8* %15, i8** %6
%16 = load i32, i32* @stdout
%17 = call i32 @fflush(i32 %16)
%18 = load i32, i32* @stdout
%19 = call i64 @ferror(i32 %18)
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %14
%22 = call i32 @exit(i32 1)
unreachable
23: ; preds = %14
%24 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
%5 = load i32, i32* @stdout
%6 = tail call i64 @ferror(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %2
%11 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct timespec {
  unsigned int tv_sec;
  unsigned int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void Sleep(unsigned int ms) {
  struct timespec t;
  t.tv_sec = ms / 1000;
  t.tv_nsec = (ms % 1000) * 1000000;
  nanosleep(&t, NULL);
}


x86 assembly (clang, -O0):
<Sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
imul   $0xf4240,%edx,%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sleep>:
push   %rax
mov    %edi,%eax
imul   $0x10624dd3,%rax,%rax
shr    $0x26,%rax
mov    %eax,(%rsp)
imul   $0x3e8,%eax,%eax
sub    %eax,%edi
imul   $0xf4240,%edi,%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @Sleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = udiv i32 %4, 1000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %5, i32* %6
%7 = load i32, i32* %2
%8 = urem i32 %7, 1000
%9 = mul i32 %8, 1000000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i32 %9, i32* %10
%11 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @Sleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = udiv i32 %0, 1000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %4, i32* %5
%6 = urem i32 %0, 1000
%7 = mul nuw nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i32 %7, i32* %8
%9 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tacenv_sysCx(char const *, char const *);
void add_util_path_env() {
  static const char k[] = "PATH";
  static const char path[] = "bin";
  tacenv_sysCx(k, path);
}


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

x86 assembly (clang, -O2):
<add_util_path_env>:
lea    0xee9(%rip),%rdi
lea    0xee7(%rip),%rsi
jmp    1030 <tacenv_sysCx@plt>

LLVM IR (-O0):
@add_util_path_env.k = internal constant [5 x i8] c"PATH\00"
@add_util_path_env.path = internal constant [4 x i8] c"bin\00"
define void @add_util_path_env() {
%1 = call i32 @tacenv_sysCx(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @add_util_path_env.k, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @add_util_path_env.path, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@add_util_path_env.k = internal constant [5 x i8] c"PATH\00"
@add_util_path_env.path = internal constant [4 x i8] c"bin\00"
define void @add_util_path_env() {
%1 = tail call i32 @tacenv_sysCx(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @add_util_path_env.k, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @add_util_path_env.path, i64 0, i64 0))
ret void
}
test_5(int code) {
  _Bool temp = testit();
  _Bool rotate = (code == 22);
  if (temp == 0 && !rotate)
    oof();
}


x86 assembly (clang, -O0):
<test_5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <testit@plt>
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
mov    %al,-0x9(%rbp)
cmpl   $0x16,-0x8(%rbp)
sete   %al
and    $0x1,%al
mov    %al,-0xa(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
jne    116b <test_5+0x4b>
testb  $0x1,-0xa(%rbp)
jne    116b <test_5+0x4b>
mov    $0x0,%al
call   1040 <oof@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_5>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <testit@plt>
cmp    $0x16,%ebx
je     113a <test_5+0x1a>
test   %eax,%eax
jne    113a <test_5+0x1a>
xor    %eax,%eax
call   1040 <oof@plt>
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test_5(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8
store i32 %0, i32* %3
%6 = call i32 (...) @testit()
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i8
store i8 %8, i8* %4
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 22
%11 = zext i1 %10 to i8
store i8 %11, i8* %5
%12 = load i8, i8* %4
%13 = trunc i8 %12 to i1
%14 = zext i1 %13 to i32
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %1
%17 = load i8, i8* %5
%18 = trunc i8 %17 to i1
br i1 %18, label %21, label %19
19: ; preds = %16
%20 = call i32 (...) @oof()
br label %21
21: ; preds = %19, %16, %1
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @test_5(i32 %0) {
%2 = tail call i32 (...) @testit()
%3 = icmp ne i32 %2, 0
%4 = icmp eq i32 %0, 22
%5 = or i1 %4, %3
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 (...) @oof()
br label %8
8: ; preds = %6, %1
ret i32 undef
}
void gk20a_sync_timeline_signal(struct sync_timeline *obj) {}


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

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

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

LLVM IR (-O2):
%struct.sync_timeline = type opaque
define void @gk20a_sync_timeline_signal(%struct.sync_timeline* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int test_log2(int);
int main() {
  int r;
  r = test_log2(128);
  assert(r == 7);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x80,%edi
call   1030 <test_log2@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x7,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x80,%edi
call   1030 <test_log2@plt>
xor    %edi,%edi
cmp    $0x7,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = call i32 @test_log2(i32 128)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 7
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test_log2(i32 128)
%2 = icmp eq i32 %1, 7
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret i32 0
}
/* Variables and functions */
int handleMQTTDisconnect();
int tpMQTTDisconnect() {
  int rc = handleMQTTDisconnect();
  return rc;
}


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

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

LLVM IR (-O0):
define i32 @tpMQTTDisconnect() {
%1 = alloca i32
%2 = call i32 (...) @handleMQTTDisconnect()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @tpMQTTDisconnect() {
%1 = tail call i32 (...) @handleMQTTDisconnect()
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void stream_close(FILE *stream, FILE *default_stream) {
  if (stream != NULL && stream != default_stream) {
    fclose(stream);
  }
}


x86 assembly (clang, -O0):
<stream_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1142 <stream_close+0x32>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1142 <stream_close+0x32>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stream_close>:
test   %rdi,%rdi
je     111f <stream_close+0xf>
cmp    %rsi,%rdi
je     111f <stream_close+0xf>
jmp    1030 <fclose@plt>
ret

LLVM IR (-O0):
define void @stream_close(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 = icmp ne i32* %5, null
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load i32*, i32** %3
%9 = load i32*, i32** %4
%10 = icmp ne i32* %8, %9
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32*, i32** %3
%13 = call i32 @fclose(i32* %12)
br label %14
14: ; preds = %11, %7, %2
ret void
}

LLVM IR (-O2):
define void @stream_close(i32* %0, i32* readnone %1) {
%3 = icmp eq i32* %0, null
%4 = icmp eq i32* %0, %1
%5 = or i1 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @fclose(i32* %0)
br label %8
8: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void __auto_fclose__(FILE **f) {
  if (*f)
    fclose(*f);
}


x86 assembly (clang, -O0):
<__auto_fclose__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1136 <__auto_fclose__+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__auto_fclose__>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <__auto_fclose__+0xd>
jmp    1030 <fclose@plt>
ret

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

LLVM IR (-O2):
define void @__auto_fclose__(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
char *strnchr(char *s, int c, int n) {
  while (n--) {
    if (*s == c) {
      return s;
    } else {
      ++s;
    }
  }
  return NULL;
}


x86 assembly (clang, -O0):
<strnchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x18(%rbp)
cmp    $0x0,%eax
je     1150 <strnchr+0x50>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    113f <strnchr+0x3f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1158 <strnchr+0x58>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110e <strnchr+0xe>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnchr>:
test   %edx,%edx
je     1122 <strnchr+0x22>
mov    %rdi,%rax
nopw   0x0(%rax,%rax,1)
movsbl (%rax),%ecx
cmp    %esi,%ecx
je     1124 <strnchr+0x24>
add    $0xffffffff,%edx
add    $0x1,%rax
test   %edx,%edx
jne    1110 <strnchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strnchr(i8* %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %15, label %5
5: ; preds = %3, %12
%6 = phi i32 [ %8, %12 ], [ %2, %3 ]
%7 = phi i8* [ %13, %12 ], [ %0, %3 ]
%8 = add nsw i32 %6, -1
%9 = load i8, i8* %7
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, %1
br i1 %11, label %15, label %12
12: ; preds = %5
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = icmp eq i32 %8, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %12, %3
%16 = phi i8* [ null, %3 ], [ null, %12 ], [ %7, %5 ]
ret i8* %16
}
int truncate(double x) {
  int y = (int)x;
  return y;
}


x86 assembly (clang, -O0):
<truncate>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<truncate>:
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @truncate(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @truncate(double %0) {
%2 = fptosi double %0 to i32
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ dst;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, int *, int);
void memcpy_contents_Bad() {
  int src[3] = {5, 5, 5};
  int dst[3];
  memcpy(dst, src, sizeof(dst));
  int a[5];
  a[dst[0]] = 0;
}


x86 assembly (clang, -O0):
<memcpy_contents_Bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xedf(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x18(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0xc,%edx
call   1030 <memcpy@plt>
movslq -0x18(%rbp),%rax
movl   $0x0,-0x30(%rbp,%rax,4)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy_contents_Bad>:
sub    $0x18,%rsp
mov    0xeee(%rip),%eax
mov    %eax,0x8(%rsp)
mov    0xedb(%rip),%rax
mov    %rax,(%rsp)
lea    0xc(%rsp),%rdi
mov    %rsp,%rsi
mov    $0xc,%edx
call   1030 <memcpy@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.memcpy_contents_Bad.src = [3 x i32] [i32 5, i32 5, i32 5]
define void @memcpy_contents_Bad() {
%1 = alloca [3 x i32]
%2 = alloca [3 x i32]
%3 = alloca [5 x i32]
%4 = bitcast [3 x i32]* %1 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%7 = call i32 @memcpy(i32* %5, i32* %6, i32 12)
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %8
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 %10
store i32 0, i32* %11
ret void
}

LLVM IR (-O2):
@__const.memcpy_contents_Bad.src = [3 x i32] [i32 5, i32 5, i32 5]
define void @memcpy_contents_Bad() {
%1 = alloca [3 x i32]
%2 = alloca [3 x i32]
%3 = bitcast [3 x i32]* %1 to i8*
%4 = bitcast [3 x i32]* %2 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%7 = call i32 @memcpy(i32* %5, i32* %6, i32 12)
ret void
}
/* Variables and functions */
double cos(int);
int drand();
int log(int);
double sqrt(int);
double rand_normal_r() {
  double x = sqrt(-2 * log(drand())) * cos(2 * (3.141592653589793) * drand());
  return x;
}


x86 assembly (clang, -O0):
<rand_normal_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <drand@plt>
mov    %eax,%edi
call   1050 <log@plt>
imul   $0xfffffffe,%eax,%edi
call   1060 <sqrt@plt>
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <drand@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe87(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_normal_r>:
push   %rax
xor    %eax,%eax
call   1030 <drand@plt>
mov    %eax,%edi
call   1050 <log@plt>
lea    (%rax,%rax,1),%edi
neg    %edi
call   1060 <sqrt@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <drand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xe8c(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <cos@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @rand_normal_r() {
%1 = alloca double
%2 = call i32 (...) @drand()
%3 = call i32 @log(i32 %2)
%4 = mul nsw i32 -2, %3
%5 = call double @sqrt(i32 %4)
%6 = call i32 (...) @drand()
%7 = sitofp i32 %6 to double
%8 = fmul double 0x401921FB54442D18, %7
%9 = fptosi double %8 to i32
%10 = call double @cos(i32 %9)
%11 = fmul double %5, %10
store double %11, double* %1
%12 = load double, double* %1
ret double %12
}

LLVM IR (-O2):
define double @rand_normal_r() {
%1 = tail call i32 (...) @drand()
%2 = tail call i32 @log(i32 %1)
%3 = mul nsw i32 %2, -2
%4 = tail call double @sqrt(i32 %3)
%5 = tail call i32 (...) @drand()
%6 = sitofp i32 %5 to double
%7 = fmul double %6, 0x401921FB54442D18
%8 = fptosi double %7 to i32
%9 = tail call double @cos(i32 %8)
%10 = fmul double %4, %9
ret double %10
}
/* Variables and functions */
bool HibernateGPIORetentionGet(void) {
  if (((*((volatile unsigned long *)(0x400FC010))) &
       (0x40000000 | 0x00000100)) == (0x40000000 | 0x00000100)) {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<HibernateGPIORetentionGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fc010,%eax
mov    (%rax),%rax
and    $0x40000100,%rax
cmp    $0x40000100,%rax
jne    112a <HibernateGPIORetentionGet+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1131 <HibernateGPIORetentionGet+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateGPIORetentionGet>:
mov    0x400fc010,%rcx
40
not    %ecx
xor    %eax,%eax
test   $0x40000100,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @HibernateGPIORetentionGet() {
%1 = alloca i32
%2 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%3 = and i64 %2, 1073742080
%4 = icmp eq i64 %3, 1073742080
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 1, i32* %1
br label %7
6: ; preds = %0
store i32 0, i32* %1
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @HibernateGPIORetentionGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%2 = and i64 %1, 1073742080
%3 = icmp eq i64 %2, 1073742080
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ f(void *);
main() {
  (void)12345, f((void *)0);
  (void)0x12345, f((void *)0);
  (void)0b1010, f((void *)0);
  (void)017164113, f((void *)0);
  (void)0, f((void *)0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <f@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <f@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <f@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <f@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <f@plt>
xor    %edi,%edi
call   1030 <f@plt>
xor    %edi,%edi
call   1030 <f@plt>
xor    %edi,%edi
call   1030 <f@plt>
xor    %edi,%edi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @f(i8* null)
%2 = call i32 @f(i8* null)
%3 = call i32 @f(i8* null)
%4 = call i32 @f(i8* null)
%5 = call i32 @f(i8* null)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i8* null)
%2 = tail call i32 @f(i8* null)
%3 = tail call i32 @f(i8* null)
%4 = tail call i32 @f(i8* null)
%5 = tail call i32 @f(i8* null)
ret i32 0
}
int saat_farki(int saat, int dakika, int saniye) {
  int toplam_saniye = 0;
  toplam_saniye = saat * 60 * 60;
  toplam_saniye = toplam_saniye + (dakika * 60);
  toplam_saniye = toplam_saniye + saniye;
  return toplam_saniye;
}


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

x86 assembly (clang, -O2):
<saat_farki>:
imul   $0xe10,%edi,%ecx
imul   $0x3c,%esi,%eax
add    %ecx,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @saat_farki(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %4
%9 = mul nsw i32 %8, 60
%10 = mul nsw i32 %9, 60
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = load i32, i32* %5
%13 = mul nsw i32 %12, 60
%14 = add nsw i32 %11, %13
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = load i32, i32* %6
%17 = add nsw i32 %15, %16
store i32 %17, i32* %7
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
define i32 @saat_farki(i32 %0, i32 %1, i32 %2) {
%4 = mul i32 %0, 3600
%5 = mul nsw i32 %1, 60
%6 = add nsw i32 %5, %4
%7 = add nsw i32 %6, %2
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ rd_var(double const *, size_t);
double sqrt(int /*<<< orphan*/);
double rd_std(const double *x, size_t nmemb) { return sqrt(rd_var(x, nmemb)); }


x86 assembly (clang, -O0):
<rd_std>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <rd_var@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rd_std>:
push   %rax
call   1030 <rd_var@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @rd_std(double* %0, i64 %1) {
%3 = alloca double*
%4 = alloca i64
store double* %0, double** %3
store i64 %1, i64* %4
%5 = load double*, double** %3
%6 = load i64, i64* %4
%7 = call i32 @rd_var(double* %5, i64 %6)
%8 = call double @sqrt(i32 %7)
ret double %8
}

LLVM IR (-O2):
define double @rd_std(double* %0, i64 %1) {
%3 = tail call i32 @rd_var(double* %0, i64 %1)
%4 = tail call double @sqrt(i32 %3)
ret double %4
}
/* Variables and functions */
scalar_t__ pipe2(int *, int /*<<< orphan*/);
int main(void) {
  int p[2];
  if (pipe2(p, 0) < 0)
    return 111;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
xor    %esi,%esi
call   1030 <pipe2@plt>
cmp    $0x0,%rax
jge    1140 <main+0x30>
movl   $0x6f,-0x4(%rbp)
jmp    1147 <main+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <pipe2@plt>
sar    $0x3f,%rax
and    $0x6f,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%4 = call i64 @pipe2(i32* %3, i32 0)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 111, i32* %1
br label %8
7: ; preds = %0
store i32 0, i32* %1
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%4 = call i64 @pipe2(i32* %3, i32 0)
%5 = icmp slt i64 %4, 0
%6 = select i1 %5, i32 111, i32 0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ glWindowPos4f(double const, double const, double const,
                                 double const);
void glWindowPos4dv(const double v[4]) {
  glWindowPos4f(v[0], v[1], v[2], v[3]);
}


x86 assembly (clang, -O0):
<glWindowPos4dv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm3
call   1030 <glWindowPos4f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glWindowPos4dv>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
movsd  0x10(%rdi),%xmm2
movsd  0x18(%rdi),%xmm3
jmp    1030 <glWindowPos4f@plt>

LLVM IR (-O0):
define void @glWindowPos4dv(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 1
%8 = load double, double* %7
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 2
%11 = load double, double* %10
%12 = load double*, double** %2
%13 = getelementptr inbounds double, double* %12, i64 3
%14 = load double, double* %13
%15 = call i32 @glWindowPos4f(double %5, double %8, double %11, double %14)
ret void
}

LLVM IR (-O2):
define void @glWindowPos4dv(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = getelementptr inbounds double, double* %0, i64 2
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %0, i64 3
%8 = load double, double* %7
%9 = tail call i32 @glWindowPos4f(double %2, double %4, double %6, double %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ call(char *);
eq() { call("cceq"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"cceq\00"
define i32 @eq() {
%1 = tail call i32 @call(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
unsigned short int f13(unsigned short int x, unsigned int y) {
  return (x << y) | (x >> (8 * sizeof(unsigned short) - y));
}


x86 assembly (clang, -O0):
<f13>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
movzwl -0x2(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    %ecx,%esi
mov    $0x10,%ecx
sub    %rsi,%rcx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f13>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%ax
ret

LLVM IR (-O0):
define zeroext i16 @f13(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 %6, %7
%9 = load i16, i16* %3
%10 = zext i16 %9 to i32
%11 = load i32, i32* %4
%12 = zext i32 %11 to i64
%13 = sub i64 16, %12
%14 = trunc i64 %13 to i32
%15 = ashr i32 %10, %14
%16 = or i32 %8, %15
%17 = trunc i32 %16 to i16
ret i16 %17
}

LLVM IR (-O2):
define zeroext i16 @f13(i16 zeroext %0, i32 %1) {
%3 = trunc i32 %1 to i16
%4 = tail call i16 @llvm.fshl.i16(i16 %0, i16 %0, i16 %3)
ret i16 %4
}
unsigned int unsignedint_ignoring_signedchar(unsigned int x, signed char y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedint_ignoring_signedchar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsignedint_ignoring_signedchar>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @unsignedint_ignoring_signedchar(i32 returned %0, i8 signext %1) {
ret i32 %0
}
void ch_flightstick_pro_a0_over(void *p) {}


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

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

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

LLVM IR (-O2):
define void @ch_flightstick_pro_a0_over(i8* nocapture %0) {
ret void
}
int Get_USB3_Port_DataRate(const char *port_x) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @Get_USB3_Port_DataRate(i8* nocapture readnone %0) {
ret i32 0
}
void gpio() {}


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

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

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

LLVM IR (-O2):
define void @gpio() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _FPU_GETCW(unsigned int);
int fegetexcept(void) {
  unsigned int exc;
  _FPU_GETCW(exc);
  return (exc & 0x00F80U) >> 5;
}


x86 assembly (clang, -O0):
<fegetexcept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%edi
call   1030 <_FPU_GETCW@plt>
mov    -0x4(%rbp),%eax
and    $0xf80,%eax
shr    $0x5,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fegetexcept>:
push   %rax
call   1030 <_FPU_GETCW@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fegetexcept() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @_FPU_GETCW(i32 %2)
%4 = load i32, i32* %1
%5 = and i32 %4, 3968
%6 = lshr i32 %5, 5
ret i32 %6
}

LLVM IR (-O2):
define i32 @fegetexcept() {
%1 = tail call i32 @_FPU_GETCW(i32 undef)
ret i32 0
}
/* Variables and functions */
float getval(float);
float getmiddle(float x1, float x2) {
  float x, y1, y2;
  y1 = getval(x1);
  y2 = getval(x2);
  x = (x1 * y2 - x2 * y1) / (y2 - y1);
  return x;
}


x86 assembly (clang, -O0):
<getmiddle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <getval@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <getval@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x14(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x10(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  -0x14(%rbp),%xmm1
subss  -0x10(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getmiddle>:
sub    $0x18,%rsp
movss  %xmm1,0xc(%rsp)
movss  %xmm0,0x14(%rsp)
call   1030 <getval@plt>
movss  %xmm0,0x10(%rsp)
movss  0xc(%rsp),%xmm0
call   1030 <getval@plt>
movss  0xc(%rsp),%xmm2
movss  0x10(%rsp),%xmm3
mulss  %xmm3,%xmm2
movss  0x14(%rsp),%xmm1
mulss  %xmm0,%xmm1
subss  %xmm2,%xmm1
subss  %xmm3,%xmm0
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @getmiddle(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %3
store float %1, float* %4
%8 = load float, float* %3
%9 = call float @getval(float %8)
store float %9, float* %6
%10 = load float, float* %4
%11 = call float @getval(float %10)
store float %11, float* %7
%12 = load float, float* %3
%13 = load float, float* %7
%14 = load float, float* %4
%15 = load float, float* %6
%16 = fmul float %14, %15
%17 = fneg float %16
%18 = call float @llvm.fmuladd.f32(float %12, float %13, float %17)
%19 = load float, float* %7
%20 = load float, float* %6
%21 = fsub float %19, %20
%22 = fdiv float %18, %21
store float %22, float* %5
%23 = load float, float* %5
ret float %23
}

LLVM IR (-O2):
define float @getmiddle(float %0, float %1) {
%3 = tail call float @getval(float %0)
%4 = tail call float @getval(float %1)
%5 = fneg float %3
%6 = fmul float %5, %1
%7 = tail call float @llvm.fmuladd.f32(float %0, float %4, float %6)
%8 = fsub float %4, %3
%9 = fdiv float %7, %8
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int usage() {
  fprintf(stderr, "ln [-s] <target> <name>\n");
  return -1;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"ln [-s] <target> <name>\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"ln [-s] <target> <name>\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ mkdir(char *, char);
int main(int argc, char *argv[]) { mkdir("foobar", '644'); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x34,%esi
call   1030 <mkdir@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"foobar\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @mkdir(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext 52)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"foobar\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @mkdir(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext 52)
ret i32 0
}
int do_817() { return 817; }


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

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

LLVM IR (-O0):
define i32 @do_817() {
ret i32 817
}

LLVM IR (-O2):
define i32 @do_817() {
ret i32 817
}
/* Variables and functions */
int utf8_compare(char const *, char const *);
int _xte_utf8_compare(const char *in_string1, const char *in_string2) {
  return utf8_compare(in_string1, in_string2);
}


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

x86 assembly (clang, -O2):
<_xte_utf8_compare>:
jmp    1030 <utf8_compare@plt>

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

LLVM IR (-O2):
define i32 @_xte_utf8_compare(i8* %0, i8* %1) {
%3 = tail call i32 @utf8_compare(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ mybsearch(double);
int /*<<< orphan*/ printf(char *, double, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double num = 0.0;
  scanf("%lf", &num);
  printf("\r\n num %lf的平方根是%lf", num, mybsearch(num));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    0xecb(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1050 <mybsearch@plt>
movsd  -0x18(%rbp),%xmm0
mov    %eax,%esi
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movq   $0x0,0x8(%rsp)
lea    0xed5(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
call   1050 <mybsearch@plt>
lea    0xe9a(%rip),%rdi
movsd  0x10(%rsp),%xmm0
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [29 x i8] c"\0D\0A num %lf\E7\9A\84\E5\B9\B3\E6\96\B9\E6\A0\B9\E6\98\AF%lf\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %2
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%4 = load double, double* %2
%5 = load double, double* %2
%6 = call i32 @mybsearch(double %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), double %4, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [29 x i8] c"\0D\0A num %lf\E7\9A\84\E5\B9\B3\E6\96\B9\E6\A0\B9\E6\98\AF%lf\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
store double 0.000000e+00, double* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = call i32 @mybsearch(double %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), double %4, i32 %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ getegid();
int /*<<< orphan*/ setresgid(int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/);
int /*<<< orphan*/ vuln();
int main(int argc, char **argv) {
  gid_t gid = getegid();
  setresgid(gid, gid, gid);
  vuln();
  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)
mov    $0x0,%al
call   1050 <getegid@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <setresgid@plt>
mov    $0x0,%al
call   1030 <vuln@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <getegid@plt>
mov    %eax,%edi
mov    %eax,%esi
mov    %eax,%edx
call   1040 <setresgid@plt>
xor    %eax,%eax
call   1030 <vuln@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @getegid()
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = load i32, i32* %6
%10 = load i32, i32* %6
%11 = call i32 @setresgid(i32 %8, i32 %9, i32 %10)
%12 = call i32 (...) @vuln()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getegid()
%4 = tail call i32 @setresgid(i32 %3, i32 %3, i32 %3)
%5 = tail call i32 (...) @vuln()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int syscall(int);
int main() {
  printf("seal : %i\n", syscall(361));
  printf("is_sealed : %i\n", syscall(362));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x169,%edi
call   1040 <syscall@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x16a,%edi
call   1040 <syscall@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x169,%edi
call   1040 <syscall@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x16a,%edi
call   1040 <syscall@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"seal : %i\0A\00"
@.str.1 = [16 x i8] c"is_sealed : %i\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @syscall(i32 361)
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @syscall(i32 362)
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"seal : %i\0A\00"
@.str.1 = [16 x i8] c"is_sealed : %i\0A\00"
define i32 @main() {
%1 = tail call i32 @syscall(i32 361)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @syscall(i32 362)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}