xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printUsage(char **);
void validateArgs(int argc, char **argv) {
  char good = 1;
  if (argc != 2) {
    good = 0;
  }
  if (!good) {
    printUsage(argv);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<validateArgs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x1,-0x11(%rbp)
cmpl   $0x2,-0x4(%rbp)
je     1141 <validateArgs+0x21>
movb   $0x0,-0x11(%rbp)
cmpb   $0x0,-0x11(%rbp)
jne    115e <validateArgs+0x3e>
mov    -0x10(%rbp),%rdi
call   1030 <printUsage@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validateArgs>:
cmp    $0x2,%edi
jne    1126 <validateArgs+0x6>
ret
push   %rax
mov    %rsi,%rdi
call   1030 <printUsage@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @validateArgs(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i8 1, i8* %5
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %2
store i8 0, i8* %5
br label %9
9: ; preds = %8, %2
%10 = load i8, i8* %5
%11 = icmp ne i8 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %9
%13 = load i8**, i8*** %4
%14 = call i32 @printUsage(i8** %13)
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @validateArgs(i32 %0, i8** %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @printUsage(i8** %1)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
ret void
}
void g_printerr() {}


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

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

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

LLVM IR (-O2):
define void @g_printerr() {
ret void
}
/* Variables and functions */
size_t align_size(size_t size, size_t alignment) {
  size_t mask = alignment - 1;
  return (size + mask) & ~mask;
}


x86 assembly (clang, -O0):
<align_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    -0x18(%rbp),%rax
mov    -0x18(%rbp),%rcx
xor    $0xffffffffffffffff,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align_size>:
lea    (%rdi,%rsi,1),%rax
add    $0xffffffffffffffff,%rax
neg    %rsi
and    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @align_size(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = sub i64 %6, 1
store i64 %7, i64* %5
%8 = load i64, i64* %3
%9 = load i64, i64* %5
%10 = add i64 %8, %9
%11 = load i64, i64* %5
%12 = xor i64 %11, -1
%13 = and i64 %10, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @align_size(i64 %0, i64 %1) {
%3 = add i64 %0, -1
%4 = add i64 %3, %1
%5 = sub i64 0, %1
%6 = and i64 %4, %5
ret i64 %6
}
int fsync(int fd) {
  ;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @fsync(i32 %0) {
ret i32 0
}
void foo457(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo457(i32 %0) {
ret void
}
/* Type definitions */
struct ps_bus_event {
  int dummy;
};
struct obus_server {
  int dummy;
};
struct obus_bus_event {
  int dummy;
};

/* Variables and functions */
int obus_server_send_bus_event(struct obus_server *, struct obus_bus_event *);
int ps_bus_event_send(struct obus_server *server, struct ps_bus_event *event) {
  struct obus_bus_event *evt = (struct obus_bus_event *)event;
  return obus_server_send_bus_event(server, evt);
}


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

x86 assembly (clang, -O2):
<ps_bus_event_send>:
jmp    1030 <obus_server_send_bus_event@plt>

LLVM IR (-O0):
%struct.obus_server = type { i32 }
%struct.ps_bus_event = type { i32 }
%struct.obus_bus_event = type { i32 }
define i32 @ps_bus_event_send(%struct.obus_server* %0, %struct.ps_bus_event* %1) {
%3 = alloca %struct.obus_server*
%4 = alloca %struct.ps_bus_event*
%5 = alloca %struct.obus_bus_event*
store %struct.obus_server* %0, %struct.obus_server** %3
store %struct.ps_bus_event* %1, %struct.ps_bus_event** %4
%6 = load %struct.ps_bus_event*, %struct.ps_bus_event** %4
%7 = bitcast %struct.ps_bus_event* %6 to %struct.obus_bus_event*
store %struct.obus_bus_event* %7, %struct.obus_bus_event** %5
%8 = load %struct.obus_server*, %struct.obus_server** %3
%9 = load %struct.obus_bus_event*, %struct.obus_bus_event** %5
%10 = call i32 @obus_server_send_bus_event(%struct.obus_server* %8, %struct.obus_bus_event* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.obus_server = type { i32 }
%struct.ps_bus_event = type { i32 }
%struct.obus_bus_event = type { i32 }
define i32 @ps_bus_event_send(%struct.obus_server* %0, %struct.ps_bus_event* %1) {
%3 = bitcast %struct.ps_bus_event* %1 to %struct.obus_bus_event*
%4 = tail call i32 @obus_server_send_bus_event(%struct.obus_server* %0, %struct.obus_bus_event* %3)
ret i32 %4
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRD5_set(void) { return U_WMRCORENONE_set("U_WMRD5"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRD5\00"
define i8* @U_WMRD5_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_WMRD5\00"
define i8* @U_WMRD5_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
}
/* Variables and functions */
int omp_get_num_threads();
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char *argv[]) {
#pragma omp parallel
  {
    printf("Hello World! I'm thread %d out of %d total threads.\n",
           omp_get_thread_num(), omp_get_num_threads());
  }
  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)
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1050 <omp_get_num_threads@plt>
mov    -0x14(%rbp),%esi
mov    %eax,%edx
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <omp_get_num_threads@plt>
lea    0xeb8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [53 x i8] c"Hello World! I'm thread %d out of %d total threads.\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 (...) @omp_get_thread_num()
%7 = call i32 (...) @omp_get_num_threads()
%8 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [53 x i8] c"Hello World! I'm thread %d out of %d total threads.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @omp_get_thread_num()
%4 = tail call i32 (...) @omp_get_num_threads()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret i32 0
}
int roi_set_stream_response_header(char *buff, unsigned char data) {
  if (data == 19) {
    buff[0] = data;
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<roi_set_stream_response_header>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
cmp    $0x13,%eax
jne    1130 <roi_set_stream_response_header+0x30>
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1137 <roi_set_stream_response_header+0x37>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roi_set_stream_response_header>:
mov    $0xffffffff,%eax
cmp    $0x13,%sil
jne    1110 <roi_set_stream_response_header+0x10>
movb   $0x13,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @roi_set_stream_response_header(i8* %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = icmp eq i32 %7, 19
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8, i8* %5
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 0
store i8 %10, i8* %12
store i32 0, i32* %3
br label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %14
14: ; preds = %13, %9
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @roi_set_stream_response_header(i8* nocapture writeonly %0, i8 zeroext %1) {
%3 = icmp eq i8 %1, 19
br i1 %3, label %4, label %5
4: ; preds = %2
store i8 19, i8* %0
br label %5
5: ; preds = %2, %4
%6 = phi i32 [ 0, %4 ], [ -1, %2 ]
ret i32 %6
}
int test_imm_41int8_mem(signed char *val) {
  return ((*val) & (0x41 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_41int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 65
%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_41int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 65
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void doprintf(void) { printf("OK\n"); }


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

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

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

LLVM IR (-O2):
@str = [3 x i8] c"OK\00"
define void @doprintf() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double SCHAR_MAX;
extern double cmax_schar() { return SCHAR_MAX; }


x86 assembly (clang, -O0):
<cmax_schar>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
movsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmax_schar>:
mov    0x2ed9(%rip),%rax
movsd  (%rax),%xmm0
ret

LLVM IR (-O0):
@SCHAR_MAX = global double 0.000000e+00
define double @cmax_schar() {
%1 = load double, double* @SCHAR_MAX
ret double %1
}

LLVM IR (-O2):
@SCHAR_MAX = global double 0.000000e+00
define double @cmax_schar() {
%1 = load double, double* @SCHAR_MAX
ret double %1
}
/* Type definitions */
typedef int /*<<< orphan*/ PKCS12_SAFEBAG;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ PKCS12_SAFEBAG_it;
void PKCS12_SAFEBAG_free(PKCS12_SAFEBAG *a) {
  ASN1_item_free((ASN1_VALUE *)a, &PKCS12_SAFEBAG_it);
}


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

x86 assembly (clang, -O2):
<PKCS12_SAFEBAG_free>:
mov    0x2ee1(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

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

LLVM IR (-O2):
@PKCS12_SAFEBAG_it = global i32 0
define void @PKCS12_SAFEBAG_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @PKCS12_SAFEBAG_it)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_condattr_t;

/* Variables and functions */
int pthread_condattr_init(pthread_condattr_t *attr) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @pthread_condattr_init(i32* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ GL_COLOR_BUFFER_BIT;
int /*<<< orphan*/ glClear(int /*<<< orphan*/);
void display(void) { glClear(GL_COLOR_BUFFER_BIT); }


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <glClear@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = call i32 @glClear(i32 %1)
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = tail call i32 @glClear(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stdout;
void _move_west_n(int n) { fprintf(stdout, "\x1B[%dD", n); }


x86 assembly (clang, -O0):
<_move_west_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_move_west_n>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [6 x i8] c"\1B[%dD\00"
define void @_move_west_n(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stdout
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [6 x i8] c"\1B[%dD\00"
define void @_move_west_n(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main(int argc, char *argv[]) {
  int x, k = 3;
#pragma omp parallel private(x)
  {
#pragma omp for
    for (x = 0; x < 10; x++) {
      k = 12;
    }
  }
  if (k != 12)
    abort();
  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   $0x3,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    1153 <main+0x43>
movl   $0xc,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1134 <main+0x24>
cmpl   $0xc,-0x18(%rbp)
je     1164 <main+0x54>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void explain() { fprintf(stderr, "Usage: ... hfsc \n"); }


x86 assembly (clang, -O0):
<explain>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<explain>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"Usage: ... hfsc \0A\00"
define void @explain() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"Usage: ... hfsc \0A\00"
define void @explain() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int MV_GetReverbDelay();
int FX_GetReverbDelay(void) { return MV_GetReverbDelay(); }


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

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

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

LLVM IR (-O2):
define i32 @FX_GetReverbDelay() {
%1 = tail call i32 (...) @MV_GetReverbDelay()
ret i32 %1
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int dest;

/* Variables and functions */
int /*<<< orphan*/ write_byte(int);
int /*<<< orphan*/ write_dword(int /*<<< orphan*/);
void mov_ind_r64_imm32(uint8_t dest, uint32_t immediate) {
  uint8_t rex = 0x40 | 0x08;
  if (((dest >> 3) & 1))
    rex |= 0x02;
  write_byte(rex);
  write_byte(0xC7);
  write_byte(((((0) & 0x3) << 6) | (((0) & 0x7) << 3) | ((dest)&0x7)));
  write_dword(immediate);
}


x86 assembly (clang, -O0):
<mov_ind_r64_imm32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x48,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x3,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1150 <mov_ind_r64_imm32+0x30>
mov    -0xc(%rbp),%eax
or     $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <write_byte@plt>
mov    $0xc7,%edi
call   1040 <write_byte@plt>
mov    -0x4(%rbp),%edi
and    $0x7,%edi
or     $0x0,%edi
call   1040 <write_byte@plt>
mov    -0x8(%rbp),%edi
call   1030 <write_dword@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mov_ind_r64_imm32>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
and    $0x8,%edi
shr    $0x2,%edi
or     $0x48,%edi
call   1040 <write_byte@plt>
mov    $0xc7,%edi
call   1040 <write_byte@plt>
and    $0x7,%ebp
mov    %ebp,%edi
call   1040 <write_byte@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write_dword@plt>

LLVM IR (-O0):
define void @mov_ind_r64_imm32(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 72, i32* %5
%6 = load i32, i32* %3
%7 = ashr i32 %6, 3
%8 = and i32 %7, 1
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* %5
%12 = or i32 %11, 2
store i32 %12, i32* %5
br label %13
13: ; preds = %10, %2
%14 = load i32, i32* %5
%15 = call i32 @write_byte(i32 %14)
%16 = call i32 @write_byte(i32 199)
%17 = load i32, i32* %3
%18 = and i32 %17, 7
%19 = or i32 0, %18
%20 = call i32 @write_byte(i32 %19)
%21 = load i32, i32* %4
%22 = call i32 @write_dword(i32 %21)
ret void
}

LLVM IR (-O2):
define void @mov_ind_r64_imm32(i32 %0, i32 %1) {
%3 = and i32 %0, 8
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 72, i32 74
%6 = tail call i32 @write_byte(i32 %5)
%7 = tail call i32 @write_byte(i32 199)
%8 = and i32 %0, 7
%9 = tail call i32 @write_byte(i32 %8)
%10 = tail call i32 @write_dword(i32 %1)
ret void
}
/* Variables and functions */
char getc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
char tty_read_input(void) { return getc(stdin); }


x86 assembly (clang, -O0):
<tty_read_input>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <getc@plt>
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_read_input>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <getc@plt>

LLVM IR (-O0):
@stdin = global i32 0
define signext i8 @tty_read_input() {
%1 = load i32, i32* @stdin
%2 = call signext i8 @getc(i32 %1)
ret i8 %2
}

LLVM IR (-O2):
@stdin = global i32 0
define signext i8 @tty_read_input() {
%1 = load i32, i32* @stdin
%2 = tail call signext i8 @getc(i32 %1)
ret i8 %2
}
int main() {
  int a[16];
  scanf("%d", a), read(a), sort(a), write(a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rsi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    -0x40(%rbp),%rdi
mov    $0x0,%al
call   1050 <read@plt>
lea    -0x40(%rbp),%rdi
mov    $0x0,%al
call   1040 <sort@plt>
lea    -0x40(%rbp),%rdi
mov    $0x0,%al
call   1030 <write@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
lea    0xeb4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <read@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <sort@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <write@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [16 x i32]
%2 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 0
%3 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 0
%5 = call i32 (i32*, ...) bitcast (i32 (...)* @read to i32 (i32*, ...)*)(i32* %4)
%6 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 0
%7 = call i32 (i32*, ...) bitcast (i32 (...)* @sort to i32 (i32*, ...)*)(i32* %6)
%8 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 0
%9 = call i32 (i32*, ...) bitcast (i32 (...)* @write to i32 (i32*, ...)*)(i32* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [16 x i32]
%2 = bitcast [16 x i32]* %1 to i8*
%3 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 0
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = call i32 (i32*, ...) bitcast (i32 (...)* @read to i32 (i32*, ...)*)(i32* %3)
%6 = call i32 (i32*, ...) bitcast (i32 (...)* @sort to i32 (i32*, ...)*)(i32* %3)
%7 = call i32 (i32*, ...) bitcast (i32 (...)* @write to i32 (i32*, ...)*)(i32* %3)
ret i32 0
}
/* Variables and functions */
char *tg_newstring(int);
char *tg_chr(int v) {
  char *s = tg_newstring(1);
  s[0] = v;
  s[1] = 0;
  return s;
}


x86 assembly (clang, -O0):
<tg_chr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <tg_newstring@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tg_chr>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
call   1030 <tg_newstring@plt>
mov    %bl,(%rax)
movb   $0x0,0x1(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i8* @tg_chr(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i8* @tg_newstring(i32 1)
store i8* %4, i8** %3
%5 = load i32, i32* %2
%6 = trunc i32 %5 to i8
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 %6, i8* %8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8 0, i8* %10
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @tg_chr(i32 %0) {
%2 = tail call i8* @tg_newstring(i32 1)
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = getelementptr inbounds i8, i8* %2, i64 1
store i8 0, i8* %4
ret i8* %2
}
/* Variables and functions */
int numDecodings(char *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", numDecodings("123"));
  return (0);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"123\00"
define i32 @main() {
%1 = tail call i32 @numDecodings(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
extern unsigned char get_bit_4(const unsigned char c) { return (c & 0x10) > 0; }


x86 assembly (clang, -O0):
<get_bit_4>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bit_4>:
mov    %edi,%eax
shr    $0x4,%al
and    $0x1,%al
ret

LLVM IR (-O0):
define zeroext i8 @get_bit_4(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 16
%6 = icmp sgt i32 %5, 0
%7 = zext i1 %6 to i32
%8 = trunc i32 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define zeroext i8 @get_bit_4(i8 zeroext %0) {
%2 = lshr i8 %0, 4
%3 = and i8 %2, 1
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int usage() {
  printf("./tcp_listen -p [port_range] -a [ipaddr] [-d] [-c] [-6]\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [57 x i8] c"./tcp_listen -p [port_range] -a [ipaddr] [-d] [-c] [-6]\0A\00"
define i32 @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [56 x i8] c"./tcp_listen -p [port_range] -a [ipaddr] [-d] [-c] [-6]\00"
define i32 @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ free(char *);
char *raw_input(char *);
int raw_input_int(char *input) {
  char *get_input = raw_input(input);
  int numero = atoi(get_input);
  free(get_input);
  return numero;
}


x86 assembly (clang, -O0):
<raw_input_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <raw_input@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raw_input_int>:
push   %rbp
push   %rbx
push   %rax
call   1050 <raw_input@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <atoi@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @raw_input_int(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @raw_input(i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @atoi(i8* %7)
store i32 %8, i32* %4
%9 = load i8*, i8** %3
%10 = call i32 @free(i8* %9)
%11 = load i32, i32* %4
ret i32 %11
}

LLVM IR (-O2):
define i32 @raw_input_int(i8* %0) {
%2 = tail call i8* @raw_input(i8* %0)
%3 = tail call i32 @atoi(i8* %2)
%4 = tail call i32 @free(i8* %2)
ret i32 %3
}
void Hal_hook_wr_sgndrecfield_recelema2(void) {}


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

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

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

LLVM IR (-O2):
define void @Hal_hook_wr_sgndrecfield_recelema2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int drv_Curs_list(void) {
  printf("pure ncurses based text driver");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"pure ncurses based text driver\00"
define i32 @drv_Curs_list() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"pure ncurses based text driver\00"
define i32 @drv_Curs_list() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct eembed_log {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ eembed_fprintf_context(struct eembed_log *);
int /*<<< orphan*/ eembed_system_fprintf(int /*<<< orphan*/, char *,
                                         long double);
void eembed_fprintf_append_f(struct eembed_log *log, long double f) {
  eembed_system_fprintf(eembed_fprintf_context(log), "%Lg", f);
}


x86 assembly (clang, -O0):
<eembed_fprintf_append_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
mov    %rdi,-0x8(%rbp)
fstpt  -0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <eembed_fprintf_context@plt>
mov    %eax,%edi
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
lea    0xeb4(%rip),%rsi
call   1030 <eembed_system_fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eembed_fprintf_append_f>:
push   %rax
call   1040 <eembed_fprintf_context@plt>
lea    0xed3(%rip),%rsi
mov    %eax,%edi
pop    %rax
jmp    1030 <eembed_system_fprintf@plt>

LLVM IR (-O0):
%struct.eembed_log = type { i32 }
@.str = [4 x i8] c"%Lg\00"
define void @eembed_fprintf_append_f(%struct.eembed_log* %0, x86_fp80 %1) {
%3 = alloca %struct.eembed_log*
%4 = alloca x86_fp80
store %struct.eembed_log* %0, %struct.eembed_log** %3
store x86_fp80 %1, x86_fp80* %4
%5 = load %struct.eembed_log*, %struct.eembed_log** %3
%6 = call i32 @eembed_fprintf_context(%struct.eembed_log* %5)
%7 = load x86_fp80, x86_fp80* %4
%8 = call i32 @eembed_system_fprintf(i32 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), x86_fp80 %7)
ret void
}

LLVM IR (-O2):
%struct.eembed_log = type { i32 }
@.str = [4 x i8] c"%Lg\00"
define void @eembed_fprintf_append_f(%struct.eembed_log* %0, x86_fp80 %1) {
%3 = tail call i32 @eembed_fprintf_context(%struct.eembed_log* %0)
%4 = tail call i32 @eembed_system_fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), x86_fp80 %1)
ret void
}
/* Variables and functions */
char const *getlogin();
char const *get_user(void) { return getlogin(); }


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

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

LLVM IR (-O0):
define i8* @get_user() {
%1 = call i8* (...) @getlogin()
ret i8* %1
}

LLVM IR (-O2):
define i8* @get_user() {
%1 = tail call i8* (...) @getlogin()
ret i8* %1
}
int test_imm_E6uint32_reg(unsigned int val) {
  return ((val) & (0xE6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E6uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xe6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E6uint32_reg>:
test   $0xe6,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E6uint32_reg(i32 %0) {
%2 = and i32 %0, 230
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int var = (int)5.912345;
  printf("var = %i", var);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"var = %i\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}
/* Variables and functions */
void *new (void *heap, size_t size) {
  static void *frontier = NULL;
  void *location;
  if (frontier == NULL)
    frontier = heap;
  location = frontier;
  frontier += (size + (size % 8));
  return location;
}


x86 assembly (clang, -O0):
<new>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,0x2f14(%rip)
jne    1125 <new+0x25>
mov    -0x8(%rbp),%rax
mov    %rax,0x2f03(%rip)
mov    0x2efc(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
and    $0x7,%rcx
add    %rcx,%rax
add    0x2ee2(%rip),%rax
mov    %rax,0x2edb(%rip)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<new>:
mov    0x2f21(%rip),%rax
test   %rax,%rax
cmove  %rdi,%rax
mov    %esi,%ecx
and    $0x7,%ecx
add    %rsi,%rcx
add    %rax,%rcx
mov    %rcx,0x2f08(%rip)
ret

LLVM IR (-O0):
@new.frontier = internal global i8* null
define i8* @new(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** @new.frontier
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i8*, i8** %3
store i8* %9, i8** @new.frontier
br label %10
10: ; preds = %8, %2
%11 = load i8*, i8** @new.frontier
store i8* %11, i8** %5
%12 = load i64, i64* %4
%13 = load i64, i64* %4
%14 = urem i64 %13, 8
%15 = add i64 %12, %14
%16 = load i8*, i8** @new.frontier
%17 = getelementptr i8, i8* %16, i64 %15
store i8* %17, i8** @new.frontier
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
@new.frontier = internal unnamed_addr global i8* null
define i8* @new(i8* %0, i64 %1) {
%3 = load i8*, i8** @new.frontier
%4 = icmp eq i8* %3, null
%5 = select i1 %4, i8* %0, i8* %3
%6 = and i64 %1, 7
%7 = add i64 %6, %1
%8 = getelementptr i8, i8* %5, i64 %7
store i8* %8, i8** @new.frontier
ret i8* %5
}
signed long long f4(signed long long v_a, signed long long v_b) {
  signed long long v_anda = v_a & -16;
  signed long long v_shr = ((unsigned long long)v_b) >> 8;
  signed long long v_andb = v_shr & 15;
  signed long long v_or = v_anda | v_andb;
  return v_or;
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
and    $0xfffffffffffffff0,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
and    $0xf,%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
or     -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
and    $0xfffffffffffffff0,%rdi
shr    $0x8,%esi
and    $0xf,%esi
lea    (%rsi,%rdi,1),%rax
ret

LLVM IR (-O0):
define i64 @f4(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%9 = load i64, i64* %3
%10 = and i64 %9, -16
store i64 %10, i64* %5
%11 = load i64, i64* %4
%12 = lshr i64 %11, 8
store i64 %12, i64* %6
%13 = load i64, i64* %6
%14 = and i64 %13, 15
store i64 %14, i64* %7
%15 = load i64, i64* %5
%16 = load i64, i64* %7
%17 = or i64 %15, %16
store i64 %17, i64* %8
%18 = load i64, i64* %8
ret i64 %18
}

LLVM IR (-O2):
define i64 @f4(i64 %0, i64 %1) {
%3 = and i64 %0, -16
%4 = lshr i64 %1, 8
%5 = and i64 %4, 15
%6 = or i64 %5, %3
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int titleToNumber(char *);
int main(void) {
  printf("%d\n", titleToNumber("AB"));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [3 x i8] c"AB\00"
define i32 @main() {
%1 = tail call i32 @titleToNumber(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ serial_configure_baud_rate(unsigned short, int);
int /*<<< orphan*/ serial_configure_fifo(unsigned short);
int /*<<< orphan*/ serial_configure_line(unsigned short);
int /*<<< orphan*/ serial_configure_modem(unsigned short);
void serial_initialize(unsigned short com) {
  serial_configure_baud_rate(com, 2);
  serial_configure_line(com);
  serial_configure_fifo(com);
  serial_configure_modem(com);
}


x86 assembly (clang, -O0):
<serial_initialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x2,%esi
movzwl -0x2(%rbp),%edi
call   1050 <serial_configure_baud_rate@plt>
movzwl -0x2(%rbp),%edi
call   1040 <serial_configure_line@plt>
movzwl -0x2(%rbp),%edi
call   1060 <serial_configure_fifo@plt>
movzwl -0x2(%rbp),%edi
call   1030 <serial_configure_modem@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_initialize>:
push   %rbx
mov    %edi,%ebx
mov    $0x2,%esi
call   1050 <serial_configure_baud_rate@plt>
mov    %ebx,%edi
call   1040 <serial_configure_line@plt>
mov    %ebx,%edi
call   1060 <serial_configure_fifo@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <serial_configure_modem@plt>

LLVM IR (-O0):
define void @serial_initialize(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @serial_configure_baud_rate(i16 zeroext %3, i32 2)
%5 = load i16, i16* %2
%6 = call i32 @serial_configure_line(i16 zeroext %5)
%7 = load i16, i16* %2
%8 = call i32 @serial_configure_fifo(i16 zeroext %7)
%9 = load i16, i16* %2
%10 = call i32 @serial_configure_modem(i16 zeroext %9)
ret void
}

LLVM IR (-O2):
define void @serial_initialize(i16 zeroext %0) {
%2 = tail call i32 @serial_configure_baud_rate(i16 zeroext %0, i32 2)
%3 = tail call i32 @serial_configure_line(i16 zeroext %0)
%4 = tail call i32 @serial_configure_fifo(i16 zeroext %0)
%5 = tail call i32 @serial_configure_modem(i16 zeroext %0)
ret void
}
/* Variables and functions */
size_t strlen(char *);
char *rtrimc(char *s, char c) {
  size_t i = strlen(s);
  while (i > 0 && c == s[--i])
    s[i] = '\0';
  return s;
}


x86 assembly (clang, -O0):
<rtrimc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0x19(%rbp)
jbe    1163 <rtrimc+0x53>
movsbl -0x9(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rdx
mov    %rdx,%rsi
add    $0xffffffffffffffff,%rsi
mov    %rsi,-0x18(%rbp)
movsbl -0x1(%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1173 <rtrimc+0x63>
jmp    1184 <rtrimc+0x74>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    112f <rtrimc+0x1f>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtrimc>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %rax,%rax
je     1142 <rtrimc+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    %bpl,-0x1(%rbx,%rax,1)
jne    1142 <rtrimc+0x32>
movb   $0x0,-0x1(%rbx,%rax,1)
add    $0xffffffffffffffff,%rax
jne    1130 <rtrimc+0x20>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @rtrimc(i8* returned %0, i8 signext %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %11
%6 = phi i64 [ %7, %11 ], [ %3, %2 ]
%7 = add i64 %6, -1
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, %1
br i1 %10, label %11, label %13
11: ; preds = %5
store i8 0, i8* %8
%12 = icmp eq i64 %7, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %11, %2
ret i8* %0
}
int do_890() { return 890; }


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

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

LLVM IR (-O0):
define i32 @do_890() {
ret i32 890
}

LLVM IR (-O2):
define i32 @do_890() {
ret i32 890
}
/* Variables and functions */
int /*<<< orphan*/ bus_write(int, char);
void LCD_Write_DATA(char VH, char VL) {
  bus_write(0xBF, VH);
  bus_write(0xBF, VL);
}


x86 assembly (clang, -O0):
<LCD_Write_DATA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    $0xbf,%edi
movsbl -0x1(%rbp),%esi
call   1030 <bus_write@plt>
mov    $0xbf,%edi
movsbl -0x2(%rbp),%esi
call   1030 <bus_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_Write_DATA>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%esi
mov    $0xbf,%edi
call   1030 <bus_write@plt>
mov    $0xbf,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <bus_write@plt>

LLVM IR (-O0):
define void @LCD_Write_DATA(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = call i32 @bus_write(i32 191, i8 signext %5)
%7 = load i8, i8* %4
%8 = call i32 @bus_write(i32 191, i8 signext %7)
ret void
}

LLVM IR (-O2):
define void @LCD_Write_DATA(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @bus_write(i32 191, i8 signext %0)
%4 = tail call i32 @bus_write(i32 191, i8 signext %1)
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
bool file_exists(const char *f) {
  struct stat statbuf;
  return stat(f, &statbuf) == 0;
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @file_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_exists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}