xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) {
  float notas[2][4] = {{8, 7, 9, 3}, {4, 5, 8, 6}};
  printf("%.1f\n", notas[0][3]);
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xebd(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x18(%rbp)
movss  -0x24(%rbp),%xmm0
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
lea    0xeac(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
movss  0xed0(%rip),%xmm0
call   1040 <printf@plt>
lea    0xece(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.notas = [2 x [4 x float]] [[4 x float] [float 8.000000e+00, float 7.000000e+00, float 9.000000e+00, float 3.000000e+00], [4 x float] [float 4.000000e+00, float 5.000000e+00, float 8.000000e+00, float 6.000000e+00]]
@.str = [6 x i8] c"%.1f\0A\00"
@.str.1 = [6 x i8] c"pause\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x [4 x float]]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [2 x [4 x float]]* %6 to i8*
%8 = getelementptr inbounds [2 x [4 x float]], [2 x [4 x float]]* %6, i64 0, i64 0
%9 = getelementptr inbounds [4 x float], [4 x float]* %8, i64 0, i64 3
%10 = load float, float* %9
%11 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float %10)
%12 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.1f\0A\00"
@.str.1 = [6 x i8] c"pause\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float 3.000000e+00)
%4 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ MYSQL;

/* Variables and functions */
int /*<<< orphan*/ mysql_close(int /*<<< orphan*/ *);
void desconectar(MYSQL *mysql_conn) { mysql_close(mysql_conn); }


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

x86 assembly (clang, -O2):
<desconectar>:
jmp    1030 <mysql_close@plt>

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

LLVM IR (-O2):
define void @desconectar(i32* %0) {
%2 = tail call i32 @mysql_close(i32* %0)
ret void
}
int test_imm_F0uint8_mem(unsigned char *val) {
  return ((*val) & (-0xF0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F0uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xffffff10,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F0uint8_mem>:
testb  $0x10,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_F0uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 16
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ show_help(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void show_help_and_exit(void) {
  show_help(stderr);
  exit(1);
}


x86 assembly (clang, -O0):
<show_help_and_exit>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1030 <show_help@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<show_help_and_exit>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1030 <show_help@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @show_help_and_exit() {
%1 = load i32, i32* @stderr
%2 = call i32 @show_help(i32 %1)
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
define void @show_help_and_exit() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @show_help(i32 %1)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ pixel_avg_wxh(int /*<<< orphan*/ *, int,
                                 int /*<<< orphan*/ *, int, int, int);
void pixel_avg_2x4(uint8_t *pix1, int i_stride_pix1, uint8_t *pix2,
                   int i_stride_pix2) {
  pixel_avg_wxh(pix1, i_stride_pix1, pix2, i_stride_pix2, 2, 4);
}


x86 assembly (clang, -O0):
<pixel_avg_2x4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x2,%r8d
mov    $0x4,%r9d
call   1030 <pixel_avg_wxh@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel_avg_2x4>:
mov    $0x2,%r8d
mov    $0x4,%r9d
jmp    1030 <pixel_avg_wxh@plt>

LLVM IR (-O0):
define void @pixel_avg_2x4(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 = load i32, i32* %6
%11 = load i32*, i32** %7
%12 = load i32, i32* %8
%13 = call i32 @pixel_avg_wxh(i32* %9, i32 %10, i32* %11, i32 %12, i32 2, i32 4)
ret void
}

LLVM IR (-O2):
define void @pixel_avg_2x4(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = tail call i32 @pixel_avg_wxh(i32* %0, i32 %1, i32* %2, i32 %3, i32 2, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __default_config_init();
int /*<<< orphan*/ __init_percent_encoding_map();
void http_init() {
  __default_config_init();
  __init_percent_encoding_map();
}


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

x86 assembly (clang, -O2):
<http_init>:
push   %rax
xor    %eax,%eax
call   1030 <__default_config_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <__init_percent_encoding_map@plt>

LLVM IR (-O0):
define void @http_init() {
%1 = call i32 (...) @__default_config_init()
%2 = call i32 (...) @__init_percent_encoding_map()
ret void
}

LLVM IR (-O2):
define void @http_init() {
%1 = tail call i32 (...) @__default_config_init()
%2 = tail call i32 (...) @__init_percent_encoding_map()
ret void
}
int RTco_currentThread(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @RTco_currentThread() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ input();
int /*<<< orphan*/ solve();
int main() {
  input();
  solve();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <input@plt>
mov    $0x0,%al
call   1030 <solve@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @input()
%3 = call i32 (...) @solve()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @input()
%2 = tail call i32 (...) @solve()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cpc_ClrScr();
int /*<<< orphan*/ printf(char *);
void menuConfigurar() {
  cpc_ClrScr();
  printf("1. Sonido");
  printf("2. Teclado");
  printf("3. Volver");
}


x86 assembly (clang, -O0):
<menuConfigurar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <cpc_ClrScr@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<menuConfigurar>:
push   %rax
xor    %eax,%eax
call   1040 <cpc_ClrScr@plt>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"1. Sonido\00"
@.str.1 = [11 x i8] c"2. Teclado\00"
@.str.2 = [10 x i8] c"3. Volver\00"
define void @menuConfigurar() {
%1 = call i32 (...) @cpc_ClrScr()
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"1. Sonido\00"
@.str.1 = [11 x i8] c"2. Teclado\00"
@.str.2 = [10 x i8] c"3. Volver\00"
define void @menuConfigurar() {
%1 = tail call i32 (...) @cpc_ClrScr()
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int yogrt_get_fudge_factor();
int iyogrt_get_fudge_factor__(void) { return yogrt_get_fudge_factor(); }


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

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

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

LLVM IR (-O2):
define i32 @iyogrt_get_fudge_factor__() {
%1 = tail call i32 (...) @yogrt_get_fudge_factor()
ret i32 %1
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *__softboundcets_safe_calloc(size_t nmemb, size_t size) {
  return calloc(nmemb, size);
}


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

x86 assembly (clang, -O2):
<__softboundcets_safe_calloc>:
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define noalias i8* @__softboundcets_safe_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void print_usage(char *prog) {
  fprintf(stderr, "%s [-p port|-f file]\n", prog);
  fprintf(stderr, " -p port : listen port\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%edi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee2(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"%s [-p port|-f file]\0A\00"
@.str.1 = [24 x i8] c" -p port : listen port\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"%s [-p port|-f file]\0A\00"
@.str.1 = [24 x i8] c" -p port : listen port\0A\00"
define void @print_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int32_t sign_extend(uint32_t val, uint32_t bits) {
  int32_t r;
  int32_t const m = 1U << (bits - 1);
  val = val & ((1U << bits) - 1);
  r = (val ^ m) - m;
  return r;
}


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

x86 assembly (clang, -O2):
<sign_extend>:
lea    -0x1(%rsi),%r8d
mov    $0x1,%edx
mov    %r8d,%ecx
shl    %cl,%edx
mov    $0xffffffff,%eax
mov    %esi,%ecx
shl    %cl,%eax
not    %eax
and    %edi,%eax
btc    %r8d,%eax
sub    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @sign_extend(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = shl nuw i32 1, %3
%5 = shl nsw i32 -1, %1
%6 = xor i32 %5, -1
%7 = and i32 %6, %0
%8 = xor i32 %7, %4
%9 = sub nsw i32 %8, %4
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ gui_set_label_highlight(int, int, int, int);
void gui_set_menu_edit(int edit) {
  if (edit) {
    gui_set_label_highlight(10, 14, 14, 1);
  } else {
    gui_set_label_highlight(10, 14, 14, 0);
  }
}


x86 assembly (clang, -O0):
<gui_set_menu_edit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1140 <gui_set_menu_edit+0x30>
mov    $0xa,%edi
mov    $0xe,%edx
mov    $0x1,%ecx
mov    %edx,%esi
call   1030 <gui_set_label_highlight@plt>
jmp    1153 <gui_set_menu_edit+0x43>
mov    $0xa,%edi
mov    $0xe,%edx
xor    %ecx,%ecx
mov    %edx,%esi
call   1030 <gui_set_label_highlight@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_set_menu_edit>:
xor    %ecx,%ecx
test   %edi,%edi
setne  %cl
mov    $0xa,%edi
mov    $0xe,%esi
mov    $0xe,%edx
jmp    1030 <gui_set_label_highlight@plt>

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

LLVM IR (-O2):
define void @gui_set_menu_edit(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @gui_set_label_highlight(i32 10, i32 14, i32 14, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  double pi = 3.14159265358;
  int *ptr;
  ptr = &pi;
  printf("Value of pi : %lf\n", pi);
  printf("Value of pi : %lf\n", *ptr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cvttsd2si -0x10(%rbp),%esi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"Value of pi : %lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i32*
store i32 0, i32* %1
store double 0x400921FB5443D6F4, double* %2
%4 = bitcast double* %2 to i32*
store i32* %4, i32** %3
%5 = load double, double* %2
%6 = fptosi double %5 to i32
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Value of pi : %lf\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 1413732084)
ret i32 0
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ write_char(char);
void lcd_string(char *s) {
  int i;
  for (i = 0; i < strlen(s); i++) {
    write_char(s[i]);
  }
}


x86 assembly (clang, -O0):
<lcd_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    116e <lcd_string+0x4e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <write_char@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <lcd_string+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    115d <lcd_string+0x3d>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1040 <write_char@plt>
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <lcd_string+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @lcd_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %16, %1
%5 = load i32, i32* %3
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = icmp slt i32 %5, %7
br i1 %8, label %9, label %19
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i8, i8* %13
%15 = call i32 @write_char(i8 signext %14)
br label %16
16: ; preds = %9
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %4
19: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @lcd_string(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call i32 @write_char(i8 signext %7)
%9 = add nuw nsw i64 %5, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %9, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_array();
int /*<<< orphan*/ radix_sort(int);
int main(int argv, char *argc[]) {
  int placement = 1;
  radix_sort(1);
  placement *= 10;
  radix_sort(placement);
  placement *= 10;
  radix_sort(placement);
  print_array();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    $0x1,%edi
call   1040 <radix_sort@plt>
imul   $0xa,-0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <radix_sort@plt>
imul   $0xa,-0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <radix_sort@plt>
mov    $0x0,%al
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <radix_sort@plt>
mov    $0xa,%edi
call   1040 <radix_sort@plt>
mov    $0x64,%edi
call   1040 <radix_sort@plt>
xor    %eax,%eax
call   1030 <print_array@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
%7 = call i32 @radix_sort(i32 1)
%8 = load i32, i32* %6
%9 = mul nsw i32 %8, 10
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = call i32 @radix_sort(i32 %10)
%12 = load i32, i32* %6
%13 = mul nsw i32 %12, 10
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = call i32 @radix_sort(i32 %14)
%16 = call i32 (...) @print_array()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @radix_sort(i32 1)
%4 = tail call i32 @radix_sort(i32 10)
%5 = tail call i32 @radix_sort(i32 100)
%6 = tail call i32 (...) @print_array()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int mod5() {
  printf("mod5 from mod3\n");
  return 5;
}


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

x86 assembly (clang, -O2):
<mod5>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x5,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"mod5 from mod3\0A\00"
define i32 @mod5() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 5
}

LLVM IR (-O2):
@str = [15 x i8] c"mod5 from mod3\00"
define i32 @mod5() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 5
}
/* Variables and functions */
int ext2_get_block_size_in_sectors();
int lba_to_ext2_block(int lba) {
  return (lba - 2048) / ext2_get_block_size_in_sectors();
}


x86 assembly (clang, -O0):
<lba_to_ext2_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x800,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <ext2_get_block_size_in_sectors@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lba_to_ext2_block>:
push   %rbx
lea    -0x800(%rdi),%ebx
xor    %eax,%eax
call   1030 <ext2_get_block_size_in_sectors@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
pop    %rbx
ret

LLVM IR (-O0):
define i32 @lba_to_ext2_block(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 2048
%5 = call i32 (...) @ext2_get_block_size_in_sectors()
%6 = sdiv i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @lba_to_ext2_block(i32 %0) {
%2 = add nsw i32 %0, -2048
%3 = tail call i32 (...) @ext2_get_block_size_in_sectors()
%4 = sdiv i32 %2, %3
ret i32 %4
}
void fn0000000000401530() { return; }


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @fn0000000000401530() {
ret void
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR65_set(void) { return U_WMRCORENONE_set("U_WMR65"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR65\00"
define i8* @U_WMR65_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR65\00"
define i8* @U_WMR65_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
void op0xFC(void) {}


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

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

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

LLVM IR (-O2):
define void @op0xFC() {
ret void
}
void smootheningPrepareEdges(unsigned int *hostEdges,
                             unsigned int *hostNumEdges,
                             unsigned int totaledges,
                             unsigned int totalvertices, unsigned int **edges,
                             unsigned int **numedges) {
  *edges = hostEdges;
  *numedges = hostNumEdges;
}


x86 assembly (clang, -O0):
<smootheningPrepareEdges>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @smootheningPrepareEdges(i32* %0, i32* %1, i32 %2, i32 %3, i32** %4, i32** %5) {
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32**
%12 = alloca i32**
store i32* %0, i32** %7
store i32* %1, i32** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32** %4, i32*** %11
store i32** %5, i32*** %12
%13 = load i32*, i32** %7
%14 = load i32**, i32*** %11
store i32* %13, i32** %14
%15 = load i32*, i32** %8
%16 = load i32**, i32*** %12
store i32* %15, i32** %16
ret void
}

LLVM IR (-O2):
define void @smootheningPrepareEdges(i32* %0, i32* %1, i32 %2, i32 %3, i32** nocapture writeonly %4, i32** nocapture writeonly %5) {
store i32* %0, i32** %4
store i32* %1, i32** %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int create_socket(char *, int);
int /*<<< orphan*/ writeline(int, char *);
int node_down(char *host) {
  int connfd = create_socket(host, 2003);
  if (connfd < 0) {
    return 1;
  }
  writeline(connfd, "KEEPALIVE");
  close(connfd);
  return 0;
}


x86 assembly (clang, -O0):
<node_down>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x7d3,%esi
call   1040 <create_socket@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1163 <node_down+0x33>
movl   $0x1,-0x4(%rbp)
jmp    1181 <node_down+0x51>
mov    -0x14(%rbp),%edi
lea    0xe93(%rip),%rsi
call   1050 <writeline@plt>
mov    -0x14(%rbp),%edi
call   1030 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<node_down>:
push   %rbx
mov    $0x7d3,%esi
call   1040 <create_socket@plt>
test   %eax,%eax
js     115a <node_down+0x2a>
mov    %eax,%ebx
lea    0xeb8(%rip),%rsi
mov    %eax,%edi
call   1050 <writeline@plt>
mov    %ebx,%edi
call   1030 <close@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"KEEPALIVE\00"
define i32 @node_down(i8* %0) {
%2 = tail call i32 @create_socket(i8* %0, i32 2003)
%3 = icmp slt i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @writeline(i32 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @close(i32 %2)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ 0, %4 ], [ 1, %1 ]
ret i32 %8
}
const char *Swap_Name(void) { return "Swap"; }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"Swap\00"
define i8* @Swap_Name() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"Swap\00"
define i8* @Swap_Name() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
void pauseme(void) {
  char single_char = '\0';
  printf("Paused - press ENTER");
  scanf("%c", &single_char);
}


x86 assembly (clang, -O0):
<pauseme>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1040 <scanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pauseme>:
push   %rax
movb   $0x0,0x7(%rsp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Paused - press ENTER\00"
@.str.1 = [3 x i8] c"%c\00"
define void @pauseme() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Paused - press ENTER\00"
@.str.1 = [3 x i8] c"%c\00"
define void @pauseme() {
%1 = alloca i8
store i8 0, i8* %1
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret void
}
double foo(int x) { return (double)(float)((x & -16) | (int)0xfe00000); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfffffff0,%eax
or     $0xfe00000,%eax
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
and    $0xf01ffff0,%edi
or     $0xfe00000,%edi
cvtsi2ss %edi,%xmm0
cvtss2sd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -16
%5 = or i32 %4, 266338304
%6 = sitofp i32 %5 to float
%7 = fpext float %6 to double
ret double %7
}

LLVM IR (-O2):
define double @foo(i32 %0) {
%2 = and i32 %0, -266338320
%3 = or i32 %2, 266338304
%4 = sitofp i32 %3 to float
%5 = fpext float %4 to double
ret double %5
}
void g_node_push_allocator() {}


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

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

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

LLVM IR (-O2):
define void @g_node_push_allocator() {
ret void
}
int close(int fd) {
  int ret = 0;
  asm("movl $6,%%eax  \n\t"
      "movl %1,%%ebx  \n\t"
      "int $0x80  \n\t"
      "movl %%eax,%0 \n\t"
      : "=m"(ret)
      : "m"(fd));
  return ret;
}


x86 assembly (clang, -O0):
<close>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x6,%eax
mov    -0x4(%rbp),%ebx
int    $0x80
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<close>:
mov    %edi,-0x4(%rsp)
movl   $0x0,-0x8(%rsp)
mov    $0x6,%eax
mov    -0x4(%rsp),%ebx
int    $0x80
mov    %eax,-0x8(%rsp)
mov    -0x8(%rsp),%eax
ret

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

LLVM IR (-O2):
define i32 @close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = load i32, i32* %3
ret i32 %5
}
void inc_zcache_pageframes_freed(void) {}


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

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

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

LLVM IR (-O2):
define void @inc_zcache_pageframes_freed() {
ret void
}
void init_clock() { return; }


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

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

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

LLVM IR (-O2):
define void @init_clock() {
ret void
}
/* Variables and functions */
double exp(double);
double piemathExp(double a) { return exp(a); }


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

x86 assembly (clang, -O2):
<piemathExp>:
jmp    1030 <exp@plt>

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

LLVM IR (-O2):
define double @piemathExp(double %0) {
%2 = tail call double @exp(double %0)
ret double %2
}
void aj(int *liste, int nb) {
  int i = 0;
  while (liste[i] != 0)
    i++;
  *(liste + i) = nb;
  return;
}


x86 assembly (clang, -O0):
<aj>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1132 <aj+0x32>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <aj+0x12>
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<aj>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpl   $0x0,0x4(%rdi,%rax,4)
lea    0x1(%rax),%rax
jne    1110 <aj+0x10>
mov    %eax,%eax
mov    %esi,(%rdi,%rax,4)
ret

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

LLVM IR (-O2):
define void @aj(i32* nocapture %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %8, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = and i64 %4, 4294967295
%11 = getelementptr inbounds i32, i32* %0, i64 %10
store i32 %1, i32* %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ putp(char *);
scalar_t__ ti(char *);
void sigterm(int s) {
  putp((char *)ti("cnorm"));
  exit(0);
}


x86 assembly (clang, -O0):
<sigterm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1040 <ti@plt>
mov    %rax,%rdi
call   1030 <putp@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<sigterm>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <ti@plt>
mov    %rax,%rdi
call   1030 <putp@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"cnorm\00"
define void @sigterm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 @ti(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = inttoptr i64 %3 to i8*
%5 = call i32 @putp(i8* %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [6 x i8] c"cnorm\00"
define void @sigterm(i32 %0) {
%2 = tail call i64 @ti(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @putp(i8* %3)
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct timespec {
  int tv_nsec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ pselect(int /*<<< orphan*/, int /*<<< orphan*/ *,
                           int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                           struct timespec *, int /*<<< orphan*/);
void one_beat() {
  struct timespec ts = {.tv_sec = 0, .tv_nsec = 100};
  pselect(0, NULL, NULL, NULL, &ts, 0);
}


x86 assembly (clang, -O0):
<one_beat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
xor    %r9d,%r9d
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x8(%rbp),%r8
mov    %r9d,%edi
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1030 <pselect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<one_beat>:
push   %rax
movq   $0x64,(%rsp)
mov    %rsp,%r8
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r9d,%r9d
call   1030 <pselect@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@__const.one_beat.ts = %struct.timespec { i32 100, i32 0 }
define void @one_beat() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = call i32 @pselect(i32 0, i32* null, i32* null, i32* null, %struct.timespec* %1, i32 0)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @one_beat() {
%1 = alloca i64
%2 = bitcast i64* %1 to %struct.timespec*
%3 = bitcast i64* %1 to i8*
store i64 100, i64* %1
%4 = call i32 @pselect(i32 0, i32* null, i32* null, i32* null, %struct.timespec* %2, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ key_t;

/* Variables and functions */
int IPC_CREAT;
int IPC_EXCL;
int /*<<< orphan*/ getkey(int);
int msgget(int /*<<< orphan*/, int);
int crearmsgq(int id) {
  key_t clave;
  clave = getkey(id);
  return (msgget(clave, IPC_CREAT | IPC_EXCL | 0660));
}


x86 assembly (clang, -O0):
<crearmsgq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <getkey@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2e98(%rip),%rax
mov    (%rax),%esi
mov    0x2ea7(%rip),%rax
or     (%rax),%esi
or     $0x1b0,%esi
call   1030 <msgget@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crearmsgq>:
push   %rax
call   1040 <getkey@plt>
mov    0x2eab(%rip),%rcx
mov    (%rcx),%esi
mov    0x2eba(%rip),%rcx
or     (%rcx),%esi
or     $0x1b0,%esi
mov    %eax,%edi
pop    %rax
jmp    1030 <msgget@plt>

LLVM IR (-O0):
@IPC_CREAT = global i32 0
@IPC_EXCL = global i32 0
define i32 @crearmsgq(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @getkey(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* @IPC_CREAT
%8 = load i32, i32* @IPC_EXCL
%9 = or i32 %7, %8
%10 = or i32 %9, 432
%11 = call i32 @msgget(i32 %6, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
@IPC_CREAT = global i32 0
@IPC_EXCL = global i32 0
define i32 @crearmsgq(i32 %0) {
%2 = tail call i32 @getkey(i32 %0)
%3 = load i32, i32* @IPC_CREAT
%4 = load i32, i32* @IPC_EXCL
%5 = or i32 %3, %4
%6 = or i32 %5, 432
%7 = tail call i32 @msgget(i32 %2, i32 %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ xprintf(char *);
void SL11Write(unsigned char address, unsigned char data) {
  if (address > 0xff) {
    xprintf("Invalid register access, register %x\n");
  }
  *((volatile unsigned char *)(((long unsigned int)(int)0xa0000000) |
                               (0x100C0000))) = (address);
  *((volatile unsigned char *)(((long unsigned int)(int)0xa0000000) |
                               (0x100C0000 + 8))) = (data);
}


x86 assembly (clang, -O0):
<SL11Write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0xff,%eax
jle    113f <SL11Write+0x2f>
lea    0xec6(%rip),%rdi
call   1030 <xprintf@plt>
mov    -0x1(%rbp),%cl
mov    $0xffffffffb00c0000,%rax
mov    %cl,(%rax)
mov    -0x2(%rbp),%cl
mov    $0xffffffffb00c0008,%rax
mov    %cl,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SL11Write>:
mov    %dil,0xffffffffb00c0000
b0
mov    %sil,0xffffffffb00c0008
b0
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Invalid register access, register %x\0A\00"
define void @SL11Write(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = icmp sgt i32 %6, 255
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @xprintf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = load i8, i8* %3
store volatile i8 %11, i8* inttoptr (i64 -1341390848 to i8*)
%12 = load i8, i8* %4
store volatile i8 %12, i8* inttoptr (i64 -1341390840 to i8*)
ret void
}

LLVM IR (-O2):
define void @SL11Write(i8 zeroext %0, i8 zeroext %1) {
store volatile i8 %0, i8* inttoptr (i64 -1341390848 to i8*)
store volatile i8 %1, i8* inttoptr (i64 -1341390840 to i8*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void BinIOSwap1(const uint8_t *src, uint8_t *dst) { *dst = *src; }


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

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

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

LLVM IR (-O2):
define void @BinIOSwap1(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lua_error(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void check_arg(int cond, char *func) {
  if (!cond) {
    char buff[100];
    sprintf(buff, "incorrect argument to function `%s'", func);
    lua_error(buff);
  }
}


x86 assembly (clang, -O0):
<check_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1159 <check_arg+0x39>
lea    -0x80(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeb5(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x80(%rbp),%rdi
call   1030 <lua_error@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_arg>:
test   %edi,%edi
je     1125 <check_arg+0x5>
ret
push   %rbx
sub    $0x70,%rsp
mov    %rsi,%rdx
lea    0xecc(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <lua_error@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"incorrect argument to function `%s'\00"
define void @check_arg(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [100 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %2
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%10 = load i8*, i8** %4
%11 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%13 = call i32 @lua_error(i8* %12)
br label %14
14: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"incorrect argument to function `%s'\00"
define void @check_arg(i32 %0, i8* %1) {
%3 = alloca [100 x i8]
%4 = icmp eq i32 %0, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%7 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %1)
%8 = call i32 @lua_error(i8* %6)
br label %9
9: ; preds = %5, %2
ret void
}
__attribute__((no, noclone)) char *f2(char *p) { return p - 1; }


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

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

LLVM IR (-O0):
define i8* @f2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 -1
ret i8* %4
}

LLVM IR (-O2):
define i8* @f2(i8* readnone %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -1
ret i8* %2
}
void gp2x_sound_frame(void *blah, void *buff, int samples) {}


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

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

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

LLVM IR (-O2):
define void @gp2x_sound_frame(i8* nocapture %0, i8* nocapture %1, i32 %2) {
ret void
}
void foo_1_2_2_2_1_2_1_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_2_2_1_2_1_1_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("double (1+2) is %d\n", 2 * 1 + 2);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [20 x i8] c"double (1+2) is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}