xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *);
scalar_t__ system(char *);
void appaserver_library_purge_temporary_files(char *application_name) {
  char sys_string[128];
  sprintf(sys_string, "appaserver_purge_temporary_files.sh %s &",
          application_name);
  if (system(sys_string)) {
  };
}


x86 assembly (clang, -O0):
<appaserver_library_purge_temporary_files>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xebf(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x90(%rbp),%rdi
call   1030 <system@plt>
cmp    $0x0,%rax
je     1161 <appaserver_library_purge_temporary_files+0x41>
jmp    1161 <appaserver_library_purge_temporary_files+0x41>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<appaserver_library_purge_temporary_files>:
push   %rbx
sub    $0x80,%rsp
mov    %rdi,%rdx
lea    0xece(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"appaserver_purge_temporary_files.sh %s &\00"
define void @appaserver_library_purge_temporary_files(i8* %0) {
%2 = alloca i8*
%3 = alloca [128 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%8 = call i64 @system(i8* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %1
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"appaserver_purge_temporary_files.sh %s &\00"
define void @appaserver_library_purge_temporary_files(i8* %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i64 @system(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
void *malloc(size_t);
void *__x_malloc(size_t size) {
  void *m = malloc(size);
  assert(m);
  return m;
}


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

x86 assembly (clang, -O2):
<__x_malloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @__x_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @assert(i8* %6)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
define i8* @__x_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = tail call i32 @assert(i8* %2)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ofree(void *data) {
  if (data != NULL)
    free(data);
}


x86 assembly (clang, -O0):
<ofree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <ofree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ofree>:
test   %rdi,%rdi
je     111a <ofree+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @ofree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LCD_WriteCmdStart(int);
void LCD_Cursor(unsigned char column) {
  if (column < 16) {
    LCD_WriteCmdStart(0x80 + column);
  } else {
    LCD_WriteCmdStart(0xB0 + column);
  }
}


x86 assembly (clang, -O0):
<LCD_Cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x10,%eax
jge    113f <LCD_Cursor+0x2f>
movzbl -0x1(%rbp),%edi
add    $0x80,%edi
call   1030 <LCD_WriteCmdStart@plt>
jmp    114e <LCD_Cursor+0x3e>
movzbl -0x1(%rbp),%edi
add    $0xb0,%edi
call   1030 <LCD_WriteCmdStart@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_Cursor>:
lea    0xb0(%rdi),%ecx
mov    %edi,%eax
sub    $0xffffff80,%eax
cmp    $0x10,%dil
cmovae %ecx,%eax
mov    %eax,%edi
jmp    1030 <LCD_WriteCmdStart@plt>

LLVM IR (-O0):
define void @LCD_Cursor(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp slt i32 %4, 16
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = add nsw i32 128, %8
%10 = call i32 @LCD_WriteCmdStart(i32 %9)
br label %16
11: ; preds = %1
%12 = load i8, i8* %2
%13 = zext i8 %12 to i32
%14 = add nsw i32 176, %13
%15 = call i32 @LCD_WriteCmdStart(i32 %14)
br label %16
16: ; preds = %11, %6
ret void
}

LLVM IR (-O2):
define void @LCD_Cursor(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = icmp ult i8 %0, 16
%4 = select i1 %3, i32 128, i32 176
%5 = add nuw nsw i32 %4, %2
%6 = tail call i32 @LCD_WriteCmdStart(i32 %5)
ret void
}
/* Variables and functions */
int shim_enosys(int /*<<< orphan*/, int, int, int);
int shim_ioprio_set(int which, int who, int ioprio) {
  return shim_enosys(0, which, who, ioprio);
}


x86 assembly (clang, -O0):
<shim_ioprio_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
xor    %edi,%edi
call   1030 <shim_enosys@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shim_ioprio_set>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

LLVM IR (-O0):
define i32 @shim_ioprio_set(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @shim_enosys(i32 0, i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @shim_ioprio_set(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @shim_enosys(i32 0, i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int encode_closing_tag(int /*<<< orphan*/ *, int);
int rpm_ack_encode_apdu_object_end(uint8_t *apdu) {
  int apdu_len = 0;
  if (apdu) {
    apdu_len = encode_closing_tag(&apdu[0], 1);
  }
  return apdu_len;
}


x86 assembly (clang, -O0):
<rpm_ack_encode_apdu_object_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113f <rpm_ack_encode_apdu_object_end+0x2f>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <encode_closing_tag@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpm_ack_encode_apdu_object_end>:
test   %rdi,%rdi
je     111f <rpm_ack_encode_apdu_object_end+0xf>
mov    $0x1,%esi
jmp    1030 <encode_closing_tag@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @rpm_ack_encode_apdu_object_end(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @encode_closing_tag(i32* %0, i32 1)
br label %5
5: ; preds = %3, %1
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
void SetChangeParms(void) {}


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

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

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

LLVM IR (-O2):
define void @SetChangeParms() {
ret void
}
/* Variables and functions */
int getpid();
int md_getpid() { return (getpid()); }


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

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

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

LLVM IR (-O2):
define i32 @md_getpid() {
%1 = tail call i32 (...) @getpid()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ EVM5515_I2C_close();
int /*<<< orphan*/ EVM5515_I2C_init();
short EVM5515_I2C_reset() {
  EVM5515_I2C_close();
  EVM5515_I2C_init();
  return 0;
}


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

x86 assembly (clang, -O2):
<EVM5515_I2C_reset>:
push   %rax
xor    %eax,%eax
call   1030 <EVM5515_I2C_close@plt>
xor    %eax,%eax
call   1040 <EVM5515_I2C_init@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @EVM5515_I2C_reset() {
%1 = call i32 (...) @EVM5515_I2C_close()
%2 = call i32 (...) @EVM5515_I2C_init()
ret i16 0
}

LLVM IR (-O2):
define signext i16 @EVM5515_I2C_reset() {
%1 = tail call i32 (...) @EVM5515_I2C_close()
%2 = tail call i32 (...) @EVM5515_I2C_init()
ret i16 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t mkpixel(int r, int g, int b, int a) {
  return ((r & 0xff) << 16) | ((g & 0xff) << 8) | ((b & 0xff) << 0) |
         ((a & 0xff) << 24);
}


x86 assembly (clang, -O0):
<mkpixel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x10,%eax
mov    -0x8(%rbp),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
shl    $0x0,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkpixel>:
movzbl %dil,%eax
shl    $0x10,%eax
shl    $0x8,%esi
movzwl %si,%esi
or     %eax,%esi
movzbl %dl,%eax
or     %esi,%eax
shl    $0x18,%ecx
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @mkpixel(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = and i32 %9, 255
%11 = shl i32 %10, 16
%12 = load i32, i32* %6
%13 = and i32 %12, 255
%14 = shl i32 %13, 8
%15 = or i32 %11, %14
%16 = load i32, i32* %7
%17 = and i32 %16, 255
%18 = shl i32 %17, 0
%19 = or i32 %15, %18
%20 = load i32, i32* %8
%21 = and i32 %20, 255
%22 = shl i32 %21, 24
%23 = or i32 %19, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @mkpixel(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %0, 16
%6 = and i32 %5, 16711680
%7 = shl i32 %1, 8
%8 = and i32 %7, 65280
%9 = or i32 %8, %6
%10 = and i32 %2, 255
%11 = or i32 %9, %10
%12 = shl i32 %3, 24
%13 = or i32 %11, %12
ret i32 %13
}
void gtk_file_chooser_button_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_file_chooser_button_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *progname) {
  fprintf(stderr,
          "Usage: %s <hostname> <port> <device1> [device2] ... [deviceN]\n",
          progname);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
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    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [63 x i8] c"Usage: %s <hostname> <port> <device1> [device2] ... [deviceN]\0A\00"
define void @usage(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 ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [63 x i8] c"Usage: %s <hostname> <port> <device1> [device2] ... [deviceN]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void pstring_red(char s) {
  printf("%c%s%c%c%s", 0x1B, "[1;31m", s, 0x1B, "[0m");
}


x86 assembly (clang, -O0):
<pstring_red>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
lea    0xed7(%rip),%rdi
mov    $0x1b,%r8d
lea    0xed5(%rip),%rdx
lea    0xed5(%rip),%r9
mov    %r8d,%esi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pstring_red>:
mov    %edi,%ecx
lea    0xee7(%rip),%rdi
lea    0xeeb(%rip),%rdx
lea    0xeeb(%rip),%r9
mov    $0x1b,%esi
mov    $0x1b,%r8d
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%c%s%c%c%s\00"
@.str.1 = [7 x i8] c"[1;31m\00"
@.str.2 = [4 x i8] c"[0m\00"
define void @pstring_red(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 27, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 27, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%c%s%c%c%s\00"
@.str.1 = [7 x i8] c"[1;31m\00"
@.str.2 = [4 x i8] c"[0m\00"
define void @pstring_red(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 27, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %2, i32 27, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}
void foo_1_2_1_2_2_1_1_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_1_2_2_1_1_1_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
bool tread_val_end(void *s) {
  fprintf(stderr, "val_end\n");
  return true;
}


x86 assembly (clang, -O0):
<tread_val_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [9 x i8] c"val_end\0A\00"
define i32 @tread_val_end(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [9 x i8] c"val_end\0A\00"
define i32 @tread_val_end(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
_Bool dt_leap_year(int y) {
  return ((y & 3) == 0 && (y % 100 != 0 || y % 400 == 0));
}


x86 assembly (clang, -O0):
<dt_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x3,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    114e <dt_leap_year+0x4e>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    1148 <dt_leap_year+0x48>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dt_leap_year>:
test   $0x3,%dil
je     1109 <dt_leap_year+0x9>
xor    %eax,%eax
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x1,%al
cmp    $0x28f5c28,%edx
jbe    1125 <dt_leap_year+0x25>
ret
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
setb   %al
ret

LLVM IR (-O0):
define zeroext i1 @dt_leap_year(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 100
%9 = icmp ne i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = srem i32 %11, 400
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %1
%17 = phi i1 [ false, %1 ], [ %15, %14 ]
ret i1 %17
}

LLVM IR (-O2):
define zeroext i1 @dt_leap_year(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
br label %10
10: ; preds = %4, %7, %1
%11 = phi i1 [ false, %1 ], [ true, %4 ], [ %9, %7 ]
ret i1 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fmt_err_exit(char *, char const *, int /*<<< orphan*/);
int open(char const *, int, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int open_file(const char *file, int oflags, mode_t mode) {
  int fd;
  if ((fd = open(file, oflags, mode)) == -1)
    fmt_err_exit("%s: %s", file, strerror(errno));
  return fd;
}


x86 assembly (clang, -O0):
<open_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <open@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
jne    1185 <open_file+0x55>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
lea    0xe80(%rip),%rdi
call   1050 <fmt_err_exit@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_file>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <open@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
jne    1161 <open_file+0x31>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xea9(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <fmt_err_exit@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%s: %s\00"
@errno = global i32 0
define i32 @open_file(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @open(i8* %8, i32 %9, i32 %10)
store i32 %11, i32* %7
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %18
13: ; preds = %3
%14 = load i8*, i8** %4
%15 = load i32, i32* @errno
%16 = call i32 @strerror(i32 %15)
%17 = call i32 @fmt_err_exit(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %14, i32 %16)
br label %18
18: ; preds = %13, %3
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s: %s\00"
@errno = global i32 0
define i32 @open_file(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @open(i8* %0, i32 %1, i32 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i32, i32* @errno
%8 = tail call i32 @strerror(i32 %7)
%9 = tail call i32 @fmt_err_exit(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %8)
br label %10
10: ; preds = %6, %3
ret i32 %4
}
/* Type definitions */
struct map_session_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ map_who(int const);
int atcommand_who(const int fd, struct map_session_data *sd,
                  const char *command, const char *message) {
  map_who(fd);
  return 0;
}


x86 assembly (clang, -O0):
<atcommand_who>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <map_who@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.map_session_data = type { i32 }
define i32 @atcommand_who(i32 %0, %struct.map_session_data* %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca %struct.map_session_data*
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %5
store %struct.map_session_data* %1, %struct.map_session_data** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = call i32 @map_who(i32 %9)
ret i32 0
}

LLVM IR (-O2):
%struct.map_session_data = type { i32 }
define i32 @atcommand_who(i32 %0, %struct.map_session_data* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
%5 = tail call i32 @map_who(i32 %0)
ret i32 0
}
/* Variables and functions */
void *realloc(void *, size_t);
int /*<<< orphan*/ xcmemcheck(void *);
void *xcrealloc(void *ptr, size_t size) {
  void *mem;
  mem = realloc(ptr, size);
  xcmemcheck(mem);
  return (mem);
}


x86 assembly (clang, -O0):
<xcrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <xcmemcheck@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcrealloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <xcmemcheck@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @xcrealloc(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 i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = call i32 @xcmemcheck(i8* %9)
%11 = load i8*, i8** %5
ret i8* %11
}

LLVM IR (-O2):
define i8* @xcrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = tail call i32 @xcmemcheck(i8* %3)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ PresetIntegratedMotorEncoder(int, int /*<<< orphan*/);
void resetIME(int motor) { PresetIntegratedMotorEncoder(motor, 0); }


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

x86 assembly (clang, -O2):
<resetIME>:
xor    %esi,%esi
jmp    1030 <PresetIntegratedMotorEncoder@plt>

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

LLVM IR (-O2):
define void @resetIME(i32 %0) {
%2 = tail call i32 @PresetIntegratedMotorEncoder(i32 %0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
scalar_t__ strncmp(char *, char *, int /*<<< orphan*/);
int hasprefix(char *s, char *prefix) {
  return strncmp(s, prefix, strlen(prefix)) == 0;
}


x86 assembly (clang, -O0):
<hasprefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hasprefix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @hasprefix(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @strncmp(i8* %5, i8* %6, i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @hasprefix(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
float sqrt(int);
float etr_area_high(float high) {
  float square_root_3 = sqrt(3);
  float area = (high * high) / square_root_3;
  return area;
}


x86 assembly (clang, -O0):
<etr_area_high>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x3,%edi
call   1030 <sqrt@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<etr_area_high>:
push   %rax
movss  %xmm0,0x4(%rsp)
mov    $0x3,%edi
call   1030 <sqrt@plt>
movss  0x4(%rsp),%xmm1
mulss  %xmm1,%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @etr_area_high(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %2
%5 = call float @sqrt(i32 3)
store float %5, float* %3
%6 = load float, float* %2
%7 = load float, float* %2
%8 = fmul float %6, %7
%9 = load float, float* %3
%10 = fdiv float %8, %9
store float %10, float* %4
%11 = load float, float* %4
ret float %11
}

LLVM IR (-O2):
define float @etr_area_high(float %0) {
%2 = tail call float @sqrt(i32 3)
%3 = fmul float %0, %0
%4 = fdiv float %3, %2
ret float %4
}
void I444Scale() {}


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

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

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

LLVM IR (-O2):
define void @I444Scale() {
ret void
}
/* Type definitions */
struct bt_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct bt_node *);
void bt_free_node(struct bt_node *node) { free(node); }


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

x86 assembly (clang, -O2):
<bt_free_node>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.bt_node = type { i32 }
define void @bt_free_node(%struct.bt_node* %0) {
%2 = alloca %struct.bt_node*
store %struct.bt_node* %0, %struct.bt_node** %2
%3 = load %struct.bt_node*, %struct.bt_node** %2
%4 = call i32 @free(%struct.bt_node* %3)
ret void
}

LLVM IR (-O2):
%struct.bt_node = type { i32 }
define void @bt_free_node(%struct.bt_node* nocapture %0) {
%2 = tail call i32 @free(%struct.bt_node* %0)
ret void
}
XSetFontPath() {}


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

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

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

LLVM IR (-O2):
define i32 @XSetFontPath() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int unlink(char const *);
int _unlink(char const *file) {
  if (unlink(file) == -1) {
    fputs("unlink"
          ": ",
          stderr);
    perror(file);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<_unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
cmp    $0xffffffff,%eax
jne    1178 <_unlink+0x48>
mov    0x2e8b(%rip),%rax
mov    (%rax),%esi
lea    0xea2(%rip),%rdi
call   1040 <fputs@plt>
mov    -0x10(%rbp),%rdi
call   1050 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    117f <_unlink+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_unlink>:
push   %rbx
mov    %rdi,%rbx
call   1030 <unlink@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
je     1144 <_unlink+0x14>
pop    %rbx
ret
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
lea    0xeac(%rip),%rdi
call   1040 <fputs@plt>
mov    %rbx,%rdi
call   1050 <perror@plt>
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"unlink: \00"
@stderr = global i32 0
define i32 @_unlink(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 @perror(i8* %0)
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int japi_textarea(int, int, int);
int j_textarea(int arg0, int arg1, int arg2) {
  return (japi_textarea(arg0, arg1, arg2));
}


x86 assembly (clang, -O0):
<j_textarea>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <japi_textarea@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j_textarea>:
jmp    1030 <japi_textarea@plt>

LLVM IR (-O0):
define i32 @j_textarea(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @japi_textarea(i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @j_textarea(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @japi_textarea(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
int hash(int key, int hashSize) {
  int hashedValue = key * (key + 2);
  return (hashedValue) % hashSize;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x2,%ecx
imul   %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
lea    0x2(%rdi),%eax
imul   %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 2
%4 = mul nsw i32 %3, %0
%5 = srem i32 %4, %1
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ *visual;
};
typedef TYPE_1__ XVisualInfo;
typedef int /*<<< orphan*/ Visual;

/* Variables and functions */
void set_XVisualInfo_visual(void *_p, void *_v) {
  ((XVisualInfo *)_p)->visual = (Visual *)_v;
}


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

x86 assembly (clang, -O2):
<set_XVisualInfo_visual>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32* }
define void @set_XVisualInfo_visual(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.TYPE_2__*
%9 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %8, i32 0, i32 0
store i32* %6, i32** %9
ret void
}

LLVM IR (-O2):
define void @set_XVisualInfo_visual(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AdjustLED1Brightness();
int /*<<< orphan*/ InitApp();
void main(void) {
  InitApp();
  while (1) {
    AdjustLED1Brightness();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <InitApp@plt>
mov    $0x0,%al
call   1040 <AdjustLED1Brightness@plt>
jmp    112b <main+0xb>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <InitApp@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <AdjustLED1Brightness@plt>
jmp    1130 <main+0x10>

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @InitApp()
br label %2
2: ; preds = %0, %2
%3 = tail call i32 (...) @AdjustLED1Brightness()
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
int /*<<< orphan*/ string_append_n(void *, int /*<<< orphan*/,
                                   int /*<<< orphan*/);
int /*<<< orphan*/ string_get_chars(void *);
int /*<<< orphan*/ string_get_length(void *);
void string_append_string(void *self, void *string) {
  assert(string);
  string_append_n(self, string_get_chars(string), string_get_length(string));
}


x86 assembly (clang, -O0):
<string_append_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <string_get_chars@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <string_get_length@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    %eax,%edx
call   1030 <string_append_n@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_append_string>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1060 <string_get_chars@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <string_get_length@plt>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %eax,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <string_append_n@plt>

LLVM IR (-O0):
define void @string_append_string(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @assert(i8* %5)
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @string_get_chars(i8* %8)
%10 = load i8*, i8** %4
%11 = call i32 @string_get_length(i8* %10)
%12 = call i32 @string_append_n(i8* %7, i32 %9, i32 %11)
ret void
}

LLVM IR (-O2):
define void @string_append_string(i8* %0, i8* %1) {
%3 = tail call i32 @assert(i8* %1)
%4 = tail call i32 @string_get_chars(i8* %1)
%5 = tail call i32 @string_get_length(i8* %1)
%6 = tail call i32 @string_append_n(i8* %0, i32 %4, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ system(char *);
void doDmesg(void) {
  puts("\n---------------------------------------------------------------------"
       "----------\n");
  printf("dmesg output:\n\n");
  fflush(stdout);
  system("dmesg");
}


x86 assembly (clang, -O0):
<doDmesg>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
lea    0xefb(%rip),%rdi
call   1050 <printf@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
lea    0xef1(%rip),%rdi
call   1040 <system@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<doDmesg>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf14(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
lea    0xef4(%rip),%rdi
pop    %rax
jmp    1040 <system@plt>

LLVM IR (-O0):
@.str = [82 x i8] c"\0A-------------------------------------------------------------------------------\0A\00"
@.str.1 = [16 x i8] c"dmesg output:\0A\0A\00"
@stdout = global i32 0
@.str.2 = [6 x i8] c"dmesg\00"
define void @doDmesg() {
%1 = call i32 @puts(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
%5 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [82 x i8] c"\0A-------------------------------------------------------------------------------\0A\00"
@stdout = global i32 0
@.str.2 = [6 x i8] c"dmesg\00"
@str = [15 x i8] c"dmesg output:\0A\00"
define void @doDmesg() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
%5 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int io_con_put_str(char const *);
int con_put_str(char const *str) { return io_con_put_str(str); }


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

x86 assembly (clang, -O2):
<con_put_str>:
jmp    1030 <io_con_put_str@plt>

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

LLVM IR (-O2):
define i32 @con_put_str(i8* %0) {
%2 = tail call i32 @io_con_put_str(i8* %0)
ret i32 %2
}
void register_user(char *username, char *password) { return; }


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

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

LLVM IR (-O0):
define void @register_user(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @register_user(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void lower_hook_pre(char **s) { printf("to_lower called on '%s'\n", *s); }


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

x86 assembly (clang, -O2):
<lower_hook_pre>:
mov    (%rdi),%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"to_lower called on '%s'\0A\00"
define void @lower_hook_pre(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"to_lower called on '%s'\0A\00"
define void @lower_hook_pre(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
int fz_colordodge_byte(int bd, int s) {
  if (s < 255)
    return ((255) < (255 * bd / (255 - s)) ? (255) : (255 * bd / (255 - s)));
  else
    return 255;
}


x86 assembly (clang, -O0):
<fz_colordodge_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xff,-0xc(%rbp)
jge    1165 <fz_colordodge_byte+0x65>
imul   $0xff,-0x8(%rbp),%eax
mov    $0xff,%ecx
sub    -0xc(%rbp),%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    $0xff,%eax
cmp    %ecx,%eax
jge    1145 <fz_colordodge_byte+0x45>
mov    $0xff,%eax
mov    %eax,-0x10(%rbp)
jmp    115a <fz_colordodge_byte+0x5a>
imul   $0xff,-0x8(%rbp),%eax
mov    $0xff,%ecx
sub    -0xc(%rbp),%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116c <fz_colordodge_byte+0x6c>
movl   $0xff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fz_colordodge_byte>:
mov    $0xff,%ecx
cmp    $0xfe,%esi
jg     112b <fz_colordodge_byte+0x2b>
mov    %edi,%eax
shl    $0x8,%eax
sub    %edi,%eax
mov    $0xff,%ecx
mov    $0xff,%edi
sub    %esi,%edi
cltd
idiv   %edi
cmp    $0xff,%eax
cmovl  %eax,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fz_colordodge_byte(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* %5
%7 = icmp slt i32 %6, 255
br i1 %7, label %8, label %24
8: ; preds = %2
%9 = load i32, i32* %4
%10 = mul nsw i32 255, %9
%11 = load i32, i32* %5
%12 = sub nsw i32 255, %11
%13 = sdiv i32 %10, %12
%14 = icmp slt i32 255, %13
br i1 %14, label %15, label %16
15: ; preds = %8
br label %22
16: ; preds = %8
%17 = load i32, i32* %4
%18 = mul nsw i32 255, %17
%19 = load i32, i32* %5
%20 = sub nsw i32 255, %19
%21 = sdiv i32 %18, %20
br label %22
22: ; preds = %16, %15
%23 = phi i32 [ 255, %15 ], [ %21, %16 ]
store i32 %23, i32* %3
br label %25
24: ; preds = %2
store i32 255, i32* %3
br label %25
25: ; preds = %24, %22
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @fz_colordodge_byte(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 255
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = mul nsw i32 %0, 255
%6 = sub nsw i32 255, %1
%7 = sdiv i32 %5, %6
%8 = icmp slt i32 %7, 255
%9 = select i1 %8, i32 %7, i32 255
br label %10
10: ; preds = %2, %4
%11 = phi i32 [ %9, %4 ], [ 255, %2 ]
ret i32 %11
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int ilog2_32(unsigned int);
int32_t coff_sectalign_flags(unsigned int align) {
  return (ilog2_32(align) + 1) << 20;
}


x86 assembly (clang, -O0):
<coff_sectalign_flags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ilog2_32@plt>
add    $0x1,%eax
shl    $0x14,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coff_sectalign_flags>:
push   %rax
call   1030 <ilog2_32@plt>
shl    $0x14,%eax
add    $0x100000,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @coff_sectalign_flags(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ilog2_32(i32 %3)
%5 = add nsw i32 %4, 1
%6 = shl i32 %5, 20
ret i32 %6
}

LLVM IR (-O2):
define i32 @coff_sectalign_flags(i32 %0) {
%2 = tail call i32 @ilog2_32(i32 %0)
%3 = shl i32 %2, 20
%4 = add i32 %3, 1048576
ret i32 %4
}
int vertice_na_solucao(int a[], int k, int vertice) {
  int i;
  for (i = 0; i < k; i++) {
    if (a[i] == vertice) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<vertice_na_solucao>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1154 <vertice_na_solucao+0x54>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1141 <vertice_na_solucao+0x41>
movl   $0x1,-0x4(%rbp)
jmp    115b <vertice_na_solucao+0x5b>
jmp    1146 <vertice_na_solucao+0x46>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <vertice_na_solucao+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vertice_na_solucao>:
test   %esi,%esi
jle    111e <vertice_na_solucao+0x1e>
mov    %esi,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %edx,(%rdi,%rcx,4)
je     1121 <vertice_na_solucao+0x21>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <vertice_na_solucao+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @vertice_na_solucao(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, %2
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %9, %7, %3
%16 = phi i32 [ 0, %3 ], [ 0, %7 ], [ 1, %9 ]
ret i32 %16
}
/* Variables and functions */
int S_ISCHR(unsigned int);
int s_ifchr(unsigned int m) { return S_ISCHR(m); }


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

x86 assembly (clang, -O2):
<s_ifchr>:
jmp    1030 <S_ISCHR@plt>

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

LLVM IR (-O2):
define i32 @s_ifchr(i32 %0) {
%2 = tail call i32 @S_ISCHR(i32 %0)
ret i32 %2
}