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

/* Variables and functions */
void *i8x_ob_get_userdata(struct i8x_object *);
void *__attribute__((always_)) i8x_list_get_userdata(struct i8x_list *x) {
  return i8x_ob_get_userdata((struct i8x_object *)x);
}


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

x86 assembly (clang, -O2):
<i8x_list_get_userdata>:
jmp    1030 <i8x_ob_get_userdata@plt>

LLVM IR (-O0):
%struct.i8x_list = type { i32 }
%struct.i8x_object = type { i32 }
define i8* @i8x_list_get_userdata(%struct.i8x_list* %0) {
%2 = alloca %struct.i8x_list*
store %struct.i8x_list* %0, %struct.i8x_list** %2
%3 = load %struct.i8x_list*, %struct.i8x_list** %2
%4 = bitcast %struct.i8x_list* %3 to %struct.i8x_object*
%5 = call i8* @i8x_ob_get_userdata(%struct.i8x_object* %4)
ret i8* %5
}

LLVM IR (-O2):
%struct.i8x_list = type { i32 }
%struct.i8x_object = type { i32 }
define i8* @i8x_list_get_userdata(%struct.i8x_list* %0) {
%2 = bitcast %struct.i8x_list* %0 to %struct.i8x_object*
%3 = tail call i8* @i8x_ob_get_userdata(%struct.i8x_object* %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ send(int, char *, int, int /*<<< orphan*/);
void growl_tcp_write_nl(int sock) { send(sock, "\r\n", 2, 0); }


x86 assembly (clang, -O0):
<growl_tcp_write_nl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
mov    $0x2,%edx
xor    %ecx,%ecx
call   1030 <send@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<growl_tcp_write_nl>:
lea    0xee9(%rip),%rsi
mov    $0x2,%edx
xor    %ecx,%ecx
jmp    1030 <send@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\0D\0A\00"
define void @growl_tcp_write_nl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @send(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define void @growl_tcp_write_nl(i32 %0) {
%2 = tail call i32 @send(i32 %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2, i32 0)
ret void
}
void other(void) {}


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

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

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

LLVM IR (-O2):
define void @other() {
ret void
}
/* Variables and functions */
int test(int x) { return x + 1; }


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

x86 assembly (clang, -O2):
<test>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @test(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ XErrorEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int pgx_error_handler(Display *display, XErrorEvent *event) {
  static int error_count = 0;
  if (!event) {
    int ret_count = error_count;
    error_count = 0;
    return ret_count;
  };
  error_count++;
  return 0;
}


x86 assembly (clang, -O0):
<pgx_error_handler>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1135 <pgx_error_handler+0x35>
mov    0x2f07(%rip),%eax
mov    %eax,-0x1c(%rbp)
movl   $0x0,0x2efa(%rip)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <pgx_error_handler+0x4b>
mov    0x2ee9(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ee0(%rip)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pgx_error_handler>:
mov    0x2f1e(%rip),%ecx
lea    0x1(%rcx),%edx
xor    %eax,%eax
test   %rsi,%rsi
cmove  %eax,%edx
cmove  %ecx,%eax
mov    %edx,0x2f0a(%rip)
ret

LLVM IR (-O0):
@pgx_error_handler.error_count = internal global i32 0
define i32 @pgx_error_handler(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
%7 = load i32*, i32** %5
%8 = icmp ne i32* %7, null
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load i32, i32* @pgx_error_handler.error_count
store i32 %10, i32* %6
store i32 0, i32* @pgx_error_handler.error_count
%11 = load i32, i32* %6
store i32 %11, i32* %3
br label %15
12: ; preds = %2
%13 = load i32, i32* @pgx_error_handler.error_count
%14 = add nsw i32 %13, 1
store i32 %14, i32* @pgx_error_handler.error_count
store i32 0, i32* %3
br label %15
15: ; preds = %12, %9
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@pgx_error_handler.error_count = internal unnamed_addr global i32 0
define i32 @pgx_error_handler(i32* nocapture readnone %0, i32* readnone %1) {
%3 = icmp eq i32* %1, null
%4 = load i32, i32* @pgx_error_handler.error_count
%5 = add nsw i32 %4, 1
%6 = select i1 %3, i32 0, i32 %5
%7 = select i1 %3, i32 %4, i32 0
store i32 %6, i32* @pgx_error_handler.error_count
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ testFormatting(int /*<<< orphan*/ *);
int /*<<< orphan*/ testLongLine(int /*<<< orphan*/ *);
void testPrintf(FILE *f) {
  testLongLine(f);
  testFormatting(f);
}


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

x86 assembly (clang, -O2):
<testPrintf>:
push   %rbx
mov    %rdi,%rbx
call   1030 <testLongLine@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <testFormatting@plt>

LLVM IR (-O0):
define void @testPrintf(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @testLongLine(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @testFormatting(i32* %5)
ret void
}

LLVM IR (-O2):
define void @testPrintf(i32* %0) {
%2 = tail call i32 @testLongLine(i32* %0)
%3 = tail call i32 @testFormatting(i32* %0)
ret void
}
vegachar(x, y, c, n, size) int x, y, c, n, size;
{
  if (size == 1)
    egalchar(x, y, c, n);
  else
    egaschar(x, y, c, n);
  return (0);
}


x86 assembly (clang, -O0):
<vegachar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    115a <vegachar+0x3a>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    $0x0,%al
call   1040 <egalchar@plt>
jmp    116d <vegachar+0x4d>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    $0x0,%al
call   1030 <egaschar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vegachar>:
push   %rax
xor    %eax,%eax
cmp    $0x1,%r8d
jne    1130 <vegachar+0x10>
call   1040 <egalchar@plt>
jmp    1135 <vegachar+0x15>
call   1030 <egaschar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @vegachar(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = icmp eq i32 %4, 1
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = tail call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @egalchar to i32 (i32, i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 %2, i32 %3)
br label %11
9: ; preds = %5
%10 = tail call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @egaschar to i32 (i32, i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 %2, i32 %3)
br label %11
11: ; preds = %9, %7
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
void child_code(int i) {
  sleep(i);
  printf("Hello from child %d.\n", i);
}


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

x86 assembly (clang, -O2):
<child_code>:
push   %rbx
mov    %edi,%ebx
call   1040 <sleep@plt>
lea    0xed1(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Hello from child %d.\0A\00"
define void @child_code(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sleep(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Hello from child %d.\0A\00"
define void @child_code(i32 %0) {
%2 = tail call i32 @sleep(i32 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
unsigned int UARTModuleVersionNumberGet(unsigned int baseAdd) {
  return ((*((volatile unsigned int *)(baseAdd + (0x50)))) & 0x00FF);
}


x86 assembly (clang, -O0):
<UARTModuleVersionNumberGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTModuleVersionNumberGet>:
add    $0x50,%edi
mov    (%rdi),%eax
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @UARTModuleVersionNumberGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 80
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, 255
ret i32 %8
}

LLVM IR (-O2):
define i32 @UARTModuleVersionNumberGet(i32 %0) {
%2 = add i32 %0, 80
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, 255
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int GetModuleName(char *name, int code_page) {
  if ((name != NULL) && (code_page == 0))
    strcpy(name, "gnuboy_dingoo.sim");
  return 0;
}


x86 assembly (clang, -O0):
<GetModuleName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1144 <GetModuleName+0x34>
cmpl   $0x0,-0xc(%rbp)
jne    1144 <GetModuleName+0x34>
mov    -0x8(%rbp),%rdi
lea    0xec1(%rip),%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetModuleName>:
test   %rdi,%rdi
je     112a <GetModuleName+0x1a>
test   %esi,%esi
jne    112a <GetModuleName+0x1a>
push   %rax
lea    0xedf(%rip),%rsi
call   1030 <strcpy@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [18 x i8] c"gnuboy_dingoo.sim\00"
define i32 @GetModuleName(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i8*, i8** %3
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %10, %7, %2
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"gnuboy_dingoo.sim\00"
define i32 @GetModuleName(i8* %0, i32 %1) {
%3 = icmp ne i8* %0, null
%4 = icmp eq i32 %1, 0
%5 = and i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clear();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ usleep(int);
void greet() {
  clear();
  printf("WELCOME TO GAME OF FIFTEEN\n");
  usleep(2000000);
}


x86 assembly (clang, -O0):
<greet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <clear@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1e8480,%edi
call   1050 <usleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<greet>:
push   %rax
xor    %eax,%eax
call   1040 <clear@plt>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1e8480,%edi
pop    %rax
jmp    1050 <usleep@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"WELCOME TO GAME OF FIFTEEN\0A\00"
define void @greet() {
%1 = call i32 (...) @clear()
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @usleep(i32 2000000)
ret void
}

LLVM IR (-O2):
@str = [27 x i8] c"WELCOME TO GAME OF FIFTEEN\00"
define void @greet() {
%1 = tail call i32 (...) @clear()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @usleep(i32 2000000)
ret void
}
void try_module_get(struct module *mod) {}


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

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

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

LLVM IR (-O2):
%struct.module = type opaque
define void @try_module_get(%struct.module* nocapture %0) {
ret void
}
int main() {
  int a, *b, *const *c;
  (const) a;
  (void *)b;
  (const *const *************const *****************************)c;
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
xor    %eax,%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
%5 = load i32, i32* %2
%6 = load i32*, i32** %3
%7 = bitcast i32* %6 to i8*
%8 = load i32**, i32*** %4
%9 = bitcast i32** %8 to i32*******************************************
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ num_buf;

/* Variables and functions */
int /*<<< orphan*/ num_to_str(unsigned long, char *, int);
int print(int /*<<< orphan*/);
int print_num(unsigned long num) {
  char num_buf[30];
  return print(num_to_str(num, num_buf, sizeof(num_buf)));
}


x86 assembly (clang, -O0):
<print_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x1e,%edx
call   1040 <num_to_str@plt>
mov    %eax,%edi
call   1030 <print@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_num>:
sub    $0x28,%rsp
mov    %rsp,%rsi
mov    $0x1e,%edx
call   1040 <num_to_str@plt>
mov    %eax,%edi
call   1030 <print@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @print_num(i64 %0) {
%2 = alloca i64
%3 = alloca [30 x i8]
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%6 = call i32 @num_to_str(i64 %4, i8* %5, i32 30)
%7 = call i32 @print(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @print_num(i64 %0) {
%2 = alloca [30 x i8]
%3 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%4 = call i32 @num_to_str(i64 %0, i8* %3, i32 30)
%5 = call i32 @print(i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ gsl_test_rel(double const, double const, double const,
                                char *, char const *, char const *);
void penalty1_checksol(const double x[], const double sumsq,
                       const double epsrel, const char *sname,
                       const char *pname) {
  const double sumsq_exact = 7.08765146709037993e-05;
  gsl_test_rel(sumsq, sumsq_exact, epsrel, "%s/%s sumsq", sname, pname);
  (void)x;
}


x86 assembly (clang, -O0):
<penalty1_checksol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
movsd  0xeca(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
movsd  0xeab(%rip),%xmm1
lea    0xeac(%rip),%rdi
call   1030 <gsl_test_rel@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<penalty1_checksol>:
movaps %xmm1,%xmm2
lea    0xeee(%rip),%rdi
movsd  0xede(%rip),%xmm1
jmp    1030 <gsl_test_rel@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%s/%s sumsq\00"
define void @penalty1_checksol(double* %0, double %1, double %2, i8* %3, i8* %4) {
%6 = alloca double*
%7 = alloca double
%8 = alloca double
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca double
store double* %0, double** %6
store double %1, double* %7
store double %2, double* %8
store i8* %3, i8** %9
store i8* %4, i8** %10
store double 0x3F12947140114CEB, double* %11
%12 = load double, double* %7
%13 = load double, double* %8
%14 = load i8*, i8** %9
%15 = load i8*, i8** %10
%16 = call i32 @gsl_test_rel(double %12, double 0x3F12947140114CEB, double %13, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %14, i8* %15)
%17 = load double*, double** %6
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s/%s sumsq\00"
define void @penalty1_checksol(double* nocapture readnone %0, double %1, double %2, i8* %3, i8* %4) {
%6 = tail call i32 @gsl_test_rel(double %1, double 0x3F12947140114CEB, double %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
ret void
}
void zfree(void *p) { asm("int $0x40" ::"a"(68), "b"(13), "c"(p)); }


x86 assembly (clang, -O0):
<zfree>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x44,%eax
mov    $0xd,%ebx
int    $0x40
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<zfree>:
push   %rbx
mov    %rdi,%rcx
mov    $0x44,%eax
mov    $0xd,%ebx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define void @zfree(i8* %0) {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 68, i32 13, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay_tick(int);
void k_delay(void) { delay_tick(32 * 1000); }


x86 assembly (clang, -O0):
<k_delay>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7d00,%edi
call   1030 <delay_tick@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<k_delay>:
mov    $0x7d00,%edi
jmp    1030 <delay_tick@plt>

LLVM IR (-O0):
define void @k_delay() {
%1 = call i32 @delay_tick(i32 32000)
ret void
}

LLVM IR (-O2):
define void @k_delay() {
%1 = tail call i32 @delay_tick(i32 32000)
ret void
}
/* Variables and functions */
int PseudoRandomUsingAtomic_nextInt(int);
int /*<<< orphan*/ __VERIFIER_error();
void PseudoRandomUsingAtomic__threadmain() {
  int myrand;
  myrand = PseudoRandomUsingAtomic_nextInt(10);
  {
    if (!(myrand <= 10)) {
    ERROR:
      __VERIFIER_error();
      (void)0;
    }
  };
}


x86 assembly (clang, -O0):
<PseudoRandomUsingAtomic__threadmain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1040 <PseudoRandomUsingAtomic_nextInt@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jle    114b <PseudoRandomUsingAtomic__threadmain+0x2b>
jmp    1144 <PseudoRandomUsingAtomic__threadmain+0x24>
mov    $0x0,%al
call   1030 <__VERIFIER_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PseudoRandomUsingAtomic__threadmain>:
push   %rax
mov    $0xa,%edi
call   1040 <PseudoRandomUsingAtomic_nextInt@plt>
cmp    $0xb,%eax
jge    1132 <PseudoRandomUsingAtomic__threadmain+0x12>
pop    %rax
ret
xor    %eax,%eax
pop    %rcx
jmp    1030 <__VERIFIER_error@plt>

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

LLVM IR (-O2):
define void @PseudoRandomUsingAtomic__threadmain() {
%1 = tail call i32 @PseudoRandomUsingAtomic_nextInt(i32 10)
%2 = icmp slt i32 %1, 11
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @__VERIFIER_error()
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
int mt_genrand64_int64();
double mt_genrand64_real2(void) {
  return (mt_genrand64_int64() >> 11) * (1.0 / 9007199254740992.0);
}


x86 assembly (clang, -O0):
<mt_genrand64_real2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mt_genrand64_int64@plt>
sar    $0xb,%eax
cvtsi2sd %eax,%xmm0
movsd  0xed6(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mt_genrand64_real2>:
push   %rax
xor    %eax,%eax
call   1030 <mt_genrand64_int64@plt>
sar    $0xb,%eax
cvtsi2sd %eax,%xmm0
mulsd  0xed9(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @mt_genrand64_real2() {
%1 = call i32 (...) @mt_genrand64_int64()
%2 = ashr i32 %1, 11
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 0x3CA0000000000000
ret double %4
}

LLVM IR (-O2):
define double @mt_genrand64_real2() {
%1 = tail call i32 (...) @mt_genrand64_int64()
%2 = ashr i32 %1, 11
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 0x3CA0000000000000
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int G61_f(char *s) {
  debug("G61_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<G61_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<G61_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"G61_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G61_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"G61_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G61_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
void test_32_2(int *mem) { __atomic_fetch_or(mem, 1, 4); }


x86 assembly (clang, -O0):
<test_32_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,-0x18(%rbp)
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%esi
mov    %eax,%edx
or     %esi,%edx
lock cmpxchg %edx,(%rcx)
sete   %cl
mov    %eax,-0x24(%rbp)
test   $0x1,%cl
mov    %eax,-0x14(%rbp)
jne    114b <test_32_2+0x4b>
jmp    1122 <test_32_2+0x22>
mov    -0x24(%rbp),%eax
mov    %eax,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_32_2>:
lock orl $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @test_32_2(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
store i32 1, i32* %3
%6 = load i32, i32* %3
%7 = atomicrmw or i32* %5, i32 %6 acq_rel
store i32 %7, i32* %4
%8 = load i32, i32* %4
ret void
}

LLVM IR (-O2):
define void @test_32_2(i32* nocapture %0) {
%2 = atomicrmw or i32* %0, i32 1 acq_rel
ret void
}
void string_to_hex(void) {}


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

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

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

LLVM IR (-O2):
define void @string_to_hex() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *update_buffer(void *buf, size_t size) {
  if (size != 0) {
    void *new_buf = realloc(buf, size);
    if (new_buf == NULL) {
      fprintf(stderr, "Error: not enough memory");
      exit(2);
    }
    buf = new_buf;
  }
  return buf;
}


x86 assembly (clang, -O0):
<update_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     118e <update_buffer+0x5e>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1186 <update_buffer+0x56>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
lea    0xe89(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_buffer>:
push   %rax
test   %rsi,%rsi
je     1143 <update_buffer+0x13>
call   1040 <realloc@plt>
mov    %rax,%rdi
test   %rax,%rax
je     1148 <update_buffer+0x18>
mov    %rdi,%rax
pop    %rcx
ret
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
lea    0xea8(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"Error: not enough memory\00"
define i8* @update_buffer(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %20
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = load i64, i64* %4
%11 = call i8* @realloc(i8* %9, i64 %10)
store i8* %11, i8** %5
%12 = load i8*, i8** %5
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %18
14: ; preds = %8
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @exit(i32 2)
unreachable
18: ; preds = %8
%19 = load i8*, i8** %5
store i8* %19, i8** %3
br label %20
20: ; preds = %18, %2
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"Error: not enough memory\00"
define i8* @update_buffer(i8* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = tail call i8* @realloc(i8* %0, i64 %1)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 2)
unreachable
11: ; preds = %4, %2
%12 = phi i8* [ %0, %2 ], [ %5, %4 ]
ret i8* %12
}
void multidim_arr1_Bad() {
  int a[2][3];
  a[2][0] = 0;
}


x86 assembly (clang, -O0):
<multidim_arr1_Bad>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @multidim_arr1_Bad() {
%1 = alloca [2 x [3 x i32]]
%2 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %1, i64 0, i64 2
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
store i32 0, i32* %3
ret void
}

LLVM IR (-O2):
define void @multidim_arr1_Bad() {
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int opt_mon(char *opt) {
  if (strcmp(opt, "-m") == 0)
    return 1;
  if (strcmp(opt, "--monitor") == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<opt_mon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1142 <opt_mon+0x32>
movl   $0x1,-0x4(%rbp)
jmp    116f <opt_mon+0x5f>
mov    -0x10(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1168 <opt_mon+0x58>
movl   $0x1,-0x4(%rbp)
jmp    116f <opt_mon+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_mon>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1141 <opt_mon+0x31>
lea    0xed7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"-m\00"
@.str.1 = [10 x i8] c"--monitor\00"
define i32 @opt_mon(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, int);
main() {
  char s[] = "-10086";
  printf("%d\n", atoi(s));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xecc(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xec4(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x7(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.s = [7 x i8] c"-10086\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = bitcast [7 x i8]* %1 to i8*
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%4 = call i32 @atoi(i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 -10086)
ret i32 0
}
int is4xx(int status) { return ((status >= 400) && (status < 500)); }


x86 assembly (clang, -O0):
<is4xx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x190,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <is4xx+0x26>
cmpl   $0x1f4,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is4xx>:
add    $0xfffffe70,%edi
xor    %eax,%eax
cmp    $0x64,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @is4xx(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 400
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 500
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @is4xx(i32 %0) {
%2 = add i32 %0, -400
%3 = icmp ult i32 %2, 100
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int rom_present(char *);
int mach64vt2_available() { return rom_present("atimach64vt2pci.bin"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"atimach64vt2pci.bin\00"
define i32 @mach64vt2_available() {
%1 = call i32 @rom_present(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [20 x i8] c"atimach64vt2pci.bin\00"
define i32 @mach64vt2_available() {
%1 = tail call i32 @rom_present(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ stringToInteger(char *);
int /*<<< orphan*/ test(int /*<<< orphan*/, int);
int /*<<< orphan*/ testError(int /*<<< orphan*/);
void testStringToInteger(void) {
  test(stringToInteger("1234"), 1234);
  test(stringToInteger("-42"), -42);
  testError(stringToInteger("X"));
}


x86 assembly (clang, -O0):
<testStringToInteger>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <stringToInteger@plt>
mov    %eax,%edi
mov    $0x4d2,%esi
call   1050 <test@plt>
lea    0xeb2(%rip),%rdi
call   1030 <stringToInteger@plt>
mov    %eax,%edi
mov    $0xffffffd6,%esi
call   1050 <test@plt>
lea    0xe9e(%rip),%rdi
call   1030 <stringToInteger@plt>
mov    %eax,%edi
call   1040 <testError@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testStringToInteger>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <stringToInteger@plt>
mov    %eax,%edi
mov    $0x4d2,%esi
call   1050 <test@plt>
lea    0xeb5(%rip),%rdi
call   1030 <stringToInteger@plt>
mov    %eax,%edi
mov    $0xffffffd6,%esi
call   1050 <test@plt>
lea    0xea1(%rip),%rdi
call   1030 <stringToInteger@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <testError@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"1234\00"
@.str.1 = [4 x i8] c"-42\00"
@.str.2 = [2 x i8] c"X\00"
define void @testStringToInteger() {
%1 = call i32 @stringToInteger(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @test(i32 %1, i32 1234)
%3 = call i32 @stringToInteger(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @test(i32 %3, i32 -42)
%5 = call i32 @stringToInteger(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @testError(i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"1234\00"
@.str.1 = [4 x i8] c"-42\00"
@.str.2 = [2 x i8] c"X\00"
define void @testStringToInteger() {
%1 = tail call i32 @stringToInteger(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @test(i32 %1, i32 1234)
%3 = tail call i32 @stringToInteger(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @test(i32 %3, i32 -42)
%5 = tail call i32 @stringToInteger(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @testError(i32 %5)
ret void
}
void wakeup_init() {}


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

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

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

LLVM IR (-O2):
define void @wakeup_init() {
ret void
}
long test_lcc(char c1, char c2) { return (long)(c1 + c2); }


x86 assembly (clang, -O0):
<test_lcc>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
add    %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_lcc>:
movslq %edi,%rcx
movslq %esi,%rax
add    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @test_lcc(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i64
%4 = sext i8 %1 to i64
%5 = add nsw i64 %4, %3
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ exit(int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int open_fifo(char *filename) {
  int fd = open(filename, O_RDWR);
  if (fd < 0) {
    perror("mkfifo open error");
    exit(1);
  }
  return fd;
}


x86 assembly (clang, -O0):
<open_fifo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
call   1030 <open@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1171 <open_fifo+0x41>
lea    0xe9e(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_fifo>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
call   1030 <open@plt>
test   %eax,%eax
js     1145 <open_fifo+0x15>
pop    %rcx
ret
lea    0xeb4(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@O_RDWR = global i32 0
@.str = [18 x i8] c"mkfifo open error\00"
define i32 @open_fifo(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_RDWR
%6 = call i32 @open(i8* %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@.str = [18 x i8] c"mkfifo open error\00"
define i32 @open_fifo(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t ape_initcrc(void) { return 0xffffffff; }


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

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

LLVM IR (-O0):
define i32 @ape_initcrc() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @ape_initcrc() {
ret i32 -1
}
/* Variables and functions */
int SIGINT;
int /*<<< orphan*/ printf(char *);
void my_int_handler(int sigval) {
  if (sigval == SIGINT) {
    printf("CTRL-C won't do\n");
    return;
  }
  return;
}


x86 assembly (clang, -O0):
<my_int_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
jne    113e <my_int_handler+0x2e>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
jmp    1143 <my_int_handler+0x33>
jmp    1143 <my_int_handler+0x33>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_int_handler>:
mov    0x2ed1(%rip),%rax
cmp    %edi,(%rax)
jne    1127 <my_int_handler+0x17>
lea    0xede(%rip),%rdi
jmp    1030 <puts@plt>
ret

LLVM IR (-O0):
@SIGINT = global i32 0
@.str = [17 x i8] c"CTRL-C won't do\0A\00"
define void @my_int_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGINT
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %6
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
@str = [16 x i8] c"CTRL-C won't do\00"
define void @my_int_handler(i32 %0) {
%2 = load i32, i32* @SIGINT
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ type;
};
typedef TYPE_1__ XButtonEvent;

/* Variables and functions */
int get_XButtonEvent_type(void *_p) { return (int)((XButtonEvent *)_p)->type; }


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XButtonEvent_type(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_XButtonEvent_type(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 g(int, int, int, int);
int main() {
  int i = 0;
  int j = 0;
  int k = 0;
  i = g(10, 11, 12, 1);
  j = g(3, 4, 5, 1);
  k = g(7, 5, 4, 1);
  j = k + j;
  return j;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0xa,%edi
mov    $0xb,%esi
mov    $0xc,%edx
mov    $0x1,%ecx
call   1030 <g@plt>
mov    %eax,-0x8(%rbp)
mov    $0x3,%edi
mov    $0x4,%esi
mov    $0x5,%edx
mov    $0x1,%ecx
call   1030 <g@plt>
mov    %eax,-0xc(%rbp)
mov    $0x7,%edi
mov    $0x5,%esi
mov    $0x4,%edx
mov    $0x1,%ecx
call   1030 <g@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
mov    $0xb,%esi
mov    $0xc,%edx
mov    $0x1,%ecx
call   1030 <g@plt>
mov    $0x3,%edi
mov    $0x4,%esi
mov    $0x5,%edx
mov    $0x1,%ecx
call   1030 <g@plt>
mov    %eax,%ebx
mov    $0x7,%edi
mov    $0x5,%esi
mov    $0x4,%edx
mov    $0x1,%ecx
call   1030 <g@plt>
add    %ebx,%eax
pop    %rbx
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 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
%5 = call i32 @g(i32 10, i32 11, i32 12, i32 1)
store i32 %5, i32* %2
%6 = call i32 @g(i32 3, i32 4, i32 5, i32 1)
store i32 %6, i32* %3
%7 = call i32 @g(i32 7, i32 5, i32 4, i32 1)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = add nsw i32 %8, %9
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @g(i32 10, i32 11, i32 12, i32 1)
%2 = tail call i32 @g(i32 3, i32 4, i32 5, i32 1)
%3 = tail call i32 @g(i32 7, i32 5, i32 4, i32 1)
%4 = add nsw i32 %3, %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void SUB_HOST_REG_W(int dst_reg, int src_reg) {
  addbyte(0x66);
  addbyte(0x29);
  addbyte(0xc0 | dst_reg | (src_reg << 3));
}


x86 assembly (clang, -O0):
<SUB_HOST_REG_W>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0x29,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
or     $0xc0,%edi
mov    -0x8(%rbp),%eax
shl    $0x3,%eax
or     %eax,%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SUB_HOST_REG_W>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0x29,%edi
call   1030 <addbyte@plt>
shl    $0x3,%ebx
or     %ebp,%ebx
or     $0xc0,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @SUB_HOST_REG_W(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @addbyte(i32 102)
%6 = call i32 @addbyte(i32 41)
%7 = load i32, i32* %3
%8 = or i32 192, %7
%9 = load i32, i32* %4
%10 = shl i32 %9, 3
%11 = or i32 %8, %10
%12 = call i32 @addbyte(i32 %11)
ret void
}

LLVM IR (-O2):
define void @SUB_HOST_REG_W(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 102)
%4 = tail call i32 @addbyte(i32 41)
%5 = shl i32 %1, 3
%6 = or i32 %5, %0
%7 = or i32 %6, 192
%8 = tail call i32 @addbyte(i32 %7)
ret void
}
__attribute__((always_)) void validate_creds(const struct cred *cred) {}


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

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

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

LLVM IR (-O2):
%struct.cred = type opaque
define void @validate_creds(%struct.cred* nocapture %0) {
ret void
}
int calc_v0_volt(struct smart_dimming *dimming, int color) { return 4301; }


x86 assembly (clang, -O0):
<calc_v0_volt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x10cd,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.smart_dimming = type opaque
define i32 @calc_v0_volt(%struct.smart_dimming* nocapture readnone %0, i32 %1) {
ret i32 4301
}