xunge/DecIR huggingface dataset:
/* Variables and functions */
char *getenv(char *);
scalar_t__ strcmp(char *, char *);
int _tklog_detect_colors(void) {
  char *xcode_colors = getenv("XcodeColors");
  if (xcode_colors && (strcmp(xcode_colors, "YES") == 0)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<_tklog_detect_colors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1169 <_tklog_detect_colors+0x49>
mov    -0x10(%rbp),%rdi
lea    0xebe(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1169 <_tklog_detect_colors+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1170 <_tklog_detect_colors+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_tklog_detect_colors>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1146 <_tklog_detect_colors+0x26>
lea    0xed3(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     114a <_tklog_detect_colors+0x2a>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"XcodeColors\00"
@.str.1 = [4 x i8] c"YES\00"
define i32 @_tklog_detect_colors() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %11
6: ; preds = %0
%7 = load i8*, i8** %2
%8 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %6
store i32 1, i32* %1
br label %12
11: ; preds = %6, %0
store i32 0, i32* %1
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [12 x i8] c"XcodeColors\00"
@.str.1 = [4 x i8] c"YES\00"
define i32 @_tklog_detect_colors() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %3, %0
br label %7
7: ; preds = %3, %6
%8 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %8
}
/* Variables and functions */
int ns_add(int, int);
int main(int argc, char **argv) { return ns_add(1, 2); }


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    $0x1,%edi
mov    $0x2,%esi
call   1030 <ns_add@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @ns_add(i32 1, i32 2)
ret i32 %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @ns_add(i32 1, i32 2)
ret i32 %3
}
/* Type definitions */
typedef int socklen_t;
typedef int /*<<< orphan*/ connres;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_ERROR;
int getsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int *);
int main(int argc, char *argv[]) {
  int connres;
  socklen_t connressize = sizeof(connres);
  int res, sockfd = 0;
  res = getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &connres, &connressize);
  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)
movl   $0x4,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%edi
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
mov    0x2e91(%rip),%rax
mov    (%rax),%edx
lea    -0x14(%rbp),%rcx
lea    -0x18(%rbp),%r8
call   1030 <getsockopt@plt>
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x4,(%rsp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
mov    0x2eb0(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    %rsp,%r8
xor    %edi,%edi
call   1030 <getsockopt@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_ERROR = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 4, i32* %7
store i32 0, i32* %9
%10 = load i32, i32* %9
%11 = load i32, i32* @SOL_SOCKET
%12 = load i32, i32* @SO_ERROR
%13 = call i32 @getsockopt(i32 %10, i32 %11, i32 %12, i32* %6, i32* %7)
store i32 %13, i32* %8
ret i32 0
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_ERROR = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
store i32 4, i32* %4
%7 = load i32, i32* @SOL_SOCKET
%8 = load i32, i32* @SO_ERROR
%9 = call i32 @getsockopt(i32 0, i32 %7, i32 %8, i32* %3, i32* %4)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ chr1setBank5(int);
void m80setParams7EF3(uint16_t addr, uint8_t val) {
  (void)addr;
  chr1setBank5(val << 10);
}


x86 assembly (clang, -O0):
<m80setParams7EF3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
shl    $0xa,%edi
call   1030 <chr1setBank5@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m80setParams7EF3>:
mov    %esi,%edi
shl    $0xa,%edi
jmp    1030 <chr1setBank5@plt>

LLVM IR (-O0):
define void @m80setParams7EF3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %6, 10
%8 = call i32 @chr1setBank5(i32 %7)
ret void
}

LLVM IR (-O2):
define void @m80setParams7EF3(i32 %0, i32 %1) {
%3 = shl i32 %1, 10
%4 = tail call i32 @chr1setBank5(i32 %3)
ret void
}
/* Type definitions */
struct mdea_object {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mdea_error(char **, char *);
int mdea_boolean_node_get_object(void *p, struct mdea_object **object,
                                 char **error) {
  mdea_error(error, "Expected object, got boolean");
  return -1;
}


x86 assembly (clang, -O0):
<mdea_boolean_node_get_object>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xed1(%rip),%rsi
call   1030 <mdea_error@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdea_boolean_node_get_object>:
push   %rax
mov    %rdx,%rdi
lea    0xee5(%rip),%rsi
call   1030 <mdea_error@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.mdea_object = type { i32 }
@.str = [29 x i8] c"Expected object, got boolean\00"
define i32 @mdea_boolean_node_get_object(i8* %0, %struct.mdea_object** %1, i8** %2) {
%4 = alloca i8*
%5 = alloca %struct.mdea_object**
%6 = alloca i8**
store i8* %0, i8** %4
store %struct.mdea_object** %1, %struct.mdea_object*** %5
store i8** %2, i8*** %6
%7 = load i8**, i8*** %6
%8 = call i32 @mdea_error(i8** %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
%struct.mdea_object = type { i32 }
@.str = [29 x i8] c"Expected object, got boolean\00"
define i32 @mdea_boolean_node_get_object(i8* nocapture readnone %0, %struct.mdea_object** nocapture readnone %1, i8** %2) {
%4 = tail call i32 @mdea_error(i8** %2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Type definitions */
struct cli_assembler_compile_result {
  int dummy;
};
struct cli_assembler {
  int dummy;
};

/* Variables and functions */
int cli_assembler_implementation_compile(struct cli_assembler *, char const *,
                                         size_t,
                                         struct cli_assembler_compile_result *);
int cli_assembler_compile(struct cli_assembler *assembler, const char *assembly,
                          size_t assembly_size,
                          struct cli_assembler_compile_result *result) {
  return cli_assembler_implementation_compile(assembler, assembly,
                                              assembly_size, result);
}


x86 assembly (clang, -O0):
<cli_assembler_compile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <cli_assembler_implementation_compile@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_assembler_compile>:
jmp    1030 <cli_assembler_implementation_compile@plt>

LLVM IR (-O0):
%struct.cli_assembler = type { i32 }
%struct.cli_assembler_compile_result = type { i32 }
define i32 @cli_assembler_compile(%struct.cli_assembler* %0, i8* %1, i64 %2, %struct.cli_assembler_compile_result* %3) {
%5 = alloca %struct.cli_assembler*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca %struct.cli_assembler_compile_result*
store %struct.cli_assembler* %0, %struct.cli_assembler** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store %struct.cli_assembler_compile_result* %3, %struct.cli_assembler_compile_result** %8
%9 = load %struct.cli_assembler*, %struct.cli_assembler** %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = load %struct.cli_assembler_compile_result*, %struct.cli_assembler_compile_result** %8
%13 = call i32 @cli_assembler_implementation_compile(%struct.cli_assembler* %9, i8* %10, i64 %11, %struct.cli_assembler_compile_result* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.cli_assembler = type { i32 }
%struct.cli_assembler_compile_result = type { i32 }
define i32 @cli_assembler_compile(%struct.cli_assembler* %0, i8* %1, i64 %2, %struct.cli_assembler_compile_result* %3) {
%5 = tail call i32 @cli_assembler_implementation_compile(%struct.cli_assembler* %0, i8* %1, i64 %2, %struct.cli_assembler_compile_result* %3)
ret i32 %5
}
/* Type definitions */
struct cdrom_device_info {
  int dummy;
};

/* Variables and functions */
int cdrom_media_erasable(struct cdrom_device_info *);
int cdrom_dvdram_open_write(struct cdrom_device_info *cdi) {
  int ret;
  int tmp;
  tmp = cdrom_media_erasable(cdi);
  ret = tmp;
  if (!ret) {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<cdrom_dvdram_open_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <cdrom_media_erasable@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1144 <cdrom_dvdram_open_write+0x34>
movl   $0x1,-0x4(%rbp)
jmp    114b <cdrom_dvdram_open_write+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdrom_dvdram_open_write>:
push   %rax
call   1030 <cdrom_media_erasable@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.cdrom_device_info = type { i32 }
define i32 @cdrom_dvdram_open_write(%struct.cdrom_device_info* %0) {
%2 = alloca i32
%3 = alloca %struct.cdrom_device_info*
%4 = alloca i32
%5 = alloca i32
store %struct.cdrom_device_info* %0, %struct.cdrom_device_info** %3
%6 = load %struct.cdrom_device_info*, %struct.cdrom_device_info** %3
%7 = call i32 @cdrom_media_erasable(%struct.cdrom_device_info* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %1
store i32 1, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.cdrom_device_info = type { i32 }
define i32 @cdrom_dvdram_open_write(%struct.cdrom_device_info* %0) {
%2 = tail call i32 @cdrom_media_erasable(%struct.cdrom_device_info* %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int str_length(char *s) {
  int len;
  for (len = 0; s[len] != '\0'; len++)
    ;
  return len;
}


x86 assembly (clang, -O0):
<str_length>:
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     1137 <str_length+0x37>
jmp    1129 <str_length+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <str_length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @str_length(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %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 %16
12: ; preds = %4
br label %13
13: ; preds = %12
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %4
16: ; preds = %4
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @str_length(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 */
int /*<<< orphan*/ ipod_init_backlight();
int /*<<< orphan*/ ipod_init_input();
int /*<<< orphan*/ ipod_init_sound();
void ipod_init() {
  ipod_init_sound();
  ipod_init_input();
  ipod_init_backlight();
}


x86 assembly (clang, -O0):
<ipod_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <ipod_init_sound@plt>
mov    $0x0,%al
call   1030 <ipod_init_input@plt>
mov    $0x0,%al
call   1050 <ipod_init_backlight@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipod_init>:
push   %rax
xor    %eax,%eax
call   1040 <ipod_init_sound@plt>
xor    %eax,%eax
call   1030 <ipod_init_input@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <ipod_init_backlight@plt>

LLVM IR (-O0):
define void @ipod_init() {
%1 = call i32 (...) @ipod_init_sound()
%2 = call i32 (...) @ipod_init_input()
%3 = call i32 (...) @ipod_init_backlight()
ret void
}

LLVM IR (-O2):
define void @ipod_init() {
%1 = tail call i32 (...) @ipod_init_sound()
%2 = tail call i32 (...) @ipod_init_input()
%3 = tail call i32 (...) @ipod_init_backlight()
ret void
}
void setup_stack_canary_segment(int cpu) {}


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

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

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

LLVM IR (-O2):
define void @setup_stack_canary_segment(i32 %0) {
ret void
}
int conf_begin(void) {
  static int seq = 0;
  return (++seq);
}


x86 assembly (clang, -O0):
<conf_begin>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f11(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<conf_begin>:
mov    0x2f1e(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f15(%rip)
ret

LLVM IR (-O0):
@conf_begin.seq = internal global i32 0
define i32 @conf_begin() {
%1 = load i32, i32* @conf_begin.seq
%2 = add nsw i32 %1, 1
store i32 %2, i32* @conf_begin.seq
ret i32 %2
}

LLVM IR (-O2):
@conf_begin.seq = internal unnamed_addr global i32 0
define i32 @conf_begin() {
%1 = load i32, i32* @conf_begin.seq
%2 = add nsw i32 %1, 1
store i32 %2, i32* @conf_begin.seq
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int _unlink(const char *name) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<_unlink>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @_unlink(i8* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void seppuku(int rc, int desired) {
  if (rc != desired) {
    exit(rc);
  }
}


x86 assembly (clang, -O0):
<seppuku>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1132 <seppuku+0x22>
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seppuku>:
cmp    %esi,%edi
jne    1115 <seppuku+0x5>
ret
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @seppuku(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @exit(i32 %0)
unreachable
6: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double b, h;
  scanf("%lf", &b);
  scanf("%lf", &h);
  double volume = b * h / 3;
  printf("O VOLUME DA PIRAMIDE E = %0.2f\n", volume);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec2(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xe9f(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xedc(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
mulsd  (%rsp),%xmm0
divsd  0xea9(%rip),%xmm0
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [32 x i8] c"O VOLUME DA PIRAMIDE E = %0.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%7 = load double, double* %2
%8 = load double, double* %3
%9 = fmul double %7, %8
%10 = fdiv double %9, 3.000000e+00
store double %10, double* %4
%11 = load double, double* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), double %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [32 x i8] c"O VOLUME DA PIRAMIDE E = %0.2f\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%7 = load double, double* %1
%8 = load double, double* %2
%9 = fmul double %7, %8
%10 = fdiv double %9, 3.000000e+00
%11 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), double %10)
ret i32 0
}
/* Variables and functions */
float pow(float, float);
int /*<<< orphan*/ show_fe_exceptions();
float _pow(float operando1, float operando2) {
  float result = pow(operando1, operando2);
  show_fe_exceptions();
  return result;
}


x86 assembly (clang, -O0):
<_pow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1040 <pow@plt>
movss  %xmm0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <show_fe_exceptions@plt>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_pow>:
push   %rax
call   1040 <pow@plt>
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1030 <show_fe_exceptions@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @_pow(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = call float @pow(float %6, float %7)
store float %8, float* %5
%9 = call i32 (...) @show_fe_exceptions()
%10 = load float, float* %5
ret float %10
}

LLVM IR (-O2):
define float @_pow(float %0, float %1) {
%3 = tail call float @pow(float %0, float %1)
%4 = tail call i32 (...) @show_fe_exceptions()
ret float %3
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
time_t mktime(struct tm *timeptr) { return (time_t)(-1); }


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

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

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

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @mktime(%struct.tm* nocapture readnone %0) {
ret i32 -1
}
void pthread_mutex_lock() {}


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

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

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

LLVM IR (-O2):
define void @pthread_mutex_lock() {
ret void
}
unsigned xrop3_90_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  stk1 = D ^ T;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_90_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_90_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
xor    $0xff,%ecx
not    %eax
and    %ecx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_90_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
store i32 %14, i32* %6
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 8
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
store i32 %20, i32* %7
%21 = load i32, i32* %5
%22 = load i32, i32* %7
%23 = xor i32 %21, %22
store i32 %23, i32* %8
%24 = load i32, i32* %8
%25 = load i32, i32* %6
%26 = xor i32 %25, -1
%27 = and i32 %24, %26
%28 = load i32, i32* %5
%29 = load i32, i32* %6
%30 = and i32 %28, %29
%31 = or i32 %27, %30
ret i32 %31
}

LLVM IR (-O2):
define i32 @xrop3_90_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %6, 255
%8 = xor i32 %4, -1
%9 = and i32 %7, %8
%10 = or i32 %9, %3
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void ekg_oom_handler() {
  printf("braklo pamieci\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"braklo pamieci\0A\00"
define void @ekg_oom_handler() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [15 x i8] c"braklo pamieci\00"
define void @ekg_oom_handler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
int main() {
  int **a;
  int *b;
  int c = 24;
  b = &c;
  a = &b;
  return **a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x18,-0x1c(%rbp)
lea    -0x1c(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32**
%3 = alloca i32*
%4 = alloca i32
store i32 0, i32* %1
store i32 24, i32* %4
store i32* %4, i32** %3
store i32** %3, i32*** %2
%5 = load i32**, i32*** %2
%6 = load i32*, i32** %5
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
ret i32 24
}
int SemInit(int sem_count) {
  int sid;
  asm("movl %1, %%eax; int $51; movl %%eax, %0"
      : "=g"(sid)
      : "g"(sem_count)
      : "eax");
  return sid;
}


x86 assembly (clang, -O0):
<SemInit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
int    $0x33
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SemInit>:
mov    %edi,-0x8(%rsp)
mov    -0x8(%rsp),%eax
int    $0x33
mov    %eax,-0x4(%rsp)
mov    -0x4(%rsp),%eax
ret

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

LLVM IR (-O2):
define i32 @SemInit(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* %2
ret i32 %4
}
float isotropic_phase_func(float mu) { return 1. / 4. * 3.14159265359; }


x86 assembly (clang, -O0):
<isotropic_phase_func>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<isotropic_phase_func>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @isotropic_phase_func(float %0) {
%2 = alloca float
store float %0, float* %2
ret float 0x3FE921FB60000000
}

LLVM IR (-O2):
define float @isotropic_phase_func(float %0) {
ret float 0x3FE921FB60000000
}
/* Variables and functions */
int WHILEBODY();
void WHILE(int condition) {
  while (condition) {
    condition = WHILEBODY();
  }
}


x86 assembly (clang, -O0):
<WHILE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1134 <WHILE+0x24>
mov    $0x0,%al
call   1030 <WHILEBODY@plt>
mov    %eax,-0x4(%rbp)
jmp    111b <WHILE+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WHILE>:
push   %rax
test   %edi,%edi
je     112b <WHILE+0x1b>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1030 <WHILEBODY@plt>
test   %eax,%eax
jne    1120 <WHILE+0x10>
pop    %rax
ret

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

LLVM IR (-O2):
define void @WHILE(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1, %3
%4 = tail call i32 (...) @WHILEBODY()
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %3
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_stream_proplist_remove() {
  printf("NOT IMPLEMENTED:"
         "pa_stream_proplist_remove"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [42 x i8] c"NOT IMPLEMENTED:pa_stream_proplist_remove\00"
define i32 @pa_stream_proplist_remove() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int b(int x, int y) {
  int a;
  int b;
  int c;
  c = x + y;
  return 0;
}


x86 assembly (clang, -O0):
<b>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @b(i32 %0, i32 %1) {
ret i32 0
}
void clear_bit(int nr, volatile void *addr) {
  ((unsigned char *)addr)[nr / 8] &= ~(1UL << (nr % 8));
}


x86 assembly (clang, -O0):
<clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    %eax,%ecx
mov    $0x1,%esi
shl    %cl,%rsi
xor    $0xffffffffffffffff,%rsi
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
and    %rsi,%rdx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_bit>:
mov    %edi,%ecx
lea    0x7(%rcx),%eax
test   %edi,%edi
cmovns %edi,%eax
mov    %eax,%edx
and    $0xfffffff8,%edx
sub    %edx,%ecx
mov    $0x1,%edx
shl    %cl,%rdx
sar    $0x3,%eax
cltq
not    %dl
and    %dl,(%rsi,%rax,1)
ret

LLVM IR (-O0):
define void @clear_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = srem i32 %5, 8
%7 = zext i32 %6 to i64
%8 = shl i64 1, %7
%9 = xor i64 %8, -1
%10 = load i8*, i8** %4
%11 = load i32, i32* %3
%12 = sdiv i32 %11, 8
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %10, i64 %13
%15 = load i8, i8* %14
%16 = zext i8 %15 to i64
%17 = and i64 %16, %9
%18 = trunc i64 %17 to i8
store i8 %18, i8* %14
ret void
}

LLVM IR (-O2):
define void @clear_bit(i32 %0, i8* nocapture %1) {
%3 = srem i32 %0, 8
%4 = zext i32 %3 to i64
%5 = shl nuw i64 1, %4
%6 = sdiv i32 %0, 8
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %1, i64 %7
%9 = load i8, i8* %8
%10 = trunc i64 %5 to i8
%11 = xor i8 %10, -1
%12 = and i8 %9, %11
store i8 %12, i8* %8
ret void
}
int _return_0() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @_return_0() {
ret i32 0
}
/* Variables and functions */
size_t taa_ui_count_font_vertices(const char *txt, size_t txtlen) {
  return txtlen * 6;
}


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

x86 assembly (clang, -O2):
<taa_ui_count_font_vertices>:
add    %rsi,%rsi
lea    (%rsi,%rsi,2),%rax
ret

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

LLVM IR (-O2):
define i64 @taa_ui_count_font_vertices(i8* nocapture readnone %0, i64 %1) {
%3 = mul i64 %1, 6
ret i64 %3
}
int selinux_xfrm_enabled(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @selinux_xfrm_enabled() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _mvaddnstr(int, int, char *, int);
void target(int x, int y) { _mvaddnstr(y, x, "\x1b[1;46;32m¡¤", 2); }


x86 assembly (clang, -O0):
<target>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
lea    0xed5(%rip),%rdx
mov    $0x2,%ecx
call   1030 <_mvaddnstr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<target>:
mov    %edi,%eax
lea    0xee7(%rip),%rdx
mov    %esi,%edi
mov    %eax,%esi
mov    $0x2,%ecx
jmp    1030 <_mvaddnstr@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"\1B[1;46;32m\C2\A1\C2\A4\00"
define void @target(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @_mvaddnstr(i32 %5, i32 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"\1B[1;46;32m\C2\A1\C2\A4\00"
define void @target(i32 %0, i32 %1) {
%3 = tail call i32 @_mvaddnstr(i32 %1, i32 %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}
int sum2(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<sum2>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @sum2(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
letnum(c) {
  if (letter(c) || (c >= '0' && c <= '9'))
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<letnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <letter@plt>
cmp    $0x0,%eax
jne    1142 <letnum+0x32>
cmpl   $0x30,-0x8(%rbp)
jl     114e <letnum+0x3e>
cmpl   $0x39,-0x8(%rbp)
jg     114e <letnum+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1155 <letnum+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<letnum>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <letter@plt>
test   %eax,%eax
setne  %al
add    $0xffffffd0,%ebx
cmp    $0xa,%ebx
setb   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @letnum(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, ...) bitcast (i32 (...)* @letter to i32 (i32, ...)*)(i32 %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sge i32 %8, 48
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load i32, i32* %3
%12 = icmp sle i32 %11, 57
br i1 %12, label %13, label %14
13: ; preds = %10, %1
store i32 1, i32* %2
br label %15
14: ; preds = %10, %7
store i32 0, i32* %2
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @letnum(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @letter to i32 (i32, ...)*)(i32 %0)
%3 = icmp ne i32 %2, 0
%4 = add i32 %0, -48
%5 = icmp ult i32 %4, 10
%6 = or i1 %5, %3
%7 = zext i1 %6 to i32
ret i32 %7
}
int mbuffer_system_init() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mbuffer_system_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ um_crti();
int /*<<< orphan*/ um_halt();
int /*<<< orphan*/ um_ipl(int, char **);
int umc_start();
int main(int argc, char **argv) {
  int x;
  um_ipl(argc, argv);
  um_crti();
  x = umc_start();
  um_halt();
  return x;
}


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <um_ipl@plt>
mov    $0x0,%al
call   1040 <um_crti@plt>
mov    $0x0,%al
call   1030 <umc_start@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1060 <um_halt@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
call   1050 <um_ipl@plt>
xor    %eax,%eax
call   1040 <um_crti@plt>
xor    %eax,%eax
call   1030 <umc_start@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <um_halt@plt>
mov    %ebx,%eax
pop    %rbx
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 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 @um_ipl(i32 %7, i8** %8)
%10 = call i32 (...) @um_crti()
%11 = call i32 (...) @umc_start()
store i32 %11, i32* %6
%12 = call i32 (...) @um_halt()
%13 = load i32, i32* %6
ret i32 %13
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @um_ipl(i32 %0, i8** %1)
%4 = tail call i32 (...) @um_crti()
%5 = tail call i32 (...) @umc_start()
%6 = tail call i32 (...) @um_halt()
ret i32 %5
}
char itoc(const int source) {
  if ((source >= 0) && (source <= 9)) {
    return ('0' + source);
  } else {
    return ('A' + (source - 10));
  }
}


x86 assembly (clang, -O0):
<itoc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1129 <itoc+0x29>
cmpl   $0x9,-0x8(%rbp)
jg     1129 <itoc+0x29>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1135 <itoc+0x35>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
add    $0x41,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoc>:
cmp    $0xa,%edi
mov    $0x30,%ecx
mov    $0x37,%eax
cmovb  %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @itoc(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 9
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 48, %10
%12 = trunc i32 %11 to i8
store i8 %12, i8* %2
br label %18
13: ; preds = %6, %1
%14 = load i32, i32* %3
%15 = sub nsw i32 %14, 10
%16 = add nsw i32 65, %15
%17 = trunc i32 %16 to i8
store i8 %17, i8* %2
br label %18
18: ; preds = %13, %9
%19 = load i8, i8* %2
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @itoc(i32 %0) {
%2 = icmp ult i32 %0, 10
%3 = trunc i32 %0 to i8
%4 = select i1 %2, i8 48, i8 55
%5 = add i8 %4, %3
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ breakpt();
int /*<<< orphan*/ sleep(int);
void go_parent() {
  breakpt();
  while (1)
    sleep(1);
}


x86 assembly (clang, -O0):
<go_parent>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <breakpt@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    112b <go_parent+0xb>

x86 assembly (clang, -O2):
<go_parent>:
push   %rax
xor    %eax,%eax
call   1030 <breakpt@plt>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1130 <go_parent+0x10>

LLVM IR (-O0):
define void @go_parent() {
%1 = call i32 (...) @breakpt()
br label %2
2: ; preds = %0, %2
%3 = call i32 @sleep(i32 1)
br label %2
}

LLVM IR (-O2):
define void @go_parent() {
%1 = tail call i32 (...) @breakpt()
br label %2
2: ; preds = %0, %2
%3 = tail call i32 @sleep(i32 1)
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void usage() { die("Usage: build bootsect setup system [> image]"); }


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

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

LLVM IR (-O0):
@.str = [45 x i8] c"Usage: build bootsect setup system [> image]\00"
define void @usage() {
%1 = call i32 @die(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"Usage: build bootsect setup system [> image]\00"
define void @usage() {
%1 = tail call i32 @die(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret void
}
float modulo(float num, int mod) {
  float result;
  int tmp;
  tmp = (int)(num / (float)mod);
  result = num - (float)(tmp * mod);
  if (result < 0)
    result += mod;
  return (result);
}


x86 assembly (clang, -O0):
<modulo>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%eax
imul   -0x8(%rbp),%eax
cvtsi2ss %eax,%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1156 <modulo+0x56>
cvtsi2ssl -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<modulo>:
cvtsi2ss %edi,%xmm1
movaps %xmm0,%xmm2
divss  %xmm1,%xmm2
cvttss2si %xmm2,%eax
imul   %edi,%eax
xorps  %xmm2,%xmm2
cvtsi2ss %eax,%xmm2
subss  %xmm2,%xmm0
xorps  %xmm2,%xmm2
movaps %xmm0,%xmm3
cmpltss %xmm2,%xmm3
andps  %xmm3,%xmm1
movss  0xecd(%rip),%xmm2
andnps %xmm2,%xmm3
orps   %xmm1,%xmm3
addss  %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @modulo(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
%5 = alloca float
%6 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%7 = load float, float* %3
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to float
%10 = fdiv float %7, %9
%11 = fptosi float %10 to i32
store i32 %11, i32* %6
%12 = load float, float* %3
%13 = load i32, i32* %6
%14 = load i32, i32* %4
%15 = mul nsw i32 %13, %14
%16 = sitofp i32 %15 to float
%17 = fsub float %12, %16
store float %17, float* %5
%18 = load float, float* %5
%19 = fcmp olt float %18, 0.000000e+00
br i1 %19, label %20, label %25
20: ; preds = %2
%21 = load i32, i32* %4
%22 = sitofp i32 %21 to float
%23 = load float, float* %5
%24 = fadd float %23, %22
store float %24, float* %5
br label %25
25: ; preds = %20, %2
%26 = load float, float* %5
ret float %26
}

LLVM IR (-O2):
define float @modulo(float %0, i32 %1) {
%3 = sitofp i32 %1 to float
%4 = fdiv float %0, %3
%5 = fptosi float %4 to i32
%6 = mul nsw i32 %5, %1
%7 = sitofp i32 %6 to float
%8 = fsub float %0, %7
%9 = fcmp olt float %8, 0.000000e+00
%10 = select i1 %9, float %3, float -0.000000e+00
%11 = fadd float %8, %10
ret float %11
}
/* Variables and functions */
int close(int);
int close_s(int fd) { return close(fd); }


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

x86 assembly (clang, -O2):
<close_s>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @close_s(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
double log(scalar_t__);
scalar_t__ sqrt(double);
double asech(double x) {
  double oneOverX = 1.0 / x;
  return log(oneOverX + sqrt(oneOverX * oneOverX - 1.0));
}


x86 assembly (clang, -O0):
<asech>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xed3(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea1(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  -0x18(%rbp),%xmm0
cvtsi2sd %rax,%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1030 <log@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asech>:
push   %rax
movsd  0xed7(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
addsd  0xec6(%rip),%xmm0
call   1040 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  (%rsp),%xmm0
cvttsd2si %xmm0,%rdi
pop    %rax
jmp    1030 <log@plt>

LLVM IR (-O0):
define double @asech(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fdiv double 1.000000e+00, %4
store double %5, double* %3
%6 = load double, double* %3
%7 = load double, double* %3
%8 = load double, double* %3
%9 = call double @llvm.fmuladd.f64(double %7, double %8, double -1.000000e+00)
%10 = call i64 @sqrt(double %9)
%11 = sitofp i64 %10 to double
%12 = fadd double %6, %11
%13 = fptosi double %12 to i64
%14 = call double @log(i64 %13)
ret double %14
}

LLVM IR (-O2):
define double @asech(double %0) {
%2 = fdiv double 1.000000e+00, %0
%3 = tail call double @llvm.fmuladd.f64(double %2, double %2, double -1.000000e+00)
%4 = tail call i64 @sqrt(double %3)
%5 = sitofp i64 %4 to double
%6 = fadd double %2, %5
%7 = fptosi double %6 to i64
%8 = tail call double @log(i64 %7)
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ Snake_Move();
int /*<<< orphan*/ set_ticker(int);
void sig_alrm(int singo) {
  set_ticker(500);
  Snake_Move();
}


x86 assembly (clang, -O0):
<sig_alrm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1f4,%edi
call   1030 <set_ticker@plt>
mov    $0x0,%al
call   1040 <Snake_Move@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_alrm>:
push   %rax
mov    $0x1f4,%edi
call   1030 <set_ticker@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <Snake_Move@plt>

LLVM IR (-O0):
define void @sig_alrm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @set_ticker(i32 500)
%4 = call i32 (...) @Snake_Move()
ret void
}

LLVM IR (-O2):
define void @sig_alrm(i32 %0) {
%2 = tail call i32 @set_ticker(i32 500)
%3 = tail call i32 (...) @Snake_Move()
ret void
}