xunge/DecIR huggingface dataset:
/* Variables and functions */
int ug_io_transaction(int);
int ug_is_txfifo_ready(void) {
  return ug_io_transaction(0xc0000000) & 0x04000000;
}


x86 assembly (clang, -O0):
<ug_is_txfifo_ready>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc0000000,%edi
call   1030 <ug_io_transaction@plt>
and    $0x4000000,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ug_is_txfifo_ready>:
push   %rax
mov    $0xc0000000,%edi
call   1030 <ug_io_transaction@plt>
and    $0x4000000,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ug_is_txfifo_ready() {
%1 = call i32 @ug_io_transaction(i32 -1073741824)
%2 = and i32 %1, 67108864
ret i32 %2
}

LLVM IR (-O2):
define i32 @ug_is_txfifo_ready() {
%1 = tail call i32 @ug_io_transaction(i32 -1073741824)
%2 = and i32 %1, 67108864
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ decode_id(unsigned char *, unsigned char *, unsigned int *,
                             unsigned long long *);
void print_result_id(unsigned char result_id[5]) {
  unsigned char table_type;
  unsigned int table_i;
  unsigned long long row_i;
  decode_id(result_id, &table_type, &table_i, &row_i);
}


x86 assembly (clang, -O0):
<print_result_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x9(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1030 <decode_id@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_result_id>:
sub    $0x18,%rsp
lea    0xb(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x10(%rsp),%rcx
call   1030 <decode_id@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define void @print_result_id(i8* %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca i64
%5 = bitcast i32* %3 to i8*
%6 = bitcast i64* %4 to i8*
%7 = call i32 @decode_id(i8* %0, i8* %2, i32* %3, i64* %4)
ret void
}
int fun884() { return 884; }


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

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

LLVM IR (-O0):
define i32 @fun884() {
ret i32 884
}

LLVM IR (-O2):
define i32 @fun884() {
ret i32 884
}
/* Variables and functions */
int /*<<< orphan*/ GPIO_Set(int);
void SPI_EndTransfer(int csBitId) { GPIO_Set(csBitId); }


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

x86 assembly (clang, -O2):
<SPI_EndTransfer>:
jmp    1030 <GPIO_Set@plt>

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

LLVM IR (-O2):
define void @SPI_EndTransfer(i32 %0) {
%2 = tail call i32 @GPIO_Set(i32 %0)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t lp_read_u32_le(void *p) {
  uint8_t *s = (uint8_t *)p;
  uint32_t v = s[0] | s[1] << 8 | s[2] << 16 | s[3] << 24;
  return v;
}


x86 assembly (clang, -O0):
<lp_read_u32_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0xc(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lp_read_u32_le>:
mov    0x4(%rdi),%ecx
mov    0x8(%rdi),%edx
shl    $0x8,%ecx
or     (%rdi),%ecx
shl    $0x10,%edx
mov    0xc(%rdi),%eax
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @lp_read_u32_le(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = getelementptr inbounds i8, i8* %0, i64 4
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = shl i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 8
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = shl i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 12
%15 = bitcast i8* %14 to i32*
%16 = load i32, i32* %15
%17 = shl i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
/* Variables and functions */
int assign_standard_coefficient_of_slice(int /*<<< orphan*/, int /*<<< orphan*/,
                                         double *);
int set_standard_trace_slice(int first) {
  int fail;
  double r[2];
  r[1] = 0.0;
  if (first == 1)
    r[0] = -1.0;
  else
    r[0] = +1.0;
  fail = assign_standard_coefficient_of_slice(0, 0, r);
  return fail;
}


x86 assembly (clang, -O0):
<set_standard_trace_slice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    113f <set_standard_trace_slice+0x2f>
movsd  0xed3(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    114c <set_standard_trace_slice+0x3c>
movsd  0xeb9(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    -0x20(%rbp),%rdx
xor    %esi,%esi
mov    %esi,%edi
call   1030 <assign_standard_coefficient_of_slice@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_standard_trace_slice>:
sub    $0x18,%rsp
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
movq   $0x0,0x8(%rsp)
lea    0xed4(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
movsd  %xmm0,(%rsp)
mov    %rsp,%rdx
xor    %edi,%edi
xor    %esi,%esi
call   1030 <assign_standard_coefficient_of_slice@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @set_standard_trace_slice(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [2 x double]
store i32 %0, i32* %2
%5 = getelementptr inbounds [2 x double], [2 x double]* %4, i64 0, i64 1
store double 0.000000e+00, double* %5
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = getelementptr inbounds [2 x double], [2 x double]* %4, i64 0, i64 0
store double -1.000000e+00, double* %9
br label %12
10: ; preds = %1
%11 = getelementptr inbounds [2 x double], [2 x double]* %4, i64 0, i64 0
store double 1.000000e+00, double* %11
br label %12
12: ; preds = %10, %8
%13 = getelementptr inbounds [2 x double], [2 x double]* %4, i64 0, i64 0
%14 = call i32 @assign_standard_coefficient_of_slice(i32 0, i32 0, double* %13)
store i32 %14, i32* %3
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @set_standard_trace_slice(i32 %0) {
%2 = alloca [2 x double]
%3 = bitcast [2 x double]* %2 to i8*
%4 = getelementptr inbounds [2 x double], [2 x double]* %2, i64 0, i64 1
store double 0.000000e+00, double* %4
%5 = icmp eq i32 %0, 1
%6 = select i1 %5, double -1.000000e+00, double 1.000000e+00
%7 = getelementptr inbounds [2 x double], [2 x double]* %2, i64 0, i64 0
store double %6, double* %7
%8 = call i32 @assign_standard_coefficient_of_slice(i32 0, i32 0, double* %7)
ret i32 %8
}
char *hash_plugin_summary(void) { return ("oracle11g \tOracle 11g plugin"); }


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"oracle11g \09Oracle 11g plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [29 x i8] c"oracle11g \09Oracle 11g plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0)
}
void foo(long long i) {
  while (i != -1) {
    ++i;
    __asm__("");
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0xffffffffffffffff,-0x8(%rbp)
je     1124 <foo+0x24>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <foo+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    $0xffffffffffffffff,%rdi
je     1115 <foo+0x15>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
inc    %rdi
jne    1110 <foo+0x10>
ret

LLVM IR (-O0):
define void @foo(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
br label %3
3: ; preds = %6, %1
%4 = load i64, i64* %2
%5 = icmp ne i64 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i64, i64* %2
%8 = add nsw i64 %7, 1
store i64 %8, i64* %2
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @foo(i64 %0) {
%2 = icmp eq i64 %0, -1
br i1 %2, label %7, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %5, %3 ], [ %0, %1 ]
%5 = add nuw nsw i64 %4, 1
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
%6 = icmp eq i64 %5, -1
br i1 %6, label %7, label %3
7: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_make_fd_block() {
  printf("NOT IMPLEMENTED:"
         "pa_make_fd_block"
         "\n");
}


x86 assembly (clang, -O0):
<pa_make_fd_block>:
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_make_fd_block>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_make_fd_block\00"
define i32 @pa_make_fd_block() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x6c() {
  Assert_real((isupper(108) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              545, ("isupper should be 0 for l"));
}


x86 assembly (clang, -O0):
<t_isupper_0x6c>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6c,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x221,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x6c>:
push   %rax
mov    $0x6c,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x221,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for l\00"
define void @t_isupper_0x6c() {
%1 = call i64 @isupper(i32 108)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 545, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for l\00"
define void @t_isupper_0x6c() {
%1 = tail call i64 @isupper(i32 108)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 545, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Util_runtime_error(char *);
void *calloc(int, int);
void *Util_allocate_initialize(int nmemb, int size) {
  void *rtn = calloc(nmemb, size);
  if (rtn == NULL) {
    Util_runtime_error("Error when allocating memory");
  }
  return rtn;
}


x86 assembly (clang, -O0):
<Util_allocate_initialize>:
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 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <Util_allocate_initialize+0x34>
lea    0xeb1(%rip),%rdi
call   1040 <Util_runtime_error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Util_allocate_initialize>:
push   %rbx
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <Util_allocate_initialize+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <Util_runtime_error@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [29 x i8] c"Error when allocating memory\00"
define noalias i8* @Util_allocate_initialize(i32 %0, i32 %1) {
%3 = tail call i8* @calloc(i32 %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @Util_runtime_error(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int mmc(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int a, b;
  printf("Informe os dois números: ");
  scanf("%d %d", &a, &b);
  printf("O mmc é %d\n", mmc(a, b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec7(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <mmc@plt>
mov    %eax,%esi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1030 <mmc@plt>
lea    0xebb(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Informe os dois n\C3\BAmeros: \00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [13 x i8] c"O mmc \C3\A9 %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @mmc(i32 %6, i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Informe os dois n\C3\BAmeros: \00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [13 x i8] c"O mmc \C3\A9 %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @mmc(i32 %7, i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int fork();
int getpid();
int getppid();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = 0, status;
  i = fork();
  if (i > 0)
    fork();
  printf("Io sono il processo con PID %d \n", getpid());
  printf("Mio padre è il processo con PID %d \n\n", getppid());
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1060 <fork@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1171 <main+0x31>
mov    $0x0,%al
call   1060 <fork@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xe7f(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getppid@plt>
mov    %eax,%esi
lea    0xe8b(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <fork@plt>
test   %eax,%eax
jle    1153 <main+0x13>
xor    %eax,%eax
call   1060 <fork@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xe9f(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getppid@plt>
lea    0xeab(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Io sono il processo con PID %d \0A\00"
@.str.1 = [39 x i8] c"Mio padre \C3\A8 il processo con PID %d \0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%4 = call i32 (...) @fork()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (...) @fork()
br label %9
9: ; preds = %7, %0
%10 = call i32 (...) @getpid()
%11 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 (...) @getppid()
%13 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str = [33 x i8] c"Io sono il processo con PID %d \0A\00"
@.str.1 = [39 x i8] c"Mio padre \C3\A8 il processo con PID %d \0A\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @fork()
%2 = icmp sgt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @fork()
br label %5
5: ; preds = %3, %0
%6 = tail call i32 (...) @getpid()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = tail call i32 (...) @getppid()
%9 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
long strtoll(char *, char **, int);
long int t22(char **x) { return strtoll("1234", x, 10); }


x86 assembly (clang, -O0):
<t22>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0xa,%edx
call   1030 <strtoll@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t22>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
mov    $0xa,%edx
jmp    1030 <strtoll@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"1234\00"
define i64 @t22(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = call i64 @strtoll(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %3, i32 10)
ret i64 %4
}

LLVM IR (-O2):
@.str = [5 x i8] c"1234\00"
define i64 @t22(i8** nocapture %0) {
%2 = tail call i64 @strtoll(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %0, i32 10)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void dummy0(void *cc) { fprintf(stdout, "dummy0\n"); }


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

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

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [8 x i8] c"dummy0\0A\00"
define void @dummy0(i8* nocapture readnone %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int LOG_CONS;
int /*<<< orphan*/ LOG_DEBUG;
int /*<<< orphan*/ LOG_LOCAL1;
int LOG_NDELAY;
int LOG_PID;
int /*<<< orphan*/ LOG_UPTO(int /*<<< orphan*/);
int /*<<< orphan*/ openlog(char const *, int, int /*<<< orphan*/);
int /*<<< orphan*/ setlogmask(int /*<<< orphan*/);
int log_init(const char *name) {
  setlogmask(LOG_UPTO(LOG_DEBUG));
  openlog(name, LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL1);
  return 0;
}


x86 assembly (clang, -O0):
<log_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1030 <LOG_UPTO@plt>
mov    %eax,%edi
call   1040 <setlogmask@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e7c(%rip),%rax
mov    (%rax),%esi
mov    0x2e7b(%rip),%rax
or     (%rax),%esi
mov    0x2e4a(%rip),%rax
or     (%rax),%esi
mov    0x2e59(%rip),%rax
mov    (%rax),%edx
call   1050 <openlog@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_init>:
push   %rbx
mov    %rdi,%rbx
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1030 <LOG_UPTO@plt>
mov    %eax,%edi
call   1040 <setlogmask@plt>
mov    0x2e88(%rip),%rax
mov    0x2e89(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e56(%rip),%rax
or     (%rax),%esi
mov    0x2e65(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
call   1050 <openlog@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@LOG_DEBUG = global i32 0
@LOG_CONS = global i32 0
@LOG_PID = global i32 0
@LOG_NDELAY = global i32 0
@LOG_LOCAL1 = global i32 0
define i32 @log_init(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @LOG_DEBUG
%4 = call i32 @LOG_UPTO(i32 %3)
%5 = call i32 @setlogmask(i32 %4)
%6 = load i8*, i8** %2
%7 = load i32, i32* @LOG_CONS
%8 = load i32, i32* @LOG_PID
%9 = or i32 %7, %8
%10 = load i32, i32* @LOG_NDELAY
%11 = or i32 %9, %10
%12 = load i32, i32* @LOG_LOCAL1
%13 = call i32 @openlog(i8* %6, i32 %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@LOG_DEBUG = global i32 0
@LOG_CONS = global i32 0
@LOG_PID = global i32 0
@LOG_NDELAY = global i32 0
@LOG_LOCAL1 = global i32 0
define i32 @log_init(i8* %0) {
%2 = load i32, i32* @LOG_DEBUG
%3 = tail call i32 @LOG_UPTO(i32 %2)
%4 = tail call i32 @setlogmask(i32 %3)
%5 = load i32, i32* @LOG_CONS
%6 = load i32, i32* @LOG_PID
%7 = or i32 %6, %5
%8 = load i32, i32* @LOG_NDELAY
%9 = or i32 %7, %8
%10 = load i32, i32* @LOG_LOCAL1
%11 = tail call i32 @openlog(i8* %0, i32 %9, i32 %10)
ret i32 0
}
int get_p(char p) {
  switch (p) {
  case '+':
  case '-':
    return 1;
  case '*':
  case '/':
    return 2;
  case '^':
    return 3;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<get_p>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x2a,%eax
je     116f <get_p+0x6f>
jmp    111f <get_p+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x2b,%eax
je     1163 <get_p+0x63>
jmp    1130 <get_p+0x30>
mov    -0xc(%rbp),%eax
sub    $0x2d,%eax
je     1163 <get_p+0x63>
jmp    1141 <get_p+0x41>
mov    -0xc(%rbp),%eax
sub    $0x2f,%eax
je     116f <get_p+0x6f>
jmp    1152 <get_p+0x52>
mov    -0xc(%rbp),%eax
sub    $0x5e,%eax
je     117b <get_p+0x7b>
jmp    1187 <get_p+0x87>
movl   $0x1,-0x4(%rbp)
jmp    118e <get_p+0x8e>
movl   $0x2,-0x4(%rbp)
jmp    118e <get_p+0x8e>
movl   $0x3,-0x4(%rbp)
jmp    118e <get_p+0x8e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_p>:
lea    -0x2a(%rdi),%ecx
cmp    $0x5,%ecx
ja     1123 <get_p+0x23>
mov    $0x1,%eax
lea    0xeec(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x2,%eax
ret
cmp    $0x5e,%edi
jne    112e <get_p+0x2e>
mov    $0x3,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @get_p(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %9 [
i32 43, label %6
i32 45, label %6
i32 42, label %7
i32 47, label %7
i32 94, label %8
]
6: ; preds = %1, %1
store i32 1, i32* %2
br label %10
7: ; preds = %1, %1
store i32 2, i32* %2
br label %10
8: ; preds = %1
store i32 3, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8, %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @get_p(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %5 [
i32 43, label %6
i32 45, label %6
i32 42, label %3
i32 47, label %3
i32 94, label %4
]
3: ; preds = %1, %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %1, %5, %4, %3
%7 = phi i32 [ 0, %5 ], [ 3, %4 ], [ 2, %3 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %7
}
/* Variables and functions */
char *DbgGetFrameNameByAddr(unsigned int);
int DbgGetFrameNameOffsetByAddr(unsigned LinearAddr) {
  int Offset = 0;
  char *FrameName;
  FrameName = DbgGetFrameNameByAddr(LinearAddr);
  while (FrameName == DbgGetFrameNameByAddr(--LinearAddr))
    ++Offset;
  return (Offset);
}


x86 assembly (clang, -O0):
<DbgGetFrameNameOffsetByAddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <DbgGetFrameNameByAddr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
add    $0xffffffff,%edi
mov    %edi,-0x4(%rbp)
call   1030 <DbgGetFrameNameByAddr@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
jne    1162 <DbgGetFrameNameOffsetByAddr+0x52>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112e <DbgGetFrameNameOffsetByAddr+0x1e>
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DbgGetFrameNameOffsetByAddr>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
call   1030 <DbgGetFrameNameByAddr@plt>
mov    %rax,%r14
add    $0xffffffff,%ebx
mov    $0xffffffff,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <DbgGetFrameNameByAddr@plt>
add    $0x1,%ebp
add    $0xffffffff,%ebx
cmp    %rax,%r14
je     1130 <DbgGetFrameNameOffsetByAddr+0x20>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @DbgGetFrameNameOffsetByAddr(i32 %0) {
%2 = tail call i8* @DbgGetFrameNameByAddr(i32 %0)
br label %3
3: ; preds = %3, %1
%4 = phi i32 [ 0, %1 ], [ %9, %3 ]
%5 = phi i32 [ %0, %1 ], [ %6, %3 ]
%6 = add i32 %5, -1
%7 = tail call i8* @DbgGetFrameNameByAddr(i32 %6)
%8 = icmp eq i8* %2, %7
%9 = add nuw nsw i32 %4, 1
br i1 %8, label %3, label %10
10: ; preds = %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned long);
void disasm_u32(char *dst, unsigned long val) {
  sprintf(dst, "%08lx", val & 0xffffffffUL);
}


x86 assembly (clang, -O0):
<disasm_u32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movabs $0xffffffff,%rdx
and    -0x10(%rbp),%rdx
lea    0xec7(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disasm_u32>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%08lx\00"
define void @disasm_u32(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = and i64 %6, 4294967295
%8 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %7)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%08lx\00"
define void @disasm_u32(i8* nocapture writeonly %0, i64 %1) {
%3 = and i64 %1, 4294967295
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
void preinit_1(void) { write(STDOUT_FILENO, "preinit array 1\n", 16); }


x86 assembly (clang, -O0):
<preinit_1>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
mov    $0x10,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<preinit_1>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
mov    $0x10,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@.str = [17 x i8] c"preinit array 1\0A\00"
define void @preinit_1() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = call i32 @write(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 16)
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@.str = [17 x i8] c"preinit array 1\0A\00"
define void @preinit_1() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = tail call i32 @write(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 16)
ret void
}
unsigned long int cast_char_ulong_fast(char x) { return (unsigned long int)x; }


x86 assembly (clang, -O0):
<cast_char_ulong_fast>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbq -0x1(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cast_char_ulong_fast>:
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @cast_char_ulong_fast(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @cast_char_ulong_fast(i8 signext %0) {
%2 = sext i8 %0 to i64
ret i64 %2
}
/* Variables and functions */
char *malloc(int);
char *strchr(char *, char);
char *strrchr(char *, char);
int main(int argc, char *argv[]) {
  char *s, *a __attribute__((unused)), *b __attribute__((unused));
  s = malloc(sizeof(char));
  a = strchr(s, '1');
  b = strrchr(s, '1');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x31,%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x31,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
add    $0x30,%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 i8*
%7 = alloca i8*
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i8* @malloc(i32 1)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = call i8* @strchr(i8* %10, i8 signext 49)
store i8* %11, i8** %7
%12 = load i8*, i8** %6
%13 = call i8* @strrchr(i8* %12, i8 signext 49)
store i8* %13, i8** %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
char *basename(char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
char *xstrdup(char const *);
void usage(const char *argv0) {
  char *tmp = xstrdup(argv0);
  printf("Usage: %s [-d|--detach] [-p|--pidfile pidfile] config\n",
         basename(tmp));
  free(tmp);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <xstrdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <basename@plt>
mov    %rax,%rsi
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
call   1050 <xstrdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1060 <basename@plt>
lea    0xea8(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [55 x i8] c"Usage: %s [-d|--detach] [-p|--pidfile pidfile] config\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @xstrdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i8* @basename(i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %3
%10 = call i32 @free(i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [55 x i8] c"Usage: %s [-d|--detach] [-p|--pidfile pidfile] config\0A\00"
define void @usage(i8* %0) {
%2 = tail call i8* @xstrdup(i8* %0)
%3 = tail call i8* @basename(i8* %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putenv(char *);
void SetupEnvironment() {
  putenv("LD_LIBRARY_PATH=/usr/slib:/lib:/usr/lib");
  putenv("PATH=/usr/bin:/bin");
  putenv("__GL_SYNC_TO_VBLANK=1");
  putenv("force_s3tc_enable=true");
}


x86 assembly (clang, -O0):
<SetupEnvironment>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <putenv@plt>
lea    0xf01(%rip),%rdi
call   1030 <putenv@plt>
lea    0xf08(%rip),%rdi
call   1030 <putenv@plt>
lea    0xf12(%rip),%rdi
call   1030 <putenv@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetupEnvironment>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <putenv@plt>
lea    0xf04(%rip),%rdi
call   1030 <putenv@plt>
lea    0xf0b(%rip),%rdi
call   1030 <putenv@plt>
lea    0xf15(%rip),%rdi
pop    %rax
jmp    1030 <putenv@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"LD_LIBRARY_PATH=/usr/slib:/lib:/usr/lib\00"
@.str.1 = [19 x i8] c"PATH=/usr/bin:/bin\00"
@.str.2 = [22 x i8] c"__GL_SYNC_TO_VBLANK=1\00"
@.str.3 = [23 x i8] c"force_s3tc_enable=true\00"
define void @SetupEnvironment() {
%1 = call i32 @putenv(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @putenv(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @putenv(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @putenv(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"LD_LIBRARY_PATH=/usr/slib:/lib:/usr/lib\00"
@.str.1 = [19 x i8] c"PATH=/usr/bin:/bin\00"
@.str.2 = [22 x i8] c"__GL_SYNC_TO_VBLANK=1\00"
@.str.3 = [23 x i8] c"force_s3tc_enable=true\00"
define void @SetupEnvironment() {
%1 = tail call i32 @putenv(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @putenv(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @putenv(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @putenv(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
ret void
}
int test_imm_84uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x84 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_84uint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0x84,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_84uint64_midword_reg>:
test   $0x840000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_84uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 8650752
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit_syscall_process(char const *, int, double, int, void *);
void compat_syscall_exit_process(const char *modname, int pass, double clock,
                                 int cpu, void *args) {
  exit_syscall_process(modname, pass, clock, cpu, args);
}


x86 assembly (clang, -O0):
<compat_syscall_exit_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
movsd  -0x18(%rbp),%xmm0
mov    -0x1c(%rbp),%edx
mov    -0x28(%rbp),%rcx
call   1030 <exit_syscall_process@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compat_syscall_exit_process>:
jmp    1030 <exit_syscall_process@plt>

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

LLVM IR (-O2):
define void @compat_syscall_exit_process(i8* %0, i32 %1, double %2, i32 %3, i8* %4) {
%6 = tail call i32 @exit_syscall_process(i8* %0, i32 %1, double %2, i32 %3, i8* %4)
ret void
}
void handler(int signo) { (void)signo; }


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

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

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

LLVM IR (-O2):
define void @handler(i32 %0) {
ret void
}
/* Variables and functions */
int barriereNatif32(int);
scalar_t__ systemeBigEndian();
int natif32VersLittle(int natif) {
  if (systemeBigEndian()) {
    return barriereNatif32(natif);
  } else {
    return natif;
  }
}


x86 assembly (clang, -O0):
<natif32VersLittle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <systemeBigEndian@plt>
cmp    $0x0,%rax
je     114c <natif32VersLittle+0x2c>
mov    -0x8(%rbp),%edi
call   1040 <barriereNatif32@plt>
mov    %eax,-0x4(%rbp)
jmp    1152 <natif32VersLittle+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<natif32VersLittle>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <systemeBigEndian@plt>
test   %rax,%rax
je     1137 <natif32VersLittle+0x17>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <barriereNatif32@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @natif32VersLittle(i32 %0) {
%2 = tail call i64 (...) @systemeBigEndian()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @barriereNatif32(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ child();
void call_with_cushion(void) { child(); }


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

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

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

LLVM IR (-O2):
define void @call_with_cushion() {
%1 = tail call i32 (...) @child()
ret void
}
int alpha_value(char c) { return c - 64; }


x86 assembly (clang, -O0):
<alpha_value>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x40,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @alpha_value(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 64
ret i32 %5
}

LLVM IR (-O2):
define i32 @alpha_value(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -64
ret i32 %3
}
int ft_fibonacci(int index) {
  if (index < 0)
    return (-1);
  if (index == 0)
    return (0);
  if (index <= 2)
    return (1);
  else
    return (ft_fibonacci(index - 1) + ft_fibonacci(index - 2));
}


x86 assembly (clang, -O0):
<ft_fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1131 <ft_fibonacci+0x21>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <ft_fibonacci+0x70>
cmpl   $0x0,-0x8(%rbp)
jne    1147 <ft_fibonacci+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1180 <ft_fibonacci+0x70>
cmpl   $0x2,-0x8(%rbp)
jg     115d <ft_fibonacci+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1180 <ft_fibonacci+0x70>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <ft_fibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <ft_fibonacci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_fibonacci>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
js     1138 <ft_fibonacci+0x28>
je     113f <ft_fibonacci+0x2f>
mov    %edi,%ebx
xor    %ebp,%ebp
nopl   (%rax)
cmp    $0x3,%ebx
jb     1143 <ft_fibonacci+0x33>
lea    -0x1(%rbx),%edi
call   1030 <ft_fibonacci@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
jne    1120 <ft_fibonacci+0x10>
xor    %eax,%eax
jmp    1148 <ft_fibonacci+0x38>
mov    $0xffffffff,%ebp
jmp    114a <ft_fibonacci+0x3a>
xor    %ebp,%ebp
jmp    114a <ft_fibonacci+0x3a>
mov    $0x1,%eax
add    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ft_fibonacci(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %19, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, 0
br i1 %4, label %19, label %5
5: ; preds = %3, %9
%6 = phi i32 [ %13, %9 ], [ 0, %3 ]
%7 = phi i32 [ %12, %9 ], [ %0, %3 ]
%8 = icmp ult i32 %7, 3
br i1 %8, label %15, label %9
9: ; preds = %5
%10 = add nsw i32 %7, -1
%11 = tail call i32 @ft_fibonacci(i32 %10)
%12 = add nsw i32 %7, -2
%13 = add nsw i32 %11, %6
%14 = icmp eq i32 %12, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %9
%16 = phi i32 [ %13, %9 ], [ %6, %5 ]
%17 = phi i32 [ 0, %9 ], [ 1, %5 ]
%18 = add nsw i32 %17, %16
br label %19
19: ; preds = %3, %15, %1
%20 = phi i32 [ -1, %1 ], [ %18, %15 ], [ 0, %3 ]
ret i32 %20
}
/* Type definitions */
typedef int /*<<< orphan*/ str;
typedef int /*<<< orphan*/ ptr;
typedef int /*<<< orphan*/ i;
typedef int /*<<< orphan*/ ch;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, ...);
int main() {
  char ch;
  int i;
  char *ptr;
  printf("%d %d %d %d %d\n", sizeof(i), sizeof(ch), sizeof(ptr), sizeof(*ptr),
         sizeof(ptr[0]));
  char str[256];
  printf("%d %d\n", sizeof(str), sizeof(str[0]));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
lea    0xede(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    $0x8,%ecx
mov    $0x1,%r9d
mov    %r9,%r8
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
mov    $0x100,%esi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"%d %d %d %d %d\0A\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 4, i32 1, i64 8, i64 1, i64 1)
%2 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 256, i32 1)
ret i32 0
}