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

/* Variables and functions */
char *bt_encodeMessage(struct irc_message_t *input) { return NULL; }


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

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

LLVM IR (-O0):
%struct.irc_message_t = type { i32 }
define i8* @bt_encodeMessage(%struct.irc_message_t* %0) {
%2 = alloca %struct.irc_message_t*
store %struct.irc_message_t* %0, %struct.irc_message_t** %2
ret i8* null
}

LLVM IR (-O2):
%struct.irc_message_t = type { i32 }
define noalias i8* @bt_encodeMessage(%struct.irc_message_t* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ stack_test_5();
int stack_so_deep() {
  stack_test_5();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @stack_so_deep() {
%1 = call i32 (...) @stack_test_5()
ret i32 0
}

LLVM IR (-O2):
define i32 @stack_so_deep() {
%1 = tail call i32 (...) @stack_test_5()
ret i32 0
}
void *__evil_const_cast(const void *p) { return (void *)p; }


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

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

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

LLVM IR (-O2):
define i8* @__evil_const_cast(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ testCommandHandler();
int /*<<< orphan*/ testNSNet();
int /*<<< orphan*/ testStringTable();
int main(int argc, char **argv) {
  testStringTable();
  testCommandHandler();
  testNSNet();
  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    $0x0,%al
call   1040 <testStringTable@plt>
mov    $0x0,%al
call   1030 <testCommandHandler@plt>
mov    $0x0,%al
call   1050 <testNSNet@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <testStringTable@plt>
xor    %eax,%eax
call   1030 <testCommandHandler@plt>
xor    %eax,%eax
call   1050 <testNSNet@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @testStringTable()
%7 = call i32 (...) @testCommandHandler()
%8 = call i32 (...) @testNSNet()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @testStringTable()
%4 = tail call i32 (...) @testCommandHandler()
%5 = tail call i32 (...) @testNSNet()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ do_output(char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ unknown_com();
void setSave(char *rel, char *filename) {
  if (strcmp(rel, "=") == 0) {
    do_output(filename);
  } else {
    unknown_com();
  }
}


x86 assembly (clang, -O0):
<setSave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1168 <setSave+0x38>
mov    -0x10(%rbp),%rdi
call   1050 <do_output@plt>
jmp    116f <setSave+0x3f>
mov    $0x0,%al
call   1030 <unknown_com@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setSave>:
push   %rbx
mov    %rsi,%rbx
lea    0xec5(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     114d <setSave+0x1d>
xor    %eax,%eax
pop    %rbx
jmp    1030 <unknown_com@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <do_output@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"=\00"
define void @setSave(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @do_output(i8* %1)
br label %9
7: ; preds = %2
%8 = tail call i32 (...) @unknown_com()
br label %9
9: ; preds = %7, %5
ret void
}
FUNCTION_DEFINE(debug_level) { PG_RETURN_INT32(DebugLevel()); }


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

x86 assembly (clang, -O2):
<FUNCTION_DEFINE>:
push   %rax
xor    %eax,%eax
call   1030 <DebugLevel@plt>
mov    %eax,%edi
xor    %eax,%eax
pop    %rcx
jmp    1040 <PG_RETURN_INT32@plt>

LLVM IR (-O0):
define i32 @FUNCTION_DEFINE(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (...) @DebugLevel()
%5 = call i32 (i32, ...) bitcast (i32 (...)* @PG_RETURN_INT32 to i32 (i32, ...)*)(i32 %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @FUNCTION_DEFINE(i32 %0) {
%2 = tail call i32 (...) @DebugLevel()
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @PG_RETURN_INT32 to i32 (i32, ...)*)(i32 %2)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
void convUint2char(void) { ol("ld\th,0"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"ld\09h,0\00"
define void @convUint2char() {
%1 = call i32 @ol(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"ld\09h,0\00"
define void @convUint2char() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int mkdir(char *, int);
int xmkdir(char *path) { return mkdir(path, 0644); }


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

x86 assembly (clang, -O2):
<xmkdir>:
mov    $0x1a4,%esi
jmp    1030 <mkdir@plt>

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

LLVM IR (-O2):
define i32 @xmkdir(i8* nocapture %0) {
%2 = tail call i32 @mkdir(i8* %0, i32 420)
ret i32 %2
}
int ft_str_is_uppercase(char *str) {
  char *tmp;
  tmp = str;
  while (*tmp) {
    if (*tmp < 'A' || *tmp > 'Z')
      return (0);
    tmp++;
  }
  return (1);
}


x86 assembly (clang, -O0):
<ft_str_is_uppercase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <ft_str_is_uppercase+0x5a>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     113d <ft_str_is_uppercase+0x3d>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jle    1149 <ft_str_is_uppercase+0x49>
movl   $0x0,-0x4(%rbp)
jmp    1161 <ft_str_is_uppercase+0x61>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1110 <ft_str_is_uppercase+0x10>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_str_is_uppercase>:
mov    (%rdi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1123 <ft_str_is_uppercase+0x23>
add    $0x1,%rdi
nop
add    $0xa5,%cl
cmp    $0xe5,%cl
jbe    1124 <ft_str_is_uppercase+0x24>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <ft_str_is_uppercase+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_str_is_uppercase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = add i8 %8, -91
%11 = icmp ult i8 %10, -26
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
void setpassent(i) int i;
{}


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

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

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

LLVM IR (-O2):
define void @setpassent(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mbstate_t;

/* Variables and functions */
int /*<<< orphan*/ mbrlen(char const *, size_t, int /*<<< orphan*/ *);
void nullPointer_mbrlen(const char *p, size_t m, mbstate_t *s) {
  (void)mbrlen(NULL, m, s);
  (void)mbrlen(NULL, 0, s);
  (void)mbrlen(p, m, NULL);
}


x86 assembly (clang, -O0):
<nullPointer_mbrlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%edi
call   1030 <mbrlen@plt>
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%esi
mov    %rsi,%rdi
call   1030 <mbrlen@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <mbrlen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nullPointer_mbrlen>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %edi,%edi
call   1030 <mbrlen@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <mbrlen@plt>
mov    %r15,%rdi
mov    %r14,%rsi
xor    %edx,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <mbrlen@plt>

LLVM IR (-O0):
define void @nullPointer_mbrlen(i8* %0, i64 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32* %2, i32** %6
%7 = load i64, i64* %5
%8 = load i32*, i32** %6
%9 = call i32 @mbrlen(i8* null, i64 %7, i32* %8)
%10 = load i32*, i32** %6
%11 = call i32 @mbrlen(i8* null, i64 0, i32* %10)
%12 = load i8*, i8** %4
%13 = load i64, i64* %5
%14 = call i32 @mbrlen(i8* %12, i64 %13, i32* null)
ret void
}

LLVM IR (-O2):
define void @nullPointer_mbrlen(i8* %0, i64 %1, i32* %2) {
%4 = tail call i32 @mbrlen(i8* null, i64 %1, i32* %2)
%5 = tail call i32 @mbrlen(i8* null, i64 0, i32* %2)
%6 = tail call i32 @mbrlen(i8* %0, i64 %1, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, b, c, bit;
  scanf("%d", &a);
  scanf("%d", &b);
  c = b >> a;
  bit = c & 1;
  printf("%d", bit);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x8(%rsp),%esi
mov    0xc(%rsp),%cl
shr    %cl,%esi
and    $0x1,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = load i32, i32* %1
%9 = lshr i32 %7, %8
%10 = and i32 %9, 1
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}
void gtk_cell_renderer_progress_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_cell_renderer_progress_get_type() {
ret void
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *, char);
int main() {
  char a, b;
  a = getchar();
  b = a - 97;
  b = 122 - b;
  printf("%c", b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%ecx
mov    $0x7a,%eax
sub    %ecx,%eax
mov    %al,-0x2(%rbp)
lea    0xeaf(%rip),%rdi
movsbl -0x2(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    $0xdb,%cl
sub    %al,%cl
movsbl %cl,%esi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
%3 = call signext i8 (...) @getchar()
store i8 %3, i8* %1
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = sub nsw i32 %5, 97
%7 = trunc i32 %6 to i8
store i8 %7, i8* %2
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = sub nsw i32 122, %9
%11 = trunc i32 %10 to i8
store i8 %11, i8* %2
%12 = load i8, i8* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = sub i8 -37, %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void __attribute__((stdcall)) test(int arg) {
  printf("The argument passed was %i\n", arg);
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"The argument passed was %i\0A\00"
define void @test(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"The argument passed was %i\0A\00"
define void @test(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ depth;
};
typedef TYPE_1__ XImage;

/* Variables and functions */
int get_XImage_depth(void *_p) { return (int)((XImage *)_p)->depth; }


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XImage_depth(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XImage_depth(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void error(char *msg) {
  fprintf(stderr, "[Error] %s\n", msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"[Error] %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"[Error] %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double R;
  double pi = 3.14159;
  scanf("%lf", &R);
  double sphere = (4 / 3.0) * pi * (R * R * R);
  printf("VOLUME = %.3lf\n", sphere);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm1
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  0xeb7(%rip),%xmm0
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [16 x i8] c"VOLUME = %.3lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fmul double %4, %4
%6 = fmul double %4, %5
%7 = fmul double %6, 0x4010C1514ABD0449
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double %7)
ret i32 0
}
void __attribute__((weak)) SysTick_Hook(void) {}


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

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

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

LLVM IR (-O2):
define weak void @SysTick_Hook() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __ESBMC_check_stability(float *, float *);
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int main() {
  float a[] = {
      1.000000000000000,
      -0.375000000000000,
      0.187500000000000,
  };
  float b[] = {0.218750000000000, 0.406250000000000, 0.218750000000000};
  assert(__ESBMC_check_stability(a, b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    0xec2(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xec0(%rip),%eax
mov    %eax,-0x14(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1030 <__ESBMC_check_stability@plt>
mov    %eax,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xede(%rip),%eax
mov    %eax,0x20(%rsp)
mov    0xecb(%rip),%rax
mov    %rax,0x18(%rsp)
mov    0xed4(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xec1(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x18(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <__ESBMC_check_stability@plt>
mov    %eax,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [3 x float] [float 1.000000e+00, float -3.750000e-01, float 1.875000e-01]
@__const.main.b = [3 x float] [float 2.187500e-01, float 4.062500e-01, float 2.187500e-01]
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x float]
%3 = alloca [3 x float]
store i32 0, i32* %1
%4 = bitcast [3 x float]* %2 to i8*
%5 = bitcast [3 x float]* %3 to i8*
%6 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 0
%7 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 0
%8 = call i32 @__ESBMC_check_stability(float* %6, float* %7)
%9 = call i32 @assert(i32 %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [3 x float] [float 1.000000e+00, float -3.750000e-01, float 1.875000e-01]
@__const.main.b = [3 x float] [float 2.187500e-01, float 4.062500e-01, float 2.187500e-01]
define i32 @main() {
%1 = alloca [3 x float]
%2 = alloca [3 x float]
%3 = bitcast [3 x float]* %1 to i8*
%4 = bitcast [3 x float]* %2 to i8*
%5 = getelementptr inbounds [3 x float], [3 x float]* %1, i64 0, i64 0
%6 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 0
%7 = call i32 @__ESBMC_check_stability(float* %5, float* %6)
%8 = call i32 @assert(i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strends(char *, char *);
main() {
  char *s = "abcdefghijklmn";
  char *t = "klmn";
  printf("%d\n", strends(s, t));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xed0(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strends@plt>
mov    %eax,%esi
lea    0xebb(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedb(%rip),%rsi
call   1030 <strends@plt>
lea    0xed4(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"abcdefghijklmn\00"
@.str.1 = [5 x i8] c"klmn\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @strends(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %1)
ret i32 0
}
int muspcm_init(int audio_buffer_size) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @muspcm_init(i32 %0) {
ret i32 -1
}
/* Variables and functions */
double sin(double);
double f5(double x) { return x - 0.5 * sin(x) - 1; }


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x10(%rbp),%xmm1
movsd  0xeca(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xeb2(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <sin@plt>
mulsd  0xedd(%rip),%xmm0
addsd  (%rsp),%xmm0
addsd  0xed8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f5(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @sin(double %4)
%6 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %5, double %3)
%7 = fsub double %6, 1.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @f5(double %0) {
%2 = tail call double @sin(double %0)
%3 = tail call double @llvm.fmuladd.f64(double %2, double -5.000000e-01, double %0)
%4 = fadd double %3, -1.000000e+00
ret double %4
}
/* Variables and functions */
int ez_net_tcp_connect_ex(char const *, int, int);
int ez_net_tcp_connect_non_block(const char *addr, int port) {
  return ez_net_tcp_connect_ex(addr, port, 1);
}


x86 assembly (clang, -O0):
<ez_net_tcp_connect_non_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x1,%edx
call   1030 <ez_net_tcp_connect_ex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ez_net_tcp_connect_non_block>:
mov    $0x1,%edx
jmp    1030 <ez_net_tcp_connect_ex@plt>

LLVM IR (-O0):
define i32 @ez_net_tcp_connect_non_block(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 i32 @ez_net_tcp_connect_ex(i8* %5, i32 %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @ez_net_tcp_connect_non_block(i8* %0, i32 %1) {
%3 = tail call i32 @ez_net_tcp_connect_ex(i8* %0, i32 %1, i32 1)
ret i32 %3
}
/* Variables and functions */
int hclock_read(int);
int cmos_clock_busy(void) { return (hclock_read(10) & 0x80); }


x86 assembly (clang, -O0):
<cmos_clock_busy>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <hclock_read@plt>
and    $0x80,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmos_clock_busy>:
push   %rax
mov    $0xa,%edi
call   1030 <hclock_read@plt>
and    $0x80,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cmos_clock_busy() {
%1 = call i32 @hclock_read(i32 10)
%2 = and i32 %1, 128
ret i32 %2
}

LLVM IR (-O2):
define i32 @cmos_clock_busy() {
%1 = tail call i32 @hclock_read(i32 10)
%2 = and i32 %1, 128
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;
struct hle_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ alist_interleave(struct hle_t *, int, int, int, int);
void INTERLEAVE(struct hle_t *hle, uint32_t w1, uint32_t w2) {
  uint16_t count = ((w1 >> 12) & 0xff0);
  uint16_t dmemo = w1;
  uint16_t left = (w2 >> 16);
  uint16_t right = w2;
  alist_interleave(hle, dmemo, left, right, count);
}


x86 assembly (clang, -O0):
<INTERLEAVE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sar    $0xc,%eax
and    $0xff0,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
sar    $0x10,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0x14(%rbp),%r8d
call   1030 <alist_interleave@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<INTERLEAVE>:
mov    %edx,%ecx
mov    %esi,%r8d
shr    $0xc,%r8d
and    $0xff0,%r8d
sar    $0x10,%edx
jmp    1030 <alist_interleave@plt>

LLVM IR (-O0):
%struct.hle_t = type { i32 }
define void @INTERLEAVE(%struct.hle_t* %0, i32 %1, i32 %2) {
%4 = alloca %struct.hle_t*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.hle_t* %0, %struct.hle_t** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%11 = load i32, i32* %5
%12 = ashr i32 %11, 12
%13 = and i32 %12, 4080
store i32 %13, i32* %7
%14 = load i32, i32* %5
store i32 %14, i32* %8
%15 = load i32, i32* %6
%16 = ashr i32 %15, 16
store i32 %16, i32* %9
%17 = load i32, i32* %6
store i32 %17, i32* %10
%18 = load %struct.hle_t*, %struct.hle_t** %4
%19 = load i32, i32* %8
%20 = load i32, i32* %9
%21 = load i32, i32* %10
%22 = load i32, i32* %7
%23 = call i32 @alist_interleave(%struct.hle_t* %18, i32 %19, i32 %20, i32 %21, i32 %22)
ret void
}

LLVM IR (-O2):
%struct.hle_t = type { i32 }
define void @INTERLEAVE(%struct.hle_t* %0, i32 %1, i32 %2) {
%4 = lshr i32 %1, 12
%5 = and i32 %4, 4080
%6 = ashr i32 %2, 16
%7 = tail call i32 @alist_interleave(%struct.hle_t* %0, i32 %1, i32 %6, i32 %2, i32 %5)
ret void
}
void test() {
  11;
  2;
  1;
  ;
  22;
}


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

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

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

LLVM IR (-O2):
define void @test() {
ret void
}
/* Variables and functions */
scalar_t__ close(int);
int errno;
int J1939SocketClose(int number) {
  if (close(number) != 0) {
    int errsv = errno;
    return -1 * errsv;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<J1939SocketClose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
cmp    $0x0,%rax
je     1148 <J1939SocketClose+0x38>
mov    0x2eac(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
imul   $0xffffffff,-0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114f <J1939SocketClose+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<J1939SocketClose>:
push   %rax
call   1030 <close@plt>
mov    0x2ec3(%rip),%rdx
xor    %ecx,%ecx
sub    (%rdx),%ecx
xor    %edx,%edx
test   %rax,%rax
cmove  %edx,%ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @J1939SocketClose(i32 %0) {
%2 = tail call i64 @close(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = load i32, i32* @errno
%5 = sub nsw i32 0, %4
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ a_0_55(int, char *);
void a_0_62(void) {
  { a_0_55(((((45)))), "= ?"); }
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"= ?\00"
define void @a_0_62() {
%1 = call i32 @a_0_55(i32 45, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"= ?\00"
define void @a_0_62() {
%1 = tail call i32 @a_0_55(i32 45, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int ten();
int zero();
int foo(int k, int j) {
  if (k >= ten()) {
    if (j > k) {
      if (j > zero())
        return j;
    }
  }
  return j + 1;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <ten@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jl     1183 <foo+0x63>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    117e <foo+0x5e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <zero@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jle    1179 <foo+0x59>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    118c <foo+0x6c>
jmp    117e <foo+0x5e>
jmp    1183 <foo+0x63>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <ten@plt>
cmp    %ebp,%ebx
jle    1141 <foo+0x21>
cmp    %ebp,%eax
jg     1141 <foo+0x21>
xor    %eax,%eax
call   1040 <zero@plt>
cmp    %ebx,%eax
jl     1144 <foo+0x24>
add    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @foo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = call i32 (...) @ten()
%8 = icmp sge i32 %6, %7
br i1 %8, label %9, label %21
9: ; preds = %2
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = icmp sgt i32 %10, %11
br i1 %12, label %13, label %20
13: ; preds = %9
%14 = load i32, i32* %5
%15 = call i32 (...) @zero()
%16 = icmp sgt i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load i32, i32* %5
store i32 %18, i32* %3
br label %24
19: ; preds = %13
br label %20
20: ; preds = %19, %9
br label %21
21: ; preds = %20, %2
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %24
24: ; preds = %21, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = tail call i32 (...) @ten()
%4 = icmp sle i32 %3, %0
%5 = icmp sgt i32 %1, %0
%6 = and i1 %5, %4
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = tail call i32 (...) @zero()
%9 = icmp slt i32 %8, %1
br i1 %9, label %12, label %10
10: ; preds = %7, %2
%11 = add nsw i32 %1, 1
br label %12
12: ; preds = %7, %10
%13 = phi i32 [ %11, %10 ], [ %1, %7 ]
ret i32 %13
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t mask_u32(uint32_t x, uint32_t y) {
  uint32_t diff = x ^ y;
  uint32_t diff_is_zero = ~diff & (diff - 1);
  return -(diff_is_zero >> 31);
}


x86 assembly (clang, -O0):
<mask_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
sar    $0x1f,%ecx
xor    %eax,%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mask_u32>:
xor    %esi,%edi
lea    -0x1(%rdi),%eax
mov    %edi,%ecx
not    %ecx
and    %ecx,%eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @mask_u32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = xor i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = xor i32 %10, -1
%12 = load i32, i32* %5
%13 = sub nsw i32 %12, 1
%14 = and i32 %11, %13
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = ashr i32 %15, 31
%17 = sub nsw i32 0, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @mask_u32(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = xor i32 %3, -1
%5 = add nsw i32 %3, -1
%6 = and i32 %5, %4
%7 = lshr i32 %6, 31
ret i32 %7
}
const char *Alloc_Definition(void) {
  return "struct Alloc {\n"
         "  var (*alloc)(void);\n"
         "  void (*dealloc)(var);\n"
         "};";
}


x86 assembly (clang, -O0):
<Alloc_Definition>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Alloc_Definition>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [64 x i8] c"struct Alloc {\0A var (*alloc)(void);\0A void (*dealloc)(var);\0A};\00"
define i8* @Alloc_Definition() {
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [64 x i8] c"struct Alloc {\0A var (*alloc)(void);\0A void (*dealloc)(var);\0A};\00"
define i8* @Alloc_Definition() {
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("sizeof character literal - %ld\n", sizeof('a'));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [32 x i8] c"sizeof character literal - %ld\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
/* Variables and functions */
long strtol(char const *, void *, int);
long atol(const char *pszString) { return strtol(pszString, (void *)0, 10); }


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

x86 assembly (clang, -O2):
<atol>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtol@plt>

LLVM IR (-O0):
define i64 @atol(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strtol(i8* %3, i8* null, i32 10)
ret i64 %4
}

LLVM IR (-O2):
define i64 @atol(i8* nocapture %0) {
%2 = tail call i64 @strtol(i8* nocapture %0, i8* null, i32 10)
ret i64 %2
}
int decode_test(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @decode_test() {
ret i32 0
}
/* Variables and functions */
int ipify_connect();
int ipify_disconnect(int);
int ipify_query(int, char *, size_t);
int ipify(char *addr, size_t len) {
  int sd, ret;
  sd = ipify_connect();
  if (sd < 0)
    return 1;
  ret = ipify_query(sd, addr, len);
  ret |= ipify_disconnect(sd);
  return ret;
}


x86 assembly (clang, -O0):
<ipify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    $0x0,%al
call   1050 <ipify_connect@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1160 <ipify+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1187 <ipify+0x57>
mov    -0x1c(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <ipify_query@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%edi
call   1030 <ipify_disconnect@plt>
or     -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipify>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <ipify_connect@plt>
test   %eax,%eax
js     1161 <ipify+0x31>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <ipify_query@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1030 <ipify_disconnect@plt>
or     %ebx,%eax
jmp    1166 <ipify+0x36>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ipify(i8* %0, i64 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
%8 = call i32 (...) @ipify_connect()
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 1, i32* %3
br label %22
12: ; preds = %2
%13 = load i32, i32* %6
%14 = load i8*, i8** %4
%15 = load i64, i64* %5
%16 = call i32 @ipify_query(i32 %13, i8* %14, i64 %15)
store i32 %16, i32* %7
%17 = load i32, i32* %6
%18 = call i32 @ipify_disconnect(i32 %17)
%19 = load i32, i32* %7
%20 = or i32 %19, %18
store i32 %20, i32* %7
%21 = load i32, i32* %7
store i32 %21, i32* %3
br label %22
22: ; preds = %12, %11
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @ipify(i8* %0, i64 %1) {
%3 = tail call i32 (...) @ipify_connect()
%4 = icmp slt i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @ipify_query(i32 %3, i8* %0, i64 %1)
%7 = tail call i32 @ipify_disconnect(i32 %3)
%8 = or i32 %7, %6
br label %9
9: ; preds = %2, %5
%10 = phi i32 [ %8, %5 ], [ 1, %2 ]
ret i32 %10
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
signed int mem_get_sle16_aligned_as_int(const void *vmem) {
  const int16_t *mem = (const int16_t *)vmem;
  return *mem;
}


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

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

LLVM IR (-O0):
define i32 @mem_get_sle16_aligned_as_int(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @mem_get_sle16_aligned_as_int(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
double divide_two_doubles(double a, double b) {
  if (!b && !a)
    return 0;
  return a / b;
}


x86 assembly (clang, -O0):
<divide_two_doubles>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    114b <divide_two_doubles+0x4b>
jp     114b <divide_two_doubles+0x4b>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    114b <divide_two_doubles+0x4b>
jp     114b <divide_two_doubles+0x4b>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115a <divide_two_doubles+0x5a>
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<divide_two_doubles>:
movapd %xmm0,%xmm2
divsd  %xmm1,%xmm2
xorpd  %xmm3,%xmm3
cmpneqsd %xmm3,%xmm0
movapd %xmm0,%xmm4
andpd  %xmm2,%xmm4
cmpneqsd %xmm3,%xmm1
andpd  %xmm2,%xmm1
andnpd %xmm1,%xmm0
orpd   %xmm4,%xmm0
ret

LLVM IR (-O0):
define double @divide_two_doubles(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %5
%7 = fcmp une double %6, 0.000000e+00
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load double, double* %4
%10 = fcmp une double %9, 0.000000e+00
br i1 %10, label %12, label %11
11: ; preds = %8
store double 0.000000e+00, double* %3
br label %16
12: ; preds = %8, %2
%13 = load double, double* %4
%14 = load double, double* %5
%15 = fdiv double %13, %14
store double %15, double* %3
br label %16
16: ; preds = %12, %11
%17 = load double, double* %3
ret double %17
}

LLVM IR (-O2):
define double @divide_two_doubles(double %0, double %1) {
%3 = fcmp une double %1, 0.000000e+00
%4 = fcmp une double %0, 0.000000e+00
%5 = or i1 %4, %3
%6 = fdiv double %0, %1
%7 = select i1 %5, double %6, double 0.000000e+00
ret double %7
}