xunge/DecIR huggingface dataset:
int pre_skip(const struct roff_meta *meta, struct roff_node *n) { return 0; }


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

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

LLVM IR (-O0):
%struct.roff_meta = type opaque
%struct.roff_node = type opaque
define i32 @pre_skip(%struct.roff_meta* %0, %struct.roff_node* %1) {
%3 = alloca %struct.roff_meta*
%4 = alloca %struct.roff_node*
store %struct.roff_meta* %0, %struct.roff_meta** %3
store %struct.roff_node* %1, %struct.roff_node** %4
ret i32 0
}

LLVM IR (-O2):
%struct.roff_meta = type opaque
%struct.roff_node = type opaque
define i32 @pre_skip(%struct.roff_meta* nocapture readnone %0, %struct.roff_node* nocapture readnone %1) {
ret i32 0
}
void sd_ct_init(void) {}


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

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

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

LLVM IR (-O2):
define void @sd_ct_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void closeClient(int clientSocket) {
  if (clientSocket != -1) {
    close(clientSocket);
  }
}


x86 assembly (clang, -O0):
<closeClient>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
je     112d <closeClient+0x1d>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closeClient>:
cmp    $0xffffffff,%edi
je     111a <closeClient+0xa>
jmp    1030 <close@plt>
ret

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

LLVM IR (-O2):
define void @closeClient(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %3, %1
ret void
}
int whitespace(char c) {
  if ((c == ' ') || (c == '\t') || (c == '\r') || (c == '\n'))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     113e <whitespace+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
je     113e <whitespace+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0xd,%eax
je     113e <whitespace+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
jne    114a <whitespace+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <whitespace+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<whitespace>:
cmp    $0x20,%dil
ja     1120 <whitespace+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100002600,%rdx
bt     %rcx,%rdx
jae    1120 <whitespace+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @whitespace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %3
i8 13, label %3
i8 10, label %3
i8 9, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
void devfs_remove(const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @devfs_remove(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int write(int, unsigned char *, int);
int i2cWriteByte(int i2cAdapter, unsigned char address, unsigned char byte) {
  unsigned char buff[2];
  buff[0] = i2cAdapter;
  buff[1] = byte;
  if (write(i2cAdapter, buff, 2) != 2) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<i2cWriteByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %edi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0xc(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
cmp    $0x2,%eax
je     1158 <i2cWriteByte+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <i2cWriteByte+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2cWriteByte>:
push   %rax
mov    %dil,0x6(%rsp)
mov    %dl,0x7(%rsp)
lea    0x6(%rsp),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @i2cWriteByte(i32 %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca [2 x i8]
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%6 = trunc i32 %0 to i8
store i8 %6, i8* %5
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 1
store i8 %2, i8* %7
%8 = call i32 @write(i32 %0, i8* %5, i32 2)
%9 = icmp ne i32 %8, 2
%10 = sext i1 %9 to i32
ret i32 %10
}
/* Type definitions */
struct animal_builder {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void animal_builder_ops_build_arm(struct animal_builder *animal_builder) {
  printf("animal_builder::build_arm()\n");
}


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

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

LLVM IR (-O0):
%struct.animal_builder = type { i32 }
@.str = [29 x i8] c"animal_builder::build_arm()\0A\00"
define void @animal_builder_ops_build_arm(%struct.animal_builder* %0) {
%2 = alloca %struct.animal_builder*
store %struct.animal_builder* %0, %struct.animal_builder** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.animal_builder = type { i32 }
@str = [28 x i8] c"animal_builder::build_arm()\00"
define void @animal_builder_ops_build_arm(%struct.animal_builder* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void b() { printf("Found b\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"Found b\00"
define void @b() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ cr(char);
scalar_t__ nl(char);
scalar_t__ space(char);
scalar_t__ tab(char);
int whitespace(char c) { return space(c) || tab(c) || nl(c) || cr(c); }


x86 assembly (clang, -O0):
<whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <space@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    11b2 <whitespace+0x72>
movsbl -0x1(%rbp),%edi
call   1060 <tab@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    11b2 <whitespace+0x72>
movsbl -0x1(%rbp),%edi
call   1040 <nl@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    11b2 <whitespace+0x72>
movsbl -0x1(%rbp),%edi
call   1050 <cr@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<whitespace>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1030 <space@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    117f <whitespace+0x3f>
movsbl %bpl,%ebp
mov    %ebp,%edi
call   1060 <tab@plt>
test   %rax,%rax
jne    117f <whitespace+0x3f>
mov    %ebp,%edi
call   1040 <nl@plt>
test   %rax,%rax
jne    117f <whitespace+0x3f>
mov    %ebp,%edi
call   1050 <cr@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @whitespace(i8 signext %0) {
%2 = tail call i64 @space(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %14
4: ; preds = %1
%5 = tail call i64 @tab(i8 signext %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = tail call i64 @nl(i8 signext %0)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = tail call i64 @cr(i8 signext %0)
%12 = icmp ne i64 %11, 0
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %10, %7, %4, %1
%15 = phi i32 [ 1, %7 ], [ 1, %4 ], [ 1, %1 ], [ %13, %10 ]
ret i32 %15
}
void gtk_container_child_set_valist() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ vat(int /*<<< orphan*/, int);
int main(void) {
  va_list t;
  vat(t, 1);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
call   1030 <vat@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%esi
call   1030 <vat@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* %2
%4 = call i32 @vat(i32 %3, i32 1)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @vat(i32 undef, i32 1)
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ENOMEM;
int /*<<< orphan*/ fail(int /*<<< orphan*/);
void *realloc(void *, unsigned int);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void *reallocate(void *ptr, unsigned int size) {
  ptr = realloc(ptr, size);
  if (!ptr)
    fail(strerror(ENOMEM));
  return ptr;
}


x86 assembly (clang, -O0):
<reallocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    116f <reallocate+0x3f>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%edi
call   1030 <fail@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reallocate>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1153 <reallocate+0x23>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%edi
call   1030 <fail@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@ENOMEM = global i32 0
define i8* @reallocate(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i8* @realloc(i8* %5, i32 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %14, label %10
10: ; preds = %2
%11 = load i32, i32* @ENOMEM
%12 = call i32 @strerror(i32 %11)
%13 = call i32 @fail(i32 %12)
br label %14
14: ; preds = %10, %2
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@ENOMEM = global i32 0
define i8* @reallocate(i8* %0, i32 %1) {
%3 = tail call i8* @realloc(i8* %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @ENOMEM
%7 = tail call i32 @strerror(i32 %6)
%8 = tail call i32 @fail(i32 %7)
br label %9
9: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ ExtSelect(char *, char *, int /*<<< orphan*/);
void ExttNSSelect(void) {
  ExtSelect("tNS",
            "tNS.uNS,tNS.cFQDN,tNS.uNSType,tNS.uNSSet,tNS.uServer,tNS.uOwner,"
            "tNS.uCreatedBy,tNS.uCreatedDate,tNS.uModBy,tNS.uModDate",
            0);
}


x86 assembly (clang, -O0):
<ExttNSSelect>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee2(%rip),%rsi
xor    %edx,%edx
call   1030 <ExtSelect@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExttNSSelect>:
lea    0xee9(%rip),%rdi
lea    0xee6(%rip),%rsi
xor    %edx,%edx
jmp    1030 <ExtSelect@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"tNS\00"
@.str.1 = [120 x i8] c"tNS.uNS,tNS.cFQDN,tNS.uNSType,tNS.uNSSet,tNS.uServer,tNS.uOwner,tNS.uCreatedBy,tNS.uCreatedDate,tNS.uModBy,tNS.uModDate\00"
define void @ExttNSSelect() {
%1 = call i32 @ExtSelect(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([120 x i8], [120 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"tNS\00"
@.str.1 = [120 x i8] c"tNS.uNS,tNS.cFQDN,tNS.uNSType,tNS.uNSSet,tNS.uServer,tNS.uOwner,tNS.uCreatedBy,tNS.uCreatedDate,tNS.uModBy,tNS.uModDate\00"
define void @ExttNSSelect() {
%1 = tail call i32 @ExtSelect(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([120 x i8], [120 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void externalRiskyCode() {
  printf("Calling exit from C code\n");
  exit(1);
}


x86 assembly (clang, -O0):
<externalRiskyCode>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<externalRiskyCode>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Calling exit from C code\0A\00"
define void @externalRiskyCode() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [25 x i8] c"Calling exit from C code\00"
define void @externalRiskyCode() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fork();
int getpid();
int /*<<< orphan*/ sync();
void do_slow() {
  int pid = getpid();
  if (fork())
    return;
  sync();
  exit(0);
}


x86 assembly (clang, -O0):
<do_slow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1060 <fork@plt>
cmp    $0x0,%rax
je     1169 <do_slow+0x29>
add    $0x10,%rsp
pop    %rbp
ret
mov    $0x0,%al
call   1040 <sync@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<do_slow>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
xor    %eax,%eax
call   1060 <fork@plt>
test   %rax,%rax
je     1156 <do_slow+0x16>
pop    %rax
ret
xor    %eax,%eax
call   1040 <sync@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @do_slow() {
%1 = alloca i32
%2 = call i32 (...) @getpid()
store i32 %2, i32* %1
%3 = call i64 (...) @fork()
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
ret void
6: ; preds = %0
%7 = call i32 (...) @sync()
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @do_slow() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i64 (...) @fork()
%3 = icmp eq i64 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %0
ret void
5: ; preds = %0
%6 = tail call i32 (...) @sync()
%7 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
double difftime(time_t time1, time_t time2) { return (double)(time1 - time2); }


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

x86 assembly (clang, -O2):
<difftime>:
sub    %rsi,%rdi
cvtsi2sd %rdi,%xmm0
ret

LLVM IR (-O0):
define double @difftime(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 = sub nsw i64 %5, %6
%8 = sitofp i64 %7 to double
ret double %8
}

LLVM IR (-O2):
define double @difftime(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
%4 = sitofp i64 %3 to double
ret double %4
}
int test_imm_51uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x51 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_51uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 81
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
void *bits_join(int hi, int lo) {
  intptr_t int64 = hi;
  int64 <<= 32;
  int64 += lo;
  return (void *)int64;
}


x86 assembly (clang, -O0):
<bits_join>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x20,%rax
mov    %rax,-0x10(%rbp)
movslq -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits_join>:
shl    $0x20,%rdi
movslq %esi,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @bits_join(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
store i64 %7, i64* %5
%8 = load i64, i64* %5
%9 = shl i64 %8, 32
store i64 %9, i64* %5
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = load i64, i64* %5
%13 = add nsw i64 %12, %11
store i64 %13, i64* %5
%14 = load i64, i64* %5
%15 = inttoptr i64 %14 to i8*
ret i8* %15
}

LLVM IR (-O2):
define i8* @bits_join(i32 %0, i32 %1) {
%3 = zext i32 %0 to i64
%4 = shl nuw i64 %3, 32
%5 = sext i32 %1 to i64
%6 = add nsw i64 %4, %5
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
void func1(void) {
  union s1;
  union s2 {
    char a;
  };
}


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

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

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

LLVM IR (-O2):
define void @func1() {
ret void
}
void save_mpi_arrays_adios_(void) {}


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

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

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

LLVM IR (-O2):
define void @save_mpi_arrays_adios_() {
ret void
}
void _exit(int i) {
  i = i;
  while (1)
    ;
}


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110d <_exit+0xd>

x86 assembly (clang, -O2):
<_exit>:
jmp    1100 <_exit>

LLVM IR (-O0):
define void @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store i32 %3, i32* %2
br label %4
4: ; preds = %1, %4
br label %4
}

LLVM IR (-O2):
define void @_exit(i32 %0) {
br label %2
2: ; preds = %1, %2
br label %2
}
void sub_test() {}


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

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

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

LLVM IR (-O2):
define void @sub_test() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stringConcat(char *, char *);
int main(int argc, char *argv[]) {
  if (argc < 2)
    return 1;
  int compare;
  char *str1 = argv[1];
  char *str2 = argv[2];
  stringConcat(str1, str2);
  printf("String after concatenation: %s\n", str1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    114c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1188 <main+0x68>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <stringConcat@plt>
mov    -0x20(%rbp),%rsi
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%eax
cmp    $0x2,%edi
jl     114d <main+0x2d>
push   %rbx
mov    0x8(%rsi),%rbx
mov    0x10(%rsi),%rsi
mov    %rbx,%rdi
call   1040 <stringConcat@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"String after concatenation: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 2
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 1, i32* %3
br label %24
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
store i8* %15, i8** %7
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 2
%18 = load i8*, i8** %17
store i8* %18, i8** %8
%19 = load i8*, i8** %7
%20 = load i8*, i8** %8
%21 = call i32 @stringConcat(i8* %19, i8* %20)
%22 = load i8*, i8** %7
%23 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %22)
store i32 0, i32* %3
br label %24
24: ; preds = %12, %11
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
@.str = [32 x i8] c"String after concatenation: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = tail call i32 @stringConcat(i8* %6, i8* %8)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %11
11: ; preds = %2, %4
%12 = phi i32 [ 0, %4 ], [ 1, %2 ]
ret i32 %12
}
/* Type definitions */
struct iwreq {
  int /*<<< orphan*/ ifr_name;
};

/* Variables and functions */
int /*<<< orphan*/ IFNAMSIZ;
int ioctl(int, int, struct iwreq *);
int /*<<< orphan*/ strncpy(int /*<<< orphan*/, char const *,
                           int /*<<< orphan*/);
int iw_get_ext(int skfd, const char *ifname, int request, struct iwreq *pwrq) {
  strncpy(pwrq->ifr_name, ifname, IFNAMSIZ);
  return (ioctl(skfd, request, pwrq));
}


x86 assembly (clang, -O0):
<iw_get_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
call   1030 <strncpy@plt>
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1040 <ioctl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iw_get_ext>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%rbx
mov    %edx,%r14d
mov    %edi,%ebp
mov    (%rcx),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
call   1030 <strncpy@plt>
mov    %ebp,%edi
mov    %r14d,%esi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
%struct.iwreq = type { i32 }
@IFNAMSIZ = global i32 0
define i32 @iw_get_ext(i32 %0, i8* %1, i32 %2, %struct.iwreq* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca %struct.iwreq*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store %struct.iwreq* %3, %struct.iwreq** %8
%9 = load %struct.iwreq*, %struct.iwreq** %8
%10 = getelementptr inbounds %struct.iwreq, %struct.iwreq* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = load i8*, i8** %6
%13 = load i32, i32* @IFNAMSIZ
%14 = call i32 @strncpy(i32 %11, i8* %12, i32 %13)
%15 = load i32, i32* %5
%16 = load i32, i32* %7
%17 = load %struct.iwreq*, %struct.iwreq** %8
%18 = call i32 @ioctl(i32 %15, i32 %16, %struct.iwreq* %17)
ret i32 %18
}

LLVM IR (-O2):
%struct.iwreq = type { i32 }
@IFNAMSIZ = global i32 0
define i32 @iw_get_ext(i32 %0, i8* %1, i32 %2, %struct.iwreq* %3) {
%5 = getelementptr inbounds %struct.iwreq, %struct.iwreq* %3, i64 0, i32 0
%6 = load i32, i32* %5
%7 = load i32, i32* @IFNAMSIZ
%8 = tail call i32 @strncpy(i32 %6, i8* %1, i32 %7)
%9 = tail call i32 @ioctl(i32 %0, i32 %2, %struct.iwreq* %3)
ret i32 %9
}
/* Variables and functions */
long syscall(int, int);
long auditsec_answer(int answer) { return syscall(301, answer); }


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

x86 assembly (clang, -O2):
<auditsec_answer>:
mov    %edi,%esi
mov    $0x12d,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i64 @auditsec_answer(i32 %0) {
%2 = tail call i64 @syscall(i32 301, i32 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
float __VERIFIER_nondet_float();
int main(void) {
  float a = __VERIFIER_nondet_float();
  if (a < 0) {
    return 0;
  }
  __VERIFIER_assert(a > 1);
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_float@plt>
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1154 <main+0x34>
movl   $0x0,-0x4(%rbp)
jmp    1179 <main+0x59>
movss  -0x8(%rbp),%xmm0
movss  0xe9f(%rip),%xmm1
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
cvttss2si -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_float@plt>
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
ja     1154 <main+0x34>
xor    %edi,%edi
ucomiss 0xec1(%rip),%xmm0
seta   %dil
movss  %xmm0,0xc(%rsp)
call   1030 <__VERIFIER_assert@plt>
cvttss2si 0xc(%rsp),%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call float (...) @__VERIFIER_nondet_float()
store float %3, float* %2
%4 = load float, float* %2
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 0, i32* %1
br label %14
7: ; preds = %0
%8 = load float, float* %2
%9 = fcmp ogt float %8, 1.000000e+00
%10 = zext i1 %9 to i32
%11 = call i32 @__VERIFIER_assert(i32 %10)
%12 = load float, float* %2
%13 = fptosi float %12 to i32
store i32 %13, i32* %1
br label %14
14: ; preds = %7, %6
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call float (...) @__VERIFIER_nondet_float()
%2 = fcmp olt float %1, 0.000000e+00
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = fcmp ogt float %1, 1.000000e+00
%5 = zext i1 %4 to i32
%6 = tail call i32 @__VERIFIER_assert(i32 %5)
%7 = fptosi float %1 to i32
br label %8
8: ; preds = %0, %3
%9 = phi i32 [ %7, %3 ], [ 0, %0 ]
ret i32 %9
}
/* Variables and functions */
int reset_shell_mode();
int wrap_reset_shell_mode(void) { return reset_shell_mode(); }


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

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

LLVM IR (-O0):
define i32 @wrap_reset_shell_mode() {
%1 = call i32 (...) @reset_shell_mode()
ret i32 %1
}

LLVM IR (-O2):
define i32 @wrap_reset_shell_mode() {
%1 = tail call i32 (...) @reset_shell_mode()
ret i32 %1
}
/* Variables and functions */
int Calculator_add(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char *argv[]) {
  printf("The sum is %i\n", Calculator_add(2, 3));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"The sum is %i\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @Calculator_add(i32 2, i32 3)
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"The sum is %i\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @Calculator_add(i32 2, i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
int lg(int n) {
  int i;
  for (i = 0; n > 0; ++i, n /= 2)
    ;
  return i;
}


x86 assembly (clang, -O0):
<lg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1139 <lg+0x39>
jmp    111d <lg+0x1d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <lg+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lg>:
xor    %eax,%eax
test   %edi,%edi
jle    111c <lg+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
shr    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <lg+0x10>
ret

LLVM IR (-O0):
define i32 @lg(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %4
br label %8
8: ; preds = %7
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = sdiv i32 %11, 2
store i32 %12, i32* %2
br label %4
13: ; preds = %4
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @lg(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = lshr i32 %5, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ xio_objpool_free(void *);
void xio_context_msg_pool_put(void *obj) { xio_objpool_free(obj); }


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

x86 assembly (clang, -O2):
<xio_context_msg_pool_put>:
jmp    1030 <xio_objpool_free@plt>

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

LLVM IR (-O2):
define void @xio_context_msg_pool_put(i8* %0) {
%2 = tail call i32 @xio_objpool_free(i8* %0)
ret void
}
/* Variables and functions */
int is_prime(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  printf("num=");
  scanf("%d", &num);
  printf("%d\n", is_prime(num));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <is_prime@plt>
mov    %eax,%esi
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <is_prime@plt>
lea    0xea8(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"num=\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @is_prime(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
void UARTXON1XOFF1ValProgram(unsigned int baseAdd, unsigned char xon1Value,
                             unsigned char xoff1Value) {
  (*((volatile unsigned int *)(baseAdd + (0x10)))) = xon1Value;
  (*((volatile unsigned int *)(baseAdd + (0x18)))) = xoff1Value;
}


x86 assembly (clang, -O0):
<UARTXON1XOFF1ValProgram>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %edi,-0x4(%rbp)
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
movzbl -0x5(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x10,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
movzbl -0x6(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x18,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTXON1XOFF1ValProgram>:
lea    0x10(%rdi),%eax
mov    %esi,(%rax)
add    $0x18,%edi
mov    %edx,(%rdi)
ret

LLVM IR (-O0):
define void @UARTXON1XOFF1ValProgram(i32 %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8
store i32 %0, i32* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %5
%8 = zext i8 %7 to i32
%9 = load i32, i32* %4
%10 = add i32 %9, 16
%11 = zext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
store volatile i32 %8, i32* %12
%13 = load i8, i8* %6
%14 = zext i8 %13 to i32
%15 = load i32, i32* %4
%16 = add i32 %15, 24
%17 = zext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
store volatile i32 %14, i32* %18
ret void
}

LLVM IR (-O2):
define void @UARTXON1XOFF1ValProgram(i32 %0, i8 zeroext %1, i8 zeroext %2) {
%4 = zext i8 %1 to i32
%5 = add i32 %0, 16
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
store volatile i32 %4, i32* %7
%8 = zext i8 %2 to i32
%9 = add i32 %0, 24
%10 = zext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
store volatile i32 %8, i32* %11
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
long sys_set_thread_area(va_list ap) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @sys_set_thread_area(i32 %0) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int, int, int);
void C67_CMPGT(int s1, int s2, int dst) { C67_asm("CMPGT.L1", s1, s2, dst); }


x86 assembly (clang, -O0):
<C67_CMPGT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xecf(%rip),%rdi
call   1030 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_CMPGT>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xee3(%rip),%rdi
jmp    1030 <C67_asm@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"CMPGT.L1\00"
define void @C67_CMPGT(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @C67_asm(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"CMPGT.L1\00"
define void @C67_CMPGT(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @C67_asm(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int setuidx(int, int /*<<< orphan*/);
int __seteuid(uid_t uid) { return setuidx(0x01, uid); }


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

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

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

LLVM IR (-O2):
define i32 @__seteuid(i32 %0) {
%2 = tail call i32 @setuidx(i32 1, i32 %0)
ret i32 %2
}
char unescapeURLchar(char c1, char c2) {
  register char c;
  c = (c1 >= 'A') ? ((c1 & 0xdf) - 'A') + 10 : (c1 - '0');
  c *= 16;
  c += (c2 >= 'A') ? ((c2 & 0xdf) - 'A') + 10 : (c2 - '0');
  return c;
}


x86 assembly (clang, -O0):
<unescapeURLchar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1134 <unescapeURLchar+0x34>
movsbl -0x1(%rbp),%eax
and    $0xdf,%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
jmp    113e <unescapeURLchar+0x3e>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x3(%rbp)
movsbl -0x3(%rbp),%eax
shl    $0x4,%eax
mov    %al,-0x3(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     1172 <unescapeURLchar+0x72>
movsbl -0x2(%rbp),%eax
and    $0xdf,%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0xc(%rbp)
jmp    117c <unescapeURLchar+0x7c>
movsbl -0x2(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
movsbl -0x3(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x3(%rbp)
movsbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unescapeURLchar>:
mov    %esi,%eax
and    $0xdf,%al
add    $0xc9,%al
lea    -0x30(%rsi),%ecx
cmp    $0x41,%sil
movzbl %cl,%ecx
movzbl %al,%edx
cmovl  %ecx,%edx
mov    %edi,%eax
shl    $0x4,%al
lea    -0x70(%rax),%ecx
cmp    $0x41,%dil
movzbl %al,%esi
movzbl %cl,%eax
cmovl  %esi,%eax
add    %dl,%al
ret

LLVM IR (-O0):
define signext i8 @unescapeURLchar(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = icmp sge i32 %7, 65
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = and i32 %11, 223
%13 = sub nsw i32 %12, 65
%14 = add nsw i32 %13, 10
br label %19
15: ; preds = %2
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = sub nsw i32 %17, 48
br label %19
19: ; preds = %15, %9
%20 = phi i32 [ %14, %9 ], [ %18, %15 ]
%21 = trunc i32 %20 to i8
store i8 %21, i8* %5
%22 = load i8, i8* %5
%23 = sext i8 %22 to i32
%24 = mul nsw i32 %23, 16
%25 = trunc i32 %24 to i8
store i8 %25, i8* %5
%26 = load i8, i8* %4
%27 = sext i8 %26 to i32
%28 = icmp sge i32 %27, 65
br i1 %28, label %29, label %35
29: ; preds = %19
%30 = load i8, i8* %4
%31 = sext i8 %30 to i32
%32 = and i32 %31, 223
%33 = sub nsw i32 %32, 65
%34 = add nsw i32 %33, 10
br label %39
35: ; preds = %19
%36 = load i8, i8* %4
%37 = sext i8 %36 to i32
%38 = sub nsw i32 %37, 48
br label %39
39: ; preds = %35, %29
%40 = phi i32 [ %34, %29 ], [ %38, %35 ]
%41 = load i8, i8* %5
%42 = sext i8 %41 to i32
%43 = add nsw i32 %42, %40
%44 = trunc i32 %43 to i8
store i8 %44, i8* %5
%45 = load i8, i8* %5
ret i8 %45
}

LLVM IR (-O2):
define signext i8 @unescapeURLchar(i8 signext %0, i8 signext %1) {
%3 = icmp sgt i8 %0, 64
%4 = icmp sgt i8 %1, 64
%5 = and i8 %1, -33
%6 = add i8 %5, -55
%7 = add i8 %1, -48
%8 = select i1 %4, i8 %6, i8 %7
%9 = shl i8 %0, 4
%10 = add i8 %9, -112
%11 = select i1 %3, i8 %10, i8 %9
%12 = add i8 %8, %11
ret i8 %12
}
int HEAPleft(int npos) { return npos * 2 + 1; }


x86 assembly (clang, -O0):
<HEAPleft>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HEAPleft>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @HEAPleft(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ request_free(void *);
void _free_request(void *data) { request_free(data); }


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

x86 assembly (clang, -O2):
<_free_request>:
jmp    1030 <request_free@plt>

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

LLVM IR (-O2):
define void @_free_request(i8* %0) {
%2 = tail call i32 @request_free(i8* %0)
ret void
}
/* Variables and functions */
char *strdup(char *);
void return_string_arg_test(const char **str) {
  *str = strdup("return string arg test");
}


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

x86 assembly (clang, -O2):
<return_string_arg_test>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <strdup@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"return string arg test\00"
define void @return_string_arg_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i8* @strdup(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = load i8**, i8*** %2
store i8* %3, i8** %4
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"return string arg test\00"
define void @return_string_arg_test(i8** nocapture writeonly %0) {
%2 = tail call dereferenceable_or_null(23) i8* @strdup(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %0
ret void
}
char *return_tag(theword)
char *theword;
{
  char *tempword;
  tempword = (char *)strchr(theword, '/');
  if (tempword != 0)
    return (tempword + 1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<return_tag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114a <return_tag+0x3a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <return_tag+0x42>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_tag>:
push   %rax
mov    $0x2f,%esi
call   1030 <strchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmovne %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @return_tag(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strchr(i8* %5, i32 47)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8* %11, i8** %2
br label %13
12: ; preds = %1
store i8* null, i8** %2
br label %13
13: ; preds = %12, %9
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
define i8* @return_tag(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* null, i8* %4
ret i8* %5
}