xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ atof(char *);
int /*<<< orphan*/ free(char *);
char *wPopString();
int /*<<< orphan*/ wPushNumber(int /*<<< orphan*/);
void wBasVal() {
  char *string;
  string = wPopString();
  wPushNumber(atof(string));
  free(string);
}


x86 assembly (clang, -O0):
<wBasVal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <wPopString@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <atof@plt>
mov    %eax,%edi
call   1060 <wPushNumber@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBasVal>:
push   %rbx
xor    %eax,%eax
call   1050 <wPopString@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <atof@plt>
mov    %eax,%edi
call   1060 <wPushNumber@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @wBasVal() {
%1 = alloca i8*
%2 = call i8* (...) @wPopString()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @atof(i8* %3)
%5 = call i32 @wPushNumber(i32 %4)
%6 = load i8*, i8** %1
%7 = call i32 @free(i8* %6)
ret void
}

LLVM IR (-O2):
define void @wBasVal() {
%1 = tail call i8* (...) @wPopString()
%2 = tail call i32 @atof(i8* %1)
%3 = tail call i32 @wPushNumber(i32 %2)
%4 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int abs(int);
int algoritmoEuclide(int primoNumero, int secondoNumero) {
  int resto;
  while (secondoNumero != 0) {
    resto = primoNumero % secondoNumero;
    primoNumero = secondoNumero;
    secondoNumero = resto;
  }
  return abs(primoNumero);
}


x86 assembly (clang, -O0):
<algoritmoEuclide>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1143 <algoritmoEuclide+0x33>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    111e <algoritmoEuclide+0xe>
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<algoritmoEuclide>:
mov    %edi,%eax
test   %esi,%esi
je     111d <algoritmoEuclide+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <algoritmoEuclide+0x10>
jmp    111f <algoritmoEuclide+0x1f>
mov    %eax,%ecx
mov    %ecx,%eax
neg    %eax
cmovs  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @algoritmoEuclide(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
%11 = tail call i32 @llvm.abs.i32(i32 %10, i1 true)
ret i32 %11
}
/* Variables and functions */
scalar_t__ isspace(char const);
char *skipspace(const char *s) {
  while (isspace(*s))
    ++s;
  return (char *)s;
}


x86 assembly (clang, -O0):
<skipspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <skipspace+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skipspace+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipspace>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <skipspace+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skipspace(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
unsigned int perfctr_mk_cstatus(unsigned int tsc_on, unsigned int nractrs,
                                unsigned int nrictrs) {
  return ((tsc_on << 31) | (nrictrs << 16) | ((nractrs + nrictrs) << 8) |
          nractrs);
}


x86 assembly (clang, -O0):
<perfctr_mk_cstatus>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1f,%eax
mov    -0xc(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
or     -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<perfctr_mk_cstatus>:
shl    $0x1f,%edi
lea    (%rdx,%rsi,1),%ecx
mov    %edx,%eax
shl    $0x10,%eax
shl    $0x8,%ecx
or     %esi,%edi
or     %edi,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @perfctr_mk_cstatus(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = shl i32 %7, 31
%9 = load i32, i32* %6
%10 = shl i32 %9, 16
%11 = or i32 %8, %10
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = add i32 %12, %13
%15 = shl i32 %14, 8
%16 = or i32 %11, %15
%17 = load i32, i32* %5
%18 = or i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @perfctr_mk_cstatus(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, 31
%5 = shl i32 %2, 16
%6 = add i32 %2, %1
%7 = shl i32 %6, 8
%8 = or i32 %4, %1
%9 = or i32 %8, %5
%10 = or i32 %9, %7
ret i32 %10
}
void nanos_ini_0x2584520_380301290(int *const omp_priv, int *const omp_orig) {
  (*omp_priv) = 0;
}


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

x86 assembly (clang, -O2):
<nanos_ini_0x2584520_380301290>:
movl   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @nanos_ini_0x2584520_380301290(i32* nocapture writeonly %0, i32* nocapture readnone %1) {
store i32 0, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int *addInt(int dataArray[], size_t *p_index, int data) {
  assert(p_index != NULL);
  dataArray[*p_index] = data;
  return dataArray + (*p_index)++;
}


x86 assembly (clang, -O0):
<addInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdx
mov    (%rdx),%rcx
mov    %rcx,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addInt>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
xor    %edi,%edi
test   %rsi,%rsi
setne  %dil
call   1030 <assert@plt>
mov    (%rbx),%rcx
lea    0x0(,%rcx,4),%rax
add    %rbp,%rax
mov    %r14d,0x0(%rbp,%rcx,4)
add    $0x1,%rcx
mov    %rcx,(%rbx)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32* @addInt(i32* %0, i64* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i64*
%6 = alloca i32
store i32* %0, i32** %4
store i64* %1, i64** %5
store i32 %2, i32* %6
%7 = load i64*, i64** %5
%8 = icmp ne i64* %7, null
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32, i32* %6
%12 = load i32*, i32** %4
%13 = load i64*, i64** %5
%14 = load i64, i64* %13
%15 = getelementptr inbounds i32, i32* %12, i64 %14
store i32 %11, i32* %15
%16 = load i32*, i32** %4
%17 = load i64*, i64** %5
%18 = load i64, i64* %17
%19 = add i64 %18, 1
store i64 %19, i64* %17
%20 = getelementptr inbounds i32, i32* %16, i64 %18
ret i32* %20
}

LLVM IR (-O2):
define i32* @addInt(i32* writeonly %0, i64* %1, i32 %2) {
%4 = icmp ne i64* %1, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = load i64, i64* %1
%8 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 %2, i32* %8
%9 = add i64 %7, 1
store i64 %9, i64* %1
ret i32* %8
}
/* Variables and functions */
double RAND_MAX;
double rand();
int random_range(unsigned const low, unsigned const high) {
  unsigned const range = high - low + 1;
  return low + (int)(((double)range) * rand() / (RAND_MAX + 1.0));
}


x86 assembly (clang, -O0):
<random_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x1c(%rbp),%eax
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xea3(%rip),%xmm1
mov    0x2e84(%rip),%rcx
addsd  (%rcx),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_range>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
sub    %edi,%esi
add    $0x1,%esi
cvtsi2sd %rsi,%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mulsd  0x8(%rsp),%xmm0
mov    0x2ead(%rip),%rax
movsd  (%rax),%xmm1
addsd  0xeb9(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i32 @random_range(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub i32 %6, %7
%9 = add i32 %8, 1
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %5
%12 = uitofp i32 %11 to double
%13 = call double (...) @rand()
%14 = fmul double %12, %13
%15 = load double, double* @RAND_MAX
%16 = fadd double %15, 1.000000e+00
%17 = fdiv double %14, %16
%18 = fptosi double %17 to i32
%19 = add i32 %10, %18
ret i32 %19
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i32 @random_range(i32 %0, i32 %1) {
%3 = sub i32 1, %0
%4 = add i32 %3, %1
%5 = uitofp i32 %4 to double
%6 = tail call double (...) @rand()
%7 = fmul double %6, %5
%8 = load double, double* @RAND_MAX
%9 = fadd double %8, 1.000000e+00
%10 = fdiv double %7, %9
%11 = fptosi double %10 to i32
%12 = add i32 %11, %0
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ stderr;
int rtlsdr_rpc_write_eeprom(void *dev, uint8_t *data, uint8_t offset,
                            uint16_t len) {
  fprintf(stderr, "[u] %s,%u\n",
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/TA1DB/librtlsdr/refs/heads/master/src/"
          "rtlsdr_rpc.c",
          729);
  return -1;
}


x86 assembly (clang, -O0):
<rtlsdr_rpc_write_eeprom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
lea    0xece(%rip),%rdx
mov    $0x2d9,%ecx
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"[u] %s,%u\0A\00"
@.str.1 = [141 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/TA1DB/librtlsdr/refs/heads/master/src/rtlsdr_rpc.c\00"
define i32 @rtlsdr_rpc_write_eeprom(i8* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str.1, i64 0, i64 0), i32 729)
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"[u] %s,%u\0A\00"
@.str.1 = [141 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/TA1DB/librtlsdr/refs/heads/master/src/rtlsdr_rpc.c\00"
define i32 @rtlsdr_rpc_write_eeprom(i8* nocapture readnone %0, i32* nocapture readnone %1, i32 %2, i32 %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str.1, i64 0, i64 0), i32 729)
ret i32 -1
}
void ff_hevc_put_hevc_uni_epel_v32_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_v32_10_avx2() {
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
scalar_t__ stat(char *, struct stat *);
bool dir_exists(char *fn) {
  struct stat stat_buf;
  return (stat(fn, &stat_buf) == 0) && S_ISDIR(stat_buf.st_mode);
}


x86 assembly (clang, -O0):
<dir_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    115d <dir_exists+0x3d>
mov    -0x10(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dir_exists>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <dir_exists+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @dir_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
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%9 = load i32, i32* %8
%10 = call i64 @S_ISDIR(i32 %9)
%11 = icmp ne i64 %10, 0
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ false, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @dir_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
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i64 @S_ISDIR(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void DMA2_Stream1_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @DMA2_Stream1_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @DMA2_Stream1_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
void HLT() {}


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

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

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

LLVM IR (-O2):
define void @HLT() {
ret void
}
int g_DUMMY_menu_set_pixmap(int menu_id, int item_id, int pix_id) {
  menu_id = menu_id;
  item_id = item_id;
  pix_id = pix_id;
  return -1;
}


x86 assembly (clang, -O0):
<g_DUMMY_menu_set_pixmap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @g_DUMMY_menu_set_pixmap(i32 %0, i32 %1, i32 %2) {
ret i32 -1
}
/* Variables and functions */
unsigned long pow(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  const unsigned long int MB = pow(2, 20);
  int size;
  printf("Digite o valor em MB: ");
  scanf("%d", &size);
  printf("O valor em bits é %d \n", MB * size * 8);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
mov    $0x14,%esi
call   1050 <pow@plt>
mov    %rax,-0x8(%rbp)
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
imul   %rax,%rsi
shl    $0x3,%rsi
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    $0x2,%edi
mov    $0x14,%esi
call   1050 <pow@plt>
mov    %rax,%rbx
lea    0xeb2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebb(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0xc(%rsp),%rsi
imul   %rbx,%rsi
shl    $0x3,%rsi
lea    0xea0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Digite o valor em MB: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [24 x i8] c"O valor em bits \C3\A9 %d \0A\00"
define void @main() {
%1 = alloca i64
%2 = alloca i32
%3 = call i64 @pow(i32 2, i32 20)
store i64 %3, i64* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i64, i64* %1
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = mul i64 %6, %8
%10 = mul i64 %9, 8
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i64 %10)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Digite o valor em MB: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [24 x i8] c"O valor em bits \C3\A9 %d \0A\00"
define void @main() {
%1 = alloca i32
%2 = tail call i64 @pow(i32 2, i32 20)
%3 = bitcast i32* %1 to i8*
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = sext i32 %6 to i64
%8 = shl i64 %2, 3
%9 = mul i64 %8, %7
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i64 %9)
ret void
}
fatal(s1, s2) char *s1, *s2;
{
  error(s1, s2);
  exit(1);
}


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

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

LLVM IR (-O0):
define i32 @fatal(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i8*, ...)*)(i8* %5, i8* %6)
unreachable
}

LLVM IR (-O2):
define i32 @fatal(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i8*, ...)*)(i8* %0, i8* %1)
tail call void @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ cpy_it(char *, char *, int);
void main() {
  char b[100] =
      "12345600000000000000000000000000000000000000000000000000000000000";
  char buffer[100];
  char a[2] = "1";
  cpy_it(buffer, b, 100);
  cpy_it(a, buffer, 1000);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
lea    -0x70(%rbp),%rdi
lea    0xeca(%rip),%rsi
mov    $0x64,%edx
call   1030 <memcpy@plt>
mov    0xf1d(%rip),%ax
mov    %ax,-0xe2(%rbp)
lea    -0xe0(%rbp),%rdi
lea    -0x70(%rbp),%rsi
mov    $0x64,%edx
call   1040 <cpy_it@plt>
lea    -0xe2(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
mov    $0x3e8,%edx
call   1040 <cpy_it@plt>
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xf0,%rsp
movaps 0xf31(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xf15(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xea5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x70(%rsp)
movw   $0x31,0xe(%rsp)
lea    0x80(%rsp),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x64,%edx
call   1030 <cpy_it@plt>
lea    0xe(%rsp),%rdi
mov    %rbx,%rsi
mov    $0x3e8,%edx
call   1030 <cpy_it@plt>
add    $0xf0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.b = [100 x i8] c"12345600000000000000000000000000000000000000000000000000000000000\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.a = [2 x i8] c"1\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = alloca [2 x i8]
%4 = bitcast [100 x i8]* %1 to i8*
%5 = bitcast [2 x i8]* %3 to i8*
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%8 = call i32 @cpy_it(i8* %6, i8* %7, i32 100)
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%11 = call i32 @cpy_it(i8* %9, i8* %10, i32 1000)
ret void
}

LLVM IR (-O2):
@__const.main.b = [100 x i8] c"12345600000000000000000000000000000000000000000000000000000000000\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = alloca i16
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%6 = bitcast i16* %3 to i8*
store i16 49, i16* %3
%7 = call i32 @cpy_it(i8* %5, i8* %4, i32 100)
%8 = call i32 @cpy_it(i8* %6, i8* %5, i32 1000)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t uart_baud2divisor(uint32_t baudrate, uint32_t system_clk) {
  return (system_clk / (baudrate * 16)) - 1;
}


x86 assembly (clang, -O0):
<uart_baud2divisor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x4,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_baud2divisor>:
mov    %esi,%eax
shl    $0x4,%edi
cltd
idiv   %edi
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @uart_baud2divisor(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = mul nsw i32 %6, 16
%8 = sdiv i32 %5, %7
%9 = sub nsw i32 %8, 1
ret i32 %9
}

LLVM IR (-O2):
define i32 @uart_baud2divisor(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 4
%4 = sdiv i32 %1, %3
%5 = add nsw i32 %4, -1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _usage(void) {
  fputs("Usage: "
        "pwd"
        " [-L|-P]\n  -L	Avoid \".\" or \"..\" filenames\n  -P	Avoid symbolic "
        "links\n",
        stderr);
  return 1;
}


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

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

LLVM IR (-O0):
@.str = [79 x i8] c"Usage: pwd [-L|-P]\0A -L\09Avoid \22.\22 or \22..\22 filenames\0A -P\09Avoid symbolic links\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [79 x i8] c"Usage: pwd [-L|-P]\0A -L\09Avoid \22.\22 or \22..\22 filenames\0A -P\09Avoid symbolic links\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ eoutput(int, char *, char const *);
void iml_error(const char *message) { eoutput(-1, "Error", message); }


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

x86 assembly (clang, -O2):
<iml_error>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rsi
mov    $0xffffffff,%edi
jmp    1030 <eoutput@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"Error\00"
define void @iml_error(i8* %0) {
%2 = tail call i32 @eoutput(i32 -1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int dns_init() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dns_init() {
ret i32 0
}
/* Variables and functions */
size_t chooseMin(size_t a, size_t b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<chooseMin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1127 <chooseMin+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <chooseMin+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chooseMin>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovb  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @chooseMin(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ult i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @chooseMin(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
__attribute__((weak)) void fd_nrf8001_wakeup_success(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define weak void @fd_nrf8001_wakeup_success() {
ret void
}
void esc_code_add(int code) { printf("%s%d%s", "\x1b[", code, "m"); }


x86 assembly (clang, -O0):
<esc_code_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
lea    0xedb(%rip),%rsi
lea    0xed7(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<esc_code_add>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xee7(%rip),%rsi
lea    0xee3(%rip),%rcx
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s%d%s\00"
@.str.1 = [3 x i8] c"\1B[\00"
@.str.2 = [2 x i8] c"m\00"
define void @esc_code_add(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s%d%s\00"
@.str.1 = [3 x i8] c"\1B[\00"
@.str.2 = [2 x i8] c"m\00"
define void @esc_code_add(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}
void Et_setquality(struct usb_spca50x *spca50x) {}


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

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

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

LLVM IR (-O2):
%struct.usb_spca50x = type opaque
define void @Et_setquality(%struct.usb_spca50x* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
scalar_t__ strftime(char *, size_t, char *, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void util_getdate(char *s, size_t max) {
  time_t t = time(NULL);
  if (strftime(s, max, "%c", localtime(&t)) == 0 && max > 0)
    *s = '\0';
}


x86 assembly (clang, -O0):
<util_getdate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <localtime@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%ecx
lea    0xe8a(%rip),%rdx
call   1050 <strftime@plt>
cmp    $0x0,%rax
jne    1197 <util_getdate+0x67>
cmpq   $0x0,-0x10(%rbp)
jbe    1197 <util_getdate+0x67>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_getdate>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xeaa(%rip),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%ecx
call   1050 <strftime@plt>
test   %rbx,%rbx
je     1171 <util_getdate+0x41>
test   %rax,%rax
jne    1171 <util_getdate+0x41>
movb   $0x0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @util_getdate(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = call i32 @time(i32* null)
store i32 %6, i32* %5
%7 = load i8*, i8** %3
%8 = load i64, i64* %4
%9 = call i32 @localtime(i32* %5)
%10 = call i64 @strftime(i8* %7, i64 %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i64, i64* %4
%14 = icmp ugt i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = load i8*, i8** %3
store i8 0, i8* %16
br label %17
17: ; preds = %15, %12, %2
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @util_getdate(i8* %0, i64 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @time(i32* null)
store i32 %5, i32* %3
%6 = call i32 @localtime(i32* %3)
%7 = call i64 @strftime(i8* %0, i64 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = icmp eq i64 %7, 0
%9 = icmp ne i64 %1, 0
%10 = and i1 %9, %8
br i1 %10, label %11, label %12
11: ; preds = %2
store i8 0, i8* %0
br label %12
12: ; preds = %11, %2
ret void
}
/* Type definitions */
struct wpa_ctrl {
  int dummy;
};

/* Variables and functions */
int wpa_ctrl_command(struct wpa_ctrl *, char *);
int wpa_cli_cmd_mib(struct wpa_ctrl *ctrl, int argc, const char *argv[]) {
  return wpa_ctrl_command(ctrl, "MIB");
}


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

x86 assembly (clang, -O2):
<wpa_cli_cmd_mib>:
lea    0xee9(%rip),%rsi
jmp    1030 <wpa_ctrl_command@plt>

LLVM IR (-O0):
%struct.wpa_ctrl = type { i32 }
@.str = [4 x i8] c"MIB\00"
define i32 @wpa_cli_cmd_mib(%struct.wpa_ctrl* %0, i32 %1, i8** %2) {
%4 = alloca %struct.wpa_ctrl*
%5 = alloca i32
%6 = alloca i8**
store %struct.wpa_ctrl* %0, %struct.wpa_ctrl** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load %struct.wpa_ctrl*, %struct.wpa_ctrl** %4
%8 = call i32 @wpa_ctrl_command(%struct.wpa_ctrl* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 %8
}

LLVM IR (-O2):
%struct.wpa_ctrl = type { i32 }
@.str = [4 x i8] c"MIB\00"
define i32 @wpa_cli_cmd_mib(%struct.wpa_ctrl* %0, i32 %1, i8** nocapture readnone %2) {
%4 = tail call i32 @wpa_ctrl_command(%struct.wpa_ctrl* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ atomic_postsub_uint64_t(int /*<<< orphan*/ *, int);
uint64_t atomic_postdec_uint64_t(uint64_t *var) {
  return atomic_postsub_uint64_t(var, 1);
}


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

x86 assembly (clang, -O2):
<atomic_postdec_uint64_t>:
mov    $0x1,%esi
jmp    1030 <atomic_postsub_uint64_t@plt>

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

LLVM IR (-O2):
define i32 @atomic_postdec_uint64_t(i32* %0) {
%2 = tail call i32 @atomic_postsub_uint64_t(i32* %0, i32 1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ runalltests_behaviour_skip_list();
int main(void) {
  runalltests_behaviour_skip_list();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @runalltests_behaviour_skip_list()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void badusage(void) {
  fprintf(stderr, "Usage:\n");
  fprintf(stderr,
          "gpminkb [-op1 d/s] [-op2 d/s] [-silent] [-v] [-l/-h] groupname\n");
  exit(1);
}


x86 assembly (clang, -O0):
<badusage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<badusage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [64 x i8] c"gpminkb [-op1 d/s] [-op2 d/s] [-silent] [-v] [-l/-h] groupname\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [64 x i8] c"gpminkb [-op1 d/s] [-op2 d/s] [-silent] [-v] [-l/-h] groupname\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) { printf("Hello, World\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello, World\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int nothing() {
  int x = 3;
  return x;
}


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

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

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

LLVM IR (-O2):
define i32 @nothing() {
ret i32 3
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int e_phentsize;
};
typedef int /*<<< orphan*/ Elf32_Phdr;
typedef scalar_t__ Elf32_Off;
typedef TYPE_1__ Elf32_Ehdr;

/* Variables and functions */
TYPE_1__ *elf_get_header(void *);
int /*<<< orphan*/ *elf_get_pht(void *);
Elf32_Phdr *elf_get_ph(void *elf_image, int index) {
  Elf32_Phdr *elf_pht = elf_get_pht(elf_image);
  Elf32_Ehdr *elf_hdr = elf_get_header(elf_image);
  return (Elf32_Phdr *)((Elf32_Off)elf_pht + index * elf_hdr->e_phentsize);
}


x86 assembly (clang, -O0):
<elf_get_ph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <elf_get_pht@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <elf_get_header@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    -0x20(%rbp),%rdx
imul   (%rdx),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elf_get_ph>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
call   1040 <elf_get_pht@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
call   1030 <elf_get_header@plt>
movslq (%rax),%rcx
movslq %r14d,%rax
imul   %rcx,%rax
add    %rbp,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define i32* @elf_get_ph(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
%6 = alloca %struct.TYPE_3__*
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = call i32* @elf_get_pht(i8* %7)
store i32* %8, i32** %5
%9 = load i8*, i8** %3
%10 = call %struct.TYPE_3__* @elf_get_header(i8* %9)
store %struct.TYPE_3__* %10, %struct.TYPE_3__** %6
%11 = load i32*, i32** %5
%12 = ptrtoint i32* %11 to i64
%13 = load i32, i32* %4
%14 = load %struct.TYPE_3__*, %struct.TYPE_3__** %6
%15 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %14, i32 0, i32 0
%16 = load i32, i32* %15
%17 = mul nsw i32 %13, %16
%18 = sext i32 %17 to i64
%19 = add nsw i64 %12, %18
%20 = inttoptr i64 %19 to i32*
ret i32* %20
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define i32* @elf_get_ph(i8* %0, i32 %1) {
%3 = tail call i32* @elf_get_pht(i8* %0)
%4 = tail call %struct.TYPE_3__* @elf_get_header(i8* %0)
%5 = ptrtoint i32* %3 to i64
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %4, i64 0, i32 0
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, %1
%9 = sext i32 %8 to i64
%10 = add nsw i64 %9, %5
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}
void vis_print(char *s) {}


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

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

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

LLVM IR (-O2):
define void @vis_print(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int x;
  printf("Enter a number: ");
  scanf("%d", &x);
  printf("The square of %d is %d\n", x, x * x);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
mov    %esi,%edx
imul   %esi,%edx
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [24 x i8] c"The square of %d is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = mul nsw i32 %6, %7
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [24 x i8] c"The square of %d is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = mul nsw i32 %5, %5
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
/* Variables and functions */
int sys_reboot();
int reboot(void) { return sys_reboot(); }


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

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

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

LLVM IR (-O2):
define i32 @reboot() {
%1 = tail call i32 (...) @sys_reboot()
ret i32 %1
}