xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, float, float, float);
main() {
  float v1;
  float v2;
  float v3;
  v1 = 5;
  v2 = -4.5;
  v3 = 11.25;
  printf("v1 = %1.1f, v2 = %2.1f, v3 = %2.2f", v1, v2, v3);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xed8(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  0xec7(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xeb6(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee4(%rip),%rdi
movss  0xed0(%rip),%xmm0
movss  0xecc(%rip),%xmm1
movss  0xec8(%rip),%xmm2
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"v1 = %1.1f, v2 = %2.1f, v3 = %2.2f\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
store float 5.000000e+00, float* %1
store float -4.500000e+00, float* %2
store float 1.125000e+01, float* %3
%4 = load float, float* %1
%5 = load float, float* %2
%6 = load float, float* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), float %4, float %5, float %6)
%8 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"v1 = %1.1f, v2 = %2.1f, v3 = %2.2f\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), float 5.000000e+00, float -4.500000e+00, float 1.125000e+01)
%2 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char *, int, int, int);
void usage(const char *argv0, char *host_default, short port_default,
           int thread_count_default, int messages_default) {
  printf("Usage: %s [options]\n"
         "Options are:\n"
         "\t-h host\t\t(default = \"%s\")\n"
         "\t-p port\t\t(default = %d)\n"
         "\t-c threads\t(default = %d)\n"
         "\t-n count\t(number of messages per thread, default = %d)\n"
         "\t-v\t\t(verbose)\n",
         argv0, host_default, (int)port_default, thread_count_default,
         messages_default);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
movswl -0x12(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %r8d,%r9d
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xedb(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [184 x i8] c"Usage: %s [options]\0AOptions are:\0A\09-h host\09\09(default = \22%s\22)\0A\09-p port\09\09(default = %d)\0A\09-c threads\09(default = %d)\0A\09-n count\09(number of messages per thread, default = %d)\0A\09-v\09\09(verbose)\0A\00"
define void @usage(i8* %0, i8* %1, i16 signext %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i16
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i16 %2, i16* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i16, i16* %8
%14 = sext i16 %13 to i32
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = call i32 @printf(i8* getelementptr inbounds ([184 x i8], [184 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12, i32 %14, i32 %15, i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [184 x i8] c"Usage: %s [options]\0AOptions are:\0A\09-h host\09\09(default = \22%s\22)\0A\09-p port\09\09(default = %d)\0A\09-c threads\09(default = %d)\0A\09-n count\09(number of messages per thread, default = %d)\0A\09-v\09\09(verbose)\0A\00"
define void @usage(i8* %0, i8* %1, i16 signext %2, i32 %3, i32 %4) {
%6 = sext i16 %2 to i32
%7 = tail call i32 @printf(i8* getelementptr inbounds ([184 x i8], [184 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %6, i32 %3, i32 %4)
ret void
}
long example(void) { return 0xdeadbeef; }


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

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

LLVM IR (-O0):
define i64 @example() {
ret i64 3735928559
}

LLVM IR (-O2):
define i64 @example() {
ret i64 3735928559
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int led_mode;
};
typedef TYPE_1__ XKeyboardControl;

/* Variables and functions */
void set_XKeyboardControl_led_mode(void *_p, int _v) {
  ((XKeyboardControl *)_p)->led_mode = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XKeyboardControl_led_mode>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XKeyboardControl_led_mode(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
void wait(int se) {
  printf("Wait %d Second\n", se);
  sleep(se);
}


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

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"Wait %d Second\0A\00"
define void @wait(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @sleep(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__43__IO__makeInput();
void Msp430Adc12ImplP__Port63__makeInput(void) {
  HplMsp430GeneralIOP__43__IO__makeInput();
}


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

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

LLVM IR (-O0):
define void @Msp430Adc12ImplP__Port63__makeInput() {
%1 = call i32 (...) @HplMsp430GeneralIOP__43__IO__makeInput()
ret void
}

LLVM IR (-O2):
define void @Msp430Adc12ImplP__Port63__makeInput() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__43__IO__makeInput()
ret void
}
int test_and_change_bit(int nr, unsigned long *addr) {
  unsigned long mask = (1 << (nr));
  unsigned long old = *addr;
  *addr = old ^ mask;
  return (old & mask) != 0;
}


x86 assembly (clang, -O0):
<test_and_change_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
xor    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
and    -0x18(%rbp),%rax
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_and_change_bit>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rcx
mov    (%rsi),%rdx
mov    %rdx,%rax
xor    %rcx,%rax
mov    %rax,(%rsi)
xor    %eax,%eax
test   %rcx,%rdx
setne  %al
ret

LLVM IR (-O0):
define i32 @test_and_change_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
store i32 %0, i32* %3
store i64* %1, i64** %4
%7 = load i32, i32* %3
%8 = shl i32 1, %7
%9 = sext i32 %8 to i64
store i64 %9, i64* %5
%10 = load i64*, i64** %4
%11 = load i64, i64* %10
store i64 %11, i64* %6
%12 = load i64, i64* %6
%13 = load i64, i64* %5
%14 = xor i64 %12, %13
%15 = load i64*, i64** %4
store i64 %14, i64* %15
%16 = load i64, i64* %6
%17 = load i64, i64* %5
%18 = and i64 %16, %17
%19 = icmp ne i64 %18, 0
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @test_and_change_bit(i32 %0, i64* nocapture %1) {
%3 = shl nuw i32 1, %0
%4 = sext i32 %3 to i64
%5 = load i64, i64* %1
%6 = xor i64 %5, %4
store i64 %6, i64* %1
%7 = and i64 %5, %4
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Type definitions */
typedef scalar_t__ uint_least32_t;
typedef int uint_least16_t;

/* Variables and functions */
uint_least16_t endian_32lo16(uint_least32_t dword) {
  return (uint_least16_t)dword & 0xffff;
}


x86 assembly (clang, -O0):
<endian_32lo16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<endian_32lo16>:
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @endian_32lo16(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = and i32 %4, 65535
ret i32 %5
}

LLVM IR (-O2):
define i32 @endian_32lo16(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = and i32 %2, 65535
ret i32 %3
}
/* Type definitions */
struct const_Vector_T {
  int dummy;
};
struct Vector_T {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprint_const_Vector_T(int /*<<< orphan*/ *, int const,
                                         struct const_Vector_T const *);
void fprint_Vector_T(FILE *file, const int n_tab, struct Vector_T *a) {
  fprint_const_Vector_T(file, n_tab, (const struct const_Vector_T *)a);
}


x86 assembly (clang, -O0):
<fprint_Vector_T>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <fprint_const_Vector_T@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprint_Vector_T>:
jmp    1030 <fprint_const_Vector_T@plt>

LLVM IR (-O0):
%struct.Vector_T = type { i32 }
%struct.const_Vector_T = type { i32 }
define void @fprint_Vector_T(i32* %0, i32 %1, %struct.Vector_T* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca %struct.Vector_T*
store i32* %0, i32** %4
store i32 %1, i32* %5
store %struct.Vector_T* %2, %struct.Vector_T** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load %struct.Vector_T*, %struct.Vector_T** %6
%10 = bitcast %struct.Vector_T* %9 to %struct.const_Vector_T*
%11 = call i32 @fprint_const_Vector_T(i32* %7, i32 %8, %struct.const_Vector_T* %10)
ret void
}

LLVM IR (-O2):
%struct.Vector_T = type { i32 }
%struct.const_Vector_T = type { i32 }
define void @fprint_Vector_T(i32* %0, i32 %1, %struct.Vector_T* %2) {
%4 = bitcast %struct.Vector_T* %2 to %struct.const_Vector_T*
%5 = tail call i32 @fprint_const_Vector_T(i32* %0, i32 %1, %struct.const_Vector_T* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_config_parse() {
  printf("NOT IMPLEMENTED:"
         "pa_config_parse"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [32 x i8] c"NOT IMPLEMENTED:pa_config_parse\00"
define i32 @pa_config_parse() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct audioio_unix {
  int dummy;
};
struct audioio {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct audioio_unix *);
void iorelease(struct audioio *aio) {
  struct audioio_unix *audioio = (struct audioio_unix *)aio;
  free(audioio);
}


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

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

LLVM IR (-O0):
%struct.audioio = type { i32 }
%struct.audioio_unix = type { i32 }
define void @iorelease(%struct.audioio* %0) {
%2 = alloca %struct.audioio*
%3 = alloca %struct.audioio_unix*
store %struct.audioio* %0, %struct.audioio** %2
%4 = load %struct.audioio*, %struct.audioio** %2
%5 = bitcast %struct.audioio* %4 to %struct.audioio_unix*
store %struct.audioio_unix* %5, %struct.audioio_unix** %3
%6 = load %struct.audioio_unix*, %struct.audioio_unix** %3
%7 = call i32 @free(%struct.audioio_unix* %6)
ret void
}

LLVM IR (-O2):
%struct.audioio = type { i32 }
%struct.audioio_unix = type { i32 }
define void @iorelease(%struct.audioio* nocapture %0) {
%2 = bitcast %struct.audioio* %0 to %struct.audioio_unix*
%3 = tail call i32 @free(%struct.audioio_unix* %2)
ret void
}
void gtk_menu_set_screen() {}


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

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

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

LLVM IR (-O2):
define void @gtk_menu_set_screen() {
ret void
}
void av_sha512_init() {}


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

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

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

LLVM IR (-O2):
define void @av_sha512_init() {
ret void
}
int lis3l02dq_initialize_ring(struct iio_ring_buffer *ring) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.iio_ring_buffer = type opaque
define i32 @lis3l02dq_initialize_ring(%struct.iio_ring_buffer* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
error(char *s) {
  perror(s);
  exit(2);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
call   1030 <perror@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
define i32 @error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ dsfmt_gv_fill_array_close1_open2(double *, long);
void fill_array_close1_open2(double array[], long size) {
  dsfmt_gv_fill_array_close1_open2(array, size);
}


x86 assembly (clang, -O0):
<fill_array_close1_open2>:
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 <dsfmt_gv_fill_array_close1_open2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_array_close1_open2>:
jmp    1030 <dsfmt_gv_fill_array_close1_open2@plt>

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

LLVM IR (-O2):
define void @fill_array_close1_open2(double* %0, i64 %1) {
%3 = tail call i32 @dsfmt_gv_fill_array_close1_open2(double* %0, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(int *, int *, int);
void strncpy_good1() {
  int arr1[10];
  int arr2[20];
  strncpy(arr2, arr1, 40);
}


x86 assembly (clang, -O0):
<strncpy_good1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x80(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x28,%edx
call   1030 <strncpy@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy_good1>:
sub    $0x88,%rsp
lea    0x30(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x28,%edx
call   1030 <strncpy@plt>
add    $0x88,%rsp
ret

LLVM IR (-O0):
define void @strncpy_good1() {
%1 = alloca [10 x i32]
%2 = alloca [20 x i32]
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%5 = call i32 @strncpy(i32* %3, i32* %4, i32 40)
ret void
}

LLVM IR (-O2):
define void @strncpy_good1() {
%1 = alloca [10 x i32]
%2 = alloca [20 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [20 x i32]* %2 to i8*
%5 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%7 = call i32 @strncpy(i32* %5, i32* %6, i32 40)
ret void
}
int shr2_local(int x) { return 2 * x; }


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

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

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

LLVM IR (-O2):
define i32 @shr2_local(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int resp, a, b;
  resp = a + b;
  assert(resp == a + b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = add nsw i32 %4, %5
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = add nsw i32 %8, %9
%11 = icmp eq i32 %7, %10
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
ret i32 0
}
void gtk_tree_model_iter_n_children() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_model_iter_n_children() {
ret void
}
void wifi_rsp_flash_ps_erase_all(
    const struct wifi_msg_flash_ps_erase_all_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_flash_ps_erase_all_rsp_t = type opaque
define void @wifi_rsp_flash_ps_erase_all(%struct.wifi_msg_flash_ps_erase_all_rsp_t* nocapture %0) {
ret void
}
int free_ram() {
  extern int __heap_start, *__brkval;
  int v;
  return (int)&v - (__brkval == 0 ? (int)&__heap_start : (int)__brkval);
}


x86 assembly (clang, -O0):
<free_ram>:
push   %rbp
mov    %rsp,%rbp
lea    -0x4(%rbp),%rax
mov    %eax,-0x8(%rbp)
mov    0x2ed6(%rip),%rax
cmpq   $0x0,(%rax)
jne    112b <free_ram+0x2b>
mov    0x2eb5(%rip),%rax
mov    %eax,-0xc(%rbp)
jmp    1138 <free_ram+0x38>
mov    0x2eb6(%rip),%rax
mov    (%rax),%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_ram>:
lea    -0x4(%rsp),%rax
mov    0x2edc(%rip),%rcx
mov    (%rcx),%rcx
test   %rcx,%rcx
jne    111a <free_ram+0x1a>
mov    0x2ebe(%rip),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
@__brkval = external global i32*
@__heap_start = external global i32
define i32 @free_ram() {
%1 = alloca i32
%2 = ptrtoint i32* %1 to i32
%3 = load i32*, i32** @__brkval
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %6
5: ; preds = %0
br label %9
6: ; preds = %0
%7 = load i32*, i32** @__brkval
%8 = ptrtoint i32* %7 to i32
br label %9
9: ; preds = %6, %5
%10 = phi i32 [ ptrtoint (i32* @__heap_start to i32), %5 ], [ %8, %6 ]
%11 = sub nsw i32 %2, %10
ret i32 %11
}

LLVM IR (-O2):
@__brkval = external global i32*
@__heap_start = external global i32
define i32 @free_ram() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = ptrtoint i32* %1 to i64
%4 = trunc i64 %3 to i32
%5 = load i32*, i32** @__brkval
%6 = icmp eq i32* %5, null
%7 = ptrtoint i32* %5 to i64
%8 = trunc i64 %7 to i32
%9 = select i1 %6, i32 ptrtoint (i32* @__heap_start to i32), i32 %8
%10 = sub nsw i32 %4, %9
ret i32 %10
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_network_link_get_llmnr(int ifindex, char **llmnr) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_network_link_get_llmnr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_network_link_get_llmnr>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_network_link_get_llmnr(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_network_link_get_llmnr(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_xor_si128(int /*<<< orphan*/, int /*<<< orphan*/);
__attribute__((always_)) __m128i xorv(__m128i a, __m128i b) {
  return _mm_xor_si128(a, b);
}


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

x86 assembly (clang, -O2):
<xorv>:
jmp    1030 <_mm_xor_si128@plt>

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

LLVM IR (-O2):
define i32 @xorv(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_xor_si128(i32 %0, i32 %1)
ret i32 %3
}
int lib2t32(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @lib2t32() {
ret i32 2
}

LLVM IR (-O2):
define i32 @lib2t32() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ a_0_55(int, char *);
void a_0_70(void) {
  { a_0_55(((((22)))), "TO?"); }
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"TO?\00"
define void @a_0_70() {
%1 = tail call i32 @a_0_55(i32 22, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int max(int, int /*<<< orphan*/);
int /*<<< orphan*/ min(int, int);
int test_02(int a) { return max(-32768, min(32767, a)); }


x86 assembly (clang, -O0):
<test_02>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x7fff,%edi
call   1030 <min@plt>
mov    %eax,%esi
mov    $0xffff8000,%edi
call   1040 <max@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_02>:
push   %rax
mov    %edi,%esi
mov    $0x7fff,%edi
call   1030 <min@plt>
mov    $0xffff8000,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <max@plt>

LLVM IR (-O0):
define i32 @test_02(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @min(i32 32767, i32 %3)
%5 = call i32 @max(i32 -32768, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @test_02(i32 %0) {
%2 = tail call i32 @min(i32 32767, i32 %0)
%3 = tail call i32 @max(i32 -32768, i32 %2)
ret i32 %3
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ addr;

/* Variables and functions */
int connect(int, struct sockaddr *, int);
int test(void) {
  int sockfd = 4;
  struct sockaddr addr;
  socklen_t addrlen = sizeof(addr);
  return connect(sockfd, &addr, addrlen);
}


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

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x4,%edx
call   1030 <connect@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @test() {
%1 = alloca i32
%2 = alloca %struct.sockaddr
%3 = alloca i32
store i32 4, i32* %1
store i32 4, i32* %3
%4 = load i32, i32* %1
%5 = load i32, i32* %3
%6 = call i32 @connect(i32 %4, %struct.sockaddr* %2, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @test() {
%1 = alloca %struct.sockaddr
%2 = bitcast %struct.sockaddr* %1 to i8*
%3 = call i32 @connect(i32 4, %struct.sockaddr* %1, i32 4)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _usage(void) {
  fputs("Usage: "
        "strings"
        " [-a][-t format][-n number][file...]\n"
        "  -a	Scan files in their entirety\n"
        "  -t	Precede each string with its byte offset (\"d\", \"o\" or "
        "\"h\")\n"
        "  -n	Minimum string length\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [177 x i8] c"Usage: strings [-a][-t format][-n number][file...]\0A -a\09Scan files in their entirety\0A -t\09Precede each string with its byte offset (\22d\22, \22o\22 or \22h\22)\0A -n\09Minimum string length\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([177 x i8], [177 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [177 x i8] c"Usage: strings [-a][-t format][-n number][file...]\0A -a\09Scan files in their entirety\0A -t\09Precede each string with its byte offset (\22d\22, \22o\22 or \22h\22)\0A -n\09Minimum string length\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([177 x i8], [177 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ cdoAbort(char *);
void lcc2_to_geo(int gridID, int gridsize, double *xvals, double *yvals) {
  cdoAbort("proj4 support not compiled in!");
}


x86 assembly (clang, -O0):
<lcc2_to_geo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <cdoAbort@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [31 x i8] c"proj4 support not compiled in!\00"
define void @lcc2_to_geo(i32 %0, i32 %1, double* %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
store i32 %0, i32* %5
store i32 %1, i32* %6
store double* %2, double** %7
store double* %3, double** %8
%9 = call i32 @cdoAbort(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"proj4 support not compiled in!\00"
define void @lcc2_to_geo(i32 %0, i32 %1, double* nocapture readnone %2, double* nocapture readnone %3) {
%5 = tail call i32 @cdoAbort(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned long long getHash(char *);
int getIndex(char *str, int tableSize) {
  unsigned long long x = getHash(str);
  int y = x % tableSize;
  return y;
}


x86 assembly (clang, -O0):
<getIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getHash@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getIndex>:
push   %rbx
mov    %esi,%ebx
call   1030 <getHash@plt>
movslq %ebx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1131 <getIndex+0x21>
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
pop    %rbx
ret
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getIndex(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = call i64 @getHash(i8* %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = urem i64 %9, %11
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
ret i32 %14
}

LLVM IR (-O2):
define i32 @getIndex(i8* %0, i32 %1) {
%3 = tail call i64 @getHash(i8* %0)
%4 = sext i32 %1 to i64
%5 = urem i64 %3, %4
%6 = trunc i64 %5 to i32
ret i32 %6
}
int execute_setgroups() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_setgroups() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ function(char *);
void main() {
  char large_string[256];
  int i;
  for (i = 0; i < 255; i++)
    large_string[i] = 'A';
  function(large_string);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x104(%rbp)
cmpl   $0xff,-0x104(%rbp)
jge    1158 <main+0x48>
movslq -0x104(%rbp),%rax
movb   $0x41,-0x100(%rbp,%rax,1)
41
mov    -0x104(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x104(%rbp)
jmp    1125 <main+0x15>
lea    -0x100(%rbp),%rdi
call   1030 <function@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x108,%rsp
movaps 0xee2(%rip),%xmm0
movups %xmm0,0xef(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <function@plt>
add    $0x108,%rsp
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca [256 x i8]
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 255
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 %8
store i8 65, i8* %9
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
%14 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%15 = call i32 @function(i8* %14)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @function(i8* %3)
ret void
}
int do_580() { return 580; }


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

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

LLVM IR (-O0):
define i32 @do_580() {
ret i32 580
}

LLVM IR (-O2):
define i32 @do_580() {
ret i32 580
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ chars;
};
typedef TYPE_1__ XTextItem;

/* Variables and functions */
void *get_XTextItem_chars(void *_p) { return (void *)((XTextItem *)_p)->chars; }


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

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

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

LLVM IR (-O2):
define i8* @get_XTextItem_chars(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ val;
typedef int /*<<< orphan*/ uintmax_t;
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void store_umax(uint8_t *buf, uintmax_t val) { memcpy(buf, &val, sizeof(val)); }


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

x86 assembly (clang, -O2):
<store_umax>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @store_umax(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 = call i32 @memcpy(i32* %5, i32* %4, i32 4)
ret void
}

LLVM IR (-O2):
define void @store_umax(i32* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @memcpy(i32* %0, i32* %3, i32 4)
ret void
}
/* Variables and functions */
size_t softc_block_data_refs(const void *ptr) {
  size_t *cnt = (size_t *)(ptr - sizeof(size_t));
  return *cnt;
}


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

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

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

LLVM IR (-O2):
define i64 @softc_block_data_refs(i8* nocapture %0) {
%2 = getelementptr i8, i8* %0, i64 -8
%3 = bitcast i8* %2 to i64*
%4 = load i64, i64* %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ glue(int, char **);
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  while (1) {
    if (argc > 1)
      glue(argc, argv);
    else
      puts("y");
  }
  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)
cmpl   $0x1,-0x8(%rbp)
jle    1151 <main+0x31>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <glue@plt>
jmp    115d <main+0x3d>
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xed0(%rip),%r14
cmp    $0x2,%ebp
jge    114d <main+0x2d>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
call   1030 <puts@plt>
cmp    $0x2,%ebp
jl     1140 <main+0x20>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <glue@plt>
cmp    $0x2,%ebp
jge    114d <main+0x2d>
jmp    1140 <main+0x20>

LLVM IR (-O0):
@.str = [2 x i8] c"y\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
br label %6
6: ; preds = %2, %15
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %4
%11 = load i8**, i8*** %5
%12 = call i32 @glue(i32 %10, i8** %11)
br label %15
13: ; preds = %6
%14 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %9
br label %6
}

LLVM IR (-O2):
@.str = [2 x i8] c"y\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp sgt i32 %0, 1
br label %4
4: ; preds = %9, %2
br i1 %3, label %5, label %7
5: ; preds = %4
%6 = tail call i32 @glue(i32 %0, i8** %1)
br label %9
7: ; preds = %4
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
br label %4
}
void gtk_icon_source_copy() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_source_copy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bcopy(char *, char *, int);
void *memcpy(void *destination, const void *source, int size) {
  bcopy((char *)source, (char *)destination, (int)size);
  return (destination);
}


x86 assembly (clang, -O0):
<memcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <bcopy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy>:
jmp    1030 <memmove@plt>

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

LLVM IR (-O2):
define i8* @memcpy(i8* returned writeonly %0, i8* nocapture %1, i32 %2) {
tail call void @llvm.memmove.p0i8.p0i8.i32(i8* align 1 %0, i8* align 1 %1, i32 %2, i1 false)
ret i8* %0
}
/* Variables and functions */
double luaL_check_number(int);
int /*<<< orphan*/ lua_pushnumber(double);
void math_rad(void) {
  lua_pushnumber(luaL_check_number(1) * ((3.14159265358979323846) / 180.0));
}


x86 assembly (clang, -O0):
<math_rad>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
movsd  0xeca(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1040 <lua_pushnumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_rad>:
push   %rax
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
mulsd  0xecd(%rip),%xmm0
pop    %rax
jmp    1040 <lua_pushnumber@plt>

LLVM IR (-O0):
define void @math_rad() {
%1 = call double @luaL_check_number(i32 1)
%2 = fmul double %1, 0x3F91DF46A2529D39
%3 = call i32 @lua_pushnumber(double %2)
ret void
}

LLVM IR (-O2):
define void @math_rad() {
%1 = tail call double @luaL_check_number(i32 1)
%2 = fmul double %1, 0x3F91DF46A2529D39
%3 = tail call i32 @lua_pushnumber(double %2)
ret void
}
int foo() {
  int (**bar)(void);
  asm("" : "=a"(bar));
  return (*bar)();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
call   *(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
jmp    *(%rax)

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32 ()**
%2 = call i32 ()** asm "", "={ax},~{dirflag},~{fpsr},~{flags}"()
store i32 ()** %2, i32 ()*** %1
%3 = load i32 ()**, i32 ()*** %1
%4 = load i32 ()*, i32 ()** %3
%5 = call i32 %4()
ret i32 %5
}

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i32 ()** asm "", "={ax},~{dirflag},~{fpsr},~{flags}"()
%2 = load i32 ()*, i32 ()** %1
%3 = tail call i32 %2()
ret i32 %3
}
int sets1() {
  static int s1 = 5;
  static int s2;
  static int counter = 29;
  s2++;
  return s1 + counter;
}


x86 assembly (clang, -O0):
<sets1>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f22(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f19(%rip)
mov    0x2f07(%rip),%eax
add    0x2f05(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sets1>:
addl   $0x1,0x2f1d(%rip)
mov    $0x22,%eax
ret

LLVM IR (-O0):
@sets1.s1 = internal global i32 5
@sets1.s2 = internal global i32 0
@sets1.counter = internal global i32 29
define i32 @sets1() {
%1 = load i32, i32* @sets1.s2
%2 = add nsw i32 %1, 1
store i32 %2, i32* @sets1.s2
%3 = load i32, i32* @sets1.s1
%4 = load i32, i32* @sets1.counter
%5 = add nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
@sets1.s2 = internal unnamed_addr global i32 0
define i32 @sets1() {
%1 = load i32, i32* @sets1.s2
%2 = add nsw i32 %1, 1
store i32 %2, i32* @sets1.s2
ret i32 34
}
void initarr(int *arr) {
  arr[0] = 1;
  arr[1] = 1;
  arr[2] = 1;
  arr[3] = 1;
  arr[4] = 1;
  arr[5] = 1;
  arr[6] = 1;
  arr[7] = 1;
  arr[8] = 1;
  arr[9] = 1;
}


x86 assembly (clang, -O0):
<initarr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0x8(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0xc(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0x10(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0x14(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0x18(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0x1c(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0x20(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0x24(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<initarr>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movups %xmm0,0x10(%rdi)
movabs $0x100000001,%rax
mov    %rax,0x20(%rdi)
ret

LLVM IR (-O0):
define void @initarr(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
store i32 1, i32* %4
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 1, i32* %6
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 2
store i32 1, i32* %8
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 3
store i32 1, i32* %10
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 4
store i32 1, i32* %12
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i64 5
store i32 1, i32* %14
%15 = load i32*, i32** %2
%16 = getelementptr inbounds i32, i32* %15, i64 6
store i32 1, i32* %16
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 7
store i32 1, i32* %18
%19 = load i32*, i32** %2
%20 = getelementptr inbounds i32, i32* %19, i64 8
store i32 1, i32* %20
%21 = load i32*, i32** %2
%22 = getelementptr inbounds i32, i32* %21, i64 9
store i32 1, i32* %22
ret void
}

LLVM IR (-O2):
define void @initarr(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %2
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = bitcast i32* %3 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %4
%5 = getelementptr inbounds i32, i32* %0, i64 8
store i32 1, i32* %5
%6 = getelementptr inbounds i32, i32* %0, i64 9
store i32 1, i32* %6
ret void
}
/* Variables and functions */
scalar_t__ my_strlen(char *);
char *xcalloc(scalar_t__, int);
char *my_strdup(char *dest, char *src) {
  int i;
  i = 0;
  if (src == NULL)
    return (0);
  if (src)
    dest = xcalloc((my_strlen(src) + 1), sizeof(*dest));
  return (dest);
}


x86 assembly (clang, -O0):
<my_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    114f <my_strdup+0x2f>
movq   $0x0,-0x8(%rbp)
jmp    1180 <my_strdup+0x60>
cmpq   $0x0,-0x18(%rbp)
je     1178 <my_strdup+0x58>
mov    -0x18(%rbp),%rdi
call   1030 <my_strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    $0x1,%esi
call   1040 <xcalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strdup>:
test   %rsi,%rsi
je     113d <my_strdup+0x1d>
push   %rax
mov    %rsi,%rdi
call   1030 <my_strlen@plt>
lea    0x1(%rax),%rdi
mov    $0x1,%esi
pop    %rax
jmp    1040 <xcalloc@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @my_strdup(i8* nocapture readnone %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i64 @my_strlen(i8* %1)
%6 = add nsw i64 %5, 1
%7 = tail call i8* @xcalloc(i64 %6, i32 1)
br label %8
8: ; preds = %2, %4
%9 = phi i8* [ %7, %4 ], [ null, %2 ]
ret i8* %9
}